[CLAMP-1] Initial ONAP CLAMP seed code commit
[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:StringMatch': 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                          
1515                          
1516
1517                          drawLine(p, [{
1518                              x: 0,
1519                              y: 20
1520                          }, {
1521                              x: element.width,
1522                              y: 20
1523                          }]);
1524                          var text2 = getSemantic(element).name;
1525                          if(text2 == undefined )
1526                         {
1527                           text2 = 'StringMatch';
1528                         }
1529                          renderLabel(p, text2, {
1530                              box: element,
1531                              align: 'center-middle'
1532                          });
1533                          
1534                     } else {
1535                         // Collapsed pool draw text inline
1536                         var text2 = getSemantic(element).name;
1537                         renderLabel(p, text2, {
1538                             box: element,
1539                             align: 'center-middle'
1540                         });
1541                     }
1542
1543                     var participantMultiplicity = !!(getSemantic(element).participantMultiplicity);
1544
1545                     if (participantMultiplicity) {
1546                         renderer('ParticipantMultiplicityMarker')(p, element);
1547                     }
1548
1549                     return lane;
1550
1551
1552                 },
1553                 'bpmn:TCA': function(p, element) {
1554                     var lane = renderer('bpmn:Lane')(p, element, {
1555                         fill: 'White'
1556                     });
1557
1558                     var expandedPool = DiUtil.isExpanded(element);
1559
1560                     if (expandedPool) {
1561                          
1562
1563                          drawLine(p, [{
1564                                  x: 0,
1565                              y: element.height - 20
1566                          }, {
1567                              x: element.width,
1568                              y: element.height - 20
1569                          }]);
1570                          var text2 = getSemantic(element).name;
1571                          if(text2 == undefined )
1572                         {
1573                           text2 = 'TCA';
1574                         }
1575                          renderLabel(p, text2, {
1576                              box: element,
1577                              align: 'center-middle'
1578                          });
1579                          
1580                     } else {
1581                         // Collapsed pool draw text inline
1582                         var text2 = getSemantic(element).name;
1583                         renderLabel(p, text2, {
1584                             box: element,
1585                             align: 'center-middle'
1586                         });
1587                     }
1588
1589                     var participantMultiplicity = !!(getSemantic(element).participantMultiplicity);
1590
1591                     if (participantMultiplicity) {
1592                         renderer('ParticipantMultiplicityMarker')(p, element);
1593                     }
1594
1595                     return lane;
1596
1597
1598                 },
1599                                 'bpmn:GOC': function(p, element) {
1600                     var lane = renderer('bpmn:Lane')(p, element, {
1601                         fill: 'White'
1602                     });
1603
1604                     var expandedPool = DiUtil.isExpanded(element);
1605
1606                     if (expandedPool) {
1607                          
1608                          
1609
1610                          drawLine(p, [{
1611                              x: element.width/2,
1612                              y: element.height
1613                          }, {
1614                              x: element.width,
1615                              y: element.height/2
1616                          }]);
1617                          var text2 = getSemantic(element).name;
1618                          if(text2 == undefined )
1619                         {
1620                           text2 = 'GOC';
1621                         }
1622                          renderLabel(p, text2, {
1623                              box: element,
1624                              align: 'center-middle'
1625                          });
1626                          
1627                     } else {
1628                         // Collapsed pool draw text inline
1629                         var text2 = getSemantic(element).name;
1630                         renderLabel(p, text2, {
1631                             box: element,
1632                             align: 'center-middle'
1633                         });
1634                     }
1635
1636                     var participantMultiplicity = !!(getSemantic(element).participantMultiplicity);
1637
1638                     if (participantMultiplicity) {
1639                         renderer('ParticipantMultiplicityMarker')(p, element);
1640                     }
1641
1642                     return lane;
1643
1644
1645                 },
1646                                 'bpmn:Policy': function(p, element) {
1647                     var lane = renderer('bpmn:Lane')(p, element, {
1648                         fill: 'White'
1649                     });
1650
1651                     var expandedPool = DiUtil.isExpanded(element);
1652
1653                     if (expandedPool) {
1654                          
1655                          
1656
1657                          drawLine(p, [{
1658                              x: 0,
1659                              y: element.height/2
1660                          }, {
1661                              x: element.width/2,
1662                              y: 0
1663                          }]);
1664                          var text2 = getSemantic(element).name;
1665                          if(text2 == undefined )
1666                         {
1667                           text2 = 'Policy';
1668                         }
1669                          renderLabel(p, text2, {
1670                              box: element,
1671                              align: 'center-middle'
1672                          });
1673                          
1674                     } else {
1675                         // Collapsed pool draw text inline
1676                         var text2 = getSemantic(element).name;
1677                         renderLabel(p, text2, {
1678                             box: element,
1679                             align: 'center-middle'
1680                         });
1681                     }
1682
1683                     var participantMultiplicity = !!(getSemantic(element).participantMultiplicity);
1684
1685                     if (participantMultiplicity) {
1686                         renderer('ParticipantMultiplicityMarker')(p, element);
1687                     }
1688
1689                     return lane;
1690
1691
1692                 },
1693                 'bpmn:MessageEventDefinition': function(p, element, isThrowing) {
1694                     var pathData = pathMap.getScaledPath('EVENT_MESSAGE', {
1695                         xScaleFactor: 0.9,
1696                         yScaleFactor: 0.9,
1697                         containerWidth: element.width,
1698                         containerHeight: element.height,
1699                         position: {
1700                             mx: 0.235,
1701                             my: 0.315
1702                         }
1703                     });
1704
1705                     var fill = isThrowing ? 'black' : 'white';
1706                     var stroke = isThrowing ? 'white' : 'black';
1707
1708                     var messagePath = drawPath(p, pathData, {
1709                         strokeWidth: 1,
1710                         fill: fill,
1711                         stroke: stroke
1712                     });
1713
1714                     return messagePath;
1715                 },
1716                 'bpmn:TimerEventDefinition': function(p, element) {
1717
1718                     var circle = drawCircle(p, element.width, element.height, 0.2 * element.height, {
1719                         strokeWidth: 2
1720                     });
1721
1722                     var pathData = pathMap.getScaledPath('EVENT_TIMER_WH', {
1723                         xScaleFactor: 0.75,
1724                         yScaleFactor: 0.75,
1725                         containerWidth: element.width,
1726                         containerHeight: element.height,
1727                         position: {
1728                             mx: 0.5,
1729                             my: 0.5
1730                         }
1731                     });
1732
1733                     drawPath(p, pathData, {
1734                         strokeWidth: 2,
1735                         strokeLinecap: 'square'
1736                     });
1737
1738                     for (var i = 0; i < 12; i++) {
1739
1740                         var linePathData = pathMap.getScaledPath('EVENT_TIMER_LINE', {
1741                             xScaleFactor: 0.75,
1742                             yScaleFactor: 0.75,
1743                             containerWidth: element.width,
1744                             containerHeight: element.height,
1745                             position: {
1746                                 mx: 0.5,
1747                                 my: 0.5
1748                             }
1749                         });
1750
1751                         var width = element.width / 2;
1752                         var height = element.height / 2;
1753
1754                         drawPath(p, linePathData, {
1755                             strokeWidth: 1,
1756                             strokeLinecap: 'square',
1757                             transform: 'rotate(' + (i * 30) + ',' + height + ',' + width + ')'
1758                         });
1759                     }
1760
1761                     return circle;
1762                 },
1763                 'bpmn:EscalationEventDefinition': function(p, event, isThrowing) {
1764                     var pathData = pathMap.getScaledPath('EVENT_ESCALATION', {
1765                         xScaleFactor: 1,
1766                         yScaleFactor: 1,
1767                         containerWidth: event.width,
1768                         containerHeight: event.height,
1769                         position: {
1770                             mx: 0.5,
1771                             my: 0.555
1772                         }
1773                     });
1774
1775                     var fill = isThrowing ? 'black' : 'none';
1776
1777                     return drawPath(p, pathData, {
1778                         strokeWidth: 1,
1779                         fill: fill
1780                     });
1781                 },
1782                 'bpmn:ConditionalEventDefinition': function(p, event) {
1783                     var pathData = pathMap.getScaledPath('EVENT_CONDITIONAL', {
1784                         xScaleFactor: 1,
1785                         yScaleFactor: 1,
1786                         containerWidth: event.width,
1787                         containerHeight: event.height,
1788                         position: {
1789                             mx: 0.5,
1790                             my: 0.222
1791                         }
1792                     });
1793
1794                     return drawPath(p, pathData, {
1795                         strokeWidth: 1
1796                     });
1797                 },
1798                 'bpmn:LinkEventDefinition': function(p, event, isThrowing) {
1799                     var pathData = pathMap.getScaledPath('EVENT_LINK', {
1800                         xScaleFactor: 1,
1801                         yScaleFactor: 1,
1802                         containerWidth: event.width,
1803                         containerHeight: event.height,
1804                         position: {
1805                             mx: 0.57,
1806                             my: 0.263
1807                         }
1808                     });
1809
1810                     var fill = isThrowing ? 'black' : 'none';
1811
1812                     return drawPath(p, pathData, {
1813                         strokeWidth: 1,
1814                         fill: fill
1815                     });
1816                 },
1817                 'bpmn:ErrorEventDefinition': function(p, event, isThrowing) {
1818                     var pathData = pathMap.getScaledPath('EVENT_ERROR', {
1819                         xScaleFactor: 1.1,
1820                         yScaleFactor: 1.1,
1821                         containerWidth: event.width,
1822                         containerHeight: event.height,
1823                         position: {
1824                             mx: 0.2,
1825                             my: 0.722
1826                         }
1827                     });
1828
1829                     var fill = isThrowing ? 'black' : 'none';
1830
1831                     return drawPath(p, pathData, {
1832                         strokeWidth: 1,
1833                         fill: fill
1834                     });
1835                 },
1836                 'bpmn:CancelEventDefinition': function(p, event, isThrowing) {
1837                     var pathData = pathMap.getScaledPath('EVENT_CANCEL_45', {
1838                         xScaleFactor: 1.0,
1839                         yScaleFactor: 1.0,
1840                         containerWidth: event.width,
1841                         containerHeight: event.height,
1842                         position: {
1843                             mx: 0.638,
1844                             my: -0.055
1845                         }
1846                     });
1847
1848                     var fill = isThrowing ? 'black' : 'none';
1849
1850                     return drawPath(p, pathData, {
1851                         strokeWidth: 1,
1852                         fill: fill
1853                     }).transform('rotate(45)');
1854                 },
1855                 'bpmn:CompensateEventDefinition': function(p, event, isThrowing) {
1856                     var pathData = pathMap.getScaledPath('EVENT_COMPENSATION', {
1857                         xScaleFactor: 1,
1858                         yScaleFactor: 1,
1859                         containerWidth: event.width,
1860                         containerHeight: event.height,
1861                         position: {
1862                             mx: 0.201,
1863                             my: 0.472
1864                         }
1865                     });
1866
1867                     var fill = isThrowing ? 'black' : 'none';
1868
1869                     return drawPath(p, pathData, {
1870                         strokeWidth: 1,
1871                         fill: fill
1872                     });
1873                 },
1874                 'bpmn:SignalEventDefinition': function(p, event, isThrowing) {
1875                     var pathData = pathMap.getScaledPath('EVENT_SIGNAL', {
1876                         xScaleFactor: 0.9,
1877                         yScaleFactor: 0.9,
1878                         containerWidth: event.width,
1879                         containerHeight: event.height,
1880                         position: {
1881                             mx: 0.5,
1882                             my: 0.2
1883                         }
1884                     });
1885
1886                     var fill = isThrowing ? 'black' : 'none';
1887
1888                     return drawPath(p, pathData, {
1889                         strokeWidth: 1,
1890                         fill: fill
1891                     });
1892                 },
1893                 'bpmn:MultipleEventDefinition': function(p, event, isThrowing) {
1894                     var pathData = pathMap.getScaledPath('EVENT_MULTIPLE', {
1895                         xScaleFactor: 1.1,
1896                         yScaleFactor: 1.1,
1897                         containerWidth: event.width,
1898                         containerHeight: event.height,
1899                         position: {
1900                             mx: 0.222,
1901                             my: 0.36
1902                         }
1903                     });
1904
1905                     var fill = isThrowing ? 'black' : 'none';
1906
1907                     return drawPath(p, pathData, {
1908                         strokeWidth: 1,
1909                         fill: fill
1910                     });
1911                 },
1912                 'bpmn:ParallelMultipleEventDefinition': function(p, event) {
1913                     var pathData = pathMap.getScaledPath('EVENT_PARALLEL_MULTIPLE', {
1914                         xScaleFactor: 1.2,
1915                         yScaleFactor: 1.2,
1916                         containerWidth: event.width,
1917                         containerHeight: event.height,
1918                         position: {
1919                             mx: 0.458,
1920                             my: 0.194
1921                         }
1922                     });
1923
1924                     return drawPath(p, pathData, {
1925                         strokeWidth: 1
1926                     });
1927                 },
1928                 'bpmn:EndEvent': function(p, element) {
1929                     var circle = renderer('bpmn:Event')(p, element, {
1930                         strokeWidth: 4
1931                     });
1932
1933                     renderEventContent(element, p, true);
1934
1935                     return circle;
1936                 },
1937                 'bpmn:TerminateEventDefinition': function(p, element) {
1938                     var circle = drawCircle(p, element.width, element.height, 8, {
1939                         strokeWidth: 4,
1940                         fill: 'black'
1941                     });
1942
1943                     return circle;
1944                 },
1945                 'bpmn:IntermediateEvent': function(p, element) {
1946                     var outer = renderer('bpmn:Event')(p, element, {
1947                         strokeWidth: 1
1948                     });
1949                     /* inner */
1950                     drawCircle(p, element.width, element.height, INNER_OUTER_DIST, {
1951                         strokeWidth: 1,
1952                         fill: 'none'
1953                     });
1954
1955                     renderEventContent(element, p);
1956
1957                     return outer;
1958                 },
1959                 'bpmn:IntermediateCatchEvent': as('bpmn:IntermediateEvent'),
1960                 'bpmn:IntermediateThrowEvent': as('bpmn:IntermediateEvent'),
1961
1962                 'bpmn:Activity': function(p, element, attrs) {
1963                     return drawRect(p, element.width, element.height, TASK_BORDER_RADIUS, attrs);
1964                 },
1965
1966                 'bpmn:Task': function(p, element, attrs) {
1967                     var rect = renderer('bpmn:Activity')(p, element, attrs);
1968                     renderEmbeddedLabel(p, element, 'center-middle');
1969                     attachTaskMarkers(p, element);
1970                     return rect;
1971                 },
1972                 'bpmn:ServiceTask': function(p, element) {
1973                     var task = renderer('bpmn:Task')(p, element);
1974
1975                     var pathDataBG = pathMap.getScaledPath('TASK_TYPE_SERVICE', {
1976                         abspos: {
1977                             x: 12,
1978                             y: 18
1979                         }
1980                     });
1981
1982                     /* service bg */
1983                     drawPath(p, pathDataBG, {
1984                         strokeWidth: 1,
1985                         fill: 'none'
1986                     });
1987
1988                     var fillPathData = pathMap.getScaledPath('TASK_TYPE_SERVICE_FILL', {
1989                         abspos: {
1990                             x: 17.2,
1991                             y: 18
1992                         }
1993                     });
1994
1995                     /* service fill */
1996                     drawPath(p, fillPathData, {
1997                         strokeWidth: 0,
1998                         stroke: 'none',
1999                         fill: 'white'
2000                     });
2001
2002                     var pathData = pathMap.getScaledPath('TASK_TYPE_SERVICE', {
2003                         abspos: {
2004                             x: 17,
2005                             y: 22
2006                         }
2007                     });
2008
2009                     /* service */
2010                     drawPath(p, pathData, {
2011                         strokeWidth: 1,
2012                         fill: 'white'
2013                     });
2014
2015                     return task;
2016                 },
2017                 'bpmn:UserTask': function(p, element) {
2018                     var task = renderer('bpmn:Task')(p, element);
2019
2020                     var x = 15;
2021                     var y = 12;
2022
2023                     var pathData = pathMap.getScaledPath('TASK_TYPE_USER_1', {
2024                         abspos: {
2025                             x: x,
2026                             y: y
2027                         }
2028                     });
2029
2030                     /* user path */
2031                     drawPath(p, pathData, {
2032                         strokeWidth: 0.5,
2033                         fill: 'none'
2034                     });
2035
2036                     var pathData2 = pathMap.getScaledPath('TASK_TYPE_USER_2', {
2037                         abspos: {
2038                             x: x,
2039                             y: y
2040                         }
2041                     });
2042
2043                     /* user2 path */
2044                     drawPath(p, pathData2, {
2045                         strokeWidth: 0.5,
2046                         fill: 'none'
2047                     });
2048
2049                     var pathData3 = pathMap.getScaledPath('TASK_TYPE_USER_3', {
2050                         abspos: {
2051                             x: x,
2052                             y: y
2053                         }
2054                     });
2055
2056                     /* user3 path */
2057                     drawPath(p, pathData3, {
2058                         strokeWidth: 0.5,
2059                         fill: 'black'
2060                     });
2061
2062                     return task;
2063                 },
2064                 'bpmn:ManualTask': function(p, element) {
2065                     var task = renderer('bpmn:Task')(p, element);
2066
2067                     var pathData = pathMap.getScaledPath('TASK_TYPE_MANUAL', {
2068                         abspos: {
2069                             x: 17,
2070                             y: 15
2071                         }
2072                     });
2073
2074                     /* manual path */
2075                     drawPath(p, pathData, {
2076                         strokeWidth: 0.25,
2077                         fill: 'white',
2078                         stroke: 'black'
2079                     });
2080
2081                     return task;
2082                 },
2083                 'bpmn:SendTask': function(p, element) {
2084                     var task = renderer('bpmn:Task')(p, element);
2085
2086                     var pathData = pathMap.getScaledPath('TASK_TYPE_SEND', {
2087                         xScaleFactor: 1,
2088                         yScaleFactor: 1,
2089                         containerWidth: 21,
2090                         containerHeight: 14,
2091                         position: {
2092                             mx: 0.285,
2093                             my: 0.357
2094                         }
2095                     });
2096
2097                     /* send path */
2098                     drawPath(p, pathData, {
2099                         strokeWidth: 1,
2100                         fill: 'black',
2101                         stroke: 'white'
2102                     });
2103
2104                     return task;
2105                 },
2106                 'bpmn:ReceiveTask': function(p, element) {
2107                     var semantic = getSemantic(element);
2108
2109                     var task = renderer('bpmn:Task')(p, element);
2110                     var pathData;
2111
2112                     if (semantic.instantiate) {
2113                         drawCircle(p, 28, 28, 20 * 0.22, {
2114                             strokeWidth: 1
2115                         });
2116
2117                         pathData = pathMap.getScaledPath('TASK_TYPE_INSTANTIATING_SEND', {
2118                             abspos: {
2119                                 x: 7.77,
2120                                 y: 9.52
2121                             }
2122                         });
2123                     } else {
2124
2125                         pathData = pathMap.getScaledPath('TASK_TYPE_SEND', {
2126                             xScaleFactor: 0.9,
2127                             yScaleFactor: 0.9,
2128                             containerWidth: 21,
2129                             containerHeight: 14,
2130                             position: {
2131                                 mx: 0.3,
2132                                 my: 0.4
2133                             }
2134                         });
2135                     }
2136
2137                     /* receive path */
2138                     drawPath(p, pathData, {
2139                         strokeWidth: 1
2140                     });
2141
2142                     return task;
2143                 },
2144                 'bpmn:ScriptTask': function(p, element) {
2145                     var task = renderer('bpmn:Task')(p, element);
2146
2147                     var pathData = pathMap.getScaledPath('TASK_TYPE_SCRIPT', {
2148                         abspos: {
2149                             x: 15,
2150                             y: 20
2151                         }
2152                     });
2153
2154                     /* script path */
2155                     drawPath(p, pathData, {
2156                         strokeWidth: 1
2157                     });
2158
2159                     return task;
2160                 },
2161                 'bpmn:BusinessRuleTask': function(p, element) {
2162                     var task = renderer('bpmn:Task')(p, element);
2163
2164                     var headerPathData = pathMap.getScaledPath('TASK_TYPE_BUSINESS_RULE_HEADER', {
2165                         abspos: {
2166                             x: 8,
2167                             y: 8
2168                         }
2169                     });
2170
2171                     var businessHeaderPath = drawPath(p, headerPathData);
2172                     businessHeaderPath.attr({
2173                         strokeWidth: 1,
2174                         fill: 'AAA'
2175                     });
2176
2177                     var headerData = pathMap.getScaledPath('TASK_TYPE_BUSINESS_RULE_MAIN', {
2178                         abspos: {
2179                             x: 8,
2180                             y: 8
2181                         }
2182                     });
2183
2184                     var businessPath = drawPath(p, headerData);
2185                     businessPath.attr({
2186                         strokeWidth: 1
2187                     });
2188
2189                     return task;
2190                 },
2191                 'bpmn:SubProcess': function(p, element, attrs) {
2192                     var rect = renderer('bpmn:Activity')(p, element, attrs);
2193
2194                     var semantic = getSemantic(element);
2195
2196                     var expanded = DiUtil.isExpanded(semantic);
2197
2198                     var isEventSubProcess = !!semantic.triggeredByEvent;
2199                     if (isEventSubProcess) {
2200                         rect.attr({
2201                             strokeDasharray: '1,2'
2202                         });
2203                     }
2204
2205                     renderEmbeddedLabel(p, element, expanded ? 'center-top' : 'center-middle');
2206
2207                     if (expanded) {
2208                         attachTaskMarkers(p, element);
2209                     } else {
2210                         attachTaskMarkers(p, element, ['SubProcessMarker']);
2211                     }
2212
2213                     return rect;
2214                 },
2215                 'bpmn:AdHocSubProcess': function(p, element) {
2216                     return renderer('bpmn:SubProcess')(p, element);
2217                 },
2218                 'bpmn:Transaction': function(p, element) {
2219                     var outer = renderer('bpmn:SubProcess')(p, element);
2220
2221                     var innerAttrs = styles.style(['no-fill', 'no-events']);
2222
2223                     /* inner path */
2224                     drawRect(p, element.width, element.height, TASK_BORDER_RADIUS - 2, INNER_OUTER_DIST, innerAttrs);
2225
2226                     return outer;
2227                 },
2228                 'bpmn:CallActivity': function(p, element) {
2229                     return renderer('bpmn:Task')(p, element, {
2230                         strokeWidth: 5
2231                     });
2232                 },
2233                 'bpmn:Participant': function(p, element) {
2234
2235                     var lane = renderer('bpmn:Lane')(p, element, {
2236                         fill: 'White'
2237                     });
2238
2239                     var expandedPool = DiUtil.isExpanded(element);
2240
2241                     if (expandedPool) {
2242                         drawLine(p, [{
2243                             x: 30,
2244                             y: 0
2245                         }, {
2246                             x: 30,
2247                             y: element.height
2248                         }]);
2249                         var text = getSemantic(element).name;
2250                         renderLaneLabel(p, text, element);
2251                     } else {
2252                         // Collapsed pool draw text inline
2253                         var text2 = getSemantic(element).name;
2254                         renderLabel(p, text2, {
2255                             box: element,
2256                             align: 'center-middle'
2257                         });
2258                     }
2259
2260                     var participantMultiplicity = !!(getSemantic(element).participantMultiplicity);
2261
2262                     if (participantMultiplicity) {
2263                         renderer('ParticipantMultiplicityMarker')(p, element);
2264                     }
2265
2266                     return lane;
2267                 },
2268                 'bpmn:Lane': function(p, element, attrs) {
2269                     var rect = drawRect(p, element.width, element.height, 0, attrs || {
2270                         fill: 'none'
2271                     });
2272
2273                     var semantic = getSemantic(element);
2274
2275                     if (semantic.$type === 'bpmn:Lane') {
2276                         var text = semantic.name;
2277                         renderLaneLabel(p, text, element);
2278                     }
2279
2280                     return rect;
2281                 },
2282                 'bpmn:InclusiveGateway': function(p, element) {
2283                     var diamond = drawDiamond(p, element.width, element.height);
2284
2285                     /* circle path */
2286                     drawCircle(p, element.width, element.height, element.height * 0.24, {
2287                         strokeWidth: 2.5,
2288                         fill: 'none'
2289                     });
2290
2291                     return diamond;
2292                 },
2293                 'bpmn:ExclusiveGateway': function(p, element) {
2294                     var diamond = drawDiamond(p, element.width, element.height);
2295                     renderEmbeddedLabel(p, element, 'center-middle');
2296
2297                     var pathData = pathMap.getScaledPath('GATEWAY_EXCLUSIVE', {
2298                         xScaleFactor: 0.4,
2299                         yScaleFactor: 0.4,
2300                         containerWidth: element.width,
2301                         containerHeight: element.height,
2302                         position: {
2303                             mx: 0.32,
2304                             my: 0.3
2305                         }
2306                     });
2307
2308                     if (!!(getDi(element).isMarkerVisible)) {
2309                         drawPath(p, pathData, {
2310                             strokeWidth: 1,
2311                             fill: 'black'
2312                         });
2313                     }
2314
2315                     return diamond;
2316                 },
2317                 'bpmn:ComplexGateway': function(p, element) {
2318                     var diamond = drawDiamond(p, element.width, element.height);
2319
2320                     var pathData = pathMap.getScaledPath('GATEWAY_COMPLEX', {
2321                         xScaleFactor: 0.5,
2322                         yScaleFactor: 0.5,
2323                         containerWidth: element.width,
2324                         containerHeight: element.height,
2325                         position: {
2326                             mx: 0.46,
2327                             my: 0.26
2328                         }
2329                     });
2330
2331                     /* complex path */
2332                     drawPath(p, pathData, {
2333                         strokeWidth: 1,
2334                         fill: 'black'
2335                     });
2336
2337                     return diamond;
2338                 },
2339                 'bpmn:ParallelGateway': function(p, element) {
2340                     var diamond = drawDiamond(p, element.width, element.height);
2341
2342                     var pathData = pathMap.getScaledPath('GATEWAY_PARALLEL', {
2343                         xScaleFactor: 0.6,
2344                         yScaleFactor: 0.6,
2345                         containerWidth: element.width,
2346                         containerHeight: element.height,
2347                         position: {
2348                             mx: 0.46,
2349                             my: 0.2
2350                         }
2351                     });
2352
2353                     /* parallel path */
2354                     drawPath(p, pathData, {
2355                         strokeWidth: 1,
2356                         fill: 'black'
2357                     });
2358
2359                     return diamond;
2360                 },
2361                 'bpmn:EventBasedGateway': function(p, element) {
2362
2363                     var semantic = getSemantic(element);
2364
2365                     var diamond = drawDiamond(p, element.width, element.height);
2366
2367                     /* outer circle path */
2368                     drawCircle(p, element.width, element.height, element.height * 0.20, {
2369                         strokeWidth: 1,
2370                         fill: 'none'
2371                     });
2372
2373                     var type = semantic.eventGatewayType;
2374                     var instantiate = !!semantic.instantiate;
2375
2376                     function drawEvent() {
2377
2378                         var pathData = pathMap.getScaledPath('GATEWAY_EVENT_BASED', {
2379                             xScaleFactor: 0.18,
2380                             yScaleFactor: 0.18,
2381                             containerWidth: element.width,
2382                             containerHeight: element.height,
2383                             position: {
2384                                 mx: 0.36,
2385                                 my: 0.44
2386                             }
2387                         });
2388
2389                         /* event path */
2390                         drawPath(p, pathData, {
2391                             strokeWidth: 2,
2392                             fill: 'none'
2393                         });
2394                     }
2395
2396                     if (type === 'Parallel') {
2397
2398                         var pathData = pathMap.getScaledPath('GATEWAY_PARALLEL', {
2399                             xScaleFactor: 0.4,
2400                             yScaleFactor: 0.4,
2401                             containerWidth: element.width,
2402                             containerHeight: element.height,
2403                             position: {
2404                                 mx: 0.474,
2405                                 my: 0.296
2406                             }
2407                         });
2408
2409                         var parallelPath = drawPath(p, pathData);
2410                         parallelPath.attr({
2411                             strokeWidth: 1,
2412                             fill: 'none'
2413                         });
2414                     } else if (type === 'Exclusive') {
2415
2416                         if (!instantiate) {
2417                             var innerCircle = drawCircle(p, element.width, element.height, element.height * 0.26);
2418                             innerCircle.attr({
2419                                 strokeWidth: 1,
2420                                 fill: 'none'
2421                             });
2422                         }
2423
2424                         drawEvent();
2425                     }
2426
2427
2428                     return diamond;
2429                 },
2430                 'bpmn:Gateway': function(p, element) {
2431                     var diamond = drawDiamond(p, element.width, element.height);
2432                     renderEmbeddedLabel(p, element, 'center-middle');
2433
2434                     return diamond;
2435                 },
2436                 'bpmn:SequenceFlow': function(p, element) {
2437                     var pathData = createPathFromConnection(element);
2438                     var path = drawPath(p, pathData, {
2439                         strokeLinejoin: 'round',
2440                         markerEnd: marker('sequenceflow-end')
2441                     });
2442
2443                     var sequenceFlow = getSemantic(element);
2444                     var source = element.source.businessObject;
2445
2446                     // conditional flow marker
2447                     if (sequenceFlow.conditionExpression && source.$instanceOf('bpmn:Task')) {
2448                         path.attr({
2449                             markerStart: marker('conditional-flow-marker')
2450                         });
2451                     }
2452
2453                     // default marker
2454                     if (source.default && source.$instanceOf('bpmn:Gateway') && source.default === sequenceFlow) {
2455                         path.attr({
2456                             markerStart: marker('conditional-default-flow-marker')
2457                         });
2458                     }
2459
2460                     return path;
2461                 },
2462                 'bpmn:Association': function(p, element, attrs) {
2463
2464                     attrs = assign({
2465                         strokeDasharray: '1,6',
2466                         strokeLinecap: 'round',
2467                         strokeLinejoin: 'round'
2468                     }, attrs || {});
2469
2470                     // TODO(nre): style according to directed state
2471                     return drawLine(p, element.waypoints, attrs);
2472                 },
2473                 'bpmn:DataInputAssociation': function(p, element) {
2474                     return renderer('bpmn:Association')(p, element, {
2475                         markerEnd: marker('data-association-end')
2476                     });
2477                 },
2478                 'bpmn:DataOutputAssociation': function(p, element) {
2479                     return renderer('bpmn:Association')(p, element, {
2480                         markerEnd: marker('data-association-end')
2481                     });
2482                 },
2483                 'bpmn:MessageFlow': function(p, element) {
2484
2485                     var semantic = getSemantic(element),
2486                         di = getDi(element);
2487
2488                     var pathData = createPathFromConnection(element);
2489                     var path = drawPath(p, pathData, {
2490                         markerEnd: marker('messageflow-end'),
2491                         markerStart: marker('messageflow-start'),
2492                         strokeDasharray: '10, 12',
2493                         strokeLinecap: 'round',
2494                         strokeLinejoin: 'round',
2495                         strokeWidth: '1.5px'
2496                     });
2497
2498                     if (semantic.messageRef) {
2499                         var midPoint = path.getPointAtLength(path.getTotalLength() / 2);
2500
2501                         var markerPathData = pathMap.getScaledPath('MESSAGE_FLOW_MARKER', {
2502                             abspos: {
2503                                 x: midPoint.x,
2504                                 y: midPoint.y
2505                             }
2506                         });
2507
2508                         var messageAttrs = {
2509                             strokeWidth: 1
2510                         };
2511
2512                         if (di.messageVisibleKind === 'initiating') {
2513                             messageAttrs.fill = 'white';
2514                             messageAttrs.stroke = 'black';
2515                         } else {
2516                             messageAttrs.fill = '#888';
2517                             messageAttrs.stroke = 'white';
2518                         }
2519
2520                         drawPath(p, markerPathData, messageAttrs);
2521                     }
2522
2523                     return path;
2524                 },
2525                 'bpmn:DataObject': function(p, element) {
2526                     var pathData = pathMap.getScaledPath('DATA_OBJECT_PATH', {
2527                         xScaleFactor: 1,
2528                         yScaleFactor: 1,
2529                         containerWidth: element.width,
2530                         containerHeight: element.height,
2531                         position: {
2532                             mx: 0.474,
2533                             my: 0.296
2534                         }
2535                     });
2536
2537                     var elementObject = drawPath(p, pathData, {
2538                         fill: 'white'
2539                     });
2540
2541                     var semantic = getSemantic(element);
2542
2543                     if (isCollection(semantic)) {
2544                         renderDataItemCollection(p, element);
2545                     }
2546
2547                     return elementObject;
2548                 },
2549                 'bpmn:DataObjectReference': as('bpmn:DataObject'),
2550                 'bpmn:DataInput': function(p, element) {
2551
2552                     var arrowPathData = pathMap.getRawPath('DATA_ARROW');
2553
2554                     // page
2555                     var elementObject = renderer('bpmn:DataObject')(p, element);
2556
2557                     /* input arrow path */
2558                     drawPath(p, arrowPathData, {
2559                         strokeWidth: 1
2560                     });
2561
2562                     return elementObject;
2563                 },
2564                 'bpmn:DataOutput': function(p, element) {
2565                     var arrowPathData = pathMap.getRawPath('DATA_ARROW');
2566
2567                     // page
2568                     var elementObject = renderer('bpmn:DataObject')(p, element);
2569
2570                     /* output arrow path */
2571                     drawPath(p, arrowPathData, {
2572                         strokeWidth: 1,
2573                         fill: 'black'
2574                     });
2575
2576                     return elementObject;
2577                 },
2578                 'bpmn:DataStoreReference': function(p, element) {
2579                     var DATA_STORE_PATH = pathMap.getScaledPath('DATA_STORE', {
2580                         xScaleFactor: 1,
2581                         yScaleFactor: 1,
2582                         containerWidth: element.width,
2583                         containerHeight: element.height,
2584                         position: {
2585                             mx: 0,
2586                             my: 0.133
2587                         }
2588                     });
2589
2590                     var elementStore = drawPath(p, DATA_STORE_PATH, {
2591                         strokeWidth: 2,
2592                         fill: 'white'
2593                     });
2594
2595                     return elementStore;
2596                 },
2597                 'bpmn:BoundaryEvent': function(p, element) {
2598
2599                     var semantic = getSemantic(element),
2600                         cancel = semantic.cancelActivity;
2601
2602                     var attrs = {
2603                         strokeLinecap: 'round',
2604                         strokeWidth: 1
2605                     };
2606
2607                     if (!cancel) {
2608                         attrs.strokeDasharray = '6';
2609                     }
2610
2611                     var outer = renderer('bpmn:Event')(p, element, attrs);
2612                     /* inner path */
2613                     drawCircle(p, element.width, element.height, INNER_OUTER_DIST, attrs);
2614
2615                     renderEventContent(element, p);
2616
2617                     return outer;
2618                 },
2619                 'bpmn:Group': function(p, element) {
2620                     return drawRect(p, element.width, element.height, TASK_BORDER_RADIUS, {
2621                         strokeWidth: 1,
2622                         strokeDasharray: '8,3,1,3',
2623                         fill: 'none',
2624                         pointerEvents: 'none'
2625                     });
2626                 },
2627                 'label': function(p, element) {
2628                     return renderExternalLabel(p, element, '');
2629                 },
2630                 'bpmn:TextAnnotation': function(p, element) {
2631                     var style = {
2632                         'fill': 'none',
2633                         'stroke': 'none'
2634                     };
2635                     var textElement = drawRect(p, element.width, element.height, 0, 0, style);
2636                     var textPathData = pathMap.getScaledPath('TEXT_ANNOTATION', {
2637                         xScaleFactor: 1,
2638                         yScaleFactor: 1,
2639                         containerWidth: element.width,
2640                         containerHeight: element.height,
2641                         position: {
2642                             mx: 0.0,
2643                             my: 0.0
2644                         }
2645                     });
2646                     drawPath(p, textPathData);
2647
2648                     var text = getSemantic(element).text || '';
2649                     renderLabel(p, text, {
2650                         box: element,
2651                         align: 'left-middle',
2652                         padding: 5
2653                     });
2654
2655                     return textElement;
2656                 },
2657                 'ParticipantMultiplicityMarker': function(p, element) {
2658                     var subProcessPath = pathMap.getScaledPath('MARKER_PARALLEL', {
2659                         xScaleFactor: 1,
2660                         yScaleFactor: 1,
2661                         containerWidth: element.width,
2662                         containerHeight: element.height,
2663                         position: {
2664                             mx: ((element.width / 2) / element.width),
2665                             my: (element.height - 15) / element.height
2666                         }
2667                     });
2668
2669                     drawPath(p, subProcessPath);
2670                 },
2671                 'SubProcessMarker': function(p, element) {
2672                     var markerRect = drawRect(p, 14, 14, 0, {
2673                         strokeWidth: 1
2674                     });
2675
2676                     // Process marker is placed in the middle of the box
2677                     // therefore fixed values can be used here
2678                     markerRect.transform('translate(' + (element.width / 2 - 7.5) + ',' + (element.height - 20) + ')');
2679
2680                     var subProcessPath = pathMap.getScaledPath('MARKER_SUB_PROCESS', {
2681                         xScaleFactor: 1.5,
2682                         yScaleFactor: 1.5,
2683                         containerWidth: element.width,
2684                         containerHeight: element.height,
2685                         position: {
2686                             mx: (element.width / 2 - 7.5) / element.width,
2687                             my: (element.height - 20) / element.height
2688                         }
2689                     });
2690
2691                     drawPath(p, subProcessPath);
2692                 },
2693                 'ParallelMarker': function(p, element, position) {
2694                     var subProcessPath = pathMap.getScaledPath('MARKER_PARALLEL', {
2695                         xScaleFactor: 1,
2696                         yScaleFactor: 1,
2697                         containerWidth: element.width,
2698                         containerHeight: element.height,
2699                         position: {
2700                             mx: ((element.width / 2 + position.parallel) / element.width),
2701                             my: (element.height - 20) / element.height
2702                         }
2703                     });
2704                     drawPath(p, subProcessPath);
2705                 },
2706                 'SequentialMarker': function(p, element, position) {
2707                     var sequentialPath = pathMap.getScaledPath('MARKER_SEQUENTIAL', {
2708                         xScaleFactor: 1,
2709                         yScaleFactor: 1,
2710                         containerWidth: element.width,
2711                         containerHeight: element.height,
2712                         position: {
2713                             mx: ((element.width / 2 + position.seq) / element.width),
2714                             my: (element.height - 19) / element.height
2715                         }
2716                     });
2717                     drawPath(p, sequentialPath);
2718                 },
2719                 'CompensationMarker': function(p, element, position) {
2720                     var compensationPath = pathMap.getScaledPath('MARKER_COMPENSATION', {
2721                         xScaleFactor: 1,
2722                         yScaleFactor: 1,
2723                         containerWidth: element.width,
2724                         containerHeight: element.height,
2725                         position: {
2726                             mx: ((element.width / 2 + position.compensation) / element.width),
2727                             my: (element.height - 13) / element.height
2728                         }
2729                     });
2730                     drawPath(p, compensationPath, {
2731                         strokeWidth: 1
2732                     });
2733                 },
2734                 'LoopMarker': function(p, element, position) {
2735                     var loopPath = pathMap.getScaledPath('MARKER_LOOP', {
2736                         xScaleFactor: 1,
2737                         yScaleFactor: 1,
2738                         containerWidth: element.width,
2739                         containerHeight: element.height,
2740                         position: {
2741                             mx: ((element.width / 2 + position.loop) / element.width),
2742                             my: (element.height - 7) / element.height
2743                         }
2744                     });
2745
2746                     drawPath(p, loopPath, {
2747                         strokeWidth: 1,
2748                         fill: 'none',
2749                         strokeLinecap: 'round',
2750                         strokeMiterlimit: 0.5
2751                     });
2752                 },
2753                 'AdhocMarker': function(p, element, position) {
2754                     var loopPath = pathMap.getScaledPath('MARKER_ADHOC', {
2755                         xScaleFactor: 1,
2756                         yScaleFactor: 1,
2757                         containerWidth: element.width,
2758                         containerHeight: element.height,
2759                         position: {
2760                             mx: ((element.width / 2 + position.adhoc) / element.width),
2761                             my: (element.height - 15) / element.height
2762                         }
2763                     });
2764
2765                     drawPath(p, loopPath, {
2766                         strokeWidth: 1,
2767                         fill: 'black'
2768                     });
2769                 }
2770             };
2771
2772             function attachTaskMarkers(p, element, taskMarkers) {
2773                 var obj = getSemantic(element);
2774
2775                 var subprocess = includes(taskMarkers, 'SubProcessMarker');
2776                 var position;
2777
2778                 if (subprocess) {
2779                     position = {
2780                         seq: -21,
2781                         parallel: -22,
2782                         compensation: -42,
2783                         loop: -18,
2784                         adhoc: 10
2785                     };
2786                 } else {
2787                     position = {
2788                         seq: -3,
2789                         parallel: -6,
2790                         compensation: -27,
2791                         loop: 0,
2792                         adhoc: 10
2793                     };
2794                 }
2795
2796                 forEach(taskMarkers, function(marker) {
2797                     renderer(marker)(p, element, position);
2798                 });
2799
2800                 if (obj.$type === 'bpmn:AdHocSubProcess') {
2801                     renderer('AdhocMarker')(p, element, position);
2802                 }
2803                 if (obj.loopCharacteristics && obj.loopCharacteristics.isSequential === undefined) {
2804                     renderer('LoopMarker')(p, element, position);
2805                     return;
2806                 }
2807                 if (obj.loopCharacteristics &&
2808                     obj.loopCharacteristics.isSequential !== undefined &&
2809                     !obj.loopCharacteristics.isSequential) {
2810                     renderer('ParallelMarker')(p, element, position);
2811                 }
2812                 if (obj.loopCharacteristics && !!obj.loopCharacteristics.isSequential) {
2813                     renderer('SequentialMarker')(p, element, position);
2814                 }
2815                 if (!!obj.isForCompensation) {
2816                     renderer('CompensationMarker')(p, element, position);
2817                 }
2818             }
2819
2820             function drawShape(parent, element) {
2821                 var type = element.type;
2822                 var h = handlers[type];
2823
2824                 /* jshint -W040 */
2825                 if (!h) {
2826                     return DefaultRenderer.prototype.drawShape.apply(this, [parent, element]);
2827                 } else {
2828                     return h(parent, element);
2829                 }
2830             }
2831
2832             function drawConnection(parent, element) {
2833                 var type = element.type;
2834                 var h = handlers[type];
2835
2836                 /* jshint -W040 */
2837                 if (!h) {
2838                     return DefaultRenderer.prototype.drawConnection.apply(this, [parent, element]);
2839                 } else {
2840                     return h(parent, element);
2841                 }
2842             }
2843
2844             function renderDataItemCollection(p, element) {
2845
2846                 var yPosition = (element.height - 16) / element.height;
2847
2848                 var pathData = pathMap.getScaledPath('DATA_OBJECT_COLLECTION_PATH', {
2849                     xScaleFactor: 1,
2850                     yScaleFactor: 1,
2851                     containerWidth: element.width,
2852                     containerHeight: element.height,
2853                     position: {
2854                         mx: 0.451,
2855                         my: yPosition
2856                     }
2857                 });
2858
2859                 /* collection path */
2860                 drawPath(p, pathData, {
2861                     strokeWidth: 2
2862                 });
2863             }
2864
2865             function isCollection(element, filter) {
2866                 return element.isCollection ||
2867                     (element.elementObjectRef && element.elementObjectRef.isCollection);
2868             }
2869
2870             function getDi(element) {
2871                 return element.businessObject.di;
2872             }
2873
2874             function getSemantic(element) {
2875                 return element.businessObject;
2876             }
2877
2878             /**
2879              * Checks if eventDefinition of the given element matches with semantic
2880              * type.
2881              * 
2882              * @return {boolean} true if element is of the given semantic type
2883              */
2884             function isTypedEvent(event, eventDefinitionType, filter) {
2885
2886                 function matches(definition, filter) {
2887                     return every(filter, function(val, key) {
2888
2889                         // we want a == conversion here, to be able to catch
2890                         // undefined == false and friends
2891                         /* jshint -W116 */
2892                         return definition[key] == val;
2893                     });
2894                 }
2895
2896                 return some(event.eventDefinitions, function(definition) {
2897                     return definition.$type === eventDefinitionType && matches(event, filter);
2898                 });
2899             }
2900
2901             function isThrowEvent(event) {
2902                 return (event.$type === 'bpmn:IntermediateThrowEvent') || (event.$type === 'bpmn:EndEvent');
2903             }
2904
2905
2906             // ///// cropping path customizations /////////////////////////
2907
2908             function componentsToPath(elements) {
2909                 return elements.join(',').replace(/,?([A-z]),?/g, '$1');
2910             }
2911
2912             function getCirclePath(shape) {
2913
2914                 var cx = shape.x + shape.width / 2,
2915                     cy = shape.y + shape.height / 2,
2916                     radius = shape.width / 2;
2917
2918                 var circlePath = [
2919                     ['M', cx, cy],
2920                     ['m', 0, -radius],
2921                     ['a', radius, radius, 0, 1, 1, 0, 2 * radius],
2922                     ['a', radius, radius, 0, 1, 1, 0, -2 * radius],
2923                     ['z']
2924                 ];
2925
2926                 return componentsToPath(circlePath);
2927             }
2928
2929             function getRoundRectPath(shape) {
2930
2931                 var radius = TASK_BORDER_RADIUS,
2932                     x = shape.x,
2933                     y = shape.y,
2934                     width = shape.width,
2935                     height = shape.height;
2936
2937                 var roundRectPath = [
2938                     ['M', x + radius, y],
2939                     ['l', width - radius * 2, 0],
2940                     ['a', radius, radius, 0, 0, 1, radius, radius],
2941                     ['l', 0, height - radius * 2],
2942                     ['a', radius, radius, 0, 0, 1, -radius, radius],
2943                     ['l', radius * 2 - width, 0],
2944                     ['a', radius, radius, 0, 0, 1, -radius, -radius],
2945                     ['l', 0, radius * 2 - height],
2946                     ['a', radius, radius, 0, 0, 1, radius, -radius],
2947                     ['z']
2948                 ];
2949
2950                 return componentsToPath(roundRectPath);
2951             }
2952
2953             function getDiamondPath(shape) {
2954
2955                 var width = shape.width,
2956                     height = shape.height,
2957                     x = shape.x,
2958                     y = shape.y,
2959                     halfWidth = width / 2,
2960                     halfHeight = height / 2;
2961
2962                 var diamondPath = [
2963                     ['M', x + halfWidth, y],
2964                     ['l', halfWidth, halfHeight],
2965                     ['l', -halfWidth, halfHeight],
2966                     ['l', -halfWidth, -halfHeight],
2967                     ['z']
2968                 ];
2969
2970                 return componentsToPath(diamondPath);
2971             }
2972
2973             function getRectPath(shape) {
2974                 var x = shape.x,
2975                     y = shape.y,
2976                     width = shape.width,
2977                     height = shape.height;
2978
2979                 var rectPath = [
2980                     ['M', x, y],
2981                     ['l', width, 0],
2982                     ['l', 0, height],
2983                     ['l', -width, 0],
2984                     ['z']
2985                 ];
2986
2987                 return componentsToPath(rectPath);
2988             }
2989
2990             function getShapePath(element) {
2991                 var obj = getSemantic(element);
2992
2993                 if (obj.$instanceOf('bpmn:Event')) {
2994                     return getCirclePath(element);
2995                 }
2996
2997                 if (obj.$instanceOf('bpmn:Activity')) {
2998                     return getRoundRectPath(element);
2999                 }
3000
3001                 if (obj.$instanceOf('bpmn:Gateway')) {
3002                     return getDiamondPath(element);
3003                 }
3004
3005                 return getRectPath(element);
3006             }
3007
3008
3009             // hook onto canvas init event to initialize
3010             // connection start/end markers on svg
3011             events.on('canvas.init', function(event) {
3012                 initMarkers(event.svg);
3013             });
3014
3015             this.drawShape = drawShape;
3016             this.drawConnection = drawConnection;
3017
3018             this.getShapePath = getShapePath;
3019         }
3020
3021         inherits(BpmnRenderer, DefaultRenderer);
3022
3023
3024         BpmnRenderer.$inject = ['eventBus', 'styles', 'pathMap'];
3025
3026         module.exports = BpmnRenderer;
3027
3028     }, {
3029         "../util/DiUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\util\\DiUtil.js",
3030         "diagram-js/lib/draw/Renderer": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\draw\\Renderer.js",
3031         "diagram-js/lib/util/Text": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Text.js",
3032         "inherits": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\inherits\\inherits_browser.js",
3033         "lodash/collection/every": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\every.js",
3034         "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
3035         "lodash/collection/includes": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\includes.js",
3036         "lodash/collection/some": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\some.js",
3037         "lodash/lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js",
3038         "lodash/lang/isObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isObject.js",
3039         "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js"
3040     }],
3041     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\draw\\PathMap.js": [function(require, module, exports) {
3042         'use strict';
3043
3044         var Snap = require('diagram-js/vendor/snapsvg');
3045
3046         /**
3047          * Map containing SVG paths needed by BpmnRenderer.
3048          */
3049
3050         function PathMap() {
3051
3052             /**
3053              * Contains a map of path elements
3054              * 
3055              * <h1>Path definition</h1>
3056              * A parameterized path is defined like this:
3057              * 
3058              * <pre>
3059              * 'GATEWAY_PARALLEL': {
3060              *   d: 'm {mx},{my} {e.x0},0 0,{e.x1} {e.x1},0 0,{e.y0} -{e.x1},0 0,{e.y1} ' +
3061              *           '-{e.x0},0 0,-{e.y1} -{e.x1},0 0,-{e.y0} {e.x1},0 z',
3062              *   height: 17.5,
3063              *   width:  17.5,
3064              *   heightElements: [2.5, 7.5],
3065              *   widthElements: [2.5, 7.5]
3066              * }
3067              * </pre>
3068              * 
3069              * <p>
3070              * It's important to specify a correct <b>height and width</b> for the path
3071              * as the scaling is based on the ratio between the specified height and
3072              * width in this object and the height and width that is set as scale target
3073              * (Note x,y coordinates will be scaled with individual ratios).
3074              * </p>
3075              * <p>
3076              * The '<b>heightElements</b>' and '<b>widthElements</b>' array must
3077              * contain the values that will be scaled. The scaling is based on the
3078              * computed ratios. Coordinates on the y axis should be in the
3079              * <b>heightElement</b>'s array, they will be scaled using the computed
3080              * ratio coefficient. In the parameterized path the scaled values can be
3081              * accessed through the 'e' object in {} brackets.
3082              * <ul>
3083              * <li>The values for the y axis can be accessed in the path string using
3084              * {e.y0}, {e.y1}, ....</li>
3085              * <li>The values for the x axis can be accessed in the path string using
3086              * {e.x0}, {e.x1}, ....</li>
3087              * </ul>
3088              * The numbers x0, x1 respectively y0, y1, ... map to the corresponding
3089              * array index.
3090              * </p>
3091              */
3092             this.pathMap = {
3093                 'EVENT_MESSAGE': {
3094                     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}',
3095                     height: 36,
3096                     width: 36,
3097                     heightElements: [6, 14],
3098                     widthElements: [10.5, 21]
3099                 },
3100                 'EVENT_SIGNAL': {
3101                     d: 'M {mx},{my} l {e.x0},{e.y0} l -{e.x1},0 Z',
3102                     height: 36,
3103                     width: 36,
3104                     heightElements: [18],
3105                     widthElements: [10, 20]
3106                 },
3107                 'EVENT_ESCALATION': {
3108                     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} ' +
3109                         '{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',
3110                     height: 36,
3111                     width: 36,
3112                     heightElements: [2.382, 4.764, 4.926, 6.589333, 7.146, 13.178667, 19.768],
3113                     widthElements: [2.463, 2.808, 4.926, 5.616, 7.389, 8.424]
3114                 },
3115                 'EVENT_CONDITIONAL': {
3116                     d: 'M {e.x0},{e.y0} l {e.x1},0 l 0,{e.y2} l -{e.x1},0 Z ' +
3117                         'M {e.x2},{e.y3} l {e.x0},0 ' +
3118                         'M {e.x2},{e.y4} l {e.x0},0 ' +
3119                         'M {e.x2},{e.y5} l {e.x0},0 ' +
3120                         'M {e.x2},{e.y6} l {e.x0},0 ' +
3121                         'M {e.x2},{e.y7} l {e.x0},0 ' +
3122                         'M {e.x2},{e.y8} l {e.x0},0 ',
3123                     height: 36,
3124                     width: 36,
3125                     heightElements: [8.5, 14.5, 18, 11.5, 14.5, 17.5, 20.5, 23.5, 26.5],
3126                     widthElements: [10.5, 14.5, 12.5]
3127                 },
3128                 'EVENT_LINK': {
3129                     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',
3130                     height: 36,
3131                     width: 36,
3132                     heightElements: [4.4375, 6.75, 7.8125],
3133                     widthElements: [9.84375, 13.5]
3134                 },
3135                 'EVENT_ERROR': {
3136                     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',
3137                     height: 36,
3138                     width: 36,
3139                     heightElements: [0.023, 8.737, 8.151, 16.564, 10.591, 8.714],
3140                     widthElements: [0.085, 6.672, 6.97, 4.273, 5.337, 6.636]
3141                 },
3142                 'EVENT_CANCEL_45': {
3143                     d: 'm {mx},{my} -{e.x1},0 0,{e.x0} {e.x1},0 0,{e.y1} {e.x0},0 ' +
3144                         '0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z',
3145                     height: 36,
3146                     width: 36,
3147                     heightElements: [4.75, 8.5],
3148                     widthElements: [4.75, 8.5]
3149                 },
3150                 'EVENT_COMPENSATION': {
3151                     d: 'm {mx},{my} {e.x0},-{e.y0} 0,{e.y1} z m {e.x0},0 {e.x0},-{e.y0} 0,{e.y1} z',
3152                     height: 36,
3153                     width: 36,
3154                     heightElements: [5, 10],
3155                     widthElements: [10]
3156                 },
3157                 'EVENT_TIMER_WH': {
3158                     d: 'M {mx},{my} l {e.x0},-{e.y0} m -{e.x0},{e.y0} l {e.x1},{e.y1} ',
3159                     height: 36,
3160                     width: 36,
3161                     heightElements: [10, 2],
3162                     widthElements: [3, 7]
3163                 },
3164                 'EVENT_TIMER_LINE': {
3165                     d: 'M {mx},{my} ' +
3166                         'm {e.x0},{e.y0} l -{e.x1},{e.y1} ',
3167                     height: 36,
3168                     width: 36,
3169                     heightElements: [10, 3],
3170                     widthElements: [0, 0]
3171                 },
3172                 'EVENT_MULTIPLE': {
3173                     d: 'm {mx},{my} {e.x1},-{e.y0} {e.x1},{e.y0} -{e.x0},{e.y1} -{e.x2},0 z',
3174                     height: 36,
3175                     width: 36,
3176                     heightElements: [6.28099, 12.56199],
3177                     widthElements: [3.1405, 9.42149, 12.56198]
3178                 },
3179                 'EVENT_PARALLEL_MULTIPLE': {
3180                     d: 'm {mx},{my} {e.x0},0 0,{e.y1} {e.x1},0 0,{e.y0} -{e.x1},0 0,{e.y1} ' +
3181                         '-{e.x0},0 0,-{e.y1} -{e.x1},0 0,-{e.y0} {e.x1},0 z',
3182                     height: 36,
3183                     width: 36,
3184                     heightElements: [2.56228, 7.68683],
3185                     widthElements: [2.56228, 7.68683]
3186                 },
3187                 'GATEWAY_EXCLUSIVE': {
3188                     d: 'm {mx},{my} {e.x0},{e.y0} {e.x1},{e.y0} {e.x2},0 {e.x4},{e.y2} ' +
3189                         '{e.x4},{e.y1} {e.x2},0 {e.x1},{e.y3} {e.x0},{e.y3} ' +
3190                         '{e.x3},0 {e.x5},{e.y1} {e.x5},{e.y2} {e.x3},0 z',
3191                     height: 17.5,
3192                     width: 17.5,
3193                     heightElements: [8.5, 6.5312, -6.5312, -8.5],
3194                     widthElements: [6.5, -6.5, 3, -3, 5, -5]
3195                 },
3196                 'GATEWAY_PARALLEL': {
3197                     d: 'm {mx},{my} 0,{e.y1} -{e.x1},0 0,{e.y0} {e.x1},0 0,{e.y1} {e.x0},0 ' +
3198                         '0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z',
3199                     height: 30,
3200                     width: 30,
3201                     heightElements: [5, 12.5],
3202                     widthElements: [5, 12.5]
3203                 },
3204                 'GATEWAY_EVENT_BASED': {
3205                     d: 'm {mx},{my} {e.x0},{e.y0} {e.x0},{e.y1} {e.x1},{e.y2} {e.x2},0 z',
3206                     height: 11,
3207                     width: 11,
3208                     heightElements: [-6, 6, 12, -12],
3209                     widthElements: [9, -3, -12]
3210                 },
3211                 'GATEWAY_COMPLEX': {
3212                     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} ' +
3213                         '{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} ' +
3214                         '{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} ' +
3215                         '-{e.x0},{e.y1} 0,-{e.y0} -{e.x3},0 z',
3216                     height: 17.125,
3217                     width: 17.125,
3218                     heightElements: [4.875, 3.4375, 2.125, 3],
3219                     widthElements: [3.4375, 2.125, 4.875, 3]
3220                 },
3221                 'DATA_OBJECT_PATH': {
3222                     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',
3223                     height: 61,
3224                     width: 51,
3225                     heightElements: [10, 50, 60],
3226                     widthElements: [10, 40, 50, 60]
3227                 },
3228                 'DATA_OBJECT_COLLECTION_PATH': {
3229                     d: 'm {mx}, {my} ' +
3230                         'm  0 15  l 0 -15 ' +
3231                         'm  4 15  l 0 -15 ' +
3232                         'm  4 15  l 0 -15 ',
3233                     height: 61,
3234                     width: 51,
3235                     heightElements: [12],
3236                     widthElements: [1, 6, 12, 15]
3237                 },
3238                 'DATA_ARROW': {
3239                     d: 'm 5,9 9,0 0,-3 5,5 -5,5 0,-3 -9,0 z',
3240                     height: 61,
3241                     width: 51,
3242                     heightElements: [],
3243                     widthElements: []
3244                 },
3245                 'DATA_STORE': {
3246                     d: 'm  {mx},{my} ' +
3247                         'l  0,{e.y2} ' +
3248                         'c  {e.x0},{e.y1} {e.x1},{e.y1}  {e.x2},0 ' +
3249                         'l  0,-{e.y2} ' +
3250                         'c -{e.x0},-{e.y1} -{e.x1},-{e.y1} -{e.x2},0' +
3251                         'c  {e.x0},{e.y1} {e.x1},{e.y1}  {e.x2},0 ' +
3252                         'm  -{e.x2},{e.y0}' +
3253                         'c  {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0' +
3254                         'm  -{e.x2},{e.y0}' +
3255                         'c  {e.x0},{e.y1} {e.x1},{e.y1}  {e.x2},0',
3256                     height: 61,
3257                     width: 61,
3258                     heightElements: [7, 10, 45],
3259                     widthElements: [2, 58, 60]
3260                 },
3261                 'TEXT_ANNOTATION': {
3262                     d: 'm {mx}, {my} m 10,0 l -10,0 l 0,{e.y0} l 10,0',
3263                     height: 30,
3264                     width: 10,
3265                     heightElements: [30],
3266                     widthElements: [10]
3267                 },
3268                 'MARKER_SUB_PROCESS': {
3269                     d: 'm{mx},{my} m 7,2 l 0,10 m -5,-5 l 10,0',
3270                     height: 10,
3271                     width: 10,
3272                     heightElements: [],
3273                     widthElements: []
3274                 },
3275                 'MARKER_PARALLEL': {
3276                     d: 'm{mx},{my} m 3,2 l 0,10 m 3,-10 l 0,10 m 3,-10 l 0,10',
3277                     height: 10,
3278                     width: 10,
3279                     heightElements: [],
3280                     widthElements: []
3281                 },
3282                 'MARKER_SEQUENTIAL': {
3283                     d: 'm{mx},{my} m 0,3 l 10,0 m -10,3 l 10,0 m -10,3 l 10,0',
3284                     height: 10,
3285                     width: 10,
3286                     heightElements: [],
3287                     widthElements: []
3288                 },
3289                 'MARKER_COMPENSATION': {
3290                     d: 'm {mx},{my} 8,-5 0,10 z m 9,0 8,-5 0,10 z',
3291                     height: 10,
3292                     width: 21,
3293                     heightElements: [],
3294                     widthElements: []
3295                 },
3296                 'MARKER_LOOP': {
3297                     d: 'm {mx},{my} c 3.526979,0 6.386161,-2.829858 6.386161,-6.320661 0,-3.490806 -2.859182,-6.320661 ' +
3298                         '-6.386161,-6.320661 -3.526978,0 -6.38616,2.829855 -6.38616,6.320661 0,1.745402 ' +
3299                         '0.714797,3.325567 1.870463,4.469381 0.577834,0.571908 1.265885,1.034728 2.029916,1.35457 ' +
3300                         'l -0.718163,-3.909793 m 0.718163,3.909793 -3.885211,0.802902',
3301                     height: 13.9,
3302                     width: 13.7,
3303                     heightElements: [],
3304                     widthElements: []
3305                 },
3306                 'MARKER_ADHOC': {
3307                     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 ' +
3308                         '3.85579,1.15803 5.76082,1.79107 1.06385,0.34139996 2.24454,0.1438 3.18759,-0.43767 0.61743,-0.33642 ' +
3309                         '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 ' +
3310                         '-3.6918,1.66181996 -1.24459,0.0927 -2.46671,-0.2491 -3.59505,-0.74812 -1.35789,-0.55965 ' +
3311                         '-2.75133,-1.33436996 -4.27027,-1.18121996 -1.37741,0.14601 -2.41842,1.13685996 -3.44288,1.96782996 z',
3312                     height: 4,
3313                     width: 15,
3314                     heightElements: [],
3315                     widthElements: []
3316                 },
3317                 'TASK_TYPE_SEND': {
3318                     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}',
3319                     height: 14,
3320                     width: 21,
3321                     heightElements: [6, 14],
3322                     widthElements: [10.5, 21]
3323                 },
3324                 'TASK_TYPE_SCRIPT': {
3325                     d: 'm {mx},{my} c 9.966553,-6.27276 -8.000926,-7.91932 2.968968,-14.938 l -8.802728,0 ' +
3326                         'c -10.969894,7.01868 6.997585,8.66524 -2.968967,14.938 z ' +
3327                         'm -7,-12 l 5,0 ' +
3328                         'm -4.5,3 l 4.5,0 ' +
3329                         'm -3,3 l 5,0' +
3330                         'm -4,3 l 5,0',
3331                     height: 15,
3332                     width: 12.6,
3333                     heightElements: [6, 14],
3334                     widthElements: [10.5, 21]
3335                 },
3336                 'TASK_TYPE_USER_1': {
3337                     d: 'm {mx},{my} c 0.909,-0.845 1.594,-2.049 1.594,-3.385 0,-2.554 -1.805,-4.62199999 ' +
3338                         '-4.357,-4.62199999 -2.55199998,0 -4.28799998,2.06799999 -4.28799998,4.62199999 0,1.348 ' +
3339                         '0.974,2.562 1.89599998,3.405 -0.52899998,0.187 -5.669,2.097 -5.794,4.7560005 v 6.718 ' +
3340                         'h 17 v -6.718 c 0,-2.2980005 -5.5279996,-4.5950005 -6.0509996,-4.7760005 z' +
3341                         'm -8,6 l 0,5.5 m 11,0 l 0,-5'
3342                 },
3343                 'TASK_TYPE_USER_2': {
3344                     d: 'm {mx},{my} m 2.162,1.009 c 0,2.4470005 -2.158,4.4310005 -4.821,4.4310005 ' +
3345                         '-2.66499998,0 -4.822,-1.981 -4.822,-4.4310005 '
3346                 },
3347                 'TASK_TYPE_USER_3': {
3348                     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 ' +
3349                         '4.124,0.965 -0.098,-0.57 -0.117,-3.79099999 -4.191,-4.13599999 -3.57499998,0.001 ' +
3350                         '-4.20799998,3.36699999 -4.20699998,4.34799999 z'
3351                 },
3352                 'TASK_TYPE_MANUAL': {
3353                     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 ' +
3354                         '-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 ' +
3355                         '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 ' +
3356                         '-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 ' +
3357                         '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 ' +
3358                         '-10.86,-0.003 -11.0829995,-0.003 -0.022,-0.047 -0.045,-0.094 -0.069,-0.139 0.3939995,-0.319 ' +
3359                         '2.0409995,-1.626 2.4149995,-2.017 0.469,-0.4870005 0.519,-1.1650005 0.162,-1.6040005 -0.414,-0.511 ' +
3360                         '-0.973,-0.5 -1.48,-0.236 -1.4609995,0.764 -6.5999995,3.6430005 -7.7329995,4.2710005 -0.9,0.499 ' +
3361                         '-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 ' +
3362                         '-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 ' +
3363                         '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 ' +
3364                         '-5.824,-0.004 -6.04,-0.004 10e-4,-0.084 0.003,-0.586 10e-4,-0.67 z'
3365                 },
3366                 'TASK_TYPE_INSTANTIATING_SEND': {
3367                     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'
3368                 },
3369                 'TASK_TYPE_SERVICE': {
3370                     d: 'm {mx},{my} v -1.71335 c 0.352326,-0.0705 0.703932,-0.17838 1.047628,-0.32133 ' +
3371                         '0.344416,-0.14465 0.665822,-0.32133 0.966377,-0.52145 l 1.19431,1.18005 1.567487,-1.57688 ' +
3372                         '-1.195028,-1.18014 c 0.403376,-0.61394 0.683079,-1.29908 0.825447,-2.01824 l 1.622133,-0.01 ' +
3373                         'v -2.2196 l -1.636514,0.01 c -0.07333,-0.35153 -0.178319,-0.70024 -0.323564,-1.04372 ' +
3374                         '-0.145244,-0.34406 -0.321407,-0.6644 -0.522735,-0.96217 l 1.131035,-1.13631 -1.583305,-1.56293 ' +
3375                         '-1.129598,1.13589 c -0.614052,-0.40108 -1.302883,-0.68093 -2.022633,-0.82247 l 0.0093,-1.61852 ' +
3376                         '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 ' +
3377                         '-0.665102,0.32092 -0.9635006,0.52046 l -1.1698628,-1.15823 -1.5667691,1.5792 1.1684265,1.15669 ' +
3378                         'c -0.4026573,0.61283 -0.68308,1.29797 -0.8247287,2.01713 l -1.6588041,0.003 v 2.22174 ' +
3379                         'l 1.6724648,-0.006 c 0.073327,0.35077 0.1797598,0.70243 0.3242851,1.04472 0.1452428,0.34448 ' +
3380                         '0.3214064,0.6644 0.5227339,0.96066 l -1.1993431,1.19723 1.5840256,1.56011 1.1964668,-1.19348 ' +
3381                         'c 0.6140517,0.40346 1.3028827,0.68232 2.0233517,0.82331 l 7.19e-4,1.69892 h 2.226848 z ' +
3382                         'm 0.221462,-3.9957 c -1.788948,0.7502 -3.8576,-0.0928 -4.6097055,-1.87438 -0.7521065,-1.78321 ' +
3383                         '0.090598,-3.84627 1.8802645,-4.59604 1.78823,-0.74936 3.856881,0.0929 4.608987,1.87437 ' +
3384                         '0.752106,1.78165 -0.0906,3.84612 -1.879546,4.59605 z'
3385                 },
3386                 'TASK_TYPE_SERVICE_FILL': {
3387                     d: 'm {mx},{my} c -1.788948,0.7502 -3.8576,-0.0928 -4.6097055,-1.87438 -0.7521065,-1.78321 ' +
3388                         '0.090598,-3.84627 1.8802645,-4.59604 1.78823,-0.74936 3.856881,0.0929 4.608987,1.87437 ' +
3389                         '0.752106,1.78165 -0.0906,3.84612 -1.879546,4.59605 z'
3390                 },
3391                 'TASK_TYPE_BUSINESS_RULE_HEADER': {
3392                     d: 'm {mx},{my} 0,4 20,0 0,-4 z'
3393                 },
3394                 'TASK_TYPE_BUSINESS_RULE_MAIN': {
3395                     d: 'm {mx},{my} 0,12 20,0 0,-12 z' +
3396                         'm 0,8 l 20,0 ' +
3397                         'm -13,-4 l 0,8'
3398                 },
3399                 'MESSAGE_FLOW_MARKER': {
3400                     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'
3401                 }
3402             };
3403
3404             this.getRawPath = function getRawPath(pathId) {
3405                 return this.pathMap[pathId].d;
3406             };
3407
3408             /**
3409              * Scales the path to the given height and width.
3410              * <h1>Use case</h1>
3411              * <p>
3412              * Use case is to scale the content of elements (event, gateways) based on
3413              * the element bounding box's size.
3414              * </p>
3415              * <h1>Why not transform</h1>
3416              * <p>
3417              * Scaling a path with transform() will also scale the stroke and IE does
3418              * not support the option 'non-scaling-stroke' to prevent this. Also there
3419              * are use cases where only some parts of a path should be scaled.
3420              * </p>
3421              * 
3422              * @param {String}
3423              *            pathId The ID of the path.
3424              * @param {Object}
3425              *            param
3426              *            <p>
3427              *            Example param object scales the path to 60% size of the
3428              *            container (data.width, data.height).
3429              * 
3430              * <pre>
3431              * {
3432              *  xScaleFactor : 0.6,
3433              *  yScaleFactor : 0.6,
3434              *  containerWidth : data.width,
3435              *  containerHeight : data.height,
3436              *  position : {
3437              *          mx : 0.46,
3438              *          my : 0.2,
3439              *  }
3440              * }
3441              * </pre>
3442              * 
3443              * <ul>
3444              *            <li>targetpathwidth = xScaleFactor * containerWidth</li>
3445              *            <li>targetpathheight = yScaleFactor * containerHeight</li>
3446              *            <li>Position is used to set the starting coordinate of the
3447              *            path. M is computed:
3448              *            <ul>
3449              *            <li>position.x * containerWidth</li>
3450              *            <li>position.y * containerHeight</li>
3451              *            </ul>
3452              *            Center of the container
3453              * 
3454              * <pre>
3455              *  position: {
3456              *       mx: 0.5,
3457              *       my: 0.5,
3458              *     }
3459              * </pre>
3460              * 
3461              * Upper left corner of the container
3462              * 
3463              * <pre>
3464              *  position: {
3465              *       mx: 0.0,
3466              *       my: 0.0,
3467              *     }
3468              * </pre>
3469              * 
3470              * </li>
3471              *            </ul>
3472              *            </p>
3473              * 
3474              */
3475             this.getScaledPath = function getScaledPath(pathId, param) {
3476                 var rawPath = this.pathMap[pathId];
3477
3478                 // positioning
3479                 // compute the start point of the path
3480                 var mx, my;
3481
3482                 if (!!param.abspos) {
3483                     mx = param.abspos.x;
3484                     my = param.abspos.y;
3485                 } else {
3486                     mx = param.containerWidth * param.position.mx;
3487                     my = param.containerHeight * param.position.my;
3488                 }
3489
3490                 var coordinates = {}; // map for the scaled coordinates
3491                 if (param.position) {
3492
3493                     // path
3494                     var heightRatio = (param.containerHeight / rawPath.height) * param.yScaleFactor;
3495                     var widthRatio = (param.containerWidth / rawPath.width) * param.xScaleFactor;
3496
3497
3498                     // Apply height ratio
3499                     for (var heightIndex = 0; heightIndex < rawPath.heightElements.length; heightIndex++) {
3500                         coordinates['y' + heightIndex] = rawPath.heightElements[heightIndex] * heightRatio;
3501                     }
3502
3503                     // Apply width ratio
3504                     for (var widthIndex = 0; widthIndex < rawPath.widthElements.length; widthIndex++) {
3505                         coordinates['x' + widthIndex] = rawPath.widthElements[widthIndex] * widthRatio;
3506                     }
3507                 }
3508
3509                 // Apply value to raw path
3510                 var path = Snap.format(
3511                     rawPath.d, {
3512                         mx: mx,
3513                         my: my,
3514                         e: coordinates
3515                     }
3516                 );
3517                 return path;
3518             };
3519         }
3520
3521         module.exports = PathMap;
3522
3523     }, {
3524         "diagram-js/vendor/snapsvg": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\vendor\\snapsvg.js"
3525     }],
3526     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\draw\\index.js": [function(require, module, exports) {
3527         module.exports = {
3528             renderer: ['type', require('./BpmnRenderer')],
3529             pathMap: ['type', require('./PathMap')]
3530         };
3531     }, {
3532         "./BpmnRenderer": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\draw\\BpmnRenderer.js",
3533         "./PathMap": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\draw\\PathMap.js"
3534     }],
3535     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\context-pad\\ContextPadProvider.js": [function(require, module, exports) {
3536         'use strict';
3537
3538
3539         var assign = require('lodash/object/assign'),
3540             forEach = require('lodash/collection/forEach');
3541
3542
3543         /**
3544          * A provider for BPMN 2.0 elements context pad
3545          */
3546         function ContextPadProvider(contextPad, modeling, elementFactory,
3547             connect, create, bpmnReplace,
3548             canvas) {
3549
3550             contextPad.registerProvider(this);
3551
3552             this._contextPad = contextPad;
3553
3554             this._modeling = modeling;
3555
3556             this._elementFactory = elementFactory;
3557             this._connect = connect;
3558             this._create = create;
3559             this._bpmnReplace = bpmnReplace;
3560             this._canvas = canvas;
3561         }
3562
3563         ContextPadProvider.$inject = [
3564             'contextPad',
3565             'modeling',
3566             'elementFactory',
3567             'connect',
3568             'create',
3569             'bpmnReplace',
3570             'canvas'
3571         ];
3572
3573         ContextPadProvider.prototype.getContextPadEntries = function(element) {
3574
3575             var contextPad = this._contextPad,
3576                 modeling = this._modeling,
3577
3578                 elementFactory = this._elementFactory,
3579                 connect = this._connect,
3580                 create = this._create,
3581                 bpmnReplace = this._bpmnReplace,
3582                 canvas = this._canvas;
3583
3584             var actions = {};
3585
3586             if (element.type === 'label') {
3587                 return actions;
3588             }
3589
3590             var bpmnElement = element.businessObject;
3591
3592             function startConnect(event, element, autoActivate) {
3593                 connect.start(event, element, autoActivate);
3594             }
3595
3596             function removeElement(e) {
3597               console.log(e);
3598                 if (element.waypoints) {
3599                     modeling.removeConnection(element);
3600                 } else {
3601                     modeling.removeShape(element);
3602                   
3603                 }
3604                 if(element.id == selected_decison_element)
3605                         {
3606                         
3607                         invisiblepropertyExplorer();
3608                         }
3609             }
3610
3611             function getReplaceMenuPosition(element) {
3612
3613                 var Y_OFFSET = 5;
3614
3615                 var diagramContainer = canvas.getContainer(),
3616                     pad = contextPad.getPad(element).html;
3617
3618                 var diagramRect = diagramContainer.getBoundingClientRect(),
3619                     padRect = pad.getBoundingClientRect();
3620
3621                 var top = padRect.top - diagramRect.top;
3622                 var left = padRect.left - diagramRect.left;
3623
3624                 var pos = {
3625                     x: left,
3626                     y: top + padRect.height + Y_OFFSET
3627                 };
3628
3629                 return pos;
3630             }
3631
3632            
3633             var change_color = function(par1,par2)
3634             {
3635                 if(isImportSchema == true){
3636
3637                         return par2/*'define-schema'*/;
3638                 }
3639                 else
3640                         {
3641                         return  par1/*'define-modify-schema'*/;
3642                         }
3643             }
3644             function appendAction(type, className, options) {
3645
3646                 function appendListener(event, element) {
3647
3648                     var shape = elementFactory.createShape(assign({
3649                         type: type
3650                     }, options));
3651                     create.start(event, shape, element);
3652                 }
3653
3654                 var shortType = type.replace(/^bpmn\:/, '');
3655
3656                 return {
3657                     group: 'model',
3658                     className: className,
3659                     title: 'Append ' + shortType,
3660                     action: {
3661                         dragstart: appendListener,
3662                         click: appendListener
3663                     }
3664                 };
3665             }
3666
3667
3668             if (bpmnElement.$instanceOf('bpmn:Gateway') || bpmnElement.$instanceOf('bpmn:MultiBranchConnector')) {
3669                 assign(actions, {
3670                     'define-path': {
3671                         group: 'DefinePath',
3672                         className: 'define-path',
3673                         title: 'Define/View Path',
3674                         action: {
3675                             click: function(event) {
3676                                                  
3677                                 if(bpmnElement.name){
3678                                                   var bpmnElementID = bpmnElement.id;
3679                                                 selected_decison_element = bpmnElementID;
3680                                                   var bpmnElementName = bpmnElement.name;
3681                                                 selected_element_name = bpmnElementName;
3682                                                   var pathIdentifiers = [];
3683                                                   
3684                                                   if (bpmnElement.outgoing) {
3685
3686                                                           var check_outgoing_names = true; 
3687                                                   forEach(bpmnElement.outgoing, function(og) {
3688                                                           
3689                                                           if(og.name && og.name.length !=0)
3690                                                                 {
3691                                                                   
3692                                                                                 pathIdentifiers.push(og.name);
3693                                                                 
3694                                                                  }
3695                                                           else
3696                                                                   {
3697                                                                 
3698                                                                                 errorProperty(bpmnElement.name+" out going path name was not entered");
3699                                                                                 check_outgoing_names=false;
3700                                                                   }
3701                                                           
3702                                                   });
3703                                                   if(check_outgoing_names)
3704                                                   {
3705                                                           
3706                                                                                 pathDetails(bpmnElementID,bpmnElementName,pathIdentifiers);
3707                                                   }
3708                                                   
3709                                                   
3710                                                         
3711                                                   }
3712                                                   else
3713                                                   {
3714                                                                         errorProperty(bpmnElement.name+' should atleast one output path was required');
3715                                                   }
3716                                                 
3717                             }
3718                                 else
3719                                         {
3720                                         errorProperty('Enter Valid Decision Name');
3721                                         }
3722                             }
3723                         }
3724                     }
3725                 });
3726             }
3727
3728             
3729
3730             if (bpmnElement.$instanceOf('bpmn:InitiateProcess')) {
3731             }
3732
3733                         if (bpmnElement.$instanceOf('bpmn:StartEvent')) {
3734             }
3735                         if (bpmnElement.$instanceOf('bpmn:Collector')) {
3736                 assign(actions, {
3737                     'Properties': {
3738                         group: 'clds',
3739                         label: 'Edit Properties',
3740                         className: 'clds-edit-properties',
3741                         title: 'Properties',
3742                         action: {
3743                             click: function(event) {
3744                                 lastElementSelected=bpmnElement.id
3745                                 CollectorsWindow(bpmnElement);
3746                             }
3747                         }
3748                     }
3749                 });
3750                                 
3751             }
3752                         if (bpmnElement.$instanceOf('bpmn:StringMatch')) {
3753                 assign(actions, {
3754                     'Properties': {
3755                         group: 'clds',
3756                         label: 'Edit Properties',
3757                         className: 'clds-edit-properties',
3758                         title: 'Properties',
3759                         action: {
3760                             click: function(event) {
3761                                 lastElementSelected=bpmnElement.id
3762                                 StringMatchWindow(bpmnElement);
3763                             }
3764                         }
3765                     }
3766                 });
3767             }
3768                         if (bpmnElement.$instanceOf('bpmn:TCA')) {
3769                 assign(actions, {
3770                     'Properties': {
3771                         group: 'clds',
3772                         label: 'Edit Properties',
3773                         className: 'clds-edit-properties',
3774                         title: 'Properties',
3775                         action: {
3776                             click: function(event) {
3777                               console.log(event);
3778                                 lastElementSelected=bpmnElement.id
3779                             }
3780                         }
3781                     }
3782                 });
3783             }
3784                         if (bpmnElement.$instanceOf('bpmn:GOC')) {
3785                 assign(actions, {
3786                     'Properties': {
3787                         group: 'clds',
3788                         label: 'Edit Properties',
3789                         className: 'clds-edit-properties',
3790                         title: 'Properties',
3791                         action: {
3792                             click: function(event) {
3793                                 lastElementSelected=bpmnElement.id
3794                                 GOCWindow();
3795                             }
3796                         }
3797                     }
3798                 });
3799             }
3800                         if (bpmnElement.$instanceOf('bpmn:Policy')) {
3801                 assign(actions, {
3802                     'Properties': {
3803                         group: 'clds',
3804                         label: 'Edit Properties',
3805                         className: 'clds-edit-properties',
3806                         title: 'Properties',
3807                         action: {
3808                             click: function(event) {
3809                                 lastElementSelected=bpmnElement.id
3810                                 PolicyWindow(bpmnElement);
3811                             }
3812                         }
3813                     }
3814                 });
3815             }
3816
3817             if (bpmnElement.$instanceOf('bpmn:FlowNode') ||
3818                 bpmnElement.$instanceOf('bpmn:InteractionNode')) {
3819
3820                 assign(actions, {
3821                     'append.text-annotation': appendAction('bpmn:TextAnnotation', 'icon-text-annotation'),
3822
3823                     'connect': {
3824                         group: 'connect',
3825                         className: 'icon-connection',
3826                         title: 'Connector',
3827                         action: {
3828                             click: startConnect,
3829                             dragstart: startConnect
3830                         }
3831                     }
3832                 });
3833             }
3834                         
3835                         // Delete Element Entry
3836             assign(actions, {
3837                 'delete': {
3838                     group: 'edits',
3839                     className: 'icon-trash',
3840                     title: 'Remove',
3841                     action: {
3842                         click: removeElement,
3843                         dragstart: removeElement
3844                     }
3845                 }
3846
3847
3848
3849             });
3850
3851             return actions;
3852         };
3853
3854         function isEventType(eventBo, type, definition) {
3855
3856             var isType = eventBo.$instanceOf(type);
3857             var isDefinition = false;
3858
3859             var definitions = eventBo.eventDefinitions || [];
3860             forEach(definitions, function(def) {
3861                 if (def.$type === definition) {
3862                     isDefinition = true;
3863                 }
3864             });
3865
3866             return isType && isDefinition;
3867         }
3868
3869
3870         module.exports = ContextPadProvider;
3871
3872     }, {
3873         "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
3874         "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js"
3875     }],
3876     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\context-pad\\index.js": [function(require, module, exports) {
3877         module.exports = {
3878             __depends__: [
3879                 require('diagram-js-direct-editing'),
3880                 require('diagram-js/lib/features/context-pad'),
3881                 require('diagram-js/lib/features/selection'),
3882                 require('diagram-js/lib/features/connect'),
3883                 require('diagram-js/lib/features/create'),
3884                 require('../replace')
3885             ],
3886             __init__: ['contextPadProvider'],
3887             contextPadProvider: ['type', require('./ContextPadProvider')]
3888         };
3889     }, {
3890         "../replace": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\replace\\index.js",
3891         "./ContextPadProvider": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\context-pad\\ContextPadProvider.js",
3892         "diagram-js-direct-editing": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\diagram-js-direct-editing\\index.js",
3893         "diagram-js/lib/features/connect": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\connect\\index.js",
3894         "diagram-js/lib/features/context-pad": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\context-pad\\index.js",
3895         "diagram-js/lib/features/create": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\create\\index.js",
3896         "diagram-js/lib/features/selection": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\selection\\index.js"
3897     }],
3898     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\keyboard\\BpmnKeyBindings.js": [function(require, module, exports) {
3899         'use strict';
3900
3901
3902         function BpmnKeyBindings(keyboard, spaceTool, lassoTool, directEditing, selection) {
3903                 
3904             keyboard.addListener(function(key, modifiers) {
3905                 
3906                 if (keyboard.hasModifier(modifiers)) {
3907                     return;
3908                 }
3909
3910                 // S -> activate space tool
3911                 if (key === 83) {
3912                     spaceTool.activateSelection();
3913
3914                     return true;
3915                 }
3916
3917                 // L -> activate lasso tool
3918                 if (key === 108) {
3919                     lassoTool.activateSelection();
3920
3921                     return true;
3922                 }
3923
3924                 var currentSelection = selection.get();
3925
3926                 // E -> activate direct editing
3927                 if (key === 69) {
3928                     if (currentSelection.length) {
3929                         directEditing.activate(currentSelection[0]);
3930                     }
3931
3932                     return true;
3933                 }
3934             });
3935         }
3936
3937         BpmnKeyBindings.$inject = ['keyboard', 'spaceTool', 'lassoTool', 'directEditing', 'selection'];
3938
3939         module.exports = BpmnKeyBindings;
3940     }, {}],
3941     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\keyboard\\index.js": [function(require, module, exports) {
3942         module.exports = {
3943             __depends__: [
3944                 require('diagram-js/lib/features/keyboard')
3945             ],
3946             __init__: ['bpmnKeyBindings'],
3947             bpmnKeyBindings: ['type', require('./BpmnKeyBindings')]
3948         };
3949     }, {
3950         "./BpmnKeyBindings": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\keyboard\\BpmnKeyBindings.js",
3951         "diagram-js/lib/features/keyboard": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\keyboard\\index.js"
3952     }],
3953     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\label-editing\\LabelEditingProvider.js": [function(require, module, exports) {
3954         'use strict';
3955
3956         var UpdateLabelHandler = require('./cmd/UpdateLabelHandler');
3957
3958         var LabelUtil = require('./LabelUtil');
3959
3960         var is = require('../../util/ModelUtil').is,
3961             isExpanded = require('../../util/DiUtil').isExpanded;
3962
3963         var daOriginalLabel = '';
3964
3965         var MIN_BOUNDS = {
3966             width: 150,
3967             height: 50
3968         };
3969
3970
3971         function LabelEditingProvider(eventBus, canvas, directEditing, commandStack, injector) {
3972
3973             directEditing.registerProvider(this);
3974             commandStack.registerHandler('element.updateLabel', UpdateLabelHandler);
3975
3976             // listen to dblclick on non-root elements
3977             eventBus.on('element.dblclick', function(event) {
3978                 
3979                 directEditing.activate(event.element);
3980             });
3981             
3982
3983             // complete on followup canvas operation
3984             eventBus.on(['element.mousedown', 'drag.activate', 'canvas.viewbox.changed'], function(event) {
3985                 directEditing.complete();
3986             });
3987
3988             // cancel on command stack changes
3989             eventBus.on(['commandStack.changed'], function() {
3990                 directEditing.cancel();
3991             });
3992
3993
3994             // activate direct editing for activities and text annotations
3995
3996
3997             if ('ontouchstart' in document.documentElement) {
3998                 // we deactivate automatic label editing on mobile devices
3999                 // as it breaks the user interaction workflow
4000
4001                 // TODO(nre): we should temporarily focus the edited element here
4002                 // and release the focused viewport after the direct edit operation is
4003                 // finished
4004             } else {
4005                 eventBus.on('create.end', 500, function(e) {
4006
4007                     var element = e.shape,
4008                         canExecute = e.context.canExecute;
4009
4010                     if (!canExecute) {
4011                         return;
4012                     }
4013
4014                     if (is(element, 'bpmn:Task') || is(element, 'bpmn:TextAnnotation') ||
4015                         (is(element, 'bpmn:SubProcess') && !isExpanded(element))) {
4016
4017                         directEditing.activate(element);
4018                     }
4019                 });
4020             }
4021
4022             this._canvas = canvas;
4023             this._commandStack = commandStack;
4024         }
4025
4026         LabelEditingProvider.$inject = ['eventBus', 'canvas', 'directEditing', 'commandStack', 'injector'];
4027
4028         module.exports = LabelEditingProvider;
4029
4030
4031         LabelEditingProvider.prototype.activate = function(element) {
4032
4033             var text = LabelUtil.getLabel(element);
4034
4035             if (text === undefined) {
4036                 return;
4037             }
4038
4039             daOriginalLabel = text;
4040             
4041             var bbox = this.getEditingBBox(element);
4042
4043             // adjust for expanded pools AND lanes
4044             if ((is(element, 'bpmn:Participant') && isExpanded(element)) || is(element, 'bpmn:Lane')) {
4045
4046                 bbox.width = MIN_BOUNDS.width;
4047                 bbox.height = MIN_BOUNDS.height;
4048
4049                 bbox.x = bbox.x + 10 - bbox.width / 2;
4050                 bbox.y = bbox.mid.y - bbox.height / 2;
4051             }
4052
4053             // adjust for expanded sub processes
4054             if (is(element, 'bpmn:SubProcess') && isExpanded(element)) {
4055
4056                 bbox.height = MIN_BOUNDS.height;
4057
4058                 bbox.x = bbox.mid.x - bbox.width / 2;
4059                 bbox.y = bbox.y + 10 - bbox.height / 2;
4060             }
4061
4062             return {
4063                 bounds: bbox,
4064                 text: text
4065             };
4066         };
4067
4068
4069         LabelEditingProvider.prototype.getEditingBBox = function(element, maxBounds) {
4070
4071             var target = element.label || element;
4072
4073             var bbox = this._canvas.getAbsoluteBBox(target);
4074
4075             var mid = {
4076                 x: bbox.x + bbox.width / 2,
4077                 y: bbox.y + bbox.height / 2
4078             };
4079
4080             // external label
4081             if (target.labelTarget) {
4082                 bbox.width = Math.max(bbox.width, MIN_BOUNDS.width);
4083                 bbox.height = Math.max(bbox.height, MIN_BOUNDS.height);
4084
4085                 bbox.x = mid.x - bbox.width / 2;
4086             }
4087
4088             bbox.mid = mid;
4089
4090             return bbox;
4091         };
4092
4093
4094         LabelEditingProvider.prototype.update = function(element, newLabel) {
4095                 //update conditional node
4096                 if (is(element, 'bpmn:ExclusiveGateway') || is(element, 'bpmn:MultiBranchConnector')){
4097                         updateDecisionLabel(daOriginalLabel, newLabel);
4098                 }
4099                 
4100                 this._commandStack.execute('element.updateLabel', {
4101                 element: element,
4102                 newLabel: newLabel
4103             });
4104         };
4105     }, {
4106         "../../util/DiUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\util\\DiUtil.js",
4107         "../../util/ModelUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\util\\ModelUtil.js",
4108         "./LabelUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\label-editing\\LabelUtil.js",
4109         "./cmd/UpdateLabelHandler": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\label-editing\\cmd\\UpdateLabelHandler.js"
4110     }],
4111     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\label-editing\\LabelUtil.js": [function(require, module, exports) {
4112         'use strict';
4113
4114         function getLabelAttr(semantic) {
4115             if (semantic.$instanceOf('bpmn:FlowElement') ||
4116                 semantic.$instanceOf('bpmn:Participant') ||
4117                 semantic.$instanceOf('bpmn:Lane') ||
4118                 semantic.$instanceOf('bpmn:SequenceFlow') ||
4119                 semantic.$instanceOf('bpmn:MessageFlow')) {
4120                 return 'name';
4121             }
4122
4123             if (semantic.$instanceOf('bpmn:TextAnnotation')) {
4124                 return 'text';
4125             }
4126         }
4127
4128         module.exports.getLabel = function(element) {
4129             var semantic = element.businessObject,
4130                 attr = getLabelAttr(semantic);
4131
4132             if (attr) {
4133                 return semantic[attr] || '';
4134             }
4135         };
4136
4137
4138         module.exports.setLabel = function(element, text) {
4139             var semantic = element.businessObject,
4140                 attr = getLabelAttr(semantic);
4141
4142             if (attr) {
4143                 semantic[attr] = text;
4144             }
4145
4146             var label = element.label || element;
4147
4148             // show label
4149             label.hidden = false;
4150
4151             return label;
4152         };
4153     }, {}],
4154     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\label-editing\\cmd\\UpdateLabelHandler.js": [function(require, module, exports) {
4155         'use strict';
4156
4157         var LabelUtil = require('../LabelUtil');
4158
4159
4160         /**
4161          * A handler that updates the text of a BPMN element.
4162          * 
4163          * @param {EventBus}
4164          *            eventBus
4165          */
4166         function UpdateTextHandler(eventBus) {
4167
4168             function setText(element, text) {
4169                 var label = LabelUtil.setLabel(element, text);
4170
4171                 eventBus.fire('element.changed', {
4172                     element: label
4173                 });
4174             }
4175
4176             function execute(ctx) {
4177                 ctx.oldLabel = LabelUtil.getLabel(ctx.element);
4178                 return setText(ctx.element, ctx.newLabel);
4179             }
4180
4181             function revert(ctx) {
4182                 return setText(ctx.element, ctx.oldLabel);
4183             }
4184
4185
4186             function canExecute(ctx) {
4187                 return true;
4188             }
4189
4190             // API
4191
4192             this.execute = execute;
4193             this.revert = revert;
4194
4195             this.canExecute = canExecute;
4196         }
4197
4198
4199         UpdateTextHandler.$inject = ['eventBus'];
4200
4201         module.exports = UpdateTextHandler;
4202     }, {
4203         "../LabelUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\label-editing\\LabelUtil.js"
4204     }],
4205     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\label-editing\\index.js": [function(require, module, exports) {
4206         module.exports = {
4207             __depends__: [
4208                 require('diagram-js/lib/command'),
4209                 require('diagram-js/lib/features/change-support'),
4210                 require('diagram-js-direct-editing')
4211             ],
4212             __init__: ['labelEditingProvider'],
4213             labelEditingProvider: ['type', require('./LabelEditingProvider')]
4214         };
4215     }, {
4216         "./LabelEditingProvider": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\label-editing\\LabelEditingProvider.js",
4217         "diagram-js-direct-editing": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\diagram-js-direct-editing\\index.js",
4218         "diagram-js/lib/command": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\command\\index.js",
4219         "diagram-js/lib/features/change-support": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\change-support\\index.js"
4220     }],
4221     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\BpmnFactory.js": [function(require, module, exports) {
4222         'use strict';
4223
4224         var map = require('lodash/collection/map'),
4225             assign = require('lodash/object/assign'),
4226             pick = require('lodash/object/pick');
4227
4228
4229         function BpmnFactory(moddle) {
4230             this._model = moddle;
4231         }
4232
4233         BpmnFactory.$inject = ['moddle'];
4234
4235
4236         BpmnFactory.prototype._needsId = function(element) {
4237             return element.$instanceOf('bpmn:RootElement') ||
4238                 element.$instanceOf('bpmn:FlowElement') ||
4239                 element.$instanceOf('bpmn:MessageFlow') ||
4240                 element.$instanceOf('bpmn:Artifact') ||
4241                 element.$instanceOf('bpmn:Participant') ||
4242                 element.$instanceOf('bpmn:Process') ||
4243                 element.$instanceOf('bpmn:Collaboration') ||
4244                 element.$instanceOf('bpmndi:BPMNShape') ||
4245                 element.$instanceOf('bpmndi:BPMNEdge') ||
4246                 element.$instanceOf('bpmndi:BPMNDiagram') ||
4247                 element.$instanceOf('bpmndi:BPMNPlane');
4248         };
4249
4250         BpmnFactory.prototype._ensureId = function(element) {
4251
4252             // generate semantic ids for elements
4253             // bpmn:SequenceFlow -> SequenceFlow_ID
4254             var prefix = (element.$type || '').replace(/^[^:]*:/g, '') + '_';
4255
4256             if (!element.id && this._needsId(element)) {
4257                 element.id = this._model.ids.nextPrefixed(prefix, element);
4258             }
4259         };
4260
4261
4262         BpmnFactory.prototype.create = function(type, attrs) {
4263             var element = this._model.create(type, attrs || {});
4264
4265             this._ensureId(element);
4266
4267             return element;
4268         };
4269
4270
4271         BpmnFactory.prototype.createDiLabel = function() {
4272             return this.create('bpmndi:BPMNLabel', {
4273                 bounds: this.createDiBounds()
4274             });
4275         };
4276
4277
4278         BpmnFactory.prototype.createDiShape = function(semantic, bounds, attrs) {
4279
4280             return this.create('bpmndi:BPMNShape', assign({
4281                 bpmnElement: semantic,
4282                 bounds: this.createDiBounds(bounds)
4283             }, attrs));
4284         };
4285
4286
4287         BpmnFactory.prototype.createDiBounds = function(bounds) {
4288             return this.create('dc:Bounds', bounds);
4289         };
4290
4291
4292         BpmnFactory.prototype.createDiWaypoints = function(waypoints) {
4293             return map(waypoints, function(pos) {
4294                 return this.createDiWaypoint(pos);
4295             }, this);
4296         };
4297
4298         BpmnFactory.prototype.createDiWaypoint = function(point) {
4299             return this.create('dc:Point', pick(point, ['x', 'y']));
4300         };
4301
4302
4303         BpmnFactory.prototype.createDiEdge = function(semantic, waypoints, attrs) {
4304             return this.create('bpmndi:BPMNEdge', assign({
4305                 bpmnElement: semantic
4306             }, attrs));
4307         };
4308
4309         BpmnFactory.prototype.createDiPlane = function(semantic) {
4310             return this.create('bpmndi:BPMNPlane', {
4311                 bpmnElement: semantic
4312             });
4313         };
4314
4315         module.exports = BpmnFactory;
4316
4317     }, {
4318         "lodash/collection/map": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\map.js",
4319         "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js",
4320         "lodash/object/pick": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\pick.js"
4321     }],
4322     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\BpmnLayouter.js": [function(require, module, exports) {
4323         'use strict';
4324
4325         var inherits = require('inherits');
4326
4327         var assign = require('lodash/object/assign');
4328
4329         var BaseLayouter = require('diagram-js/lib/layout/BaseLayouter'),
4330             LayoutUtil = require('diagram-js/lib/layout/LayoutUtil'),
4331             ManhattanLayout = require('diagram-js/lib/layout/ManhattanLayout');
4332
4333         var is = require('../../util/ModelUtil').is;
4334
4335
4336         function BpmnLayouter() {}
4337
4338         inherits(BpmnLayouter, BaseLayouter);
4339
4340         module.exports = BpmnLayouter;
4341
4342
4343         function getAttachment(waypoints, idx, shape) {
4344             var point = waypoints && waypoints[idx];
4345
4346             return point ? (point.original || point) : LayoutUtil.getMidPoint(shape);
4347         }
4348
4349
4350         BpmnLayouter.prototype.layoutConnection = function(connection, hints) {
4351             var source = connection.source,
4352                 target = connection.target,
4353                 waypoints = connection.waypoints,
4354                 start,
4355                 end;
4356
4357             var layoutManhattan,
4358                 updatedWaypoints;
4359
4360             start = getAttachment(waypoints, 0, source);
4361             end = getAttachment(waypoints, waypoints && waypoints.length - 1, target);
4362
4363             // manhattan layout sequence / message flows
4364             if (is(connection, 'bpmn:MessageFlow')) {
4365                 layoutManhattan = {
4366                     preferStraight: true,
4367                     preferVertical: true
4368                 };
4369             }
4370
4371             if (is(connection, 'bpmn:SequenceFlow')) {
4372                 layoutManhattan = {};
4373             }
4374
4375             if (layoutManhattan) {
4376
4377                 layoutManhattan = assign(layoutManhattan, hints);
4378
4379                 updatedWaypoints =
4380                     ManhattanLayout.repairConnection(
4381                         source, target, start, end,
4382                         waypoints,
4383                         layoutManhattan);
4384             }
4385
4386             return updatedWaypoints || [start, end];
4387         };
4388     }, {
4389         "../../util/ModelUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\util\\ModelUtil.js",
4390         "diagram-js/lib/layout/BaseLayouter": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\layout\\BaseLayouter.js",
4391         "diagram-js/lib/layout/LayoutUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\layout\\LayoutUtil.js",
4392         "diagram-js/lib/layout/ManhattanLayout": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\layout\\ManhattanLayout.js",
4393         "inherits": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\inherits\\inherits_browser.js",
4394         "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js"
4395     }],
4396     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\BpmnUpdater.js": [function(require, module, exports) {
4397         'use strict';
4398
4399         var assign = require('lodash/object/assign'),
4400             forEach = require('lodash/collection/forEach'),
4401             inherits = require('inherits');
4402
4403         var Collections = require('diagram-js/lib/util/Collections'),
4404             Model = require('diagram-js/lib/model');
4405
4406         var CommandInterceptor = require('diagram-js/lib/command/CommandInterceptor');
4407
4408
4409         /**
4410          * A handler responsible for updating the underlying BPMN 2.0 XML + DI once
4411          * changes on the diagram happen
4412          */
4413         function BpmnUpdater(eventBus, bpmnFactory, connectionDocking) {
4414
4415             CommandInterceptor.call(this, eventBus);
4416
4417             this._bpmnFactory = bpmnFactory;
4418
4419             var self = this;
4420
4421
4422
4423             // //// connection cropping /////////////////////////
4424
4425             // crop connection ends during create/update
4426             function cropConnection(e) {
4427                 var context = e.context,
4428                     connection;
4429
4430                 if (!context.cropped) {
4431                     connection = context.connection;
4432                     connection.waypoints = connectionDocking.getCroppedWaypoints(connection);
4433                     context.cropped = true;
4434                 }
4435             }
4436
4437             this.executed([
4438                 'connection.layout',
4439                 'connection.create',
4440                 'connection.reconnectEnd',
4441                 'connection.reconnectStart'
4442             ], cropConnection);
4443
4444             this.reverted(['connection.layout'], function(e) {
4445                 delete e.context.cropped;
4446             });
4447
4448
4449
4450             // //// BPMN + DI update /////////////////////////
4451
4452
4453             // update parent
4454             function updateParent(e) {
4455                 self.updateParent(e.context.shape || e.context.connection);
4456             }
4457
4458             this.executed(['shape.move',
4459                 'shape.create',
4460                 'shape.delete',
4461                 'connection.create',
4462                 'connection.move',
4463                 'connection.delete'
4464             ], updateParent);
4465             this.reverted(['shape.move',
4466                 'shape.create',
4467                 'shape.delete',
4468                 'connection.create',
4469                 'connection.move',
4470                 'connection.delete'
4471             ], updateParent);
4472
4473             /*
4474              * ## Updating Parent
4475              * 
4476              * When morphing a Process into a Collaboration or vice-versa, make sure
4477              * that both the *semantic* and *di* parent of each element is updated.
4478              * 
4479              */
4480             function updateRoot(event) {
4481                 var context = event.context,
4482                     oldRoot = context.oldRoot,
4483                     children = oldRoot.children;
4484
4485                 forEach(children, function(child) {
4486                     self.updateParent(child);
4487                 });
4488             }
4489
4490             this.executed(['canvas.updateRoot'], updateRoot);
4491             this.reverted(['canvas.updateRoot'], updateRoot);
4492
4493
4494             // update bounds
4495             function updateBounds(e) {
4496                 self.updateBounds(e.context.shape);
4497             }
4498
4499             this.executed(['shape.move', 'shape.create', 'shape.resize'], updateBounds);
4500             this.reverted(['shape.move', 'shape.create', 'shape.resize'], updateBounds);
4501
4502
4503             // attach / detach connection
4504             function updateConnection(e) {
4505                 self.updateConnection(e.context.connection);
4506             }
4507
4508             this.executed([
4509                 'connection.create',
4510                 'connection.move',
4511                 'connection.delete',
4512                 'connection.reconnectEnd',
4513                 'connection.reconnectStart'
4514             ], updateConnection);
4515
4516             this.reverted([
4517                 'connection.create',
4518                 'connection.move',
4519                 'connection.delete',
4520                 'connection.reconnectEnd',
4521                 'connection.reconnectStart'
4522             ], updateConnection);
4523
4524
4525             // update waypoints
4526             function updateConnectionWaypoints(e) {
4527                 self.updateConnectionWaypoints(e.context.connection);
4528             }
4529
4530             this.executed([
4531                 'connection.layout',
4532                 'connection.move',
4533                 'connection.updateWaypoints',
4534                 'connection.reconnectEnd',
4535                 'connection.reconnectStart'
4536             ], updateConnectionWaypoints);
4537
4538             this.reverted([
4539                 'connection.layout',
4540                 'connection.move',
4541                 'connection.updateWaypoints',
4542                 'connection.reconnectEnd',
4543                 'connection.reconnectStart'
4544             ], updateConnectionWaypoints);
4545         }
4546
4547         inherits(BpmnUpdater, CommandInterceptor);
4548
4549         module.exports = BpmnUpdater;
4550
4551         BpmnUpdater.$inject = ['eventBus', 'bpmnFactory', 'connectionDocking'];
4552
4553
4554         // ///// implementation //////////////////////////////////
4555
4556
4557         BpmnUpdater.prototype.updateParent = function(element) {
4558
4559             // do not update BPMN 2.0 label parent
4560             if (element instanceof Model.Label) {
4561                 return;
4562             }
4563
4564             var parentShape = element.parent;
4565
4566             var businessObject = element.businessObject,
4567                 parentBusinessObject = parentShape && parentShape.businessObject,
4568                 parentDi = parentBusinessObject && parentBusinessObject.di;
4569
4570             this.updateSemanticParent(businessObject, parentBusinessObject);
4571
4572             this.updateDiParent(businessObject.di, parentDi);
4573         };
4574
4575
4576         BpmnUpdater.prototype.updateBounds = function(shape) {
4577
4578             var di = shape.businessObject.di;
4579
4580             var bounds = (shape instanceof Model.Label) ? this._getLabel(di).bounds : di.bounds;
4581
4582             assign(bounds, {
4583                 x: shape.x,
4584                 y: shape.y,
4585                 width: shape.width,
4586                 height: shape.height
4587             });
4588         };
4589
4590
4591         BpmnUpdater.prototype.updateDiParent = function(di, parentDi) {
4592
4593             if (parentDi && !parentDi.$instanceOf('bpmndi:BPMNPlane')) {
4594                 parentDi = parentDi.$parent;
4595             }
4596
4597             if (di.$parent === parentDi) {
4598                 return;
4599             }
4600
4601             var planeElements = (parentDi || di.$parent).get('planeElement');
4602
4603             if (parentDi) {
4604                 planeElements.push(di);
4605                 di.$parent = parentDi;
4606             } else {
4607                 Collections.remove(planeElements, di);
4608                 di.$parent = null;
4609             }
4610         };
4611
4612         function getDefinitions(element) {
4613             while (element && !element.$instanceOf('bpmn:Definitions')) {
4614                 element = element.$parent;
4615             }
4616
4617             return element;
4618         }
4619
4620         BpmnUpdater.prototype.updateSemanticParent = function(businessObject, newParent) {
4621
4622             var containment;
4623
4624             if (businessObject.$parent === newParent) {
4625                 return;
4626             }
4627
4628             if (businessObject.$instanceOf('bpmn:FlowElement')) {
4629
4630                 if (newParent && newParent.$instanceOf('bpmn:Participant')) {
4631                     newParent = newParent.processRef;
4632                 }
4633
4634                 containment = 'flowElements';
4635
4636             } else
4637
4638             if (businessObject.$instanceOf('bpmn:Artifact')) {
4639
4640                 while (newParent &&
4641                     !newParent.$instanceOf('bpmn:Process') &&
4642                     !newParent.$instanceOf('bpmn:SubProcess') &&
4643                     !newParent.$instanceOf('bpmn:Collaboration')) {
4644
4645                     if (newParent.$instanceOf('bpmn:Participant')) {
4646                         newParent = newParent.processRef;
4647                         break;
4648                     } else {
4649                         newParent = newParent.$parent;
4650                     }
4651                 }
4652
4653                 containment = 'artifacts';
4654             } else
4655
4656             if (businessObject.$instanceOf('bpmn:MessageFlow')) {
4657                 containment = 'messageFlows';
4658
4659             } else
4660
4661             if (businessObject.$instanceOf('bpmn:Participant')) {
4662                 containment = 'participants';
4663
4664                 // make sure the participants process is properly attached / detached
4665                 // from the XML document
4666
4667                 var process = businessObject.processRef,
4668                     definitions;
4669
4670                 if (process) {
4671                     definitions = getDefinitions(businessObject.$parent || newParent);
4672
4673                     if (businessObject.$parent) {
4674                         Collections.remove(definitions.get('rootElements'), process);
4675                         process.$parent = null;
4676                     }
4677
4678                     if (newParent) {
4679                         Collections.add(definitions.get('rootElements'), process);
4680                         process.$parent = definitions;
4681                     }
4682                 }
4683             }
4684
4685             if (!containment) {
4686                 throw new Error('no parent for ', businessObject, newParent);
4687             }
4688
4689             var children;
4690
4691             if (businessObject.$parent) {
4692                 // remove from old parent
4693                 children = businessObject.$parent.get(containment);
4694                 Collections.remove(children, businessObject);
4695             }
4696
4697             if (!newParent) {
4698                 businessObject.$parent = null;
4699             } else {
4700                 // add to new parent
4701                 children = newParent.get(containment);
4702                 children.push(businessObject);
4703                 businessObject.$parent = newParent;
4704             }
4705         };
4706
4707
4708         BpmnUpdater.prototype.updateConnectionWaypoints = function(connection) {
4709
4710             connection.businessObject.di.set('waypoint', this._bpmnFactory.createDiWaypoints(connection.waypoints));
4711         };
4712
4713
4714         BpmnUpdater.prototype.updateConnection = function(connection) {
4715
4716             var businessObject = connection.businessObject,
4717                 newSource = connection.source && connection.source.businessObject,
4718                 newTarget = connection.target && connection.target.businessObject;
4719
4720             var inverseSet = businessObject.$instanceOf('bpmn:SequenceFlow');
4721
4722             if (businessObject.sourceRef !== newSource) {
4723                 if (inverseSet) {
4724                     Collections.remove(businessObject.sourceRef && businessObject.sourceRef.get('outgoing'), businessObject);
4725
4726                     if (newSource) {
4727                         newSource.get('outgoing').push(businessObject);
4728                     }
4729                 }
4730
4731                 businessObject.sourceRef = newSource;
4732             }
4733             if (businessObject.targetRef !== newTarget) {
4734                 if (inverseSet) {
4735                     Collections.remove(businessObject.targetRef && businessObject.targetRef.get('incoming'), businessObject);
4736
4737                     if (newTarget) {
4738                         newTarget.get('incoming').push(businessObject);
4739                     }
4740                 }
4741
4742                 businessObject.targetRef = newTarget;
4743             }
4744
4745             businessObject.di.set('waypoint', this._bpmnFactory.createDiWaypoints(connection.waypoints));
4746         };
4747
4748
4749         // ///// helpers /////////////////////////////////////////
4750
4751         BpmnUpdater.prototype._getLabel = function(di) {
4752             if (!di.label) {
4753                 di.label = this._bpmnFactory.createDiLabel();
4754             }
4755
4756             return di.label;
4757         };
4758     }, {
4759         "diagram-js/lib/command/CommandInterceptor": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\command\\CommandInterceptor.js",
4760         "diagram-js/lib/model": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\model\\index.js",
4761         "diagram-js/lib/util/Collections": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Collections.js",
4762         "inherits": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\inherits\\inherits_browser.js",
4763         "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
4764         "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js"
4765     }],
4766     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\ElementFactory.js": [function(require, module, exports) {
4767         'use strict';
4768
4769         var assign = require('lodash/object/assign'),
4770             inherits = require('inherits');
4771
4772         var BaseElementFactory = require('diagram-js/lib/core/ElementFactory'),
4773             LabelUtil = require('../../util/LabelUtil');
4774
4775
4776         /**
4777          * A bpmn-aware factory for diagram-js shapes
4778          */
4779         function ElementFactory(bpmnFactory, moddle) {
4780             BaseElementFactory.call(this);
4781
4782             this._bpmnFactory = bpmnFactory;
4783             this._moddle = moddle;
4784         }
4785
4786         inherits(ElementFactory, BaseElementFactory);
4787
4788
4789         ElementFactory.$inject = ['bpmnFactory', 'moddle'];
4790
4791         module.exports = ElementFactory;
4792
4793         ElementFactory.prototype.baseCreate = BaseElementFactory.prototype.create;
4794
4795         ElementFactory.prototype.create = function(elementType, attrs) {
4796
4797             // no special magic for labels,
4798             // we assume their businessObjects have already been created
4799             // and wired via attrs
4800             if (elementType === 'label') {
4801                 return this.baseCreate(elementType, assign({
4802                     type: 'label'
4803                 }, LabelUtil.DEFAULT_LABEL_SIZE, attrs));
4804             }
4805
4806             attrs = attrs || {};
4807
4808             var businessObject = attrs.businessObject,
4809                 size;
4810
4811             if (!businessObject) {
4812                 if (!attrs.type) {
4813                     throw new Error('no shape type specified');
4814                 }
4815
4816                 businessObject = this._bpmnFactory.create(attrs.type);
4817             }
4818
4819             if (!businessObject.di) {
4820                 if (elementType === 'root') {
4821                     businessObject.di = this._bpmnFactory.createDiPlane(businessObject, [], {
4822                         id: businessObject.id + '_di'
4823                     });
4824                 } else
4825                 if (elementType === 'connection') {
4826                     businessObject.di = this._bpmnFactory.createDiEdge(businessObject, [], {
4827                         id: businessObject.id + '_di'
4828                     });
4829                 } else {
4830                     businessObject.di = this._bpmnFactory.createDiShape(businessObject, {}, {
4831                         id: businessObject.id + '_di'
4832                     });
4833                 }
4834             }
4835
4836             if (!!attrs.isExpanded) {
4837                 businessObject.di.isExpanded = attrs.isExpanded;
4838             }
4839
4840             /*
4841              * if (businessObject.$instanceOf('bpmn:ExclusiveGateway')) {
4842              * businessObject.di.isMarkerVisible = true; }
4843              */
4844
4845             if (attrs._eventDefinitionType) {
4846                 var eventDefinitions = businessObject.get('eventDefinitions') || [],
4847                     newEventDefinition = this._moddle.create(attrs._eventDefinitionType);
4848
4849                 eventDefinitions.push(newEventDefinition);
4850                 businessObject.eventDefinitions = eventDefinitions;
4851             }
4852
4853             size = this._getDefaultSize(businessObject);
4854
4855             attrs = assign({
4856                 businessObject: businessObject,
4857                 id: businessObject.id
4858             }, size, attrs);
4859
4860             return this.baseCreate(elementType, attrs);
4861         };
4862
4863
4864         ElementFactory.prototype._getDefaultSize = function(semantic) {
4865
4866             if (semantic.$instanceOf('bpmn:SubProcess')) {
4867                 var isExpanded = semantic.di.isExpanded === true;
4868
4869                 if (isExpanded) {
4870                     return {
4871                         width: 350,
4872                         height: 200
4873                     };
4874                 } else {
4875                     return {
4876                         width: 100,
4877                         height: 80
4878                     };
4879                 }
4880             }
4881
4882             if (semantic.$instanceOf('bpmn:InitiateProcess')) {
4883                 return {
4884                     width: 120,
4885                     height: 80
4886                 };
4887             }
4888             if (semantic.$instanceOf('bpmn:Collector')) {
4889                 return {
4890                     width: 120,
4891                     height: 80
4892                 };
4893             }
4894         
4895                         if (semantic.$instanceOf('bpmn:StringMatch')) {
4896                 return {
4897                     width: 120,
4898                     height: 80
4899                 };
4900             }
4901                         
4902                         if (semantic.$instanceOf('bpmn:TCA')) {
4903                 return {
4904                     width: 120,
4905                     height: 80
4906                 };
4907             }
4908                         
4909                         if (semantic.$instanceOf('bpmn:Policy')) {
4910                 return {
4911                     width: 120,
4912                     height: 80
4913                 };
4914             }
4915                         
4916                         if (semantic.$instanceOf('bpmn:GOC')) {
4917                 return {
4918                     width: 120,
4919                     height: 80
4920                 };
4921             }
4922             if (semantic.$instanceOf('bpmn:ParentReturn')) {
4923                 return {
4924                     width: 100,
4925                     height: 80
4926                 };
4927             }
4928             if (semantic.$instanceOf('bpmn:SubProcessCall')) {
4929                 return {
4930                     width: 100,
4931                     height: 80
4932                 };
4933             }
4934
4935             if (semantic.$instanceOf('bpmn:ExclusiveGateway')) {
4936                 return {
4937                     width: 100,
4938                     height: 80
4939                 };
4940             }
4941
4942             if (semantic.$instanceOf('bpmn:Task')) {
4943                 return {
4944                     width: 100,
4945                     height: 80
4946                 };
4947             }
4948
4949             if (semantic.$instanceOf('bpmn:Gateway')) {
4950                 return {
4951                     width: 100,
4952                     height: 100
4953                 };
4954             }
4955
4956             if (semantic.$instanceOf('bpmn:Event')) {
4957                 return {
4958                     width: 36,
4959                     height: 36
4960                 };
4961             }
4962
4963             if (semantic.$instanceOf('bpmn:Participant')) {
4964                 return {
4965                     width: 100,
4966                     height: 80
4967                 };
4968             }
4969
4970             return {
4971                 width: 100,
4972                 height: 80
4973             };
4974         };
4975
4976
4977         ElementFactory.prototype.createParticipantShape = function(collapsed) {
4978             // alert("entering createParticipantShape");
4979             var participantShape = this.createShape({
4980                 type: 'bpmn:Participant'
4981             });
4982
4983             if (!collapsed) {
4984                 participantShape.businessObject.processRef = this._bpmnFactory.create('bpmn:Process');
4985             }
4986
4987             return participantShape;
4988         };
4989     }, {
4990         "../../util/LabelUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\util\\LabelUtil.js",
4991         "diagram-js/lib/core/ElementFactory": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\core\\ElementFactory.js",
4992         "inherits": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\inherits\\inherits_browser.js",
4993         "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js"
4994     }],
4995     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\LabelSupport.js": [function(require, module, exports) {
4996         'use strict';
4997
4998         var assign = require('lodash/object/assign'),
4999             forEach = require('lodash/collection/forEach');
5000
5001         var LabelUtil = require('../../util/LabelUtil');
5002
5003         var hasExternalLabel = LabelUtil.hasExternalLabel,
5004             getExternalLabelMid = LabelUtil.getExternalLabelMid;
5005
5006
5007         function LabelSupport(eventBus, modeling, bpmnFactory) {
5008
5009             // create external labels on shape creation
5010
5011             eventBus.on([
5012                 'commandStack.shape.create.postExecute',
5013                 'commandStack.connection.create.postExecute'
5014             ], function(e) {
5015                 var context = e.context;
5016
5017                 var element = context.shape || context.connection,
5018                     businessObject = element.businessObject;
5019
5020                 var position;
5021
5022                 if (hasExternalLabel(businessObject)) {
5023                     position = getExternalLabelMid(element);
5024                     modeling.createLabel(element, position, {
5025                         id: businessObject.id + '_label',
5026                         businessObject: businessObject
5027                     });
5028                 }
5029             });
5030
5031
5032             //move label when connection/shape is being moved
5033             //if shape is being moved, get connection as element
5034             
5035             eventBus.on(['commandStack.connection.create.postExecute',
5036                          'commandStack.connection.move.postExecute',
5037                          //'commandStack.connection.delete.postExecute',
5038                          'commandStack.connection.reconnectEnd.postExecute',
5039                          'commandStack.connection.reconnectStart.postExecute',
5040                          'commandStack.connection.updateWaypoints.postExecute',
5041                          'shape.move.end'
5042                      ],function(e){
5043                                 
5044                                 var context = e.context;
5045                                 var element;
5046                                 
5047                                 if(context.allDraggedElements != null){
5048                                         if(context.allDraggedElements.length > 0){
5049                                                 element = context.allDraggedElements[1];
5050                                         }
5051                                 }else{
5052                                         element = context.connection;
5053                                 }
5054                                 
5055                                 if(element==null){
5056                                         return;
5057                                 }
5058                 
5059                                 var businessObject = element.businessObject;
5060                                 
5061                                 if(businessObject.$type != 'bpmn:SequenceFlow'){
5062                                         return;
5063                                 }
5064                                 
5065                                 var position;
5066                 
5067                                 if (hasExternalLabel(businessObject)) {
5068                                     position = getExternalLabelMid(element);
5069                                     modeling.removeShape(element.label);
5070                                     modeling.createLabel(element, position, {
5071                                         id: businessObject.id + '_label',
5072                                         businessObject: businessObject
5073                                     });
5074                                 }
5075                 
5076             });
5077             
5078             
5079             // indicate label is dragged during move
5080
5081             // we need to add labels to the list of selected
5082             // shapes before the visuals get drawn.
5083             //
5084             // Hence this awesome magic number.
5085             //
5086             eventBus.on('shape.move.start', function(e) {
5087
5088                 var context = e.context,
5089                     shapes = context.shapes;
5090
5091                 var labels = [];
5092
5093                 forEach(shapes, function(element) {
5094                     var label = element.label;
5095
5096                     if (label && !label.hidden && context.shapes.indexOf(label) === -1) {
5097                         labels.push(label);
5098                     }
5099                 });
5100
5101                 forEach(labels, function(label) {
5102                     shapes.push(label);
5103                 });
5104             });
5105
5106
5107             // move labels with shapes
5108
5109             eventBus.on([
5110                 'commandStack.shapes.move.postExecute'
5111             ], function(e) {
5112
5113                 var context = e.context,
5114                     closure = context.closure,
5115                     enclosedElements = closure.enclosedElements;
5116
5117                 // ensure we move all labels with their respective elements
5118                 // if they have not been moved already
5119
5120                 forEach(enclosedElements, function(e) {
5121                     if (e.label && !enclosedElements[e.label.id]) {
5122                         modeling.moveShape(e.label, context.delta, e.parent);
5123                     }
5124                 });
5125             });
5126
5127
5128             // update di information on label movement and creation
5129
5130             eventBus.on([
5131                 'commandStack.label.create.executed',
5132                 'commandStack.shape.moved.executed'
5133             ], function(e) {
5134
5135                 var element = e.context.shape,
5136                     businessObject = element.businessObject,
5137                     di = businessObject.di;
5138
5139                 // we want to trigger on real labels only
5140                 if (!element.labelTarget) {
5141                     return;
5142                 }
5143
5144                 if (!di.label) {
5145                     di.label = bpmnFactory.create('bpmndi:BPMNLabel', {
5146                         bounds: bpmnFactory.create('dc:Bounds')
5147                     });
5148                 }
5149
5150                 assign(di.label.bounds, {
5151                     x: element.x,
5152                     y: element.y,
5153                     width: element.width,
5154                     height: element.height
5155                 });
5156             });
5157         }
5158
5159         LabelSupport.$inject = ['eventBus', 'modeling', 'bpmnFactory'];
5160
5161         module.exports = LabelSupport;
5162
5163     }, {
5164         "../../util/LabelUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\util\\LabelUtil.js",
5165         "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
5166         "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js"
5167     }],
5168     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\Modeling.js": [function(require, module, exports) {
5169         'use strict';
5170
5171         var inherits = require('inherits');
5172
5173         var BaseModeling = require('diagram-js/lib/features/modeling/Modeling');
5174
5175         var UpdatePropertiesHandler = require('./cmd/UpdatePropertiesHandler'),
5176             UpdateCanvasRootHandler = require('./cmd/UpdateCanvasRootHandler');
5177
5178
5179         /**
5180          * BPMN 2.0 modeling features activator
5181          * 
5182          * @param {EventBus}
5183          *            eventBus
5184          * @param {ElementFactory}
5185          *            elementFactory
5186          * @param {CommandStack}
5187          *            commandStack
5188          * @param {BpmnRules}
5189          *            bpmnRules
5190          */
5191         function Modeling(eventBus, elementFactory, commandStack, bpmnRules) {
5192             BaseModeling.call(this, eventBus, elementFactory, commandStack);
5193
5194             this._bpmnRules = bpmnRules;
5195         }
5196
5197         inherits(Modeling, BaseModeling);
5198
5199         Modeling.$inject = ['eventBus', 'elementFactory', 'commandStack', 'bpmnRules'];
5200
5201         module.exports = Modeling;
5202
5203
5204         Modeling.prototype.getHandlers = function() {
5205             var handlers = BaseModeling.prototype.getHandlers.call(this);
5206
5207             handlers['element.updateProperties'] = UpdatePropertiesHandler;
5208             handlers['canvas.updateRoot'] = UpdateCanvasRootHandler;
5209
5210             return handlers;
5211         };
5212
5213
5214         Modeling.prototype.updateLabel = function(element, newLabel) {
5215             this._commandStack.execute('element.updateLabel', {
5216                 element: element,
5217                 newLabel: newLabel
5218             });
5219         };
5220
5221
5222         var getSharedParent = require('./ModelingUtil').getSharedParent;
5223
5224         Modeling.prototype.connect = function(source, target, attrs) {
5225
5226             var bpmnRules = this._bpmnRules;
5227
5228             if (!attrs) {
5229                 if (bpmnRules.canConnectMessageFlow(source, target)) {
5230                     attrs = {
5231                         type: 'bpmn:MessageFlow'
5232                     };
5233                 } else
5234                 if (bpmnRules.canConnectSequenceFlow(source, target)) {
5235                     attrs = {
5236                         type: 'bpmn:SequenceFlow'
5237                     };
5238                 } else {
5239                     attrs = {
5240                         type: 'bpmn:Association'
5241                     };
5242                 }
5243             }
5244
5245             return this.createConnection(source, target, attrs, getSharedParent(source, target));
5246         };
5247
5248
5249         Modeling.prototype.updateProperties = function(element, properties) {
5250             this._commandStack.execute('element.updateProperties', {
5251                 element: element,
5252                 properties: properties
5253             });
5254         };
5255
5256
5257         /**
5258          * Transform the current diagram into a collaboration.
5259          * 
5260          * @return {djs.model.Root} the new root element
5261          */
5262         Modeling.prototype.makeCollaboration = function() {
5263
5264             var collaborationElement = this._create('root', {
5265                 type: 'bpmn:Collaboration'
5266             });
5267
5268             var context = {
5269                 newRoot: collaborationElement
5270             };
5271
5272             this._commandStack.execute('canvas.updateRoot', context);
5273
5274             return collaborationElement;
5275         };
5276
5277         /**
5278          * Transform the current diagram into a process.
5279          * 
5280          * @return {djs.model.Root} the new root element
5281          */
5282         Modeling.prototype.makeProcess = function() {
5283
5284             var processElement = this._create('root', {
5285                 type: 'bpmn:Process'
5286             });
5287
5288             var context = {
5289                 newRoot: processElement
5290             };
5291
5292             this._commandStack.execute('canvas.updateRoot', context);
5293         };
5294     }, {
5295         "./ModelingUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\ModelingUtil.js",
5296         "./cmd/UpdateCanvasRootHandler": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\cmd\\UpdateCanvasRootHandler.js",
5297         "./cmd/UpdatePropertiesHandler": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\cmd\\UpdatePropertiesHandler.js",
5298         "diagram-js/lib/features/modeling/Modeling": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\Modeling.js",
5299         "inherits": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\inherits\\inherits_browser.js"
5300     }],
5301     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\ModelingUtil.js": [function(require, module, exports) {
5302         'use strict';
5303
5304         var find = require('lodash/collection/find');
5305
5306
5307         function getParents(element) {
5308
5309             var parents = [];
5310
5311             while (element) {
5312                 element = element.parent;
5313
5314                 if (element) {
5315                     parents.push(element);
5316                 }
5317             }
5318
5319             return parents;
5320         }
5321
5322         module.exports.getParents = getParents;
5323
5324
5325         function getSharedParent(a, b) {
5326
5327             var parentsA = getParents(a),
5328                 parentsB = getParents(b);
5329
5330             return find(parentsA, function(parent) {
5331                 return parentsB.indexOf(parent) !== -1;
5332             });
5333         }
5334
5335         module.exports.getSharedParent = getSharedParent;
5336     }, {
5337         "lodash/collection/find": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\find.js"
5338     }],
5339     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\behavior\\AppendBehavior.js": [function(require, module, exports) {
5340         'use strict';
5341
5342         var inherits = require('inherits');
5343
5344         var is = require('../../../util/ModelUtil').is;
5345
5346         var CommandInterceptor = require('diagram-js/lib/command/CommandInterceptor');
5347
5348
5349         function AppendBehavior(eventBus, elementFactory, bpmnRules) {
5350
5351             CommandInterceptor.call(this, eventBus);
5352
5353             // assign correct shape position unless already set
5354
5355             this.preExecute('shape.append', function(context) {
5356
5357                 var source = context.source,
5358                     shape = context.shape;
5359
5360                 if (!context.position) {
5361
5362                     if (is(shape, 'bpmn:TextAnnotation')) {
5363                         context.position = {
5364                             x: source.x + source.width / 2 + 75,
5365                             y: source.y - (50) - shape.height / 2
5366                         };
5367                     } else {
5368                         context.position = {
5369                             x: source.x + source.width + 80 + shape.width / 2,
5370                             y: source.y + source.height / 2
5371                         };
5372                     }
5373                 }
5374             }, true);
5375         }
5376
5377
5378         AppendBehavior.$inject = ['eventBus', 'elementFactory', 'bpmnRules'];
5379
5380         inherits(AppendBehavior, CommandInterceptor);
5381
5382         module.exports = AppendBehavior;
5383     }, {
5384         "../../../util/ModelUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\util\\ModelUtil.js",
5385         "diagram-js/lib/command/CommandInterceptor": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\command\\CommandInterceptor.js",
5386         "inherits": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\inherits\\inherits_browser.js"
5387     }],
5388     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\behavior\\CreateBehavior.js": [function(require, module, exports) {
5389         'use strict';
5390
5391         var inherits = require('inherits');
5392
5393         var CommandInterceptor = require('diagram-js/lib/command/CommandInterceptor');
5394
5395         var is = require('../../../util/ModelUtil').is;
5396
5397         /**
5398          * BPMN specific create behavior
5399          */
5400         function CreateBehavior(eventBus, modeling) {
5401
5402             CommandInterceptor.call(this, eventBus);
5403
5404
5405             /**
5406              * morph process into collaboration before adding participant onto
5407              * collaboration
5408              */
5409
5410             this.preExecute('shape.create', function(context) {
5411
5412                 var parent = context.parent,
5413                     shape = context.shape,
5414                     position = context.position;
5415
5416                 if (is(parent, 'bpmn:Process') && is(shape, 'bpmn:Participant')) {
5417
5418                     // this is going to detach the process root
5419                     // and set the returned collaboration element
5420                     // as the new root element
5421                     var collaborationElement = modeling.makeCollaboration();
5422
5423                     // monkey patch the create context
5424                     // so that the participant is being dropped
5425                     // onto the new collaboration root instead
5426                     context.position = position;
5427                     context.parent = collaborationElement;
5428
5429                     context.processRoot = parent;
5430                 }
5431             }, true);
5432
5433             this.execute('shape.create', function(context) {
5434
5435                 var processRoot = context.processRoot,
5436                     shape = context.shape;
5437
5438                 if (processRoot) {
5439                     context.oldProcessRef = shape.businessObject.processRef;
5440
5441                     // assign the participant processRef
5442                     shape.businessObject.processRef = processRoot.businessObject;
5443                 }
5444             }, true);
5445
5446             this.revert('shape.create', function(context) {
5447                 var processRoot = context.processRoot,
5448                     shape = context.shape;
5449
5450                 if (processRoot) {
5451                     // assign the participant processRef
5452                     shape.businessObject.processRef = context.oldProcessRef;
5453                 }
5454             }, true);
5455
5456             this.postExecute('shape.create', function(context) {
5457                                 
5458                 var processRoot = context.processRoot,
5459                     shape = context.shape;
5460
5461                 if (processRoot) {
5462                     // process root is already detached at this point
5463                     var processChildren = processRoot.children.slice();
5464                     modeling.moveShapes(processChildren, {
5465                         x: 0,
5466                         y: 0
5467                     }, shape);
5468                 }
5469                                 //console.log(context.shape.id);
5470                                 //newElementProcessor(context.shape.id);
5471                                 //console.log(context)
5472             }, true);
5473                         
5474         }
5475
5476         CreateBehavior.$inject = ['eventBus', 'modeling'];
5477
5478         inherits(CreateBehavior, CommandInterceptor);
5479
5480         module.exports = CreateBehavior;
5481     }, {
5482         "../../../util/ModelUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\util\\ModelUtil.js",
5483         "diagram-js/lib/command/CommandInterceptor": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\command\\CommandInterceptor.js",
5484         "inherits": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\inherits\\inherits_browser.js"
5485     }],
5486     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\behavior\\DropBehavior.js": [function(require, module, exports) {
5487         'use strict';
5488
5489         var forEach = require('lodash/collection/forEach'),
5490             inherits = require('inherits');
5491
5492         var CommandInterceptor = require('diagram-js/lib/command/CommandInterceptor');
5493
5494         var is = require('../../../util/ModelUtil').is,
5495             getSharedParent = require('../ModelingUtil').getSharedParent;
5496
5497
5498         function DropBehavior(eventBus, modeling, bpmnRules) {
5499
5500             CommandInterceptor.call(this, eventBus);
5501
5502             // remove sequence flows that should not be allowed
5503             // after a move operation
5504
5505             this.postExecute('shapes.move', function(context) {
5506
5507                 var closure = context.closure,
5508                     allConnections = closure.allConnections;
5509
5510                 forEach(allConnections, function(c) {
5511
5512                     var source = c.source,
5513                         target = c.target;
5514
5515                     var replacementType,
5516                         remove;
5517
5518                     /**
5519                      * Check if incoming or outgoing connections can stay or could be
5520                      * substituted with an appropriate replacement.
5521                      * 
5522                      * This holds true for SequenceFlow <> MessageFlow.
5523                      */
5524
5525                     if (is(c, 'bpmn:SequenceFlow')) {
5526                         if (!bpmnRules.canConnectSequenceFlow(source, target)) {
5527                             remove = true;
5528                         }
5529
5530                         if (bpmnRules.canConnectMessageFlow(source, target)) {
5531                             replacementType = 'bpmn:MessageFlow';
5532                         }
5533                     }
5534
5535                     // transform message flows into sequence flows, if possible
5536
5537                     if (is(c, 'bpmn:MessageFlow')) {
5538
5539                         if (!bpmnRules.canConnectMessageFlow(source, target)) {
5540                             remove = true;
5541                         }
5542
5543                         if (bpmnRules.canConnectSequenceFlow(source, target)) {
5544                             replacementType = 'bpmn:SequenceFlow';
5545                         }
5546                     }
5547
5548                     if (is(c, 'bpmn:Association') && !bpmnRules.canConnectAssociation(source, target)) {
5549                         remove = true;
5550                     }
5551
5552
5553                     // remove invalid connection
5554                     if (remove) {
5555                         modeling.removeConnection(c);
5556                     }
5557
5558                     // replace SequenceFlow <> MessageFlow
5559
5560                     if (replacementType) {
5561                         modeling.createConnection(source, target, {
5562                             type: replacementType,
5563                             waypoints: c.waypoints.slice()
5564                         }, getSharedParent(source, target));
5565                     }
5566                 });
5567             }, true);
5568         }
5569
5570         inherits(DropBehavior, CommandInterceptor);
5571
5572         DropBehavior.$inject = ['eventBus', 'modeling', 'bpmnRules'];
5573
5574         module.exports = DropBehavior;
5575     }, {
5576         "../../../util/ModelUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\util\\ModelUtil.js",
5577         "../ModelingUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\ModelingUtil.js",
5578         "diagram-js/lib/command/CommandInterceptor": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\command\\CommandInterceptor.js",
5579         "inherits": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\inherits\\inherits_browser.js",
5580         "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js"
5581     }],
5582     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\behavior\\ModelingFeedback.js": [function(require, module, exports) {
5583         'use strict';
5584
5585         var is = require('../../../util/ModelUtil').is;
5586
5587
5588         function ModelingFeedback(eventBus, tooltips) {
5589
5590             function showError(position, message) {
5591                 tooltips.add({
5592                     position: {
5593                         x: position.x + 5,
5594                         y: position.y + 5
5595                     },
5596                     type: 'error',
5597                     timeout: 2000,
5598                     html: '<div>' + message + '</div>'
5599                 });
5600             }
5601
5602             eventBus.on(['shape.move.rejected', 'create.rejected'], function(event) {
5603
5604                 var context = event.context,
5605                     shape = context.shape,
5606                     target = context.target;
5607
5608                 if (is(target, 'bpmn:Collaboration') && is(shape, 'bpmn:FlowNode')) {
5609                     showError(event, 'flow elements must be children of pools/participants');
5610                 }
5611             });
5612
5613         }
5614
5615
5616         ModelingFeedback.$inject = ['eventBus', 'tooltips'];
5617
5618         module.exports = ModelingFeedback;
5619     }, {
5620         "../../../util/ModelUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\util\\ModelUtil.js"
5621     }],
5622     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\behavior\\RemoveBehavior.js": [function(require, module, exports) {
5623         'use strict';
5624
5625         var inherits = require('inherits');
5626
5627         var CommandInterceptor = require('diagram-js/lib/command/CommandInterceptor');
5628
5629         var is = require('../../../util/ModelUtil').is;
5630
5631
5632         /**
5633          * BPMN specific remove behavior
5634          */
5635         function RemoveBehavior(eventBus, modeling) {
5636
5637             CommandInterceptor.call(this, eventBus);
5638
5639
5640             /**
5641              * morph collaboration diagram into process diagram after the last
5642              * participant has been removed
5643              */
5644
5645             this.preExecute('shape.delete', function(context) {
5646                                 //delete elementMap[context.shape.id];
5647                                 //console.log(context.shape.id);
5648                 var shape = context.shape,
5649                     parent = shape.parent;
5650
5651                 // activate the behavior if the shape to be removed
5652                 // is a participant
5653                 if (is(shape, 'bpmn:Participant')) {
5654                     context.collaborationRoot = parent;
5655                 }
5656             }, true);
5657
5658             this.postExecute('shape.delete', function(context) {
5659
5660                 var collaborationRoot = context.collaborationRoot;
5661
5662                 if (collaborationRoot && !collaborationRoot.businessObject.participants.length) {
5663                     // replace empty collaboration with process diagram
5664                     modeling.makeProcess();
5665                 }
5666             }, true);
5667
5668         }
5669
5670         RemoveBehavior.$inject = ['eventBus', 'modeling'];
5671
5672         inherits(RemoveBehavior, CommandInterceptor);
5673
5674         module.exports = RemoveBehavior;
5675     }, {
5676         "../../../util/ModelUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\util\\ModelUtil.js",
5677         "diagram-js/lib/command/CommandInterceptor": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\command\\CommandInterceptor.js",
5678         "inherits": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\inherits\\inherits_browser.js"
5679     }],
5680     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\behavior\\index.js": [function(require, module, exports) {
5681         module.exports = {
5682             __init__: [
5683                 'appendBehavior',
5684                 'createBehavior',
5685                 'dropBehavior',
5686                 'removeBehavior',
5687                 'modelingFeedback'
5688             ],
5689             appendBehavior: ['type', require('./AppendBehavior')],
5690             dropBehavior: ['type', require('./DropBehavior')],
5691             createBehavior: ['type', require('./CreateBehavior')],
5692             removeBehavior: ['type', require('./RemoveBehavior')],
5693             modelingFeedback: ['type', require('./ModelingFeedback')]
5694         };
5695     }, {
5696         "./AppendBehavior": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\behavior\\AppendBehavior.js",
5697         "./CreateBehavior": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\behavior\\CreateBehavior.js",
5698         "./DropBehavior": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\behavior\\DropBehavior.js",
5699         "./ModelingFeedback": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\behavior\\ModelingFeedback.js",
5700         "./RemoveBehavior": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\behavior\\RemoveBehavior.js"
5701     }],
5702     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\cmd\\UpdateCanvasRootHandler.js": [function(require, module, exports) {
5703         'use strict';
5704
5705         var Collections = require('diagram-js/lib/util/Collections');
5706
5707
5708         function UpdateCanvasRootHandler(canvas, modeling) {
5709             this._canvas = canvas;
5710             this._modeling = modeling;
5711         }
5712
5713         UpdateCanvasRootHandler.$inject = ['canvas', 'modeling'];
5714
5715         module.exports = UpdateCanvasRootHandler;
5716
5717
5718         UpdateCanvasRootHandler.prototype.execute = function(context) {
5719
5720             var canvas = this._canvas;
5721
5722             var newRoot = context.newRoot,
5723                 newRootBusinessObject = newRoot.businessObject,
5724                 oldRoot = canvas.getRootElement(),
5725                 oldRootBusinessObject = oldRoot.businessObject,
5726                 bpmnDefinitions = oldRootBusinessObject.$parent,
5727                 diPlane = oldRootBusinessObject.di;
5728
5729             // (1) replace process old <> new root
5730             canvas.setRootElement(newRoot, true);
5731
5732             // (2) update root elements
5733             Collections.add(bpmnDefinitions.rootElements, newRootBusinessObject);
5734             newRootBusinessObject.$parent = bpmnDefinitions;
5735
5736             Collections.remove(bpmnDefinitions.rootElements, oldRootBusinessObject);
5737             oldRootBusinessObject.$parent = null;
5738
5739             // (3) wire di
5740             oldRootBusinessObject.di = null;
5741
5742             diPlane.bpmnElement = newRootBusinessObject;
5743             newRootBusinessObject.di = diPlane;
5744
5745             context.oldRoot = oldRoot;
5746         };
5747
5748
5749         UpdateCanvasRootHandler.prototype.revert = function(context) {
5750
5751             var canvas = this._canvas;
5752
5753             var newRoot = context.newRoot,
5754                 newRootBusinessObject = newRoot.businessObject,
5755                 oldRoot = context.oldRoot,
5756                 oldRootBusinessObject = oldRoot.businessObject,
5757                 bpmnDefinitions = newRootBusinessObject.$parent,
5758                 diPlane = newRootBusinessObject.di;
5759
5760             // (1) replace process old <> new root
5761             canvas.setRootElement(oldRoot, true);
5762
5763             // (2) update root elements
5764             Collections.remove(bpmnDefinitions.rootElements, newRootBusinessObject);
5765             newRootBusinessObject.$parent = null;
5766
5767             Collections.add(bpmnDefinitions.rootElements, oldRootBusinessObject);
5768             oldRootBusinessObject.$parent = bpmnDefinitions;
5769
5770             // (3) wire di
5771             newRootBusinessObject.di = null;
5772
5773             diPlane.bpmnElement = oldRootBusinessObject;
5774             oldRootBusinessObject.di = diPlane;
5775         };
5776     }, {
5777         "diagram-js/lib/util/Collections": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Collections.js"
5778     }],
5779     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\cmd\\UpdatePropertiesHandler.js": [function(require, module, exports) {
5780         'use strict';
5781
5782         var assign = require('lodash/object/assign'),
5783             pick = require('lodash/object/pick'),
5784             keys = require('lodash/object/keys');
5785
5786         var DEFAULT_FLOW = 'default',
5787             NAME = 'name',
5788             ID = 'id';
5789
5790
5791         /**
5792          * A handler that implements a BPMN 2.0 property update.
5793          * 
5794          * This should be used to set simple properties on elements with an underlying
5795          * BPMN business object.
5796          * 
5797          * Use respective diagram-js provided handlers if you would like to perform
5798          * automated modeling.
5799          */
5800         function UpdatePropertiesHandler(elementRegistry) {
5801             this._elementRegistry = elementRegistry;
5802         }
5803
5804         UpdatePropertiesHandler.$inject = ['elementRegistry'];
5805
5806         module.exports = UpdatePropertiesHandler;
5807
5808
5809         // //// api /////////////////////////////////////////////
5810
5811         /**
5812          * Updates a BPMN element with a list of new properties
5813          * 
5814          * @param {Object}
5815          *            context
5816          * @param {djs.model.Base}
5817          *            context.element the element to update
5818          * @param {Object}
5819          *            context.properties a list of properties to set on the element's
5820          *            businessObject (the BPMN model element)
5821          * 
5822          * @return {Array<djs.mode.Base>} the updated element
5823          */
5824         UpdatePropertiesHandler.prototype.execute = function(context) {
5825
5826             var element = context.element,
5827                 changed = [element];
5828
5829             if (!element) {
5830                 throw new Error('element required');
5831             }
5832
5833             var elementRegistry = this._elementRegistry;
5834
5835             var businessObject = element.businessObject,
5836                 properties = context.properties,
5837                 oldProperties = context.oldProperties || pick(businessObject, keys(properties));
5838
5839             if (ID in properties) {
5840                 elementRegistry.updateId(element, properties[ID]);
5841             }
5842
5843             // correctly indicate visual changes on default flow updates
5844             if (DEFAULT_FLOW in properties) {
5845
5846                 if (properties[DEFAULT_FLOW]) {
5847                     changed.push(elementRegistry.get(properties[DEFAULT_FLOW].id));
5848                 }
5849
5850                 if (businessObject[DEFAULT_FLOW]) {
5851                     changed.push(elementRegistry.get(businessObject[DEFAULT_FLOW].id));
5852                 }
5853             }
5854
5855             if (NAME in properties && element.label) {
5856                 changed.push(element.label);
5857             }
5858
5859             // update properties
5860             assign(businessObject, properties);
5861
5862
5863             // store old values
5864             context.oldProperties = oldProperties;
5865             context.changed = changed;
5866
5867             // indicate changed on objects affected by the update
5868             return changed;
5869         };
5870
5871         /**
5872          * Reverts the update on a BPMN elements properties.
5873          * 
5874          * @param {Object}
5875          *            context
5876          * 
5877          * @return {djs.mode.Base} the updated element
5878          */
5879         UpdatePropertiesHandler.prototype.revert = function(context) {
5880
5881             var element = context.element,
5882                 oldProperties = context.oldProperties,
5883                 businessObject = element.businessObject,
5884                 elementRegistry = this._elementRegistry;
5885
5886             assign(businessObject, context.oldProperties);
5887
5888             if (ID in oldProperties) {
5889                 elementRegistry.updateId(element, oldProperties[ID]);
5890             }
5891
5892             return context.changed;
5893         };
5894     }, {
5895         "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js",
5896         "lodash/object/keys": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\keys.js",
5897         "lodash/object/pick": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\pick.js"
5898     }],
5899     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\index.js": [function(require, module, exports) {
5900         module.exports = {
5901             __init__: ['modeling', 'bpmnUpdater', 'labelSupport'],
5902             __depends__: [
5903                 require('../label-editing'),
5904                 require('./rules'),
5905                 require('./behavior'),
5906                 require('diagram-js/lib/command'),
5907                 require('diagram-js/lib/features/tooltips'),
5908                 require('diagram-js/lib/features/change-support')
5909             ],
5910             bpmnFactory: ['type', require('./BpmnFactory')],
5911             bpmnUpdater: ['type', require('./BpmnUpdater')],
5912             elementFactory: ['type', require('./ElementFactory')],
5913             modeling: ['type', require('./Modeling')],
5914             labelSupport: ['type', require('./LabelSupport')],
5915             layouter: ['type', require('./BpmnLayouter')],
5916             connectionDocking: ['type', require('diagram-js/lib/layout/CroppingConnectionDocking')]
5917         };
5918
5919     }, {
5920         "../label-editing": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\label-editing\\index.js",
5921         "./BpmnFactory": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\BpmnFactory.js",
5922         "./BpmnLayouter": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\BpmnLayouter.js",
5923         "./BpmnUpdater": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\BpmnUpdater.js",
5924         "./ElementFactory": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\ElementFactory.js",
5925         "./LabelSupport": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\LabelSupport.js",
5926         "./Modeling": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\Modeling.js",
5927         "./behavior": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\behavior\\index.js",
5928         "./rules": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\rules\\index.js",
5929         "diagram-js/lib/command": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\command\\index.js",
5930         "diagram-js/lib/features/change-support": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\change-support\\index.js",
5931         "diagram-js/lib/features/tooltips": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\tooltips\\index.js",
5932         "diagram-js/lib/layout/CroppingConnectionDocking": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\layout\\CroppingConnectionDocking.js"
5933     }],
5934     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\rules\\BpmnRules.js": [function(require, module, exports) {
5935         'use strict';
5936
5937         var groupBy = require('lodash/collection/groupBy'),
5938             size = require('lodash/collection/size'),
5939             find = require('lodash/collection/find'),
5940             inherits = require('inherits');
5941
5942         var getParents = require('../ModelingUtil').getParents,
5943             is = require('../../../util/ModelUtil').is,
5944             getBusinessObject = require('../../../util/ModelUtil').getBusinessObject,
5945             isExpanded = require('../../../util/DiUtil').isExpanded;
5946
5947
5948         var RuleProvider = require('diagram-js/lib/features/rules/RuleProvider');
5949
5950         /**
5951          * BPMN specific modeling rule
5952          */
5953         function BpmnRules(eventBus) {
5954             RuleProvider.call(this, eventBus);
5955         }
5956
5957         inherits(BpmnRules, RuleProvider);
5958
5959         BpmnRules.$inject = ['eventBus'];
5960
5961         module.exports = BpmnRules;
5962
5963         BpmnRules.prototype.init = function() {
5964
5965             this.addRule('connection.create', function(context) {
5966                 var source = context.source,
5967                     target = context.target;
5968
5969                 return canConnect(source, target);
5970             });
5971
5972             this.addRule('connection.reconnectStart', function(context) {
5973
5974                 var connection = context.connection,
5975                     source = context.hover || context.source,
5976                     target = connection.target;
5977
5978                 return canConnect(source, target, connection);
5979             });
5980
5981             this.addRule('connection.reconnectEnd', function(context) {
5982
5983                 var connection = context.connection,
5984                     source = connection.source,
5985                     target = context.hover || context.target;
5986
5987                 return canConnect(source, target, connection);
5988             });
5989
5990             this.addRule('connection.updateWaypoints', function(context) {
5991                 // OK! but visually ignore
5992                 return null;
5993             });
5994
5995             this.addRule('shape.resize', function(context) {
5996
5997                 var shape = context.shape,
5998                     newBounds = context.newBounds;
5999
6000                 return canResize(shape, newBounds);
6001             });
6002
6003             this.addRule('shapes.move', function(context) {
6004
6005                 var target = context.newParent,
6006                     shapes = context.shapes;
6007
6008                 return canMove(shapes, target);
6009             });
6010
6011             this.addRule(['shape.create', 'shape.append'], function(context) {
6012                 var target = context.parent,
6013                     shape = context.shape,
6014                     source = context.source;
6015
6016                 return canCreate(shape, target, source);
6017             });
6018
6019         };
6020
6021         BpmnRules.prototype.canConnectMessageFlow = canConnectMessageFlow;
6022
6023         BpmnRules.prototype.canConnectSequenceFlow = canConnectSequenceFlow;
6024
6025         BpmnRules.prototype.canConnectAssociation = canConnectAssociation;
6026
6027         BpmnRules.prototype.canMove = canMove;
6028
6029         BpmnRules.prototype.canDrop = canDrop;
6030
6031         BpmnRules.prototype.canCreate = canCreate;
6032
6033         BpmnRules.prototype.canConnect = canConnect;
6034
6035         BpmnRules.prototype.canResize = canResize;
6036
6037         /**
6038          * Utility functions for rule checking
6039          */
6040
6041         function nonExistantOrLabel(element) {
6042             return !element || isLabel(element);
6043         }
6044
6045         function isSame(a, b) {
6046             return a === b;
6047         }
6048
6049         function getOrganizationalParent(element) {
6050
6051             var bo = getBusinessObject(element);
6052
6053             while (bo && !is(bo, 'bpmn:Process')) {
6054                 if (is(bo, 'bpmn:Participant')) {
6055                     return bo.processRef || bo;
6056                 }
6057
6058                 bo = bo.$parent;
6059             }
6060
6061             return bo;
6062         }
6063
6064         function isSameOrganization(a, b) {
6065             var parentA = getOrganizationalParent(a),
6066                 parentB = getOrganizationalParent(b);
6067
6068             return parentA === parentB;
6069         }
6070
6071         function isMessageFlowSource(element) {
6072             return is(element, 'bpmn:InteractionNode') && (!is(element, 'bpmn:Event') || (
6073                 is(element, 'bpmn:ThrowEvent') &&
6074                 hasEventDefinitionOrNone(element, 'bpmn:MessageEventDefinition')
6075             ));
6076         }
6077
6078         function isMessageFlowTarget(element) {
6079             return is(element, 'bpmn:InteractionNode') && (!is(element, 'bpmn:Event') || (
6080                 is(element, 'bpmn:CatchEvent') &&
6081                 hasEventDefinitionOrNone(element, 'bpmn:MessageEventDefinition')
6082             ));
6083         }
6084
6085         function getScopeParent(element) {
6086
6087             var bo = getBusinessObject(element);
6088
6089             if (is(bo, 'bpmn:Participant')) {
6090                 return null;
6091             }
6092
6093             while (bo) {
6094                 bo = bo.$parent;
6095
6096                 if (is(bo, 'bpmn:FlowElementsContainer')) {
6097                     return bo;
6098                 }
6099             }
6100
6101             return bo;
6102         }
6103
6104         function isSameScope(a, b) {
6105             var scopeParentA = getScopeParent(a),
6106                 scopeParentB = getScopeParent(b);
6107
6108             return scopeParentA && (scopeParentA === scopeParentB);
6109         }
6110
6111         function hasEventDefinition(element, eventDefinition) {
6112             var bo = getBusinessObject(element);
6113
6114             return !!find(bo.eventDefinitions || [], function(definition) {
6115                 return is(definition, eventDefinition);
6116             });
6117         }
6118
6119         function hasEventDefinitionOrNone(element, eventDefinition) {
6120             var bo = getBusinessObject(element);
6121
6122             return (bo.eventDefinitions || []).every(function(definition) {
6123                 return is(definition, eventDefinition);
6124             });
6125         }
6126
6127         function isSequenceFlowSource(element) {
6128             return is(element, 'bpmn:FlowNode') && !is(element, 'bpmn:EndEvent') && !(
6129                 is(element, 'bpmn:IntermediateThrowEvent') &&
6130                 hasEventDefinition(element, 'bpmn:LinkEventDefinition')
6131             );
6132         }
6133
6134         function isSequenceFlowTarget(element) {
6135             return is(element, 'bpmn:FlowNode') && !is(element, 'bpmn:StartEvent') && !(
6136                 is(element, 'bpmn:IntermediateCatchEvent') &&
6137                 hasEventDefinition(element, 'bpmn:LinkEventDefinition')
6138             );
6139         }
6140
6141         function isEventBasedTarget(element) {
6142             return is(element, 'bpmn:ReceiveTask') || (
6143                 is(element, 'bpmn:IntermediateCatchEvent') && (
6144                     hasEventDefinition(element, 'bpmn:MessageEventDefinition') ||
6145                     hasEventDefinition(element, 'bpmn:TimerEventDefinition') ||
6146                     hasEventDefinition(element, 'bpmn:ConditionalEventDefinition') ||
6147                     hasEventDefinition(element, 'bpmn:SignalEventDefinition')
6148                 )
6149             );
6150         }
6151
6152         function isLabel(element) {
6153             return element.labelTarget;
6154         }
6155
6156         function isConnection(element) {
6157             return element.waypoints;
6158         }
6159
6160         function isParent(possibleParent, element) {
6161             var allParents = getParents(element);
6162             return allParents.indexOf(possibleParent) !== -1;
6163         }
6164
6165         function canConnect(source, target, connection) {
6166
6167             if (nonExistantOrLabel(source) || nonExistantOrLabel(target)) {
6168                 return null;
6169             }
6170
6171             // See https://github.com/bpmn-io/bpmn-js/issues/178
6172             // as a workround we disallow connections with same
6173             // target and source element.
6174             // This rule must be removed if a auto layout for this
6175             // connections is implemented.
6176             if (isSame(source, target)) {
6177                 return false;
6178             }
6179
6180             if (canConnectMessageFlow(source, target) ||
6181                 canConnectSequenceFlow(source, target)) {
6182
6183                 return true;
6184             }
6185
6186             if (is(connection, 'bpmn:Association')) {
6187                 return canConnectAssociation(source, target);
6188             }
6189
6190             return false;
6191         }
6192
6193         /**
6194          * Can an element be dropped into the target element
6195          * 
6196          * @return {Boolean}
6197          */
6198         function canDrop(element, target) {
6199
6200             // can move labels everywhere
6201             if (isLabel(element) && !isConnection(target)) {
6202                 return true;
6203             }
6204
6205             // allow to create new participants on
6206             // on existing collaboration and process diagrams
6207             if (is(element, 'bpmn:Participant')) {
6208                 return is(target, 'bpmn:Process') || is(target, 'bpmn:Collaboration');
6209             }
6210
6211             // drop flow elements onto flow element containers
6212             // and participants
6213             if (is(element, 'bpmn:FlowElement')) {
6214                 if (is(target, 'bpmn:FlowElementsContainer')) {
6215                     return isExpanded(target) !== false;
6216                 }
6217
6218                 return is(target, 'bpmn:Participant');
6219             }
6220
6221             if (is(element, 'bpmn:Artifact')) {
6222                 return is(target, 'bpmn:Collaboration') ||
6223                     is(target, 'bpmn:Participant') ||
6224                     is(target, 'bpmn:Process');
6225             }
6226
6227             if (is(element, 'bpmn:MessageFlow')) {
6228                 return is(target, 'bpmn:Collaboration');
6229             }
6230
6231             return false;
6232         }
6233
6234         function canMove(elements, target) {
6235
6236             // only move if they have the same parent
6237             var sameParent = size(groupBy(elements, function(s) {
6238                 return s.parent && s.parent.id;
6239             })) === 1;
6240
6241             if (!sameParent) {
6242                 return false;
6243             }
6244
6245             if (!target) {
6246                 return true;
6247             }
6248
6249             return elements.every(function(element) {
6250                 return canDrop(element, target);
6251             });
6252         }
6253
6254         function canCreate(shape, target, source) {
6255
6256             if (!target) {
6257                 return false;
6258             }
6259
6260             if (isLabel(target)) {
6261                 return null;
6262             }
6263
6264             if (isSame(source, target)) {
6265                 return false;
6266             }
6267
6268             // ensure we do not drop the element
6269             // into source
6270             if (source && isParent(source, target)) {
6271                 return false;
6272             }
6273
6274             return canDrop(shape, target);
6275         }
6276
6277         function canResize(shape, newBounds) {
6278             if (is(shape, 'bpmn:SubProcess')) {
6279                 return isExpanded(shape) && (!newBounds || (newBounds.width >= 100 && newBounds.height >= 80));
6280             }
6281
6282             if (is(shape, 'bpmn:Participant')) {
6283                 return !newBounds || (newBounds.width >= 100 && newBounds.height >= 80);
6284             }
6285
6286             if (is(shape, 'bpmn:TextAnnotation')) {
6287                 return true;
6288             }
6289             if (is(shape, 'bpmn:MultiBranchConnector')) {
6290                 return false;
6291             }
6292
6293             return true;
6294         }
6295
6296         function canConnectAssociation(source, target) {
6297
6298             // do not connect connections
6299             if (isConnection(source) || isConnection(target)) {
6300                 return false;
6301             }
6302
6303             // connect if different parent
6304             return !isParent(target, source) &&
6305                 !isParent(source, target);
6306         }
6307
6308         function canConnectMessageFlow(source, target) {
6309
6310             return isMessageFlowSource(source) &&
6311                 isMessageFlowTarget(target) &&
6312                 !isSameOrganization(source, target);
6313         }
6314
6315         function canConnectSequenceFlow(source, target) {
6316
6317             return isSequenceFlowSource(source) &&
6318                 isSequenceFlowTarget(target) &&
6319                 isSameScope(source, target) &&
6320                 !(is(source, 'bpmn:EventBasedGateway') && !isEventBasedTarget(target));
6321         }
6322     }, {
6323         "../../../util/DiUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\util\\DiUtil.js",
6324         "../../../util/ModelUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\util\\ModelUtil.js",
6325         "../ModelingUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\ModelingUtil.js",
6326         "diagram-js/lib/features/rules/RuleProvider": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\rules\\RuleProvider.js",
6327         "inherits": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\inherits\\inherits_browser.js",
6328         "lodash/collection/find": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\find.js",
6329         "lodash/collection/groupBy": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\groupBy.js",
6330         "lodash/collection/size": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\size.js"
6331     }],
6332     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\rules\\index.js": [function(require, module, exports) {
6333         module.exports = {
6334             __depends__: [
6335                 require('diagram-js/lib/features/rules')
6336             ],
6337             __init__: ['bpmnRules'],
6338             bpmnRules: ['type', require('./BpmnRules')]
6339         };
6340
6341     }, {
6342         "./BpmnRules": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\rules\\BpmnRules.js",
6343         "diagram-js/lib/features/rules": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\rules\\index.js"
6344     }],
6345     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\palette\\PaletteProvider.js": [function(require, module, exports) {
6346         'use strict';
6347
6348         var assign = require('lodash/object/assign');
6349
6350         /**
6351          * A palette provider for BPMN 2.0 elements.
6352          */
6353         function PaletteProvider(palette, create, elementFactory, spaceTool, lassoTool) {
6354
6355             this._create = create;
6356             this._elementFactory = elementFactory;
6357             this._spaceTool = spaceTool;
6358             this._lassoTool = lassoTool;
6359
6360             palette.registerProvider(this);
6361         }
6362
6363         module.exports = PaletteProvider;
6364
6365         PaletteProvider.$inject = ['palette', 'create', 'elementFactory', 'spaceTool', 'lassoTool'];
6366
6367
6368         PaletteProvider.prototype.getPaletteEntries = function(element) {
6369
6370             var actions = {},
6371                 create = this._create,
6372                 elementFactory = this._elementFactory,
6373                 spaceTool = this._spaceTool,
6374                 lassoTool = this._lassoTool;
6375
6376
6377             function createAction(type, group, className, title, options) {
6378                 function createListener(event) {
6379                     var shape = elementFactory.createShape(assign({
6380                         type: type
6381                     }, options));
6382
6383                     if (options) {
6384                         shape.businessObject.di.isExpanded = options.isExpanded;
6385                     }
6386
6387                     create.start(event, shape);
6388                 }
6389
6390                 var shortType = type.replace(/^bpmn\:/, '');
6391
6392                 return {
6393                     group: group,
6394                     className: className,
6395                     title: title || 'Create ' + shortType,
6396                     action: {
6397                         dragstart: createListener,
6398                         click: createListener
6399                     }
6400                 };
6401             }
6402
6403             function createParticipant(event, collapsed) {
6404                 create.start(event, elementFactory.createParticipantShape(collapsed));
6405             }
6406
6407             assign(actions, {
6408                 'create.start-event': createAction(
6409                     'bpmn:StartEvent', 'event', 'icon-start-event-none', "Start"
6410                 ),
6411                 'create.collector': createAction(
6412                         'bpmn:Collector', 'event', 'icon-collector-node', 'Collector'
6413                     ),
6414                                         'create.String-Match': createAction(
6415                         'bpmn:StringMatch', 'event', 'icon-stringmatch-node', 'String Match'
6416                     ),
6417                     'create.TCA': createAction(
6418                         'bpmn:TCA', 'event', 'icon-tca-node', 'TCA'
6419                     ),
6420                                         'create.Aand-AI': createAction(
6421                         'bpmn:Policy', 'event', 'icon-policy-node', 'Policy'
6422                     ),
6423                 'create.end-event': createAction(
6424                     'bpmn:EndEvent', 'event', 'icon-end-event-none', "End"
6425                 )
6426             });
6427
6428             return actions;
6429         };
6430
6431     }, {
6432         "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js"
6433     }],
6434     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\palette\\index.js": [function(require, module, exports) {
6435         module.exports = {
6436             __depends__: [
6437                 require('diagram-js/lib/features/palette'),
6438                 require('diagram-js/lib/features/create')
6439             ],
6440             __init__: ['paletteProvider'],
6441             paletteProvider: ['type', require('./PaletteProvider')]
6442         };
6443
6444     }, {
6445         "./PaletteProvider": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\palette\\PaletteProvider.js",
6446         "diagram-js/lib/features/create": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\create\\index.js",
6447         "diagram-js/lib/features/palette": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\palette\\index.js"
6448     }],
6449     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\replace\\BpmnReplace.js": [function(require, module, exports) {
6450         'use strict';
6451
6452         var forEach = require('lodash/collection/forEach'),
6453             filter = require('lodash/collection/filter');
6454
6455         var REPLACE_OPTIONS = require('./ReplaceOptions');
6456
6457         var startEventReplace = REPLACE_OPTIONS.START_EVENT,
6458             intermediateEventReplace = REPLACE_OPTIONS.INTERMEDIATE_EVENT,
6459             endEventReplace = REPLACE_OPTIONS.END_EVENT,
6460             gatewayReplace = REPLACE_OPTIONS.GATEWAY,
6461             taskReplace = REPLACE_OPTIONS.TASK;
6462
6463
6464         /**
6465          * A replace menu provider that gives users the controls to choose and replace
6466          * BPMN elements with each other.
6467          * 
6468          * @param {BpmnFactory}
6469          *            bpmnFactory
6470          * @param {Moddle}
6471          *            moddle
6472          * @param {PopupMenu}
6473          *            popupMenu
6474          * @param {Replace}
6475          *            replace
6476          */
6477         function BpmnReplace(bpmnFactory, moddle, popupMenu, replace, selection) {
6478
6479             /**
6480              * Prepares a new business object for the replacement element and triggers
6481              * the replace operation.
6482              * 
6483              * @param {djs.model.Base}
6484              *            element
6485              * @param {Object}
6486              *            target
6487              * @return {djs.model.Base} the newly created element
6488              */
6489             function replaceElement(element, target) {
6490
6491                 var type = target.type,
6492                     oldBusinessObject = element.businessObject,
6493                     businessObject = bpmnFactory.create(type);
6494
6495                 var newElement = {
6496                     type: type,
6497                     businessObject: businessObject
6498                 };
6499
6500                 // initialize custom BPMN extensions
6501
6502                 if (target.eventDefinition) {
6503                     var eventDefinitions = businessObject.get('eventDefinitions'),
6504                         eventDefinition = moddle.create(target.eventDefinition);
6505
6506                     eventDefinitions.push(eventDefinition);
6507                 }
6508
6509                 if (target.instantiate !== undefined) {
6510                     businessObject.instantiate = target.instantiate;
6511                 }
6512
6513                 if (target.eventGatewayType !== undefined) {
6514                     businessObject.eventGatewayType = target.eventGatewayType;
6515                 }
6516
6517                 // copy size (for activities only)
6518                 if (oldBusinessObject.$instanceOf('bpmn:Activity')) {
6519
6520                     // TODO: need also to respect min/max Size
6521
6522                     newElement.width = element.width;
6523                     newElement.height = element.height;
6524                 }
6525
6526                 // TODO: copy other elligable properties from old business object
6527                 businessObject.name = oldBusinessObject.name;
6528
6529                 newElement = replace.replaceElement(element, newElement);
6530
6531                 selection.select(newElement);
6532
6533                 return newElement;
6534             }
6535
6536
6537             function getReplaceOptions(element) {
6538
6539                 var menuEntries = [];
6540                 var businessObject = element.businessObject;
6541
6542                 if (businessObject.$instanceOf('bpmn:StartEvent')) {
6543                     addEntries(startEventReplace, filterEvents);
6544                 } else
6545
6546                 if (businessObject.$instanceOf('bpmn:IntermediateCatchEvent') ||
6547                     businessObject.$instanceOf('bpmn:IntermediateThrowEvent')) {
6548
6549                     addEntries(intermediateEventReplace, filterEvents);
6550                 } else
6551
6552                 if (businessObject.$instanceOf('bpmn:EndEvent')) {
6553
6554                     addEntries(endEventReplace, filterEvents);
6555                 } else
6556
6557                 if (businessObject.$instanceOf('bpmn:Gateway')) {
6558
6559                     addEntries(gatewayReplace, function(entry) {
6560
6561                         return entry.target.type !== businessObject.$type;
6562                     });
6563                 } else
6564
6565                 if (businessObject.$instanceOf('bpmn:FlowNode')) {
6566                     addEntries(taskReplace, function(entry) {
6567                         return entry.target.type !== businessObject.$type;
6568                     });
6569                 }
6570
6571                 function filterEvents(entry) {
6572
6573                     var target = entry.target;
6574
6575                     var eventDefinition = businessObject.eventDefinitions && businessObject.eventDefinitions[0].$type;
6576                     var isEventDefinitionEqual = target.eventDefinition == eventDefinition;
6577                     var isEventTypeEqual = businessObject.$type == target.type;
6578
6579                     return ((!isEventDefinitionEqual && isEventTypeEqual) ||
6580                             !isEventTypeEqual) ||
6581                         !(isEventDefinitionEqual && isEventTypeEqual);
6582                 }
6583
6584                 function addEntries(entries, filterFun) {
6585                     // Filter selected type from the array
6586                     var filteredEntries = filter(entries, filterFun);
6587
6588                     // Add entries to replace menu
6589                     forEach(filteredEntries, function(definition) {
6590
6591                         var entry = addMenuEntry(definition);
6592                         menuEntries.push(entry);
6593                     });
6594                 }
6595
6596                 function addMenuEntry(definition) {
6597
6598                     return {
6599                         label: definition.label,
6600                         className: definition.className,
6601                         action: {
6602                             name: definition.actionName,
6603                             handler: function() {
6604                                 replaceElement(element, definition.target);
6605                             }
6606                         }
6607                     };
6608                 }
6609
6610                 return menuEntries;
6611             }
6612
6613
6614             // API
6615
6616             this.openChooser = function(position, element) {
6617                 var entries = this.getReplaceOptions(element);
6618
6619                 popupMenu.open('replace-menu', position, entries);
6620             };
6621
6622             this.getReplaceOptions = getReplaceOptions;
6623
6624             this.replaceElement = replaceElement;
6625         }
6626
6627         BpmnReplace.$inject = ['bpmnFactory', 'moddle', 'popupMenu', 'replace', 'selection'];
6628
6629         module.exports = BpmnReplace;
6630     }, {
6631         "./ReplaceOptions": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\replace\\ReplaceOptions.js",
6632         "lodash/collection/filter": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\filter.js",
6633         "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js"
6634     }],
6635     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\replace\\ReplaceOptions.js": [function(require, module, exports) {
6636         'use strict';
6637
6638         module.exports.START_EVENT = [{
6639             label: 'Start Event',
6640             actionName: 'replace-with-none-start',
6641             className: 'icon-start-event-none',
6642             target: {
6643                 type: 'bpmn:StartEvent'
6644             }
6645         }, {
6646             label: 'Intermediate Throw Event',
6647             actionName: 'replace-with-intermediate-throwing',
6648             className: 'icon-intermediate-event-none',
6649             target: {
6650                 type: 'bpmn:IntermediateThrowEvent'
6651             }
6652         }, {
6653             label: 'End Event',
6654             actionName: 'replace-with-message-end',
6655             className: 'icon-end-event-none',
6656             target: {
6657                 type: 'bpmn:EndEvent'
6658             }
6659         }, {
6660             label: 'Message Start Event',
6661             actionName: 'replace-with-message-start',
6662             className: 'icon-start-event-message',
6663             target: {
6664                 type: 'bpmn:StartEvent',
6665                 eventDefinition: 'bpmn:MessageEventDefinition'
6666             }
6667         }, {
6668             label: 'Timer Start Event',
6669             actionName: 'replace-with-timer-start',
6670             className: 'icon-start-event-timer',
6671             target: {
6672                 type: 'bpmn:StartEvent',
6673                 eventDefinition: 'bpmn:TimerEventDefinition'
6674             }
6675         }, {
6676             label: 'Conditional Start Event',
6677             actionName: 'replace-with-conditional-start',
6678             className: 'icon-start-event-condition',
6679             target: {
6680                 type: 'bpmn:StartEvent',
6681                 eventDefinition: 'bpmn:ConditionalEventDefinition'
6682             }
6683         }, {
6684             label: 'Signal Start Event',
6685             actionName: 'replace-with-signal-start',
6686             className: 'icon-start-event-signal',
6687             target: {
6688                 type: 'bpmn:StartEvent',
6689                 eventDefinition: 'bpmn:SignalEventDefinition'
6690             }
6691         }];
6692
6693         module.exports.INTERMEDIATE_EVENT = [{
6694             label: 'Start Event',
6695             actionName: 'replace-with-none-start',
6696             className: 'icon-start-event-none',
6697             target: {
6698                 type: 'bpmn:StartEvent'
6699             }
6700         }, {
6701             label: 'Intermediate Throw Event',
6702             actionName: 'replace-with-message-intermediate-throw',
6703             className: 'icon-intermediate-event-none',
6704             target: {
6705                 type: 'bpmn:IntermediateThrowEvent'
6706             }
6707         }, {
6708             label: 'End Event',
6709             actionName: 'replace-with-message-end',
6710             className: 'icon-end-event-none',
6711             target: {
6712                 type: 'bpmn:EndEvent'
6713             }
6714         }, {
6715             label: 'Message Intermediate Catch Event',
6716             actionName: 'replace-with-intermediate-catch',
6717             className: 'icon-intermediate-event-catch-message',
6718             target: {
6719                 type: 'bpmn:IntermediateCatchEvent',
6720                 eventDefinition: 'bpmn:MessageEventDefinition'
6721             }
6722         }, {
6723             label: 'Message Intermediate Throw Event',
6724             actionName: 'replace-with-intermediate-throw',
6725             className: 'icon-intermediate-event-throw-message',
6726             target: {
6727                 type: 'bpmn:IntermediateThrowEvent',
6728                 eventDefinition: 'bpmn:MessageEventDefinition'
6729             }
6730         }, {
6731             label: 'Timer Intermediate Catch Event',
6732             actionName: 'replace-with-timer-intermediate-catch',
6733             className: 'icon-intermediate-event-catch-timer',
6734             target: {
6735                 type: 'bpmn:IntermediateCatchEvent',
6736                 eventDefinition: 'bpmn:TimerEventDefinition'
6737             }
6738         }, {
6739             label: 'Escalation Intermediate Catch Event',
6740             actionName: 'replace-with-escalation-catch',
6741             className: 'icon-intermediate-event-catch-escalation',
6742             target: {
6743                 type: 'bpmn:IntermediateCatchEvent',
6744                 eventDefinition: 'bpmn:EscalationEventDefinition'
6745             }
6746         }, {
6747             label: 'Conditional Intermediate Catch Event',
6748             actionName: 'replace-with-conditional-intermediate-catch',
6749             className: 'icon-intermediate-event-catch-condition',
6750             target: {
6751                 type: 'bpmn:IntermediateCatchEvent',
6752                 eventDefinition: 'bpmn:ConditionalEventDefinition'
6753             }
6754         }, {
6755             label: 'Link Intermediate Catch Event',
6756             actionName: 'replace-with-link-intermediate-catch',
6757             className: 'icon-intermediate-event-catch-link',
6758             target: {
6759                 type: 'bpmn:IntermediateCatchEvent',
6760                 eventDefinition: 'bpmn:LinkEventDefinition'
6761             }
6762         }, {
6763             label: 'Link Intermediate Throw Event',
6764             actionName: 'replace-with-link-intermediate-throw',
6765             className: 'icon-intermediate-event-throw-link',
6766             target: {
6767                 type: 'bpmn:IntermediateThrowEvent',
6768                 eventDefinition: 'bpmn:LinkEventDefinition'
6769             }
6770         }, {
6771             label: 'Compensation Intermediate Throw Event',
6772             actionName: 'replace-with-compensation-intermediate-throw',
6773             className: 'icon-intermediate-event-throw-compensation',
6774             target: {
6775                 type: 'bpmn:IntermediateThrowEvent',
6776                 eventDefinition: 'bpmn:CompensateEventDefinition'
6777             }
6778         }, {
6779             label: 'Signal Throw Catch Event',
6780             actionName: 'replace-with-throw-intermediate-catch',
6781             className: 'icon-intermediate-event-catch-signal',
6782             target: {
6783                 type: 'bpmn:IntermediateCatchEvent',
6784                 eventDefinition: 'bpmn:SignalEventDefinition'
6785             }
6786         }, {
6787             label: 'Signal Intermediate Throw Event',
6788             actionName: 'replace-with-signal-intermediate-throw',
6789             className: 'icon-intermediate-event-throw-signal',
6790             target: {
6791                 type: 'bpmn:IntermediateThrowEvent',
6792                 eventDefinition: 'bpmn:SignalEventDefinition'
6793             }
6794         }];
6795
6796         module.exports.END_EVENT = [{
6797             label: 'Start Event',
6798             actionName: 'replace-with-none-start',
6799             className: 'icon-start-event-none',
6800             target: {
6801                 type: 'bpmn:StartEvent'
6802             }
6803         }, {
6804             label: 'Intermediate Throw Event',
6805             actionName: 'replace-with-message-intermediate-throw',
6806             className: 'icon-intermediate-event-none',
6807             target: {
6808                 type: 'bpmn:IntermediateThrowEvent'
6809             }
6810         }, {
6811             label: 'End Event',
6812             actionName: 'replace-with-none-end',
6813             className: 'icon-end-event-none',
6814             target: {
6815                 type: 'bpmn:EndEvent'
6816             }
6817         }, {
6818             label: 'Message End Event',
6819             actionName: 'replace-with-message-end',
6820             className: 'icon-end-event-message',
6821             target: {
6822                 type: 'bpmn:EndEvent',
6823                 eventDefinition: 'bpmn:MessageEventDefinition'
6824             }
6825         }, {
6826             label: 'Escalation End Event',
6827             actionName: 'replace-with-escalation-end',
6828             className: 'icon-end-event-escalation',
6829             target: {
6830                 type: 'bpmn:EndEvent',
6831                 eventDefinition: 'bpmn:EscalationEventDefinition'
6832             }
6833         }, {
6834             label: 'Error End Event',
6835             actionName: 'replace-with-error-end',
6836             className: 'icon-end-event-error',
6837             target: {
6838                 type: 'bpmn:EndEvent',
6839                 eventDefinition: 'bpmn:ErrorEventDefinition'
6840             }
6841         }, {
6842             label: 'Cancel End Event',
6843             actionName: 'replace-with-cancel-end',
6844             className: 'icon-end-event-cancel',
6845             target: {
6846                 type: 'bpmn:EndEvent',
6847                 eventDefinition: 'bpmn:CancelEventDefinition'
6848             }
6849         }, {
6850             label: 'Compensation End Event',
6851             actionName: 'replace-with-compensation-end',
6852             className: 'icon-end-event-compensation',
6853             target: {
6854                 type: 'bpmn:EndEvent',
6855                 eventDefinition: 'bpmn:CompensateEventDefinition'
6856             }
6857         }, {
6858             label: 'Signal End Event',
6859             actionName: 'replace-with-signal-end',
6860             className: 'icon-end-event-signal',
6861             target: {
6862                 type: 'bpmn:EndEvent',
6863                 eventDefinition: 'bpmn:SignalEventDefinition'
6864             }
6865         }, {
6866             label: 'Terminate End Event',
6867             actionName: 'replace-with-terminate-end',
6868             className: 'icon-end-event-terminate',
6869             target: {
6870                 type: 'bpmn:EndEvent',
6871                 eventDefinition: 'bpmn:TerminateEventDefinition'
6872             }
6873         }];
6874
6875         module.exports.GATEWAY = [{
6876                 label: 'Exclusive Gateway',
6877                 actionName: 'replace-with-exclusive-gateway',
6878                 className: 'icon-gateway-xor',
6879                 target: {
6880                     type: 'bpmn:ExclusiveGateway'
6881                 }
6882             }, {
6883                 label: 'Parallel Gateway',
6884                 actionName: 'replace-with-parallel-gateway',
6885                 className: 'icon-gateway-parallel',
6886                 target: {
6887                     type: 'bpmn:ParallelGateway'
6888                 }
6889             }, {
6890                 label: 'Inclusive Gateway',
6891                 actionName: 'replace-with-inclusive-gateway',
6892                 className: 'icon-gateway-or',
6893                 target: {
6894                     type: 'bpmn:InclusiveGateway'
6895                 }
6896             }, {
6897                 label: 'Complex Gateway',
6898                 actionName: 'replace-with-complex-gateway',
6899                 className: 'icon-gateway-complex',
6900                 target: {
6901                     type: 'bpmn:ComplexGateway'
6902                 }
6903             }, {
6904                 label: 'Event based Gateway',
6905                 actionName: 'replace-with-event-based-gateway',
6906                 className: 'icon-gateway-eventbased',
6907                 target: {
6908                     type: 'bpmn:EventBasedGateway',
6909                     instantiate: false,
6910                     eventGatewayType: 'Exclusive'
6911                 }
6912             }
6913             // Gateways deactivated until https://github.com/bpmn-io/bpmn-js/issues/194
6914             // {
6915             // label: 'Event based instantiating Gateway',
6916             // actionName: 'replace-with-exclusive-event-based-gateway',
6917             // className: 'icon-exclusive-event-based',
6918             // target: {
6919             // type: 'bpmn:EventBasedGateway'
6920             // },
6921             // options: {
6922             // businessObject: { instantiate: true, eventGatewayType: 'Exclusive' }
6923             // }
6924             // },
6925             // {
6926             // label: 'Parallel Event based instantiating Gateway',
6927             // actionName: 'replace-with-parallel-event-based-instantiate-gateway',
6928             // className: 'icon-parallel-event-based-instantiate-gateway',
6929             // target: {
6930             // type: 'bpmn:EventBasedGateway'
6931             // },
6932             // options: {
6933             // businessObject: { instantiate: true, eventGatewayType: 'Parallel' }
6934             // }
6935             // }
6936         ];
6937
6938
6939         module.exports.TASK = [{
6940             label: 'Task',
6941             actionName: 'replace-with-task',
6942             className: 'icon-task',
6943             target: {
6944                 type: 'bpmn:Task'
6945             }
6946         }, {
6947             label: 'Send Task',
6948             actionName: 'replace-with-send-task',
6949             className: 'icon-send',
6950             target: {
6951                 type: 'bpmn:SendTask'
6952             }
6953         }, {
6954             label: 'Receive Task',
6955             actionName: 'replace-with-receive-task',
6956             className: 'icon-receive',
6957             target: {
6958                 type: 'bpmn:ReceiveTask'
6959             }
6960         }, {
6961             label: 'User Task',
6962             actionName: 'replace-with-user-task',
6963             className: 'icon-user',
6964             target: {
6965                 type: 'bpmn:UserTask'
6966             }
6967         }, {
6968             label: 'Manual Task',
6969             actionName: 'replace-with-manual-task',
6970             className: 'icon-manual',
6971             target: {
6972                 type: 'bpmn:ManualTask'
6973             }
6974         }, {
6975             label: 'Business Rule Task',
6976             actionName: 'replace-with-rule-task',
6977             className: 'icon-business-rule',
6978             target: {
6979                 type: 'bpmn:BusinessRuleTask'
6980             }
6981         }, {
6982             label: 'Service Task',
6983             actionName: 'replace-with-service-task',
6984             className: 'icon-service',
6985             target: {
6986                 type: 'bpmn:ServiceTask'
6987             }
6988         }, {
6989             label: 'Script Task',
6990             actionName: 'replace-with-script-task',
6991             className: 'icon-script',
6992             target: {
6993                 type: 'bpmn:ScriptTask'
6994             }
6995         }];
6996     }, {}],
6997     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\replace\\index.js": [function(require, module, exports) {
6998         module.exports = {
6999             __depends__: [
7000                 require('diagram-js/lib/features/popup-menu'),
7001                 require('diagram-js/lib/features/replace'),
7002                 require('diagram-js/lib/features/selection')
7003             ],
7004             bpmnReplace: ['type', require('./BpmnReplace')]
7005         };
7006     }, {
7007         "./BpmnReplace": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\replace\\BpmnReplace.js",
7008         "diagram-js/lib/features/popup-menu": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\popup-menu\\index.js",
7009         "diagram-js/lib/features/replace": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\replace\\index.js",
7010         "diagram-js/lib/features/selection": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\selection\\index.js"
7011     }],
7012     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\snapping\\BpmnSnapping.js": [function(require, module, exports) {
7013         'use strict';
7014
7015         var inherits = require('inherits');
7016
7017         var forEach = require('lodash/collection/forEach');
7018
7019         var getBoundingBox = require('diagram-js/lib/util/Elements').getBBox;
7020         var is = require('../modeling/ModelingUtil').is;
7021
7022         var Snapping = require('diagram-js/lib/features/snapping/Snapping'),
7023             SnapUtil = require('diagram-js/lib/features/snapping/SnapUtil');
7024
7025         var is = require('../../util/ModelUtil').is;
7026
7027         var mid = SnapUtil.mid,
7028             topLeft = SnapUtil.topLeft,
7029             bottomRight = SnapUtil.bottomRight;
7030
7031         var round = Math.round;
7032
7033
7034         /**
7035          * BPMN specific snapping functionality
7036          *  * snap on process elements if a pool is created inside a process diagram
7037          * 
7038          * @param {EventBus}
7039          *            eventBus
7040          * @param {Canvas}
7041          *            canvas
7042          */
7043         function BpmnSnapping(eventBus, canvas) {
7044
7045             // instantiate super
7046             Snapping.call(this, eventBus, canvas);
7047
7048
7049             /**
7050              * Drop participant on process <> process elements snapping
7051              */
7052
7053             function initParticipantSnapping(context, shape, elements) {
7054
7055                 if (!elements.length) {
7056                     return;
7057                 }
7058
7059                 var snapBox = getBoundingBox(elements.filter(function(e) {
7060                     return !e.labelTarget && !e.waypoints;
7061                 }));
7062
7063                 snapBox.x -= 50;
7064                 snapBox.y -= 20;
7065                 snapBox.width += 70;
7066                 snapBox.height += 40;
7067
7068                 // adjust shape height to include bounding box
7069                 shape.width = Math.max(shape.width, snapBox.width);
7070                 shape.height = Math.max(shape.height, snapBox.height);
7071
7072                 context.participantSnapBox = snapBox;
7073             }
7074
7075             function snapParticipant(snapBox, shape, event) {
7076
7077                 var shapeHalfWidth = shape.width / 2 - 30,
7078                     shapeHalfHeight = shape.height / 2;
7079
7080                 var currentTopLeft = {
7081                     x: event.x - shapeHalfWidth - 30,
7082                     y: event.y - shapeHalfHeight
7083                 };
7084
7085                 var currentBottomRight = {
7086                     x: event.x + shapeHalfWidth + 30,
7087                     y: event.y + shapeHalfHeight
7088                 };
7089
7090                 var snapTopLeft = snapBox,
7091                     snapBottomRight = bottomRight(snapBox);
7092
7093                 if (currentTopLeft.x >= snapTopLeft.x) {
7094                     event.x = snapTopLeft.x + 30 + shapeHalfWidth;
7095                     event.snapped = true;
7096                 } else
7097                 if (currentBottomRight.x <= snapBottomRight.x) {
7098                     event.x = snapBottomRight.x - 30 - shapeHalfWidth;
7099                     event.snapped = true;
7100                 }
7101
7102                 if (currentTopLeft.y >= snapTopLeft.y) {
7103                     event.y = snapTopLeft.y + shapeHalfHeight;
7104                     event.snapped = true;
7105                 } else
7106                 if (currentBottomRight.y <= snapBottomRight.y) {
7107                     event.y = snapBottomRight.y - shapeHalfHeight;
7108                     event.snapped = true;
7109                 }
7110             }
7111
7112             eventBus.on('create.start', function(event) {
7113
7114                 var context = event.context,
7115                     shape = context.shape,
7116                     rootElement = canvas.getRootElement();
7117
7118                 // snap participant around existing elements (if any)
7119                 if (is(shape, 'bpmn:Participant') && is(rootElement, 'bpmn:Process')) {
7120
7121                     initParticipantSnapping(context, shape, rootElement.children);
7122                 }
7123             });
7124
7125             eventBus.on(['create.move', 'create.end'], 1500, function(event) {
7126
7127                 var context = event.context,
7128                     shape = context.shape,
7129                     participantSnapBox = context.participantSnapBox;
7130
7131                 if (!event.snapped && participantSnapBox) {
7132                     snapParticipant(participantSnapBox, shape, event);
7133                 }
7134             });
7135
7136             eventBus.on('resize.start', 1500, function(event) {
7137                 var context = event.context,
7138                     shape = context.shape;
7139
7140                 if (is(shape, 'bpmn:SubProcess')) {
7141                     context.minDimensions = {
7142                         width: 140,
7143                         height: 120
7144                     };
7145                 }
7146
7147                 if (is(shape, 'bpmn:Participant')) {
7148                     context.minDimensions = {
7149                         width: 400,
7150                         height: 200
7151                     };
7152                 }
7153
7154                 if (is(shape, 'bpmn:TextAnnotation')) {
7155                     context.minDimensions = {
7156                         width: 50,
7157                         height: 50
7158                     };
7159                 }
7160             });
7161
7162         }
7163
7164         inherits(BpmnSnapping, Snapping);
7165
7166         BpmnSnapping.$inject = ['eventBus', 'canvas'];
7167
7168         module.exports = BpmnSnapping;
7169
7170
7171         BpmnSnapping.prototype.initSnap = function(event) {
7172
7173             var context = event.context,
7174                 shape = context.shape,
7175                 shapeMid,
7176                 shapeBounds,
7177                 shapeTopLeft,
7178                 shapeBottomRight,
7179                 snapContext;
7180
7181
7182             snapContext = Snapping.prototype.initSnap.call(this, event);
7183
7184             if (is(shape, 'bpmn:Participant')) {
7185                 // assign higher priority for outer snaps on participants
7186                 snapContext.setSnapLocations(['top-left', 'bottom-right', 'mid']);
7187             }
7188
7189
7190             if (shape) {
7191
7192                 shapeMid = mid(shape, event);
7193
7194                 shapeBounds = {
7195                     width: shape.width,
7196                     height: shape.height,
7197                     x: isNaN(shape.x) ? round(shapeMid.x - shape.width / 2) : shape.x,
7198                     y: isNaN(shape.y) ? round(shapeMid.y - shape.height / 2) : shape.y,
7199                 };
7200
7201                 shapeTopLeft = topLeft(shapeBounds);
7202                 shapeBottomRight = bottomRight(shapeBounds);
7203
7204                 snapContext.setSnapOrigin('top-left', {
7205                     x: shapeTopLeft.x - event.x,
7206                     y: shapeTopLeft.y - event.y
7207                 });
7208
7209                 snapContext.setSnapOrigin('bottom-right', {
7210                     x: shapeBottomRight.x - event.x,
7211                     y: shapeBottomRight.y - event.y
7212                 });
7213
7214
7215                 forEach(shape.outgoing, function(c) {
7216                     var docking = c.waypoints[0];
7217
7218                     docking = docking.original || docking;
7219
7220                     snapContext.setSnapOrigin(c.id + '-docking', {
7221                         x: docking.x - event.x,
7222                         y: docking.y - event.y
7223                     });
7224                 });
7225
7226                 forEach(shape.incoming, function(c) {
7227                     var docking = c.waypoints[c.waypoints.length - 1];
7228
7229                     docking = docking.original || docking;
7230
7231                     snapContext.setSnapOrigin(c.id + '-docking', {
7232                         x: docking.x - event.x,
7233                         y: docking.y - event.y
7234                     });
7235                 });
7236
7237             }
7238
7239             var source = context.source;
7240
7241             if (source) {
7242                 snapContext.addDefaultSnap('mid', mid(source));
7243             }
7244         };
7245
7246
7247         BpmnSnapping.prototype.addTargetSnaps = function(snapPoints, shape, target) {
7248
7249             var siblings = this.getSiblings(shape, target);
7250
7251
7252             forEach(siblings, function(s) {
7253                 snapPoints.add('mid', mid(s));
7254
7255                 if (is(s, 'bpmn:Participant')) {
7256                     snapPoints.add('top-left', topLeft(s));
7257                     snapPoints.add('bottom-right', bottomRight(s));
7258                 }
7259             });
7260
7261             forEach(shape.incoming, function(c) {
7262
7263                 if (siblings.indexOf(c.source) === -1) {
7264                     snapPoints.add('mid', mid(c.source));
7265
7266                     var docking = c.waypoints[0];
7267                     snapPoints.add(c.id + '-docking', docking.original || docking);
7268                 }
7269             });
7270
7271
7272             forEach(shape.outgoing, function(c) {
7273
7274                 if (siblings.indexOf(c.target) === -1) {
7275                     snapPoints.add('mid', mid(c.target));
7276
7277                     var docking = c.waypoints[c.waypoints.length - 1];
7278                     snapPoints.add(c.id + '-docking', docking.original || docking);
7279                 }
7280             });
7281
7282         };
7283     }, {
7284         "../../util/ModelUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\util\\ModelUtil.js",
7285         "../modeling/ModelingUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\modeling\\ModelingUtil.js",
7286         "diagram-js/lib/features/snapping/SnapUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\snapping\\SnapUtil.js",
7287         "diagram-js/lib/features/snapping/Snapping": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\snapping\\Snapping.js",
7288         "diagram-js/lib/util/Elements": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Elements.js",
7289         "inherits": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\inherits\\inherits_browser.js",
7290         "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js"
7291     }],
7292     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\snapping\\index.js": [function(require, module, exports) {
7293         module.exports = {
7294             __init__: ['snapping'],
7295             snapping: ['type', require('./BpmnSnapping')]
7296         };
7297     }, {
7298         "./BpmnSnapping": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\features\\snapping\\BpmnSnapping.js"
7299     }],
7300     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\import\\BpmnImporter.js": [function(require, module, exports) {
7301         'use strict';
7302
7303         var assign = require('lodash/object/assign'),
7304             map = require('lodash/collection/map');
7305
7306         var LabelUtil = require('../util/LabelUtil');
7307
7308         var hasExternalLabel = LabelUtil.hasExternalLabel,
7309             getExternalLabelBounds = LabelUtil.getExternalLabelBounds,
7310             isExpanded = require('../util/DiUtil').isExpanded,
7311             elementToString = require('./Util').elementToString;
7312
7313
7314         function elementData(semantic, attrs) {
7315             return assign({
7316                 id: semantic.id,
7317                 type: semantic.$type,
7318                 businessObject: semantic
7319             }, attrs);
7320         }
7321
7322         function collectWaypoints(waypoints) {
7323             return map(waypoints, function(p) {
7324                 return {
7325                     x: p.x,
7326                     y: p.y
7327                 };
7328             });
7329         }
7330
7331
7332         /**
7333          * An importer that adds bpmn elements to the canvas
7334          * 
7335          * @param {EventBus}
7336          *            eventBus
7337          * @param {Canvas}
7338          *            canvas
7339          * @param {ElementFactory}
7340          *            elementFactory
7341          * @param {ElementRegistry}
7342          *            elementRegistry
7343          */
7344         function BpmnImporter(eventBus, canvas, elementFactory, elementRegistry) {
7345             this._eventBus = eventBus;
7346             this._canvas = canvas;
7347
7348             this._elementFactory = elementFactory;
7349             this._elementRegistry = elementRegistry;
7350         }
7351
7352         BpmnImporter.$inject = ['eventBus', 'canvas', 'elementFactory', 'elementRegistry'];
7353
7354         module.exports = BpmnImporter;
7355
7356
7357         /**
7358          * Add bpmn element (semantic) to the canvas onto the specified parent shape.
7359          */
7360         BpmnImporter.prototype.add = function(semantic, parentElement) {
7361
7362             var di = semantic.di,
7363                 element;
7364
7365             // ROOT ELEMENT
7366             // handle the special case that we deal with a
7367             // invisible root element (process or collaboration)
7368             if (di.$instanceOf('bpmndi:BPMNPlane')) {
7369
7370                 // add a virtual element (not being drawn)
7371                 element = this._elementFactory.createRoot(elementData(semantic));
7372
7373                 this._canvas.setRootElement(element);
7374             }
7375
7376             // SHAPE
7377             else if (di.$instanceOf('bpmndi:BPMNShape')) {
7378
7379                 var collapsed = !isExpanded(semantic);
7380                 var hidden = parentElement && (parentElement.hidden || parentElement.collapsed);
7381
7382                 var bounds = semantic.di.bounds;
7383
7384                 element = this._elementFactory.createShape(elementData(semantic, {
7385                     collapsed: collapsed,
7386                     hidden: hidden,
7387                     x: Math.round(bounds.x),
7388                     y: Math.round(bounds.y),
7389                     width: Math.round(bounds.width),
7390                     height: Math.round(bounds.height)
7391                 }));
7392
7393                 this._canvas.addShape(element, parentElement);
7394             }
7395
7396             // CONNECTION
7397             else if (di.$instanceOf('bpmndi:BPMNEdge')) {
7398
7399                 var source = this._getSource(semantic),
7400                     target = this._getTarget(semantic);
7401
7402                 element = this._elementFactory.createConnection(elementData(semantic, {
7403                     source: source,
7404                     target: target,
7405                     waypoints: collectWaypoints(semantic.di.waypoint)
7406                 }));
7407
7408                 this._canvas.addConnection(element, parentElement);
7409             } else {
7410                 throw new Error('unknown di ' + elementToString(di) + ' for element ' + elementToString(semantic));
7411             }
7412
7413             // (optional) LABEL
7414             if (hasExternalLabel(semantic)) {
7415                 this.addLabel(semantic, element);
7416             }
7417
7418
7419             this._eventBus.fire('bpmnElement.added', {
7420                 element: element
7421             });
7422
7423             return element;
7424         };
7425
7426
7427         /**
7428          * add label for an element
7429          */
7430         BpmnImporter.prototype.addLabel = function(semantic, element) {
7431             var bounds = getExternalLabelBounds(semantic, element);
7432
7433             var label = this._elementFactory.createLabel(elementData(semantic, {
7434                 id: semantic.id + '_label',
7435                 labelTarget: element,
7436                 type: 'label',
7437                 hidden: element.hidden,
7438                 x: Math.round(bounds.x),
7439                 y: Math.round(bounds.y),
7440                 width: Math.round(bounds.width),
7441                 height: Math.round(bounds.height)
7442             }));
7443
7444             return this._canvas.addShape(label, element.parent);
7445         };
7446
7447         /**
7448          * Return the drawn connection end based on the given side.
7449          * 
7450          * @throws {Error}
7451          *             if the end is not yet drawn
7452          */
7453         BpmnImporter.prototype._getEnd = function(semantic, side) {
7454
7455             var element,
7456                 refSemantic,
7457                 type = semantic.$type;
7458
7459             refSemantic = semantic[side + 'Ref'];
7460
7461             // handle mysterious isMany DataAssociation#sourceRef
7462             if (side === 'source' && type === 'bpmn:DataInputAssociation') {
7463                 refSemantic = refSemantic && refSemantic[0];
7464             }
7465
7466             // fix source / target for DataInputAssociation / DataOutputAssociation
7467             if (side === 'source' && type === 'bpmn:DataOutputAssociation' ||
7468                 side === 'target' && type === 'bpmn:DataInputAssociation') {
7469
7470                 refSemantic = semantic.$parent;
7471             }
7472
7473             element = refSemantic && this._getElement(refSemantic);
7474
7475             if (element) {
7476                 return element;
7477             }
7478
7479             if (refSemantic) {
7480                 throw new Error(
7481                     'element ' + elementToString(refSemantic) + ' referenced by ' +
7482                     elementToString(semantic) + '#' + side + 'Ref not yet drawn');
7483             } else {
7484                 throw new Error(elementToString(semantic) + '#' + side + 'Ref not specified');
7485             }
7486         };
7487
7488         BpmnImporter.prototype._getSource = function(semantic) {
7489             return this._getEnd(semantic, 'source');
7490         };
7491
7492         BpmnImporter.prototype._getTarget = function(semantic) {
7493             return this._getEnd(semantic, 'target');
7494         };
7495
7496
7497         BpmnImporter.prototype._getElement = function(semantic) {
7498             return this._elementRegistry.get(semantic.id);
7499         };
7500
7501     }, {
7502         "../util/DiUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\util\\DiUtil.js",
7503         "../util/LabelUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\util\\LabelUtil.js",
7504         "./Util": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\import\\Util.js",
7505         "lodash/collection/map": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\map.js",
7506         "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js"
7507     }],
7508     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\import\\BpmnTreeWalker.js": [function(require, module, exports) {
7509         'use strict';
7510
7511         var filter = require('lodash/collection/filter'),
7512             find = require('lodash/collection/find'),
7513             forEach = require('lodash/collection/forEach');
7514
7515         var Refs = require('object-refs');
7516
7517         var elementToString = require('./Util').elementToString;
7518
7519         var diRefs = new Refs({
7520             name: 'bpmnElement',
7521             enumerable: true
7522         }, {
7523             name: 'di'
7524         });
7525
7526         /**
7527          * Returns true if an element has the given meta-model type
7528          * 
7529          * @param {ModdleElement}
7530          *            element
7531          * @param {String}
7532          *            type
7533          * 
7534          * @return {Boolean}
7535          */
7536         function is(element, type) {
7537             return element.$instanceOf(type);
7538         }
7539
7540
7541         /**
7542          * Find a suitable display candidate for definitions where the DI does not
7543          * correctly specify one.
7544          */
7545         function findDisplayCandidate(definitions) {
7546             return find(definitions.rootElements, function(e) {
7547                 return is(e, 'bpmn:Process') || is(e, 'bpmn:Collaboration');
7548             });
7549         }
7550
7551
7552         function BpmnTreeWalker(handler) {
7553
7554             // list of containers already walked
7555             var handledProcesses = [];
7556
7557             // list of elements to handle deferred to ensure
7558             // prerequisites are drawn
7559             var deferred = [];
7560
7561             // /// Helpers /////////////////////////////////
7562
7563             function contextual(fn, ctx) {
7564                 return function(e) {
7565                     fn(e, ctx);
7566                 };
7567             }
7568
7569             function visit(element, ctx) {
7570
7571                 var gfx = element.gfx;
7572
7573                 // avoid multiple rendering of elements
7574                 if (gfx) {
7575                     throw new Error('already rendered ' + elementToString(element));
7576                 }
7577
7578                 // call handler
7579                 return handler.element(element, ctx);
7580             }
7581
7582             function visitRoot(element, diagram) {
7583                 return handler.root(element, diagram);
7584             }
7585
7586             function visitIfDi(element, ctx) {
7587                 try {
7588                     return element.di && visit(element, ctx);
7589                 } catch (e) {
7590                     logError(e.message, {
7591                         element: element,
7592                         error: e
7593                     });
7594
7595                     console.error('failed to import ' + elementToString(element));
7596                     console.error(e);
7597                 }
7598             }
7599
7600             function logError(message, context) {
7601                 handler.error(message, context);
7602             }
7603
7604             // //// DI handling ////////////////////////////
7605
7606             function registerDi(di) {
7607                 var bpmnElement = di.bpmnElement;
7608
7609                 if (bpmnElement) {
7610                     if (bpmnElement.di) {
7611                         logError('multiple DI elements defined for ' + elementToString(bpmnElement), {
7612                             element: bpmnElement
7613                         });
7614                     } else {
7615                         diRefs.bind(bpmnElement, 'di');
7616                         bpmnElement.di = di;
7617                     }
7618                 } else {
7619                     logError('no bpmnElement referenced in ' + elementToString(di), {
7620                         element: di
7621                     });
7622                 }
7623             }
7624
7625             function handleDiagram(diagram) {
7626                 handlePlane(diagram.plane);
7627             }
7628
7629             function handlePlane(plane) {
7630                 registerDi(plane);
7631
7632                 forEach(plane.planeElement, handlePlaneElement);
7633             }
7634
7635             function handlePlaneElement(planeElement) {
7636                 registerDi(planeElement);
7637             }
7638
7639
7640             // //// Semantic handling //////////////////////
7641
7642             function handleDefinitions(definitions, diagram) {
7643                 // make sure we walk the correct bpmnElement
7644
7645                 var diagrams = definitions.diagrams;
7646
7647                 if (diagram && diagrams.indexOf(diagram) === -1) {
7648                     throw new Error('diagram not part of bpmn:Definitions');
7649                 }
7650
7651                 if (!diagram && diagrams && diagrams.length) {
7652                     diagram = diagrams[0];
7653                 }
7654
7655                 // no diagram -> nothing to import
7656                 if (!diagram) {
7657                     return;
7658                 }
7659
7660                 // load DI from selected diagram only
7661                 handleDiagram(diagram);
7662
7663
7664                 var plane = diagram.plane;
7665
7666                 if (!plane) {
7667                     throw new Error('no plane for ' + elementToString(diagram));
7668                 }
7669
7670
7671                 var rootElement = plane.bpmnElement;
7672
7673                 // ensure we default to a suitable display candidate (process or
7674                 // collaboration),
7675                 // even if non is specified in DI
7676                 if (!rootElement) {
7677                     rootElement = findDisplayCandidate(definitions);
7678
7679                     if (!rootElement) {
7680                         return logError('no process or collaboration present to display');
7681                     } else {
7682
7683                         logError('correcting missing bpmnElement on ' + elementToString(plane) + ' to ' + elementToString(rootElement));
7684
7685                         // correct DI on the fly
7686                         plane.bpmnElement = rootElement;
7687                         registerDi(plane);
7688                     }
7689                 }
7690
7691
7692                 var ctx = visitRoot(rootElement, plane);
7693
7694                 if (is(rootElement, 'bpmn:Process')) {
7695                     handleProcess(rootElement, ctx);
7696                 } else if (is(rootElement, 'bpmn:Collaboration')) {
7697                     handleCollaboration(rootElement, ctx);
7698
7699                     // force drawing of everything not yet drawn that is part of the target
7700                     // DI
7701                     handleUnhandledProcesses(definitions.rootElements, ctx);
7702                 } else {
7703                     throw new Error('unsupported bpmnElement for ' + elementToString(plane) + ' : ' + elementToString(rootElement));
7704                 }
7705
7706                 // handle all deferred elements
7707                 handleDeferred(deferred);
7708             }
7709
7710             function handleDeferred(deferred) {
7711                 forEach(deferred, function(d) {
7712                     d();
7713                 });
7714             }
7715
7716             function handleProcess(process, context) {
7717                 handleFlowElementsContainer(process, context);
7718                 handleIoSpecification(process.ioSpecification, context);
7719
7720                 handleArtifacts(process.artifacts, context);
7721
7722                 // log process handled
7723                 handledProcesses.push(process);
7724             }
7725
7726             function handleUnhandledProcesses(rootElements) {
7727
7728                 // walk through all processes that have not yet been drawn and draw them
7729                 // if they contain lanes with DI information.
7730                 // we do this to pass the free-floating lane test cases in the MIWG test
7731                 // suite
7732                 var processes = filter(rootElements, function(e) {
7733                     return is(e, 'bpmn:Process') && e.laneSets && handledProcesses.indexOf(e) === -1;
7734                 });
7735
7736                 processes.forEach(contextual(handleProcess));
7737             }
7738
7739             function handleMessageFlow(messageFlow, context) {
7740                 visitIfDi(messageFlow, context);
7741             }
7742
7743             function handleMessageFlows(messageFlows, context) {
7744                 forEach(messageFlows, contextual(handleMessageFlow, context));
7745             }
7746
7747             function handleDataAssociation(association, context) {
7748                 visitIfDi(association, context);
7749             }
7750
7751             function handleDataInput(dataInput, context) {
7752                 visitIfDi(dataInput, context);
7753             }
7754
7755             function handleDataOutput(dataOutput, context) {
7756                 visitIfDi(dataOutput, context);
7757             }
7758
7759             function handleArtifact(artifact, context) {
7760
7761                 // bpmn:TextAnnotation
7762                 // bpmn:Group
7763                 // bpmn:Association
7764
7765                 visitIfDi(artifact, context);
7766             }
7767
7768             function handleArtifacts(artifacts, context) {
7769
7770                 forEach(artifacts, function(e) {
7771                     if (is(e, 'bpmn:Association')) {
7772                         deferred.push(function() {
7773                             handleArtifact(e, context);
7774                         });
7775                     } else {
7776                         handleArtifact(e, context);
7777                     }
7778                 });
7779             }
7780
7781             function handleIoSpecification(ioSpecification, context) {
7782
7783                 if (!ioSpecification) {
7784                     return;
7785                 }
7786
7787                 forEach(ioSpecification.dataInputs, contextual(handleDataInput, context));
7788                 forEach(ioSpecification.dataOutputs, contextual(handleDataOutput, context));
7789             }
7790
7791             function handleSubProcess(subProcess, context) {
7792                 handleFlowElementsContainer(subProcess, context);
7793                 handleArtifacts(subProcess.artifacts, context);
7794             }
7795
7796             function handleFlowNode(flowNode, context) {
7797                 var childCtx = visitIfDi(flowNode, context);
7798
7799                 if (is(flowNode, 'bpmn:SubProcess')) {
7800                     handleSubProcess(flowNode, childCtx || context);
7801                 }
7802             }
7803
7804             function handleSequenceFlow(sequenceFlow, context) {
7805                 visitIfDi(sequenceFlow, context);
7806             }
7807
7808             function handleDataElement(dataObject, context) {
7809                 visitIfDi(dataObject, context);
7810             }
7811
7812             function handleBoundaryEvent(dataObject, context) {
7813                 visitIfDi(dataObject, context);
7814             }
7815
7816             function handleLane(lane, context) {
7817                 var newContext = visitIfDi(lane, context);
7818
7819                 if (lane.childLaneSet) {
7820                     handleLaneSet(lane.childLaneSet, newContext || context);
7821                 } else {
7822                     var filterList = filter(lane.flowNodeRef, function(e) {
7823                         return e.$type !== 'bpmn:BoundaryEvent';
7824                     });
7825                     handleFlowElements(filterList, newContext || context);
7826                 }
7827             }
7828
7829             function handleLaneSet(laneSet, context) {
7830                 forEach(laneSet.lanes, contextual(handleLane, context));
7831             }
7832
7833             function handleLaneSets(laneSets, context) {
7834                 forEach(laneSets, contextual(handleLaneSet, context));
7835             }
7836
7837             function handleFlowElementsContainer(container, context) {
7838
7839                 if (container.laneSets) {
7840                     handleLaneSets(container.laneSets, context);
7841                     handleNonFlowNodes(container.flowElements);
7842                 } else {
7843                     handleFlowElements(container.flowElements, context);
7844                 }
7845             }
7846
7847             function handleNonFlowNodes(flowElements, context) {
7848                 forEach(flowElements, function(e) {
7849                     if (is(e, 'bpmn:SequenceFlow')) {
7850                         deferred.push(function() {
7851                             handleSequenceFlow(e, context);
7852                         });
7853                     } else if (is(e, 'bpmn:BoundaryEvent')) {
7854                         deferred.unshift(function() {
7855                             handleBoundaryEvent(e, context);
7856                         });
7857                     } else if (is(e, 'bpmn:DataObject')) {
7858                         // SKIP (assume correct referencing via DataObjectReference)
7859                     } else if (is(e, 'bpmn:DataStoreReference')) {
7860                         handleDataElement(e, context);
7861                     } else if (is(e, 'bpmn:DataObjectReference')) {
7862                         handleDataElement(e, context);
7863                     }
7864                 });
7865             }
7866
7867             function handleFlowElements(flowElements, context) {
7868                 forEach(flowElements, function(e) {
7869                     if (is(e, 'bpmn:SequenceFlow')) {
7870                         deferred.push(function() {
7871                             handleSequenceFlow(e, context);
7872                         });
7873                     } else if (is(e, 'bpmn:BoundaryEvent')) {
7874                         deferred.unshift(function() {
7875                             handleBoundaryEvent(e, context);
7876                         });
7877                     } else if (is(e, 'bpmn:FlowNode')) {
7878                         handleFlowNode(e, context);
7879
7880                         if (is(e, 'bpmn:Activity')) {
7881
7882                             handleIoSpecification(e.ioSpecification, context);
7883
7884                             // defer handling of associations
7885                             deferred.push(function() {
7886                                 forEach(e.dataInputAssociations, contextual(handleDataAssociation, context));
7887                                 forEach(e.dataOutputAssociations, contextual(handleDataAssociation, context));
7888                             });
7889                         }
7890                     } else if (is(e, 'bpmn:DataObject')) {
7891                         // SKIP (assume correct referencing via DataObjectReference)
7892                     } else if (is(e, 'bpmn:DataStoreReference')) {
7893                         handleDataElement(e, context);
7894                     } else if (is(e, 'bpmn:DataObjectReference')) {
7895                         handleDataElement(e, context);
7896                     } else {
7897                         logError(
7898                             'unrecognized flowElement ' + elementToString(e) + ' in context ' +
7899                             (context ? elementToString(context.businessObject) : null), {
7900                                 element: e,
7901                                 context: context
7902                             });
7903                     }
7904                 });
7905             }
7906
7907             function handleParticipant(participant, context) {
7908                 var newCtx = visitIfDi(participant, context);
7909
7910                 var process = participant.processRef;
7911                 if (process) {
7912                     handleProcess(process, newCtx || context);
7913                 }
7914             }
7915
7916             function handleCollaboration(collaboration) {
7917
7918                 forEach(collaboration.participants, contextual(handleParticipant));
7919
7920                 handleArtifacts(collaboration.artifacts);
7921
7922                 // handle message flows latest in the process
7923                 deferred.push(function() {
7924                     handleMessageFlows(collaboration.messageFlows);
7925                 });
7926             }
7927
7928
7929             // /// API ////////////////////////////////
7930
7931             return {
7932                 handleDefinitions: handleDefinitions
7933             };
7934         }
7935
7936         module.exports = BpmnTreeWalker;
7937     }, {
7938         "./Util": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\import\\Util.js",
7939         "lodash/collection/filter": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\filter.js",
7940         "lodash/collection/find": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\find.js",
7941         "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
7942         "object-refs": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\object-refs\\index.js"
7943     }],
7944     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\import\\Importer.js": [function(require, module, exports) {
7945         'use strict';
7946
7947         var BpmnTreeWalker = require('./BpmnTreeWalker');
7948
7949
7950         /**
7951          * Import the definitions into a diagram.
7952          * 
7953          * Errors and warnings are reported through the specified callback.
7954          * 
7955          * @param {Diagram}
7956          *            diagram
7957          * @param {ModdleElement}
7958          *            definitions
7959          * @param {Function}
7960          *            done the callback, invoked with (err, [ warning ]) once the import
7961          *            is done
7962          */
7963         function importBpmnDiagram(diagram, definitions, done) {
7964
7965             var importer = diagram.get('bpmnImporter'),
7966                 eventBus = diagram.get('eventBus');
7967
7968             var error,
7969                 warnings = [];
7970
7971             function parse(definitions) {
7972
7973                 var visitor = {
7974
7975                     root: function(element) {
7976                         return importer.add(element);
7977                     },
7978
7979                     element: function(element, parentShape) {
7980                         return importer.add(element, parentShape);
7981                     },
7982
7983                     error: function(message, context) {
7984                         warnings.push({
7985                             message: message,
7986                             context: context
7987                         });
7988                     }
7989                 };
7990
7991                 var walker = new BpmnTreeWalker(visitor);
7992
7993                 // import
7994                 walker.handleDefinitions(definitions);
7995             }
7996
7997             eventBus.fire('import.start');
7998
7999             try {
8000                 parse(definitions);
8001             } catch (e) {
8002                 error = e;
8003             }
8004
8005             eventBus.fire(error ? 'import.error' : 'import.success', {
8006                 error: error,
8007                 warnings: warnings
8008             });
8009             done(error, warnings);
8010         }
8011
8012         module.exports.importBpmnDiagram = importBpmnDiagram;
8013     }, {
8014         "./BpmnTreeWalker": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\import\\BpmnTreeWalker.js"
8015     }],
8016     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\import\\Util.js": [function(require, module, exports) {
8017         'use strict';
8018
8019         module.exports.elementToString = function(e) {
8020             if (!e) {
8021                 return '<null>';
8022             }
8023
8024             return '<' + e.$type + (e.id ? ' id="' + e.id : '') + '" />';
8025         };
8026     }, {}],
8027     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\import\\index.js": [function(require, module, exports) {
8028         module.exports = {
8029             bpmnImporter: ['type', require('./BpmnImporter')]
8030         };
8031     }, {
8032         "./BpmnImporter": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\import\\BpmnImporter.js"
8033     }],
8034     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\util\\DiUtil.js": [function(require, module, exports) {
8035         'use strict';
8036
8037         var is = require('./ModelUtil').is,
8038             getBusinessObject = require('./ModelUtil').getBusinessObject;
8039
8040         module.exports.isExpanded = function(element) {
8041
8042             if (is(element, 'bpmn:CallActivity')) {
8043                 return false;
8044             }
8045
8046             if (is(element, 'bpmn:SubProcess')) {
8047                 return getBusinessObject(element).di.isExpanded;
8048             }
8049
8050             if (is(element, 'bpmn:Participant')) {
8051                 return !!getBusinessObject(element).processRef;
8052             }
8053
8054             return true;
8055         };
8056
8057     }, {
8058         "./ModelUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\util\\ModelUtil.js"
8059     }],
8060     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\util\\LabelUtil.js": [function(require, module, exports) {
8061         'use strict';
8062
8063         var assign = require('lodash/object/assign');
8064
8065
8066         var DEFAULT_LABEL_SIZE = module.exports.DEFAULT_LABEL_SIZE = {
8067             width: 90,
8068             height: 20
8069         };
8070
8071
8072         /**
8073          * Returns true if the given semantic has an external label
8074          * 
8075          * @param {BpmnElement}
8076          *            semantic
8077          * @return {Boolean} true if has label
8078          */
8079         module.exports.hasExternalLabel = function(semantic) {
8080
8081             return semantic.$instanceOf('bpmn:Event') ||
8082                 // semantic.$instanceOf('bpmn:Gateway') ||
8083                 semantic.$instanceOf('bpmn:DataStoreReference') ||
8084                 semantic.$instanceOf('bpmn:DataObjectReference') ||
8085                 semantic.$instanceOf('bpmn:SequenceFlow') ||
8086                 semantic.$instanceOf('bpmn:MessageFlow');
8087         };
8088
8089
8090         /**
8091          * Get the middle of a number of waypoints
8092          * 
8093          * @param {Array
8094          *            <Point>} waypoints
8095          * @return {Point} the mid point
8096          */
8097         var getWaypointsMid = module.exports.getWaypointsMid = function(waypoints) {
8098
8099             var mid = waypoints.length / 2 - 1;
8100
8101             var first = waypoints[Math.floor(mid)];
8102             var second = waypoints[Math.ceil(mid + 0.01)];
8103
8104             return {
8105                 x: first.x + (second.x - first.x) / 2,
8106                 y: first.y + (second.y - first.y) / 2
8107             };
8108         };
8109
8110
8111         var getExternalLabelMid = module.exports.getExternalLabelMid = function(element) {
8112
8113             if (element.waypoints) {
8114                 return getWaypointsMid(element.waypoints);
8115             } else {
8116                 return {
8117                     x: element.x + element.width / 2,
8118                     y: element.y + element.height + DEFAULT_LABEL_SIZE.height / 2
8119                 };
8120             }
8121         };
8122
8123         /**
8124          * Returns the bounds of an elements label, parsed from the elements DI or
8125          * generated from its bounds.
8126          * 
8127          * @param {BpmnElement}
8128          *            semantic
8129          * @param {djs.model.Base}
8130          *            element
8131          */
8132         module.exports.getExternalLabelBounds = function(semantic, element) {
8133
8134             var mid,
8135                 size,
8136                 bounds,
8137                 di = semantic.di,
8138                 label = di.label;
8139
8140             if (label && label.bounds) {
8141                 bounds = label.bounds;
8142
8143                 size = {
8144                     width: Math.max(DEFAULT_LABEL_SIZE.width, bounds.width),
8145                     height: bounds.height
8146                 };
8147
8148                 mid = {
8149                     x: bounds.x + bounds.width / 2,
8150                     y: bounds.y + bounds.height / 2
8151                 };
8152             } else {
8153
8154                 mid = getExternalLabelMid(element);
8155
8156                 size = DEFAULT_LABEL_SIZE;
8157             }
8158
8159             return assign({
8160                 x: mid.x - size.width / 2,
8161                 y: mid.y - size.height / 2
8162             }, size);
8163         };
8164     }, {
8165         "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js"
8166     }],
8167     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\lib\\util\\ModelUtil.js": [function(require, module, exports) {
8168         'use strict';
8169
8170         /**
8171          * Is an element of the given BPMN type?
8172          * 
8173          * @param {djs.model.Base|ModdleElement}
8174          *            element
8175          * @param {String}
8176          *            type
8177          * 
8178          * @return {Boolean}
8179          */
8180         function is(element, type) {
8181             var bo = getBusinessObject(element);
8182
8183             return bo && bo.$instanceOf(type);
8184         }
8185
8186         module.exports.is = is;
8187
8188
8189         /**
8190          * Return the business object for a given element.
8191          * 
8192          * @param {djs.model.Base|ModdleElement}
8193          *            element
8194          * 
8195          * @return {ModdleElement}
8196          */
8197         function getBusinessObject(element) {
8198             return (element && element.businessObject) || element;
8199         }
8200
8201         module.exports.getBusinessObject = getBusinessObject;
8202
8203     }, {}],
8204     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\index.js": [function(require, module, exports) {
8205         module.exports = require('./lib/simple');
8206     }, {
8207         "./lib/simple": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\lib\\simple.js"
8208     }],
8209     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\lib\\bpmn-moddle.js": [function(require, module, exports) {
8210         'use strict';
8211
8212         var isString = require('lodash/lang/isString'),
8213             isFunction = require('lodash/lang/isFunction'),
8214             assign = require('lodash/object/assign');
8215
8216         var Moddle = require('moddle'),
8217             XmlReader = require('moddle-xml/lib/reader'),
8218             XmlWriter = require('moddle-xml/lib/writer');
8219
8220         /**
8221          * A sub class of {@link Moddle} with support for import and export of BPMN 2.0
8222          * xml files.
8223          * 
8224          * @class BpmnModdle
8225          * @extends Moddle
8226          * 
8227          * @param {Object|Array}
8228          *            packages to use for instantiating the model
8229          * @param {Object}
8230          *            [options] additional options to pass over
8231          */
8232         function BpmnModdle(packages, options) {
8233             Moddle.call(this, packages, options);
8234         }
8235
8236         BpmnModdle.prototype = Object.create(Moddle.prototype);
8237
8238         module.exports = BpmnModdle;
8239
8240
8241         /**
8242          * Instantiates a BPMN model tree from a given xml string.
8243          * 
8244          * @param {String}
8245          *            xmlStr
8246          * @param {String}
8247          *            [typeName='bpmn:Definitions'] name of the root element
8248          * @param {Object}
8249          *            [options] options to pass to the underlying reader
8250          * @param {Function}
8251          *            done callback that is invoked with (err, result, parseContext)
8252          *            once the import completes
8253          */
8254         BpmnModdle.prototype.fromXML = function(xmlStr, typeName, options, done) {
8255
8256             if (!isString(typeName)) {
8257                 done = options;
8258                 options = typeName;
8259                 typeName = 'bpmn:Definitions';
8260             }
8261
8262             if (isFunction(options)) {
8263                 done = options;
8264                 options = {};
8265             }
8266
8267             var reader = new XmlReader(assign({
8268                 model: this,
8269                 lax: true
8270             }, options));
8271             var rootHandler = reader.handler(typeName);
8272
8273             reader.fromXML(xmlStr, rootHandler, done);
8274         };
8275
8276
8277         /**
8278          * Serializes a BPMN 2.0 object tree to XML.
8279          * 
8280          * @param {String}
8281          *            element the root element, typically an instance of
8282          *            `bpmn:Definitions`
8283          * @param {Object}
8284          *            [options] to pass to the underlying writer
8285          * @param {Function}
8286          *            done callback invoked with (err, xmlStr) once the import completes
8287          */
8288         
8289       
8290         
8291         
8292         BpmnModdle.prototype.toXML = function(element, options, done) {
8293
8294             if (isFunction(options)) {
8295                 done = options;
8296                 options = {};
8297             }
8298
8299             var writer = new XmlWriter(options);
8300             try {
8301                 var result = writer.toXML(element);
8302                 modelXML = result;
8303                 list_models[selected_model]=result;
8304                 done(null, result);
8305             } catch (e) {
8306                 done(e);
8307             }
8308         };
8309
8310     }, {
8311         "lodash/lang/isFunction": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isFunction.js",
8312         "lodash/lang/isString": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isString.js",
8313         "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js",
8314         "moddle": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle\\index.js",
8315         "moddle-xml/lib/reader": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle-xml\\lib\\reader.js",
8316         "moddle-xml/lib/writer": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle-xml\\lib\\writer.js"
8317     }],
8318     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\lib\\id-support.js": [function(require, module, exports) {
8319         'use strict';
8320
8321         var ID_PATTERN = /^(.*:)?id$/;
8322
8323         /**
8324          * Extends the bpmn instance with id support.
8325          * 
8326          * @example
8327          * 
8328          * var moddle, ids;
8329          * 
8330          * require('id-support').extend(moddle, ids);
8331          * 
8332          * moddle.ids.next(); // create a next id moddle.ids; // ids instance
8333          *  // claims id as used moddle.create('foo:Bar', { id: 'fooobar1' });
8334          * 
8335          * 
8336          * @param {Moddle}
8337          *            model
8338          * @param {Ids}
8339          *            ids
8340          * 
8341          * @return {Moddle} the extended moddle instance
8342          */
8343         module.exports.extend = function(model, ids) {
8344
8345             var set = model.properties.set;
8346
8347             // do not reinitialize setter
8348             // unless it is already initialized
8349             if (!model.ids) {
8350
8351                 model.properties.set = function(target, property, value) {
8352
8353                     // ensure we log used ids once they are assigned
8354                     // to model elements
8355                     if (ID_PATTERN.test(property)) {
8356
8357                         var assigned = model.ids.assigned(value);
8358                         if (assigned && assigned !== target) {
8359                             throw new Error('id <' + value + '> already used');
8360                         }
8361
8362                         model.ids.claim(value, target);
8363                     }
8364
8365                     set.call(this, target, property, value);
8366                 };
8367             }
8368
8369             model.ids = ids;
8370
8371             return model;
8372         };
8373     }, {}],
8374     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\lib\\simple.js": [function(require, module, exports) {
8375         'use strict';
8376
8377         var assign = require('lodash/object/assign');
8378
8379         var BpmnModdle = require('./bpmn-moddle');
8380
8381         var packages = {
8382             bpmn: require('../resources/bpmn/json/bpmn.json'),
8383             bpmndi: require('../resources/bpmn/json/bpmndi.json'),
8384             dc: require('../resources/bpmn/json/dc.json'),
8385             di: require('../resources/bpmn/json/di.json')
8386         };
8387
8388         module.exports = function(additionalPackages, options) {
8389             return new BpmnModdle(assign({}, packages, additionalPackages), options);
8390         };
8391     }, {
8392         "../resources/bpmn/json/bpmn.json": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\resources\\bpmn\\json\\bpmn.json",
8393         "../resources/bpmn/json/bpmndi.json": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\resources\\bpmn\\json\\bpmndi.json",
8394         "../resources/bpmn/json/dc.json": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\resources\\bpmn\\json\\dc.json",
8395         "../resources/bpmn/json/di.json": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\resources\\bpmn\\json\\di.json",
8396         "./bpmn-moddle": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\lib\\bpmn-moddle.js",
8397         "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js"
8398     }],
8399     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle-xml\\lib\\common.js": [function(require, module, exports) {
8400         'use strict';
8401
8402         function capitalize(string) {
8403             return string.charAt(0).toUpperCase() + string.slice(1);
8404         }
8405
8406         function lower(string) {
8407             return string.charAt(0).toLowerCase() + string.slice(1);
8408         }
8409
8410         function hasLowerCaseAlias(pkg) {
8411             return pkg.xml && pkg.xml.tagAlias === 'lowerCase';
8412         }
8413
8414
8415         module.exports.aliasToName = function(alias, pkg) {
8416             if (hasLowerCaseAlias(pkg)) {
8417                 return capitalize(alias);
8418             } else {
8419                 return alias;
8420             }
8421         };
8422
8423         module.exports.nameToAlias = function(name, pkg) {
8424             if (hasLowerCaseAlias(pkg)) {
8425                 return lower(name);
8426             } else {
8427                 return name;
8428             }
8429         };
8430
8431         module.exports.DEFAULT_NS_MAP = {
8432             'xsi': 'http://www.w3.org/2001/XMLSchema-instance'
8433         };
8434
8435         module.exports.XSI_TYPE = 'xsi:type';
8436     }, {}],
8437     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle-xml\\lib\\reader.js": [function(require, module, exports) {
8438         'use strict';
8439
8440         var reduce = require('lodash/collection/reduce'),
8441             forEach = require('lodash/collection/forEach'),
8442             find = require('lodash/collection/find'),
8443             assign = require('lodash/object/assign'),
8444             defer = require('lodash/function/defer');
8445
8446         var Stack = require('tiny-stack'),
8447             SaxParser = require('sax').parser,
8448             Moddle = require('moddle'),
8449             parseNameNs = require('moddle/lib/ns').parseName,
8450             Types = require('moddle/lib/types'),
8451             coerceType = Types.coerceType,
8452             isSimpleType = Types.isSimple,
8453             common = require('./common'),
8454             XSI_TYPE = common.XSI_TYPE,
8455             XSI_URI = common.DEFAULT_NS_MAP.xsi,
8456             aliasToName = common.aliasToName;
8457
8458         function parseNodeAttributes(node) {
8459             var nodeAttrs = node.attributes;
8460
8461             return reduce(nodeAttrs, function(result, v, k) {
8462                 var name, ns;
8463
8464                 if (!v.local) {
8465                     name = v.prefix;
8466                 } else {
8467                     ns = parseNameNs(v.name, v.prefix);
8468                     name = ns.name;
8469                 }
8470
8471                 result[name] = v.value;
8472                 return result;
8473             }, {});
8474         }
8475
8476         function normalizeType(node, attr, model) {
8477             var nameNs = parseNameNs(attr.value);
8478
8479             var uri = node.ns[nameNs.prefix || ''],
8480                 localName = nameNs.localName,
8481                 pkg = uri && model.getPackage(uri),
8482                 typePrefix;
8483
8484             if (pkg) {
8485                 typePrefix = pkg.xml && pkg.xml.typePrefix;
8486
8487                 if (typePrefix && localName.indexOf(typePrefix) === 0) {
8488                     localName = localName.slice(typePrefix.length);
8489                 }
8490
8491                 attr.value = pkg.prefix + ':' + localName;
8492             }
8493         }
8494
8495         /**
8496          * Normalizes namespaces for a node given an optional default namespace and a
8497          * number of mappings from uris to default prefixes.
8498          * 
8499          * @param {XmlNode}
8500          *            node
8501          * @param {Model}
8502          *            model the model containing all registered namespaces
8503          * @param {Uri}
8504          *            defaultNsUri
8505          */
8506         function normalizeNamespaces(node, model, defaultNsUri) {
8507             var uri, prefix;
8508
8509             uri = node.uri || defaultNsUri;
8510
8511             if (uri) {
8512                 var pkg = model.getPackage(uri);
8513
8514                 if (pkg) {
8515                     prefix = pkg.prefix;
8516                 } else {
8517                     prefix = node.prefix;
8518                 }
8519
8520                 node.prefix = prefix;
8521                 node.uri = uri;
8522             }
8523
8524             forEach(node.attributes, function(attr) {
8525
8526                 // normalize xsi:type attributes because the
8527                 // assigned type may or may not be namespace prefixed
8528                 if (attr.uri === XSI_URI && attr.local === 'type') {
8529                     normalizeType(node, attr, model);
8530                 }
8531
8532                 normalizeNamespaces(attr, model, null);
8533             });
8534         }
8535
8536
8537         /**
8538          * A parse context.
8539          * 
8540          * @class
8541          * 
8542          * @param {Object}
8543          *            options
8544          * @param {ElementHandler}
8545          *            options.parseRoot the root handler for parsing a document
8546          * @param {boolean}
8547          *            [options.lax=false] whether or not to ignore invalid elements
8548          */
8549         function Context(options) {
8550
8551             /**
8552              * @property {ElementHandler} parseRoot
8553              */
8554
8555             /**
8556              * @property {Boolean} lax
8557              */
8558
8559             assign(this, options);
8560
8561             var elementsById = this.elementsById = {};
8562             var references = this.references = [];
8563             var warnings = this.warnings = [];
8564
8565             this.addReference = function(reference) {
8566                 references.push(reference);
8567             };
8568
8569             this.addElement = function(id, element) {
8570
8571                 if (!id || !element) {
8572                     throw new Error('[xml-reader] id or ctx must not be null');
8573                 }
8574
8575                 elementsById[id] = element;
8576             };
8577
8578             this.addWarning = function(w) {
8579                 warnings.push(w);
8580             };
8581         }
8582
8583         function BaseHandler() {}
8584
8585         BaseHandler.prototype.handleEnd = function() {};
8586         BaseHandler.prototype.handleText = function() {};
8587         BaseHandler.prototype.handleNode = function() {};
8588
8589
8590         /**
8591          * A simple pass through handler that does nothing except for ignoring all input
8592          * it receives.
8593          * 
8594          * This is used to ignore unknown elements and attributes.
8595          */
8596         function NoopHandler() {}
8597
8598         NoopHandler.prototype = new BaseHandler();
8599
8600         NoopHandler.prototype.handleNode = function() {
8601             return this;
8602         };
8603
8604         function BodyHandler() {}
8605
8606         BodyHandler.prototype = new BaseHandler();
8607
8608         BodyHandler.prototype.handleText = function(text) {
8609             this.body = (this.body || '') + text;
8610         };
8611
8612         function ReferenceHandler(property, context) {
8613             this.property = property;
8614             this.context = context;
8615         }
8616
8617         ReferenceHandler.prototype = new BodyHandler();
8618
8619         ReferenceHandler.prototype.handleNode = function(node) {
8620
8621             if (this.element) {
8622                 throw new Error('expected no sub nodes');
8623             } else {
8624                 this.element = this.createReference(node);
8625             }
8626
8627             return this;
8628         };
8629
8630         ReferenceHandler.prototype.handleEnd = function() {
8631             this.element.id = this.body;
8632         };
8633
8634         ReferenceHandler.prototype.createReference = function() {
8635             return {
8636                 property: this.property.ns.name,
8637                 id: ''
8638             };
8639         };
8640
8641         function ValueHandler(propertyDesc, element) {
8642             this.element = element;
8643             this.propertyDesc = propertyDesc;
8644         }
8645
8646         ValueHandler.prototype = new BodyHandler();
8647
8648         ValueHandler.prototype.handleEnd = function() {
8649
8650             var value = this.body,
8651                 element = this.element,
8652                 propertyDesc = this.propertyDesc;
8653
8654             value = coerceType(propertyDesc.type, value);
8655
8656             if (propertyDesc.isMany) {
8657                 element.get(propertyDesc.name).push(value);
8658             } else {
8659                 element.set(propertyDesc.name, value);
8660             }
8661         };
8662
8663
8664         function BaseElementHandler() {}
8665
8666         BaseElementHandler.prototype = Object.create(BodyHandler.prototype);
8667
8668         BaseElementHandler.prototype.handleNode = function(node) {
8669             var parser = this,
8670                 element = this.element,
8671                 id;
8672
8673             if (!element) {
8674                 element = this.element = this.createElement(node);
8675                 id = element.id;
8676
8677                 if (id) {
8678                     this.context.addElement(id, element);
8679                 }
8680             } else {
8681                 parser = this.handleChild(node);
8682             }
8683
8684             return parser;
8685         };
8686
8687         /**
8688          * @class XMLReader.ElementHandler
8689          * 
8690          */
8691         function ElementHandler(model, type, context) {
8692             this.model = model;
8693             this.type = model.getType(type);
8694             this.context = context;
8695         }
8696
8697         ElementHandler.prototype = new BaseElementHandler();
8698
8699         ElementHandler.prototype.addReference = function(reference) {
8700             this.context.addReference(reference);
8701         };
8702
8703         ElementHandler.prototype.handleEnd = function() {
8704
8705             var value = this.body,
8706                 element = this.element,
8707                 descriptor = element.$descriptor,
8708                 bodyProperty = descriptor.bodyProperty;
8709
8710             if (bodyProperty && value !== undefined) {
8711                 value = coerceType(bodyProperty.type, value);
8712                 element.set(bodyProperty.name, value);
8713             }
8714         };
8715
8716         /**
8717          * Create an instance of the model from the given node.
8718          * 
8719          * @param {Element}
8720          *            node the xml node
8721          */
8722         ElementHandler.prototype.createElement = function(node) {
8723             var attributes = parseNodeAttributes(node),
8724                 Type = this.type,
8725                 descriptor = Type.$descriptor,
8726                 context = this.context,
8727                 instance = new Type({});
8728
8729             forEach(attributes, function(value, name) {
8730
8731                 var prop = descriptor.propertiesByName[name];
8732
8733                 if (prop && prop.isReference) {
8734                     context.addReference({
8735                         element: instance,
8736                         property: prop.ns.name,
8737                         id: value
8738                     });
8739                 } else {
8740                     if (prop) {
8741                         value = coerceType(prop.type, value);
8742                     }
8743
8744                     instance.set(name, value);
8745                 }
8746             });
8747
8748             return instance;
8749         };
8750
8751         ElementHandler.prototype.getPropertyForNode = function(node) {
8752
8753             var nameNs = parseNameNs(node.local, node.prefix);
8754
8755             var type = this.type,
8756                 model = this.model,
8757                 descriptor = type.$descriptor;
8758
8759             var propertyName = nameNs.name,
8760                 property = descriptor.propertiesByName[propertyName],
8761                 elementTypeName,
8762                 elementType,
8763                 typeAnnotation;
8764
8765             // search for properties by name first
8766
8767             if (property) {
8768
8769                 if (property.serialize === XSI_TYPE) {
8770                     typeAnnotation = node.attributes[XSI_TYPE];
8771
8772                     // xsi type is optional, if it does not exists the
8773                     // default type is assumed
8774                     if (typeAnnotation) {
8775
8776                         elementTypeName = typeAnnotation.value;
8777
8778                         // TODO: extract real name from attribute
8779                         elementType = model.getType(elementTypeName);
8780
8781                         return assign({}, property, {
8782                             effectiveType: elementType.$descriptor.name
8783                         });
8784                     }
8785                 }
8786
8787                 // search for properties by name first
8788                 return property;
8789             }
8790
8791
8792             var pkg = model.getPackage(nameNs.prefix);
8793
8794             if (pkg) {
8795                 elementTypeName = nameNs.prefix + ':' + aliasToName(nameNs.localName, descriptor.$pkg);
8796                 elementType = model.getType(elementTypeName);
8797
8798                 // search for collection members later
8799                 property = find(descriptor.properties, function(p) {
8800                     return !p.isVirtual && !p.isReference && !p.isAttribute && elementType.hasType(p.type);
8801                 });
8802
8803                 if (property) {
8804                     return assign({}, property, {
8805                         effectiveType: elementType.$descriptor.name
8806                     });
8807                 }
8808             } else {
8809                 // parse unknown element (maybe extension)
8810                 property = find(descriptor.properties, function(p) {
8811                     return !p.isReference && !p.isAttribute && p.type === 'Element';
8812                 });
8813
8814                 if (property) {
8815                     return property;
8816                 }
8817             }
8818
8819             throw new Error('unrecognized element <' + nameNs.name + '>');
8820         };
8821
8822         ElementHandler.prototype.toString = function() {
8823             return 'ElementDescriptor[' + this.type.$descriptor.name + ']';
8824         };
8825
8826         ElementHandler.prototype.valueHandler = function(propertyDesc, element) {
8827             return new ValueHandler(propertyDesc, element);
8828         };
8829
8830         ElementHandler.prototype.referenceHandler = function(propertyDesc) {
8831             return new ReferenceHandler(propertyDesc, this.context);
8832         };
8833
8834         ElementHandler.prototype.handler = function(type) {
8835             if (type === 'Element') {
8836                 return new GenericElementHandler(this.model, type, this.context);
8837             } else {
8838                 return new ElementHandler(this.model, type, this.context);
8839             }
8840         };
8841
8842         /**
8843          * Handle the child element parsing
8844          * 
8845          * @param {Element}
8846          *            node the xml node
8847          */
8848         ElementHandler.prototype.handleChild = function(node) {
8849             var propertyDesc, type, element, childHandler;
8850
8851             propertyDesc = this.getPropertyForNode(node);
8852             element = this.element;
8853
8854             type = propertyDesc.effectiveType || propertyDesc.type;
8855
8856             if (isSimpleType(type)) {
8857                 return this.valueHandler(propertyDesc, element);
8858             }
8859
8860             if (propertyDesc.isReference) {
8861                 childHandler = this.referenceHandler(propertyDesc).handleNode(node);
8862             } else {
8863                 childHandler = this.handler(type).handleNode(node);
8864             }
8865
8866             var newElement = childHandler.element;
8867
8868             // child handles may decide to skip elements
8869             // by not returning anything
8870             if (newElement !== undefined) {
8871
8872                 if (propertyDesc.isMany) {
8873                     element.get(propertyDesc.name).push(newElement);
8874                 } else {
8875                     element.set(propertyDesc.name, newElement);
8876                 }
8877
8878                 if (propertyDesc.isReference) {
8879                     assign(newElement, {
8880                         element: element
8881                     });
8882
8883                     this.context.addReference(newElement);
8884                 } else {
8885                     // establish child -> parent relationship
8886                     newElement.$parent = element;
8887                 }
8888             }
8889
8890             return childHandler;
8891         };
8892
8893
8894         function GenericElementHandler(model, type, context) {
8895             this.model = model;
8896             this.context = context;
8897         }
8898
8899         GenericElementHandler.prototype = Object.create(BaseElementHandler.prototype);
8900
8901         GenericElementHandler.prototype.createElement = function(node) {
8902
8903             var name = node.name,
8904                 prefix = node.prefix,
8905                 uri = node.ns[prefix],
8906                 attributes = node.attributes;
8907
8908             return this.model.createAny(name, uri, attributes);
8909         };
8910
8911         GenericElementHandler.prototype.handleChild = function(node) {
8912
8913             var handler = new GenericElementHandler(this.model, 'Element', this.context).handleNode(node),
8914                 element = this.element;
8915
8916             var newElement = handler.element,
8917                 children;
8918
8919             if (newElement !== undefined) {
8920                 children = element.$children = element.$children || [];
8921                 children.push(newElement);
8922
8923                 // establish child -> parent relationship
8924                 newElement.$parent = element;
8925             }
8926
8927             return handler;
8928         };
8929
8930         GenericElementHandler.prototype.handleText = function(text) {
8931             this.body = this.body || '' + text;
8932         };
8933
8934         GenericElementHandler.prototype.handleEnd = function() {
8935             if (this.body) {
8936                 this.element.$body = this.body;
8937             }
8938         };
8939
8940         /**
8941          * A reader for a meta-model
8942          * 
8943          * @param {Object}
8944          *            options
8945          * @param {Model}
8946          *            options.model used to read xml files
8947          * @param {Boolean}
8948          *            options.lax whether to make parse errors warnings
8949          */
8950         function XMLReader(options) {
8951
8952             if (options instanceof Moddle) {
8953                 options = {
8954                     model: options
8955                 };
8956             }
8957
8958             assign(this, {
8959                 lax: false
8960             }, options);
8961         }
8962
8963
8964         XMLReader.prototype.fromXML = function(xml, rootHandler, done) {
8965
8966             var model = this.model,
8967                 lax = this.lax,
8968                 context = new Context({
8969                     parseRoot: rootHandler
8970                 });
8971
8972             var parser = new SaxParser(true, {
8973                     xmlns: true,
8974                     trim: true
8975                 }),
8976                 stack = new Stack();
8977
8978             rootHandler.context = context;
8979
8980             // push root handler
8981             stack.push(rootHandler);
8982
8983
8984             function resolveReferences() {
8985
8986                 var elementsById = context.elementsById;
8987                 var references = context.references;
8988
8989                 var i, r;
8990
8991                 for (i = 0; !!(r = references[i]); i++) {
8992                     var element = r.element;
8993                     var reference = elementsById[r.id];
8994                     var property = element.$descriptor.propertiesByName[r.property];
8995
8996                     if (!reference) {
8997                         context.addWarning({
8998                             message: 'unresolved reference <' + r.id + '>',
8999                             element: r.element,
9000                             property: r.property,
9001                             value: r.id
9002                         });
9003                     }
9004
9005                     if (property.isMany) {
9006                         var collection = element.get(property.name),
9007                             idx = collection.indexOf(r);
9008
9009                         if (!reference) {
9010                             // remove unresolvable reference
9011                             collection.splice(idx, 1);
9012                         } else {
9013                             // update reference
9014                             collection[idx] = reference;
9015                         }
9016                     } else {
9017                         element.set(property.name, reference);
9018                     }
9019                 }
9020             }
9021
9022             function handleClose(tagName) {
9023                 stack.pop().handleEnd();
9024             }
9025
9026             function handleOpen(node) {
9027                 var handler = stack.peek();
9028
9029                 normalizeNamespaces(node, model);
9030
9031                 try {
9032                     stack.push(handler.handleNode(node));
9033                 } catch (e) {
9034
9035                     var line = this.line,
9036                         column = this.column;
9037
9038                     var message =
9039                         'unparsable content <' + node.name + '> detected\n\t' +
9040                         'line: ' + line + '\n\t' +
9041                         'column: ' + column + '\n\t' +
9042                         'nested error: ' + e.message;
9043
9044                     if (lax) {
9045                         context.addWarning({
9046                             message: message,
9047                             error: e
9048                         });
9049
9050                         console.warn('could not parse node');
9051                         console.warn(e);
9052
9053                         stack.push(new NoopHandler());
9054                     } else {
9055                         console.error('could not parse document');
9056                         console.error(e);
9057
9058                         throw new Error(message);
9059                     }
9060                 }
9061             }
9062
9063             function handleText(text) {
9064                 stack.peek().handleText(text);
9065             }
9066
9067             parser.onopentag = handleOpen;
9068             parser.oncdata = parser.ontext = handleText;
9069             parser.onclosetag = handleClose;
9070             parser.onend = resolveReferences;
9071
9072             // deferred parse XML to make loading really ascnchronous
9073             // this ensures the execution environment (node or browser)
9074             // is kept responsive and that certain optimization strategies
9075             // can kick in
9076             defer(function() {
9077                 var error;
9078
9079                 try {
9080                     parser.write(xml).close();
9081                 } catch (e) {
9082                     error = e;
9083                 }
9084
9085                 done(error, error ? undefined : rootHandler.element, context);
9086             });
9087         };
9088
9089         XMLReader.prototype.handler = function(name) {
9090             return new ElementHandler(this.model, name);
9091         };
9092
9093         module.exports = XMLReader;
9094         module.exports.ElementHandler = ElementHandler;
9095     }, {
9096         "./common": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle-xml\\lib\\common.js",
9097         "lodash/collection/find": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\find.js",
9098         "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
9099         "lodash/collection/reduce": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\reduce.js",
9100         "lodash/function/defer": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\function\\defer.js",
9101         "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js",
9102         "moddle": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle\\index.js",
9103         "moddle/lib/ns": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle\\lib\\ns.js",
9104         "moddle/lib/types": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle\\lib\\types.js",
9105         "sax": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle-xml\\node_modules\\sax\\lib\\sax.js",
9106         "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"
9107     }],
9108     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle-xml\\lib\\writer.js": [function(require, module, exports) {
9109         'use strict';
9110
9111         var map = require('lodash/collection/map'),
9112             forEach = require('lodash/collection/forEach'),
9113             isString = require('lodash/lang/isString'),
9114             filter = require('lodash/collection/filter'),
9115             assign = require('lodash/object/assign');
9116
9117         var Types = require('moddle/lib/types'),
9118             parseNameNs = require('moddle/lib/ns').parseName,
9119             common = require('./common'),
9120             nameToAlias = common.nameToAlias;
9121
9122         var XML_PREAMBLE = '<?xml version="1.0" encoding="UTF-8"?>\n',
9123             ESCAPE_CHARS = /(<|>|'|"|&|\n\r|\n)/g,
9124             DEFAULT_NS_MAP = common.DEFAULT_NS_MAP,
9125             XSI_TYPE = common.XSI_TYPE;
9126
9127
9128         function nsName(ns) {
9129             if (isString(ns)) {
9130                 return ns;
9131             } else {
9132                 return (ns.prefix ? ns.prefix + ':' : '') + ns.localName;
9133             }
9134         }
9135
9136         function getElementNs(ns, descriptor) {
9137             if (descriptor.isGeneric) {
9138                 return descriptor.name;
9139             } else {
9140                 return assign({
9141                     localName: nameToAlias(descriptor.ns.localName, descriptor.$pkg)
9142                 }, ns);
9143             }
9144         }
9145
9146         function getPropertyNs(ns, descriptor) {
9147             return assign({
9148                 localName: descriptor.ns.localName
9149             }, ns);
9150         }
9151
9152         function getSerializableProperties(element) {
9153             var descriptor = element.$descriptor;
9154
9155             return filter(descriptor.properties, function(p) {
9156                 var name = p.name;
9157
9158                 // do not serialize defaults
9159                 if (!element.hasOwnProperty(name)) {
9160                     return false;
9161                 }
9162
9163                 var value = element[name];
9164
9165                 // do not serialize default equals
9166                 if (value === p.default) {
9167                     return false;
9168                 }
9169
9170                 return p.isMany ? value.length : true;
9171             });
9172         }
9173
9174         var ESCAPE_MAP = {
9175             '\n': '10',
9176             '\n\r': '10',
9177             '"': '34',
9178             '\'': '39',
9179             '<': '60',
9180             '>': '62',
9181             '&': '38'
9182         };
9183
9184         /**
9185          * Escape a string attribute to not contain any bad values (line breaks, '"',
9186          * ...)
9187          * 
9188          * @param {String}
9189          *            str the string to escape
9190          * @return {String} the escaped string
9191          */
9192         function escapeAttr(str) {
9193
9194             // ensure we are handling strings here
9195             str = isString(str) ? str : '' + str;
9196
9197             return str.replace(ESCAPE_CHARS, function(str) {
9198                 return '&#' + ESCAPE_MAP[str] + ';';
9199             });
9200         }
9201
9202         function filterAttributes(props) {
9203             return filter(props, function(p) {
9204                 return p.isAttr;
9205             });
9206         }
9207
9208         function filterContained(props) {
9209             return filter(props, function(p) {
9210                 return !p.isAttr;
9211             });
9212         }
9213
9214
9215         function ReferenceSerializer(parent, ns) {
9216             this.ns = ns;
9217         }
9218
9219         ReferenceSerializer.prototype.build = function(element) {
9220             this.element = element;
9221             return this;
9222         };
9223
9224         ReferenceSerializer.prototype.serializeTo = function(writer) {
9225             writer
9226                 .appendIndent()
9227                 .append('<' + nsName(this.ns) + '>' + this.element.id + '</' + nsName(this.ns) + '>')
9228                 .appendNewLine();
9229         };
9230
9231         function BodySerializer() {}
9232
9233         BodySerializer.prototype.serializeValue = BodySerializer.prototype.serializeTo = function(writer) {
9234             var escape = this.escape;
9235
9236             if (escape) {
9237                 writer.append('<![CDATA[');
9238             }
9239
9240             writer.append(this.value);
9241
9242             if (escape) {
9243                 writer.append(']]>');
9244             }
9245         };
9246
9247         BodySerializer.prototype.build = function(prop, value) {
9248             this.value = value;
9249
9250             if (prop.type === 'String' && ESCAPE_CHARS.test(value)) {
9251                 this.escape = true;
9252             }
9253
9254             return this;
9255         };
9256
9257         function ValueSerializer(ns) {
9258             this.ns = ns;
9259         }
9260
9261         ValueSerializer.prototype = new BodySerializer();
9262
9263         ValueSerializer.prototype.serializeTo = function(writer) {
9264
9265             writer
9266                 .appendIndent()
9267                 .append('<' + nsName(this.ns) + '>');
9268
9269             this.serializeValue(writer);
9270
9271             writer
9272                 .append('</' + nsName(this.ns) + '>')
9273                 .appendNewLine();
9274         };
9275
9276         function ElementSerializer(parent, ns) {
9277             this.body = [];
9278             this.attrs = [];
9279
9280             this.parent = parent;
9281             this.ns = ns;
9282         }
9283
9284         ElementSerializer.prototype.build = function(element) {
9285             this.element = element;
9286
9287             var otherAttrs = this.parseNsAttributes(element);
9288
9289             if (!this.ns) {
9290                 this.ns = this.nsTagName(element.$descriptor);
9291             }
9292
9293             if (element.$descriptor.isGeneric) {
9294                 this.parseGeneric(element);
9295             } else {
9296                 var properties = getSerializableProperties(element);
9297
9298                 this.parseAttributes(filterAttributes(properties));
9299                 this.parseContainments(filterContained(properties));
9300
9301                 this.parseGenericAttributes(element, otherAttrs);
9302             }
9303
9304             return this;
9305         };
9306
9307         ElementSerializer.prototype.nsTagName = function(descriptor) {
9308             var effectiveNs = this.logNamespaceUsed(descriptor.ns);
9309             return getElementNs(effectiveNs, descriptor);
9310         };
9311
9312         ElementSerializer.prototype.nsPropertyTagName = function(descriptor) {
9313             var effectiveNs = this.logNamespaceUsed(descriptor.ns);
9314             return getPropertyNs(effectiveNs, descriptor);
9315         };
9316
9317         ElementSerializer.prototype.isLocalNs = function(ns) {
9318             return ns.uri === this.ns.uri;
9319         };
9320
9321         ElementSerializer.prototype.nsAttributeName = function(element) {
9322
9323             var ns;
9324
9325             if (isString(element)) {
9326                 ns = parseNameNs(element);
9327             } else
9328             if (element.ns) {
9329                 ns = element.ns;
9330             }
9331
9332             var effectiveNs = this.logNamespaceUsed(ns);
9333
9334             // strip prefix if same namespace like parent
9335             if (this.isLocalNs(effectiveNs)) {
9336                 return {
9337                     localName: ns.localName
9338                 };
9339             } else {
9340                 return assign({
9341                     localName: ns.localName
9342                 }, effectiveNs);
9343             }
9344         };
9345
9346         ElementSerializer.prototype.parseGeneric = function(element) {
9347
9348             var self = this,
9349                 body = this.body,
9350                 attrs = this.attrs;
9351
9352             forEach(element, function(val, key) {
9353
9354                 if (key === '$body') {
9355                     body.push(new BodySerializer().build({
9356                         type: 'String'
9357                     }, val));
9358                 } else
9359                 if (key === '$children') {
9360                     forEach(val, function(child) {
9361                         body.push(new ElementSerializer(self).build(child));
9362                     });
9363                 } else
9364                 if (key.indexOf('$') !== 0) {
9365                     attrs.push({
9366                         name: key,
9367                         value: escapeAttr(val)
9368                     });
9369                 }
9370             });
9371         };
9372
9373         /**
9374          * Parse namespaces and return a list of left over generic attributes
9375          * 
9376          * @param {Object}
9377          *            element
9378          * @return {Array<Object>}
9379          */
9380         ElementSerializer.prototype.parseNsAttributes = function(element) {
9381             var self = this;
9382
9383             var genericAttrs = element.$attrs;
9384
9385             var attributes = [];
9386
9387             // parse namespace attributes first
9388             // and log them. push non namespace attributes to a list
9389             // and process them later
9390             forEach(genericAttrs, function(value, name) {
9391                 var nameNs = parseNameNs(name);
9392
9393                 if (nameNs.prefix === 'xmlns') {
9394                     self.logNamespace({
9395                         prefix: nameNs.localName,
9396                         uri: value
9397                     });
9398                 } else
9399                 if (!nameNs.prefix && nameNs.localName === 'xmlns') {
9400                     self.logNamespace({
9401                         uri: value
9402                     });
9403                 } else {
9404                     attributes.push({
9405                         name: name,
9406                         value: value
9407                     });
9408                 }
9409             });
9410
9411             return attributes;
9412         };
9413
9414         ElementSerializer.prototype.parseGenericAttributes = function(element, attributes) {
9415
9416             var self = this;
9417
9418             forEach(attributes, function(attr) {
9419
9420                 // do not serialize xsi:type attribute
9421                 // it is set manually based on the actual implementation type
9422                 if (attr.name === XSI_TYPE) {
9423                     return;
9424                 }
9425
9426                 try {
9427                     self.addAttribute(self.nsAttributeName(attr.name), attr.value);
9428                 } catch (e) {
9429                     console.warn('[writer] missing namespace information for ', attr.name, '=', attr.value, 'on', element, e);
9430                 }
9431             });
9432         };
9433
9434         ElementSerializer.prototype.parseContainments = function(properties) {
9435
9436             var self = this,
9437                 body = this.body,
9438                 element = this.element;
9439
9440             forEach(properties, function(p) {
9441                 var value = element.get(p.name),
9442                     isReference = p.isReference,
9443                     isMany = p.isMany;
9444
9445                 var ns = self.nsPropertyTagName(p);
9446
9447                 if (!isMany) {
9448                     value = [value];
9449                 }
9450
9451                 if (p.isBody) {
9452                     body.push(new BodySerializer().build(p, value[0]));
9453                 } else
9454                 if (Types.isSimple(p.type)) {
9455                     forEach(value, function(v) {
9456                         body.push(new ValueSerializer(ns).build(p, v));
9457                     });
9458                 } else
9459                 if (isReference) {
9460                     forEach(value, function(v) {
9461                         body.push(new ReferenceSerializer(self, ns).build(v));
9462                     });
9463                 } else {
9464                     // allow serialization via type
9465                     // rather than element name
9466                     var asType = p.serialize === XSI_TYPE;
9467
9468                     forEach(value, function(v) {
9469                         var serializer;
9470
9471                         if (asType) {
9472                             serializer = new TypeSerializer(self, ns);
9473                         } else {
9474                             serializer = new ElementSerializer(self);
9475                         }
9476
9477                         body.push(serializer.build(v));
9478                     });
9479                 }
9480             });
9481         };
9482
9483         ElementSerializer.prototype.getNamespaces = function() {
9484             if (!this.parent) {
9485                 if (!this.namespaces) {
9486                     this.namespaces = {
9487                         prefixMap: {},
9488                         uriMap: {},
9489                         used: {}
9490                     };
9491                 }
9492             } else {
9493                 this.namespaces = this.parent.getNamespaces();
9494             }
9495
9496             return this.namespaces;
9497         };
9498
9499         ElementSerializer.prototype.logNamespace = function(ns) {
9500             var namespaces = this.getNamespaces();
9501
9502             var existing = namespaces.uriMap[ns.uri];
9503
9504             if (!existing) {
9505                 namespaces.uriMap[ns.uri] = ns;
9506             }
9507
9508             namespaces.prefixMap[ns.prefix] = ns.uri;
9509
9510             return ns;
9511         };
9512
9513         ElementSerializer.prototype.logNamespaceUsed = function(ns) {
9514             var element = this.element,
9515                 model = element.$model,
9516                 namespaces = this.getNamespaces();
9517
9518             // ns may be
9519             //
9520             // * prefix only
9521             // * prefix:uri
9522
9523             var prefix = ns.prefix;
9524             var uri = ns.uri || DEFAULT_NS_MAP[prefix] ||
9525                 namespaces.prefixMap[prefix] || (model ? (model.getPackage(prefix) || {}).uri : null);
9526
9527             if (!uri) {
9528                 throw new Error('no namespace uri given for prefix <' + ns.prefix + '>');
9529             }
9530
9531             ns = namespaces.uriMap[uri];
9532
9533             if (!ns) {
9534                 ns = this.logNamespace({
9535                     prefix: prefix,
9536                     uri: uri
9537                 });
9538             }
9539
9540             if (!namespaces.used[ns.uri]) {
9541                 namespaces.used[ns.uri] = ns;
9542             }
9543
9544             return ns;
9545         };
9546
9547         ElementSerializer.prototype.parseAttributes = function(properties) {
9548             var self = this,
9549                 element = this.element;
9550
9551             forEach(properties, function(p) {
9552                 self.logNamespaceUsed(p.ns);
9553
9554                 var value = element.get(p.name);
9555
9556                 if (p.isReference) {
9557                     value = value.id;
9558                 }
9559
9560                 self.addAttribute(self.nsAttributeName(p), value);
9561             });
9562         };
9563
9564         ElementSerializer.prototype.addAttribute = function(name, value) {
9565             var attrs = this.attrs;
9566
9567             if (isString(value)) {
9568                 value = escapeAttr(value);
9569             }
9570
9571             attrs.push({
9572                 name: name,
9573                 value: value
9574             });
9575         };
9576
9577         ElementSerializer.prototype.serializeAttributes = function(writer) {
9578             var attrs = this.attrs,
9579                 root = !this.parent,
9580                 namespaces = this.namespaces;
9581
9582             function collectNsAttrs() {
9583                 return map(namespaces.used, function(ns) {
9584                     var name = 'xmlns' + (ns.prefix ? ':' + ns.prefix : '');
9585                     return {
9586                         name: name,
9587                         value: ns.uri
9588                     };
9589                 });
9590             }
9591
9592             if (root) {
9593                 attrs = collectNsAttrs().concat(attrs);
9594             }
9595
9596             forEach(attrs, function(a) {
9597                 writer
9598                     .append(' ')
9599                     .append(nsName(a.name)).append('="').append(a.value).append('"');
9600             });
9601         };
9602
9603         ElementSerializer.prototype.serializeTo = function(writer) {
9604             var hasBody = this.body.length,
9605                 indent = !(this.body.length === 1 && this.body[0] instanceof BodySerializer);
9606
9607             writer
9608                 .appendIndent()
9609                 .append('<' + nsName(this.ns));
9610
9611             this.serializeAttributes(writer);
9612
9613             writer.append(hasBody ? '>' : ' />');
9614
9615             if (hasBody) {
9616
9617                 if (indent) {
9618                     writer
9619                         .appendNewLine()
9620                         .indent();
9621                 }
9622
9623                 forEach(this.body, function(b) {
9624                     b.serializeTo(writer);
9625                 });
9626
9627                 if (indent) {
9628                     writer
9629                         .unindent()
9630                         .appendIndent();
9631                 }
9632
9633                 writer.append('</' + nsName(this.ns) + '>');
9634             }
9635
9636             writer.appendNewLine();
9637         };
9638
9639         /**
9640          * A serializer for types that handles serialization of data types
9641          */
9642         function TypeSerializer(parent, ns) {
9643             ElementSerializer.call(this, parent, ns);
9644         }
9645
9646         TypeSerializer.prototype = new ElementSerializer();
9647
9648         TypeSerializer.prototype.build = function(element) {
9649             var descriptor = element.$descriptor;
9650
9651             this.element = element;
9652
9653             this.typeNs = this.nsTagName(descriptor);
9654
9655             // add xsi:type attribute to represent the elements
9656             // actual type
9657
9658             var typeNs = this.typeNs,
9659                 pkg = element.$model.getPackage(typeNs.uri),
9660                 typePrefix = (pkg.xml && pkg.xml.typePrefix) || '';
9661
9662             this.addAttribute(this.nsAttributeName(XSI_TYPE), (typeNs.prefix ? typeNs.prefix + ':' : '') +
9663                 typePrefix + descriptor.ns.localName);
9664
9665             // do the usual stuff
9666             return ElementSerializer.prototype.build.call(this, element);
9667         };
9668
9669         TypeSerializer.prototype.isLocalNs = function(ns) {
9670             return ns.uri === this.typeNs.uri;
9671         };
9672
9673         function SavingWriter() {
9674             this.value = '';
9675
9676             this.write = function(str) {
9677                 this.value += str;
9678             };
9679         }
9680
9681         function FormatingWriter(out, format) {
9682
9683             var indent = [''];
9684
9685             this.append = function(str) {
9686                 out.write(str);
9687
9688                 return this;
9689             };
9690
9691             this.appendNewLine = function() {
9692                 if (format) {
9693                     out.write('\n');
9694                 }
9695
9696                 return this;
9697             };
9698
9699             this.appendIndent = function() {
9700                 if (format) {
9701                     out.write(indent.join('  '));
9702                 }
9703
9704                 return this;
9705             };
9706
9707             this.indent = function() {
9708                 indent.push('');
9709                 return this;
9710             };
9711
9712             this.unindent = function() {
9713                 indent.pop();
9714                 return this;
9715             };
9716         }
9717
9718         /**
9719          * A writer for meta-model backed document trees
9720          * 
9721          * @param {Object}
9722          *            options output options to pass into the writer
9723          */
9724         function XMLWriter(options) {
9725
9726             options = assign({
9727                 format: false,
9728                 preamble: true
9729             }, options || {});
9730
9731             function toXML(tree, writer) {
9732                 var internalWriter = writer || new SavingWriter();
9733                 var formatingWriter = new FormatingWriter(internalWriter, options.format);
9734
9735                 if (options.preamble) {
9736                     formatingWriter.append(XML_PREAMBLE);
9737                 }
9738
9739                 new ElementSerializer().build(tree).serializeTo(formatingWriter);
9740
9741                 if (!writer) {
9742                     return internalWriter.value;
9743                 }
9744             }
9745
9746             return {
9747                 toXML: toXML
9748             };
9749         }
9750
9751         module.exports = XMLWriter;
9752     }, {
9753         "./common": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle-xml\\lib\\common.js",
9754         "lodash/collection/filter": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\filter.js",
9755         "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
9756         "lodash/collection/map": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\map.js",
9757         "lodash/lang/isString": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isString.js",
9758         "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js",
9759         "moddle/lib/ns": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle\\lib\\ns.js",
9760         "moddle/lib/types": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle\\lib\\types.js"
9761     }],
9762     "\\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) {
9763         (function(Buffer) {
9764             // wrapper for non-node envs
9765             ;
9766             (function(sax) {
9767
9768                 sax.parser = function(strict, opt) {
9769                     return new SAXParser(strict, opt)
9770                 }
9771                 sax.SAXParser = SAXParser
9772                 sax.SAXStream = SAXStream
9773                 sax.createStream = createStream
9774
9775                 // When we pass the MAX_BUFFER_LENGTH position, start checking for buffer
9776                 // overruns.
9777                 // When we check, schedule the next check for MAX_BUFFER_LENGTH - (max(buffer
9778                 // lengths)),
9779                 // since that's the earliest that a buffer overrun could occur. This way, checks
9780                 // are
9781                 // as rare as required, but as often as necessary to ensure never crossing this
9782                 // bound.
9783                 // Furthermore, buffers are only tested at most once per write(), so passing a
9784                 // very
9785                 // large string into write() might have undesirable effects, but this is
9786                 // manageable by
9787                 // the caller, so it is assumed to be safe. Thus, a call to write() may, in the
9788                 // extreme
9789                 // edge case, result in creating at most one complete copy of the string passed
9790                 // in.
9791                 // Set to Infinity to have unlimited buffers.
9792                 sax.MAX_BUFFER_LENGTH = 64 * 1024
9793
9794                 var buffers = [
9795                     "comment", "sgmlDecl", "textNode", "tagName", "doctype",
9796                     "procInstName", "procInstBody", "entity", "attribName",
9797                     "attribValue", "cdata", "script"
9798                 ]
9799
9800                 sax.EVENTS = // for discoverability.
9801                     ["text", "processinginstruction", "sgmldeclaration", "doctype", "comment", "attribute", "opentag", "closetag", "opencdata", "cdata", "closecdata", "error", "end", "ready", "script", "opennamespace", "closenamespace"]
9802
9803                 function SAXParser(strict, opt) {
9804                     if (!(this instanceof SAXParser)) return new SAXParser(strict, opt)
9805
9806                     var parser = this
9807                     clearBuffers(parser)
9808                     parser.q = parser.c = ""
9809                     parser.bufferCheckPosition = sax.MAX_BUFFER_LENGTH
9810                     parser.opt = opt || {}
9811                     parser.opt.lowercase = parser.opt.lowercase || parser.opt.lowercasetags
9812                     parser.looseCase = parser.opt.lowercase ? "toLowerCase" : "toUpperCase"
9813                     parser.tags = []
9814                     parser.closed = parser.closedRoot = parser.sawRoot = false
9815                     parser.tag = parser.error = null
9816                     parser.strict = !!strict
9817                     parser.noscript = !!(strict || parser.opt.noscript)
9818                     parser.state = S.BEGIN
9819                     parser.ENTITIES = Object.create(sax.ENTITIES)
9820                     parser.attribList = []
9821
9822                     // namespaces form a prototype chain.
9823                     // it always points at the current tag,
9824                     // which protos to its parent tag.
9825                     if (parser.opt.xmlns) parser.ns = Object.create(rootNS)
9826
9827                     // mostly just for error reporting
9828                     parser.trackPosition = parser.opt.position !== false
9829                     if (parser.trackPosition) {
9830                         parser.position = parser.line = parser.column = 0
9831                     }
9832                     emit(parser, "onready")
9833                 }
9834
9835                 if (!Object.create) Object.create = function(o) {
9836                     function f() {
9837                         this.__proto__ = o
9838                     }
9839                     f.prototype = o
9840                     return new f
9841                 }
9842
9843                 if (!Object.getPrototypeOf) Object.getPrototypeOf = function(o) {
9844                     return o.__proto__
9845                 }
9846
9847                 if (!Object.keys) Object.keys = function(o) {
9848                     var a = []
9849                     for (var i in o)
9850                         if (o.hasOwnProperty(i)) a.push(i)
9851                     return a
9852                 }
9853
9854                 function checkBufferLength(parser) {
9855                     var maxAllowed = Math.max(sax.MAX_BUFFER_LENGTH, 10),
9856                         maxActual = 0
9857                     for (var i = 0, l = buffers.length; i < l; i++) {
9858                         var len = parser[buffers[i]].length
9859                         if (len > maxAllowed) {
9860                             // Text/cdata nodes can get big, and since they're buffered,
9861                             // we can get here under normal conditions.
9862                             // Avoid issues by emitting the text node now,
9863                             // so at least it won't get any bigger.
9864                             switch (buffers[i]) {
9865                                 case "textNode":
9866                                     closeText(parser)
9867                                     break
9868
9869                                 case "cdata":
9870                                     emitNode(parser, "oncdata", parser.cdata)
9871                                     parser.cdata = ""
9872                                     break
9873
9874                                 case "script":
9875                                     emitNode(parser, "onscript", parser.script)
9876                                     parser.script = ""
9877                                     break
9878
9879                                 default:
9880                                     error(parser, "Max buffer length exceeded: " + buffers[i])
9881                             }
9882                         }
9883                         maxActual = Math.max(maxActual, len)
9884                     }
9885                     // schedule the next check for the earliest possible buffer overrun.
9886                     parser.bufferCheckPosition = (sax.MAX_BUFFER_LENGTH - maxActual) + parser.position
9887                 }
9888
9889                 function clearBuffers(parser) {
9890                     for (var i = 0, l = buffers.length; i < l; i++) {
9891                         parser[buffers[i]] = ""
9892                     }
9893                 }
9894
9895                 function flushBuffers(parser) {
9896                     closeText(parser)
9897                     if (parser.cdata !== "") {
9898                         emitNode(parser, "oncdata", parser.cdata)
9899                         parser.cdata = ""
9900                     }
9901                     if (parser.script !== "") {
9902                         emitNode(parser, "onscript", parser.script)
9903                         parser.script = ""
9904                     }
9905                 }
9906
9907                 SAXParser.prototype = {
9908                     end: function() {
9909                         end(this)
9910                     },
9911                     write: write,
9912                     resume: function() {
9913                         this.error = null;
9914                         return this
9915                     },
9916                     close: function() {
9917                         return this.write(null)
9918                     },
9919                     flush: function() {
9920                         flushBuffers(this)
9921                     }
9922                 }
9923
9924                 try {
9925                     var Stream = require("stream").Stream
9926                 } catch (ex) {
9927                     var Stream = function() {}
9928                 }
9929
9930
9931                 var streamWraps = sax.EVENTS.filter(function(ev) {
9932                     return ev !== "error" && ev !== "end"
9933                 })
9934
9935                 function createStream(strict, opt) {
9936                     return new SAXStream(strict, opt)
9937                 }
9938
9939                 function SAXStream(strict, opt) {
9940                     if (!(this instanceof SAXStream)) return new SAXStream(strict, opt)
9941
9942                     Stream.apply(this)
9943
9944                     this._parser = new SAXParser(strict, opt)
9945                     this.writable = true
9946                     this.readable = true
9947
9948
9949                     var me = this
9950
9951                     this._parser.onend = function() {
9952                         me.emit("end")
9953                     }
9954
9955                     this._parser.onerror = function(er) {
9956                         me.emit("error", er)
9957
9958                         // if didn't throw, then means error was handled.
9959                         // go ahead and clear error, so we can write again.
9960                         me._parser.error = null
9961                     }
9962
9963                     this._decoder = null;
9964
9965                     streamWraps.forEach(function(ev) {
9966                         Object.defineProperty(me, "on" + ev, {
9967                             get: function() {
9968                                 return me._parser["on" + ev]
9969                             },
9970                             set: function(h) {
9971                                 if (!h) {
9972                                     me.removeAllListeners(ev)
9973                                     return me._parser["on" + ev] = h
9974                                 }
9975                                 me.on(ev, h)
9976                             },
9977                             enumerable: true,
9978                             configurable: false
9979                         })
9980                     })
9981                 }
9982
9983                 SAXStream.prototype = Object.create(Stream.prototype, {
9984                     constructor: {
9985                         value: SAXStream
9986                     }
9987                 })
9988
9989                 SAXStream.prototype.write = function(data) {
9990                     if (typeof Buffer === 'function' &&
9991                         typeof Buffer.isBuffer === 'function' &&
9992                         Buffer.isBuffer(data)) {
9993                         if (!this._decoder) {
9994                             var SD = require('string_decoder').StringDecoder
9995                             this._decoder = new SD('utf8')
9996                         }
9997                         data = this._decoder.write(data);
9998                     }
9999
10000                     this._parser.write(data.toString())
10001                     this.emit("data", data)
10002                     return true
10003                 }
10004
10005                 SAXStream.prototype.end = function(chunk) {
10006                     if (chunk && chunk.length) this.write(chunk)
10007                     this._parser.end()
10008                     return true
10009                 }
10010
10011                 SAXStream.prototype.on = function(ev, handler) {
10012                     var me = this
10013                     if (!me._parser["on" + ev] && streamWraps.indexOf(ev) !== -1) {
10014                         me._parser["on" + ev] = function() {
10015                             var args = arguments.length === 1 ? [arguments[0]] : Array.apply(null, arguments)
10016                             args.splice(0, 0, ev)
10017                             me.emit.apply(me, args)
10018                         }
10019                     }
10020
10021                     return Stream.prototype.on.call(me, ev, handler)
10022                 }
10023
10024
10025
10026                 // character classes and tokens
10027                 var whitespace = "\r\n\t "
10028                     // this really needs to be replaced with character classes.
10029                     // XML allows all manner of ridiculous numbers and digits.
10030                     ,
10031                     number = "0124356789",
10032                     letter = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
10033                     // (Letter | "_" | ":")
10034                     ,
10035                     quote = "'\"",
10036                     entity = number + letter + "#",
10037                     attribEnd = whitespace + ">",
10038                     CDATA = "[CDATA[",
10039                     DOCTYPE = "DOCTYPE",
10040                     XML_NAMESPACE = "http://www.w3.org/XML/1998/namespace",
10041                     XMLNS_NAMESPACE = "http://www.w3.org/2000/xmlns/",
10042                     rootNS = {
10043                         xml: XML_NAMESPACE,
10044                         xmlns: XMLNS_NAMESPACE
10045                     }
10046
10047                 // turn all the string character sets into character class objects.
10048                 whitespace = charClass(whitespace)
10049                 number = charClass(number)
10050                 letter = charClass(letter)
10051
10052                 // http://www.w3.org/TR/REC-xml/#NT-NameStartChar
10053                 // This implementation works on strings, a single character at a time
10054                 // as such, it cannot ever support astral-plane characters (10000-EFFFF)
10055                 // without a significant breaking change to either this parser, or the
10056                 // JavaScript language. Implementation of an emoji-capable xml parser
10057                 // is left as an exercise for the reader.
10058                 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]/
10059
10060                 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-]/
10061
10062                 quote = charClass(quote)
10063                 entity = charClass(entity)
10064                 attribEnd = charClass(attribEnd)
10065
10066                 function charClass(str) {
10067                     return str.split("").reduce(function(s, c) {
10068                         s[c] = true
10069                         return s
10070                     }, {})
10071                 }
10072
10073                 function isRegExp(c) {
10074                     return Object.prototype.toString.call(c) === '[object RegExp]'
10075                 }
10076
10077                 function is(charclass, c) {
10078                     return isRegExp(charclass) ? !!c.match(charclass) : charclass[c]
10079                 }
10080
10081                 function not(charclass, c) {
10082                     return !is(charclass, c)
10083                 }
10084
10085                 var S = 0
10086                 sax.STATE = {
10087                     BEGIN: S++,
10088                     TEXT: S++ // general stuff
10089                         ,
10090                     TEXT_ENTITY: S++ // &amp and such.
10091                         ,
10092                     OPEN_WAKA: S++ // <
10093                         ,
10094                     SGML_DECL: S++ // <!BLARG
10095                         ,
10096                     SGML_DECL_QUOTED: S++ // <!BLARG foo "bar
10097                         ,
10098                     DOCTYPE: S++ // <!DOCTYPE
10099                         ,
10100                     DOCTYPE_QUOTED: S++ // <!DOCTYPE "//blah
10101                         ,
10102                     DOCTYPE_DTD: S++ // <!DOCTYPE "//blah" [ ...
10103                         ,
10104                     DOCTYPE_DTD_QUOTED: S++ // <!DOCTYPE "//blah" [ "foo
10105                         ,
10106                     COMMENT_STARTING: S++ // <!-
10107                         ,
10108                     COMMENT: S++ // <!--
10109                         ,
10110                     COMMENT_ENDING: S++ // <!-- blah -
10111                         ,
10112                     COMMENT_ENDED: S++ // <!-- blah --
10113                         ,
10114                     CDATA: S++ // <![CDATA[ something
10115                         ,
10116                     CDATA_ENDING: S++ // ]
10117                         ,
10118                     CDATA_ENDING_2: S++ // ]]
10119                         ,
10120                     PROC_INST: S++ // <?hi
10121                         ,
10122                     PROC_INST_BODY: S++ // <?hi there
10123                         ,
10124                     PROC_INST_ENDING: S++ // <?hi "there" ?
10125                         ,
10126                     OPEN_TAG: S++ // <strong
10127                         ,
10128                     OPEN_TAG_SLASH: S++ // <strong /
10129                         ,
10130                     ATTRIB: S++ // <a
10131                         ,
10132                     ATTRIB_NAME: S++ // <a foo
10133                         ,
10134                     ATTRIB_NAME_SAW_WHITE: S++ // <a foo _
10135                         ,
10136                     ATTRIB_VALUE: S++ // <a foo=
10137                         ,
10138                     ATTRIB_VALUE_QUOTED: S++ // <a foo="bar
10139                         ,
10140                     ATTRIB_VALUE_CLOSED: S++ // <a foo="bar"
10141                         ,
10142                     ATTRIB_VALUE_UNQUOTED: S++ // <a foo=bar
10143                         ,
10144                     ATTRIB_VALUE_ENTITY_Q: S++ // <foo bar="&quot;"
10145                         ,
10146                     ATTRIB_VALUE_ENTITY_U: S++ // <foo bar=&quot;
10147                         ,
10148                     CLOSE_TAG: S++ // </a
10149                         ,
10150                     CLOSE_TAG_SAW_WHITE: S++ // </a >
10151                         ,
10152                     SCRIPT: S++ // <script> ...
10153                         ,
10154                     SCRIPT_ENDING: S++ // <script> ... <
10155                 }
10156
10157                 sax.ENTITIES = {
10158                     "amp": "&",
10159                     "gt": ">",
10160                     "lt": "<",
10161                     "quot": "\"",
10162                     "apos": "'",
10163                     "AElig": 198,
10164                     "Aacute": 193,
10165                     "Acirc": 194,
10166                     "Agrave": 192,
10167                     "Aring": 197,
10168                     "Atilde": 195,
10169                     "Auml": 196,
10170                     "Ccedil": 199,
10171                     "ETH": 208,
10172                     "Eacute": 201,
10173                     "Ecirc": 202,
10174                     "Egrave": 200,
10175                     "Euml": 203,
10176                     "Iacute": 205,
10177                     "Icirc": 206,
10178                     "Igrave": 204,
10179                     "Iuml": 207,
10180                     "Ntilde": 209,
10181                     "Oacute": 211,
10182                     "Ocirc": 212,
10183                     "Ograve": 210,
10184                     "Oslash": 216,
10185                     "Otilde": 213,
10186                     "Ouml": 214,
10187                     "THORN": 222,
10188                     "Uacute": 218,
10189                     "Ucirc": 219,
10190                     "Ugrave": 217,
10191                     "Uuml": 220,
10192                     "Yacute": 221,
10193                     "aacute": 225,
10194                     "acirc": 226,
10195                     "aelig": 230,
10196                     "agrave": 224,
10197                     "aring": 229,
10198                     "atilde": 227,
10199                     "auml": 228,
10200                     "ccedil": 231,
10201                     "eacute": 233,
10202                     "ecirc": 234,
10203                     "egrave": 232,
10204                     "eth": 240,
10205                     "euml": 235,
10206                     "iacute": 237,
10207                     "icirc": 238,
10208                     "igrave": 236,
10209                     "iuml": 239,
10210                     "ntilde": 241,
10211                     "oacute": 243,
10212                     "ocirc": 244,
10213                     "ograve": 242,
10214                     "oslash": 248,
10215                     "otilde": 245,
10216                     "ouml": 246,
10217                     "szlig": 223,
10218                     "thorn": 254,
10219                     "uacute": 250,
10220                     "ucirc": 251,
10221                     "ugrave": 249,
10222                     "uuml": 252,
10223                     "yacute": 253,
10224                     "yuml": 255,
10225                     "copy": 169,
10226                     "reg": 174,
10227                     "nbsp": 160,
10228                     "iexcl": 161,
10229                     "cent": 162,
10230                     "pound": 163,
10231                     "curren": 164,
10232                     "yen": 165,
10233                     "brvbar": 166,
10234                     "sect": 167,
10235                     "uml": 168,
10236                     "ordf": 170,
10237                     "laquo": 171,
10238                     "not": 172,
10239                     "shy": 173,
10240                     "macr": 175,
10241                     "deg": 176,
10242                     "plusmn": 177,
10243                     "sup1": 185,
10244                     "sup2": 178,
10245                     "sup3": 179,
10246                     "acute": 180,
10247                     "micro": 181,
10248                     "para": 182,
10249                     "middot": 183,
10250                     "cedil": 184,
10251                     "ordm": 186,
10252                     "raquo": 187,
10253                     "frac14": 188,
10254                     "frac12": 189,
10255                     "frac34": 190,
10256                     "iquest": 191,
10257                     "times": 215,
10258                     "divide": 247,
10259                     "OElig": 338,
10260                     "oelig": 339,
10261                     "Scaron": 352,
10262                     "scaron": 353,
10263                     "Yuml": 376,
10264                     "fnof": 402,
10265                     "circ": 710,
10266                     "tilde": 732,
10267                     "Alpha": 913,
10268                     "Beta": 914,
10269                     "Gamma": 915,
10270                     "Delta": 916,
10271                     "Epsilon": 917,
10272                     "Zeta": 918,
10273                     "Eta": 919,
10274                     "Theta": 920,
10275                     "Iota": 921,
10276                     "Kappa": 922,
10277                     "Lambda": 923,
10278                     "Mu": 924,
10279                     "Nu": 925,
10280                     "Xi": 926,
10281                     "Omicron": 927,
10282                     "Pi": 928,
10283                     "Rho": 929,
10284                     "Sigma": 931,
10285                     "Tau": 932,
10286                     "Upsilon": 933,
10287                     "Phi": 934,
10288                     "Chi": 935,
10289                     "Psi": 936,
10290                     "Omega": 937,
10291                     "alpha": 945,
10292                     "beta": 946,
10293                     "gamma": 947,
10294                     "delta": 948,
10295                     "epsilon": 949,
10296                     "zeta": 950,
10297                     "eta": 951,
10298                     "theta": 952,
10299                     "iota": 953,
10300                     "kappa": 954,
10301                     "lambda": 955,
10302                     "mu": 956,
10303                     "nu": 957,
10304                     "xi": 958,
10305                     "omicron": 959,
10306                     "pi": 960,
10307                     "rho": 961,
10308                     "sigmaf": 962,
10309                     "sigma": 963,
10310                     "tau": 964,
10311                     "upsilon": 965,
10312                     "phi": 966,
10313                     "chi": 967,
10314                     "psi": 968,
10315                     "omega": 969,
10316                     "thetasym": 977,
10317                     "upsih": 978,
10318                     "piv": 982,
10319                     "ensp": 8194,
10320                     "emsp": 8195,
10321                     "thinsp": 8201,
10322                     "zwnj": 8204,
10323                     "zwj": 8205,
10324                     "lrm": 8206,
10325                     "rlm": 8207,
10326                     "ndash": 8211,
10327                     "mdash": 8212,
10328                     "lsquo": 8216,
10329                     "rsquo": 8217,
10330                     "sbquo": 8218,
10331                     "ldquo": 8220,
10332                     "rdquo": 8221,
10333                     "bdquo": 8222,
10334                     "dagger": 8224,
10335                     "Dagger": 8225,
10336                     "bull": 8226,
10337                     "hellip": 8230,
10338                     "permil": 8240,
10339                     "prime": 8242,
10340                     "Prime": 8243,
10341                     "lsaquo": 8249,
10342                     "rsaquo": 8250,
10343                     "oline": 8254,
10344                     "frasl": 8260,
10345                     "euro": 8364,
10346                     "image": 8465,
10347                     "weierp": 8472,
10348                     "real": 8476,
10349                     "trade": 8482,
10350                     "alefsym": 8501,
10351                     "larr": 8592,
10352                     "uarr": 8593,
10353                     "rarr": 8594,
10354                     "darr": 8595,
10355                     "harr": 8596,
10356                     "crarr": 8629,
10357                     "lArr": 8656,
10358                     "uArr": 8657,
10359                     "rArr": 8658,
10360                     "dArr": 8659,
10361                     "hArr": 8660,
10362                     "forall": 8704,
10363                     "part": 8706,
10364                     "exist": 8707,
10365                     "empty": 8709,
10366                     "nabla": 8711,
10367                     "isin": 8712,
10368                     "notin": 8713,
10369                     "ni": 8715,
10370                     "prod": 8719,
10371                     "sum": 8721,
10372                     "minus": 8722,
10373                     "lowast": 8727,
10374                     "radic": 8730,
10375                     "prop": 8733,
10376                     "infin": 8734,
10377                     "ang": 8736,
10378                     "and": 8743,
10379                     "or": 8744,
10380                     "cap": 8745,
10381                     "cup": 8746,
10382                     "int": 8747,
10383                     "there4": 8756,
10384                     "sim": 8764,
10385                     "cong": 8773,
10386                     "asymp": 8776,
10387                     "ne": 8800,
10388                     "equiv": 8801,
10389                     "le": 8804,
10390                     "ge": 8805,
10391                     "sub": 8834,
10392                     "sup": 8835,
10393                     "nsub": 8836,
10394                     "sube": 8838,
10395                     "supe": 8839,
10396                     "oplus": 8853,
10397                     "otimes": 8855,
10398                     "perp": 8869,
10399                     "sdot": 8901,
10400                     "lceil": 8968,
10401                     "rceil": 8969,
10402                     "lfloor": 8970,
10403                     "rfloor": 8971,
10404                     "lang": 9001,
10405                     "rang": 9002,
10406                     "loz": 9674,
10407                     "spades": 9824,
10408                     "clubs": 9827,
10409                     "hearts": 9829,
10410                     "diams": 9830
10411                 }
10412
10413                 Object.keys(sax.ENTITIES).forEach(function(key) {
10414                     var e = sax.ENTITIES[key]
10415                     var s = typeof e === 'number' ? String.fromCharCode(e) : e
10416                     sax.ENTITIES[key] = s
10417                 })
10418
10419                 for (var S in sax.STATE) sax.STATE[sax.STATE[S]] = S
10420
10421                 // shorthand
10422                 S = sax.STATE
10423
10424                 function emit(parser, event, data) {
10425                     parser[event] && parser[event](data)
10426                 }
10427
10428                 function emitNode(parser, nodeType, data) {
10429                     if (parser.textNode) closeText(parser)
10430                     emit(parser, nodeType, data)
10431                 }
10432
10433                 function closeText(parser) {
10434                     parser.textNode = textopts(parser.opt, parser.textNode)
10435                     if (parser.textNode) emit(parser, "ontext", parser.textNode)
10436                     parser.textNode = ""
10437                 }
10438
10439                 function textopts(opt, text) {
10440                     if (opt.trim) text = text.trim()
10441                     if (opt.normalize) text = text.replace(/\s+/g, " ")
10442                     return text
10443                 }
10444
10445                 function error(parser, er) {
10446                     closeText(parser)
10447                     if (parser.trackPosition) {
10448                         er += "\nLine: " + parser.line +
10449                             "\nColumn: " + parser.column +
10450                             "\nChar: " + parser.c
10451                     }
10452                     er = new Error(er)
10453                     parser.error = er
10454                     emit(parser, "onerror", er)
10455                     return parser
10456                 }
10457
10458                 function end(parser) {
10459                     if (!parser.closedRoot) strictFail(parser, "Unclosed root tag")
10460                     if ((parser.state !== S.BEGIN) && (parser.state !== S.TEXT)) error(parser, "Unexpected end")
10461                     closeText(parser)
10462                     parser.c = ""
10463                     parser.closed = true
10464                     emit(parser, "onend")
10465                     SAXParser.call(parser, parser.strict, parser.opt)
10466                     return parser
10467                 }
10468
10469                 function strictFail(parser, message) {
10470                     if (typeof parser !== 'object' || !(parser instanceof SAXParser))
10471                         throw new Error('bad call to strictFail');
10472                     if (parser.strict) error(parser, message)
10473                 }
10474
10475                 function newTag(parser) {
10476                     if (!parser.strict) parser.tagName = parser.tagName[parser.looseCase]()
10477                     var parent = parser.tags[parser.tags.length - 1] || parser,
10478                         tag = parser.tag = {
10479                             name: parser.tagName,
10480                             attributes: {}
10481                         }
10482
10483                     // will be overridden if tag contails an xmlns="foo" or xmlns:foo="bar"
10484                     if (parser.opt.xmlns) tag.ns = parent.ns
10485                     parser.attribList.length = 0
10486                 }
10487
10488                 function qname(name, attribute) {
10489                     var i = name.indexOf(":"),
10490                         qualName = i < 0 ? ["", name] : name.split(":"),
10491                         prefix = qualName[0],
10492                         local = qualName[1]
10493
10494                     // <x "xmlns"="http://foo">
10495                     if (attribute && name === "xmlns") {
10496                         prefix = "xmlns"
10497                         local = ""
10498                     }
10499
10500                     return {
10501                         prefix: prefix,
10502                         local: local
10503                     }
10504                 }
10505
10506                 function attrib(parser) {
10507                     if (!parser.strict) parser.attribName = parser.attribName[parser.looseCase]()
10508
10509                     if (parser.attribList.indexOf(parser.attribName) !== -1 ||
10510                         parser.tag.attributes.hasOwnProperty(parser.attribName)) {
10511                         return parser.attribName = parser.attribValue = ""
10512                     }
10513
10514                     if (parser.opt.xmlns) {
10515                         var qn = qname(parser.attribName, true),
10516                             prefix = qn.prefix,
10517                             local = qn.local
10518
10519                         if (prefix === "xmlns") {
10520                             // namespace binding attribute; push the binding into scope
10521                             if (local === "xml" && parser.attribValue !== XML_NAMESPACE) {
10522                                 strictFail(parser, "xml: prefix must be bound to " + XML_NAMESPACE + "\n" + "Actual: " + parser.attribValue)
10523                             } else if (local === "xmlns" && parser.attribValue !== XMLNS_NAMESPACE) {
10524                                 strictFail(parser, "xmlns: prefix must be bound to " + XMLNS_NAMESPACE + "\n" + "Actual: " + parser.attribValue)
10525                             } else {
10526                                 var tag = parser.tag,
10527                                     parent = parser.tags[parser.tags.length - 1] || parser
10528                                 if (tag.ns === parent.ns) {
10529                                     tag.ns = Object.create(parent.ns)
10530                                 }
10531                                 tag.ns[local] = parser.attribValue
10532                             }
10533                         }
10534
10535                         // defer onattribute events until all attributes have been seen
10536                         // so any new bindings can take effect; preserve attribute order
10537                         // so deferred events can be emitted in document order
10538                         parser.attribList.push([parser.attribName, parser.attribValue])
10539                     } else {
10540                         // in non-xmlns mode, we can emit the event right away
10541                         parser.tag.attributes[parser.attribName] = parser.attribValue
10542                         emitNode(parser, "onattribute", {
10543                             name: parser.attribName,
10544                             value: parser.attribValue
10545                         })
10546                     }
10547
10548                     parser.attribName = parser.attribValue = ""
10549                 }
10550
10551                 function openTag(parser, selfClosing) {
10552                     if (parser.opt.xmlns) {
10553                         // emit namespace binding events
10554                         var tag = parser.tag
10555
10556                         // add namespace info to tag
10557                         var qn = qname(parser.tagName)
10558                         tag.prefix = qn.prefix
10559                         tag.local = qn.local
10560                         tag.uri = tag.ns[qn.prefix] || ""
10561
10562                         if (tag.prefix && !tag.uri) {
10563                             strictFail(parser, "Unbound namespace prefix: " + JSON.stringify(parser.tagName))
10564                             tag.uri = qn.prefix
10565                         }
10566
10567                         var parent = parser.tags[parser.tags.length - 1] || parser
10568                         if (tag.ns && parent.ns !== tag.ns) {
10569                             Object.keys(tag.ns).forEach(function(p) {
10570                                 emitNode(parser, "onopennamespace", {
10571                                     prefix: p,
10572                                     uri: tag.ns[p]
10573                                 })
10574                             })
10575                         }
10576
10577                         // handle deferred onattribute events
10578                         // Note: do not apply default ns to attributes:
10579                         // http://www.w3.org/TR/REC-xml-names/#defaulting
10580                         for (var i = 0, l = parser.attribList.length; i < l; i++) {
10581                             var nv = parser.attribList[i]
10582                             var name = nv[0],
10583                                 value = nv[1],
10584                                 qualName = qname(name, true),
10585                                 prefix = qualName.prefix,
10586                                 local = qualName.local,
10587                                 uri = prefix == "" ? "" : (tag.ns[prefix] || ""),
10588                                 a = {
10589                                     name: name,
10590                                     value: value,
10591                                     prefix: prefix,
10592                                     local: local,
10593                                     uri: uri
10594                                 }
10595
10596                             // if there's any attributes with an undefined namespace,
10597                             // then fail on them now.
10598                             if (prefix && prefix != "xmlns" && !uri) {
10599                                 strictFail(parser, "Unbound namespace prefix: " + JSON.stringify(prefix))
10600                                 a.uri = prefix
10601                             }
10602                             parser.tag.attributes[name] = a
10603                             emitNode(parser, "onattribute", a)
10604                         }
10605                         parser.attribList.length = 0
10606                     }
10607
10608                     parser.tag.isSelfClosing = !!selfClosing
10609
10610                     // process the tag
10611                     parser.sawRoot = true
10612                     parser.tags.push(parser.tag)
10613                     emitNode(parser, "onopentag", parser.tag)
10614                     if (!selfClosing) {
10615                         // special case for <script> in non-strict mode.
10616                         if (!parser.noscript && parser.tagName.toLowerCase() === "script") {
10617                             parser.state = S.SCRIPT
10618                         } else {
10619                             parser.state = S.TEXT
10620                         }
10621                         parser.tag = null
10622                         parser.tagName = ""
10623                     }
10624                     parser.attribName = parser.attribValue = ""
10625                     parser.attribList.length = 0
10626                 }
10627
10628                 function closeTag(parser) {
10629                     if (!parser.tagName) {
10630                         strictFail(parser, "Weird empty close tag.")
10631                         parser.textNode += "</>"
10632                         parser.state = S.TEXT
10633                         return
10634                     }
10635
10636                     if (parser.script) {
10637                         if (parser.tagName !== "script") {
10638                             parser.script += "</" + parser.tagName + ">"
10639                             parser.tagName = ""
10640                             parser.state = S.SCRIPT
10641                             return
10642                         }
10643                         emitNode(parser, "onscript", parser.script)
10644                         parser.script = ""
10645                     }
10646
10647                     // first make sure that the closing tag actually exists.
10648                     // <a><b></c></b></a> will close everything, otherwise.
10649                     var t = parser.tags.length
10650                     var tagName = parser.tagName
10651                     if (!parser.strict) tagName = tagName[parser.looseCase]()
10652                     var closeTo = tagName
10653                     while (t--) {
10654                         var close = parser.tags[t]
10655                         if (close.name !== closeTo) {
10656                             // fail the first time in strict mode
10657                             strictFail(parser, "Unexpected close tag")
10658                         } else break
10659                     }
10660
10661                     // didn't find it. we already failed for strict, so just abort.
10662                     if (t < 0) {
10663                         strictFail(parser, "Unmatched closing tag: " + parser.tagName)
10664                         parser.textNode += "</" + parser.tagName + ">"
10665                         parser.state = S.TEXT
10666                         return
10667                     }
10668                     parser.tagName = tagName
10669                     var s = parser.tags.length
10670                     while (s-- > t) {
10671                         var tag = parser.tag = parser.tags.pop()
10672                         parser.tagName = parser.tag.name
10673                         emitNode(parser, "onclosetag", parser.tagName)
10674
10675                         var x = {}
10676                         for (var i in tag.ns) x[i] = tag.ns[i]
10677
10678                         var parent = parser.tags[parser.tags.length - 1] || parser
10679                         if (parser.opt.xmlns && tag.ns !== parent.ns) {
10680                             // remove namespace bindings introduced by tag
10681                             Object.keys(tag.ns).forEach(function(p) {
10682                                 var n = tag.ns[p]
10683                                 emitNode(parser, "onclosenamespace", {
10684                                     prefix: p,
10685                                     uri: n
10686                                 })
10687                             })
10688                         }
10689                     }
10690                     if (t === 0) parser.closedRoot = true
10691                     parser.tagName = parser.attribValue = parser.attribName = ""
10692                     parser.attribList.length = 0
10693                     parser.state = S.TEXT
10694                 }
10695
10696                 function parseEntity(parser) {
10697                     var entity = parser.entity,
10698                         entityLC = entity.toLowerCase(),
10699                         num, numStr = ""
10700                     if (parser.ENTITIES[entity])
10701                         return parser.ENTITIES[entity]
10702                     if (parser.ENTITIES[entityLC])
10703                         return parser.ENTITIES[entityLC]
10704                     entity = entityLC
10705                     if (entity.charAt(0) === "#") {
10706                         if (entity.charAt(1) === "x") {
10707                             entity = entity.slice(2)
10708                             num = parseInt(entity, 16)
10709                             numStr = num.toString(16)
10710                         } else {
10711                             entity = entity.slice(1)
10712                             num = parseInt(entity, 10)
10713                             numStr = num.toString(10)
10714                         }
10715                     }
10716                     entity = entity.replace(/^0+/, "")
10717                     if (numStr.toLowerCase() !== entity) {
10718                         strictFail(parser, "Invalid character entity")
10719                         return "&" + parser.entity + ";"
10720                     }
10721
10722                     return String.fromCodePoint(num)
10723                 }
10724
10725                 function write(chunk) {
10726                     var parser = this
10727                     if (this.error) throw this.error
10728                     if (parser.closed) return error(parser,
10729                         "Cannot write after close. Assign an onready handler.")
10730                     if (chunk === null) return end(parser)
10731                     var i = 0,
10732                         c = ""
10733                     while (parser.c = c = chunk.charAt(i++)) {
10734                         if (parser.trackPosition) {
10735                             parser.position++
10736                                 if (c === "\n") {
10737                                     parser.line++
10738                                         parser.column = 0
10739                                 } else parser.column++
10740                         }
10741                         switch (parser.state) {
10742
10743                             case S.BEGIN:
10744                                 if (c === "<") {
10745                                     parser.state = S.OPEN_WAKA
10746                                     parser.startTagPosition = parser.position
10747                                 } else if (not(whitespace, c)) {
10748                                     // have to process this as a text node.
10749                                     // weird, but happens.
10750                                     strictFail(parser, "Non-whitespace before first tag.")
10751                                     parser.textNode = c
10752                                     parser.state = S.TEXT
10753                                 }
10754                                 continue
10755
10756                             case S.TEXT:
10757                                 if (parser.sawRoot && !parser.closedRoot) {
10758                                     var starti = i - 1
10759                                     while (c && c !== "<" && c !== "&") {
10760                                         c = chunk.charAt(i++)
10761                                         if (c && parser.trackPosition) {
10762                                             parser.position++
10763                                                 if (c === "\n") {
10764                                                     parser.line++
10765                                                         parser.column = 0
10766                                                 } else parser.column++
10767                                         }
10768                                     }
10769                                     parser.textNode += chunk.substring(starti, i - 1)
10770                                 }
10771                                 if (c === "<") {
10772                                     parser.state = S.OPEN_WAKA
10773                                     parser.startTagPosition = parser.position
10774                                 } else {
10775                                     if (not(whitespace, c) && (!parser.sawRoot || parser.closedRoot))
10776                                         strictFail(parser, "Text data outside of root node.")
10777                                     if (c === "&") parser.state = S.TEXT_ENTITY
10778                                     else parser.textNode += c
10779                                 }
10780                                 continue
10781
10782                             case S.SCRIPT:
10783                                 // only non-strict
10784                                 if (c === "<") {
10785                                     parser.state = S.SCRIPT_ENDING
10786                                 } else parser.script += c
10787                                 continue
10788
10789                             case S.SCRIPT_ENDING:
10790                                 if (c === "/") {
10791                                     parser.state = S.CLOSE_TAG
10792                                 } else {
10793                                     parser.script += "<" + c
10794                                     parser.state = S.SCRIPT
10795                                 }
10796                                 continue
10797
10798                             case S.OPEN_WAKA:
10799                                 // either a /, ?, !, or text is coming next.
10800                                 if (c === "!") {
10801                                     parser.state = S.SGML_DECL
10802                                     parser.sgmlDecl = ""
10803                                 } else if (is(whitespace, c)) {
10804                                     // wait for it...
10805                                 } else if (is(nameStart, c)) {
10806                                     parser.state = S.OPEN_TAG
10807                                     parser.tagName = c
10808                                 } else if (c === "/") {
10809                                     parser.state = S.CLOSE_TAG
10810                                     parser.tagName = ""
10811                                 } else if (c === "?") {
10812                                     parser.state = S.PROC_INST
10813                                     parser.procInstName = parser.procInstBody = ""
10814                                 } else {
10815                                     strictFail(parser, "Unencoded <")
10816                                         // if there was some whitespace, then add that in.
10817                                     if (parser.startTagPosition + 1 < parser.position) {
10818                                         var pad = parser.position - parser.startTagPosition
10819                                         c = new Array(pad).join(" ") + c
10820                                     }
10821                                     parser.textNode += "<" + c
10822                                     parser.state = S.TEXT
10823                                 }
10824                                 continue
10825
10826                             case S.SGML_DECL:
10827                                 if ((parser.sgmlDecl + c).toUpperCase() === CDATA) {
10828                                     emitNode(parser, "onopencdata")
10829                                     parser.state = S.CDATA
10830                                     parser.sgmlDecl = ""
10831                                     parser.cdata = ""
10832                                 } else if (parser.sgmlDecl + c === "--") {
10833                                     parser.state = S.COMMENT
10834                                     parser.comment = ""
10835                                     parser.sgmlDecl = ""
10836                                 } else if ((parser.sgmlDecl + c).toUpperCase() === DOCTYPE) {
10837                                     parser.state = S.DOCTYPE
10838                                     if (parser.doctype || parser.sawRoot) strictFail(parser,
10839                                         "Inappropriately located doctype declaration")
10840                                     parser.doctype = ""
10841                                     parser.sgmlDecl = ""
10842                                 } else if (c === ">") {
10843                                     emitNode(parser, "onsgmldeclaration", parser.sgmlDecl)
10844                                     parser.sgmlDecl = ""
10845                                     parser.state = S.TEXT
10846                                 } else if (is(quote, c)) {
10847                                     parser.state = S.SGML_DECL_QUOTED
10848                                     parser.sgmlDecl += c
10849                                 } else parser.sgmlDecl += c
10850                                 continue
10851
10852                             case S.SGML_DECL_QUOTED:
10853                                 if (c === parser.q) {
10854                                     parser.state = S.SGML_DECL
10855                                     parser.q = ""
10856                                 }
10857                                 parser.sgmlDecl += c
10858                                 continue
10859
10860                             case S.DOCTYPE:
10861                                 if (c === ">") {
10862                                     parser.state = S.TEXT
10863                                     emitNode(parser, "ondoctype", parser.doctype)
10864                                     parser.doctype = true // just remember that we saw it.
10865                                 } else {
10866                                     parser.doctype += c
10867                                     if (c === "[") parser.state = S.DOCTYPE_DTD
10868                                     else if (is(quote, c)) {
10869                                         parser.state = S.DOCTYPE_QUOTED
10870                                         parser.q = c
10871                                     }
10872                                 }
10873                                 continue
10874
10875                             case S.DOCTYPE_QUOTED:
10876                                 parser.doctype += c
10877                                 if (c === parser.q) {
10878                                     parser.q = ""
10879                                     parser.state = S.DOCTYPE
10880                                 }
10881                                 continue
10882
10883                             case S.DOCTYPE_DTD:
10884                                 parser.doctype += c
10885                                 if (c === "]") parser.state = S.DOCTYPE
10886                                 else if (is(quote, c)) {
10887                                     parser.state = S.DOCTYPE_DTD_QUOTED
10888                                     parser.q = c
10889                                 }
10890                                 continue
10891
10892                             case S.DOCTYPE_DTD_QUOTED:
10893                                 parser.doctype += c
10894                                 if (c === parser.q) {
10895                                     parser.state = S.DOCTYPE_DTD
10896                                     parser.q = ""
10897                                 }
10898                                 continue
10899
10900                             case S.COMMENT:
10901                                 if (c === "-") parser.state = S.COMMENT_ENDING
10902                                 else parser.comment += c
10903                                 continue
10904
10905                             case S.COMMENT_ENDING:
10906                                 if (c === "-") {
10907                                     parser.state = S.COMMENT_ENDED
10908                                     parser.comment = textopts(parser.opt, parser.comment)
10909                                     if (parser.comment) emitNode(parser, "oncomment", parser.comment)
10910                                     parser.comment = ""
10911                                 } else {
10912                                     parser.comment += "-" + c
10913                                     parser.state = S.COMMENT
10914                                 }
10915                                 continue
10916
10917                             case S.COMMENT_ENDED:
10918                                 if (c !== ">") {
10919                                     strictFail(parser, "Malformed comment")
10920                                         // allow <!-- blah -- bloo --> in non-strict mode,
10921                                         // which is a comment of " blah -- bloo "
10922                                     parser.comment += "--" + c
10923                                     parser.state = S.COMMENT
10924                                 } else parser.state = S.TEXT
10925                                 continue
10926
10927                             case S.CDATA:
10928                                 if (c === "]") parser.state = S.CDATA_ENDING
10929                                 else parser.cdata += c
10930                                 continue
10931
10932                             case S.CDATA_ENDING:
10933                                 if (c === "]") parser.state = S.CDATA_ENDING_2
10934                                 else {
10935                                     parser.cdata += "]" + c
10936                                     parser.state = S.CDATA
10937                                 }
10938                                 continue
10939
10940                             case S.CDATA_ENDING_2:
10941                                 if (c === ">") {
10942                                     if (parser.cdata) emitNode(parser, "oncdata", parser.cdata)
10943                                     emitNode(parser, "onclosecdata")
10944                                     parser.cdata = ""
10945                                     parser.state = S.TEXT
10946                                 } else if (c === "]") {
10947                                     parser.cdata += "]"
10948                                 } else {
10949                                     parser.cdata += "]]" + c
10950                                     parser.state = S.CDATA
10951                                 }
10952                                 continue
10953
10954                             case S.PROC_INST:
10955                                 if (c === "?") parser.state = S.PROC_INST_ENDING
10956                                 else if (is(whitespace, c)) parser.state = S.PROC_INST_BODY
10957                                 else parser.procInstName += c
10958                                 continue
10959
10960                             case S.PROC_INST_BODY:
10961                                 if (!parser.procInstBody && is(whitespace, c)) continue
10962                                 else if (c === "?") parser.state = S.PROC_INST_ENDING
10963                                 else parser.procInstBody += c
10964                                 continue
10965
10966                             case S.PROC_INST_ENDING:
10967                                 if (c === ">") {
10968                                     emitNode(parser, "onprocessinginstruction", {
10969                                         name: parser.procInstName,
10970                                         body: parser.procInstBody
10971                                     })
10972                                     parser.procInstName = parser.procInstBody = ""
10973                                     parser.state = S.TEXT
10974                                 } else {
10975                                     parser.procInstBody += "?" + c
10976                                     parser.state = S.PROC_INST_BODY
10977                                 }
10978                                 continue
10979
10980                             case S.OPEN_TAG:
10981                                 if (is(nameBody, c)) parser.tagName += c
10982                                 else {
10983                                     newTag(parser)
10984                                     if (c === ">") openTag(parser)
10985                                     else if (c === "/") parser.state = S.OPEN_TAG_SLASH
10986                                     else {
10987                                         if (not(whitespace, c)) strictFail(
10988                                             parser, "Invalid character in tag name")
10989                                         parser.state = S.ATTRIB
10990                                     }
10991                                 }
10992                                 continue
10993
10994                             case S.OPEN_TAG_SLASH:
10995                                 if (c === ">") {
10996                                     openTag(parser, true)
10997                                     closeTag(parser)
10998                                 } else {
10999                                     strictFail(parser, "Forward-slash in opening tag not followed by >")
11000                                     parser.state = S.ATTRIB
11001                                 }
11002                                 continue
11003
11004                             case S.ATTRIB:
11005                                 // haven't read the attribute name yet.
11006                                 if (is(whitespace, c)) continue
11007                                 else if (c === ">") openTag(parser)
11008                                 else if (c === "/") parser.state = S.OPEN_TAG_SLASH
11009                                 else if (is(nameStart, c)) {
11010                                     parser.attribName = c
11011                                     parser.attribValue = ""
11012                                     parser.state = S.ATTRIB_NAME
11013                                 } else strictFail(parser, "Invalid attribute name")
11014                                 continue
11015
11016                             case S.ATTRIB_NAME:
11017                                 if (c === "=") parser.state = S.ATTRIB_VALUE
11018                                 else if (c === ">") {
11019                                     strictFail(parser, "Attribute without value")
11020                                     parser.attribValue = parser.attribName
11021                                     attrib(parser)
11022                                     openTag(parser)
11023                                 } else if (is(whitespace, c)) parser.state = S.ATTRIB_NAME_SAW_WHITE
11024                                 else if (is(nameBody, c)) parser.attribName += c
11025                                 else strictFail(parser, "Invalid attribute name")
11026                                 continue
11027
11028                             case S.ATTRIB_NAME_SAW_WHITE:
11029                                 if (c === "=") parser.state = S.ATTRIB_VALUE
11030                                 else if (is(whitespace, c)) continue
11031                                 else {
11032                                     strictFail(parser, "Attribute without value")
11033                                     parser.tag.attributes[parser.attribName] = ""
11034                                     parser.attribValue = ""
11035                                     emitNode(parser, "onattribute", {
11036                                         name: parser.attribName,
11037                                         value: ""
11038                                     })
11039                                     parser.attribName = ""
11040                                     if (c === ">") openTag(parser)
11041                                     else if (is(nameStart, c)) {
11042                                         parser.attribName = c
11043                                         parser.state = S.ATTRIB_NAME
11044                                     } else {
11045                                         strictFail(parser, "Invalid attribute name")
11046                                         parser.state = S.ATTRIB
11047                                     }
11048                                 }
11049                                 continue
11050
11051                             case S.ATTRIB_VALUE:
11052                                 if (is(whitespace, c)) continue
11053                                 else if (is(quote, c)) {
11054                                     parser.q = c
11055                                     parser.state = S.ATTRIB_VALUE_QUOTED
11056                                 } else {
11057                                     strictFail(parser, "Unquoted attribute value")
11058                                     parser.state = S.ATTRIB_VALUE_UNQUOTED
11059                                     parser.attribValue = c
11060                                 }
11061                                 continue
11062
11063                             case S.ATTRIB_VALUE_QUOTED:
11064                                 if (c !== parser.q) {
11065                                     if (c === "&") parser.state = S.ATTRIB_VALUE_ENTITY_Q
11066                                     else parser.attribValue += c
11067                                     continue
11068                                 }
11069                                 attrib(parser)
11070                                 parser.q = ""
11071                                 parser.state = S.ATTRIB_VALUE_CLOSED
11072                                 continue
11073
11074                             case S.ATTRIB_VALUE_CLOSED:
11075                                 if (is(whitespace, c)) {
11076                                     parser.state = S.ATTRIB
11077                                 } else if (c === ">") openTag(parser)
11078                                 else if (c === "/") parser.state = S.OPEN_TAG_SLASH
11079                                 else if (is(nameStart, c)) {
11080                                     strictFail(parser, "No whitespace between attributes")
11081                                     parser.attribName = c
11082                                     parser.attribValue = ""
11083                                     parser.state = S.ATTRIB_NAME
11084                                 } else strictFail(parser, "Invalid attribute name")
11085                                 continue
11086
11087                             case S.ATTRIB_VALUE_UNQUOTED:
11088                                 if (not(attribEnd, c)) {
11089                                     if (c === "&") parser.state = S.ATTRIB_VALUE_ENTITY_U
11090                                     else parser.attribValue += c
11091                                     continue
11092                                 }
11093                                 attrib(parser)
11094                                 if (c === ">") openTag(parser)
11095                                 else parser.state = S.ATTRIB
11096                                 continue
11097
11098                             case S.CLOSE_TAG:
11099                                 if (!parser.tagName) {
11100                                     if (is(whitespace, c)) continue
11101                                     else if (not(nameStart, c)) {
11102                                         if (parser.script) {
11103                                             parser.script += "</" + c
11104                                             parser.state = S.SCRIPT
11105                                         } else {
11106                                             strictFail(parser, "Invalid tagname in closing tag.")
11107                                         }
11108                                     } else parser.tagName = c
11109                                 } else if (c === ">") closeTag(parser)
11110                                 else if (is(nameBody, c)) parser.tagName += c
11111                                 else if (parser.script) {
11112                                     parser.script += "</" + parser.tagName
11113                                     parser.tagName = ""
11114                                     parser.state = S.SCRIPT
11115                                 } else {
11116                                     if (not(whitespace, c)) strictFail(parser,
11117                                         "Invalid tagname in closing tag")
11118                                     parser.state = S.CLOSE_TAG_SAW_WHITE
11119                                 }
11120                                 continue
11121
11122                             case S.CLOSE_TAG_SAW_WHITE:
11123                                 if (is(whitespace, c)) continue
11124                                 if (c === ">") closeTag(parser)
11125                                 else strictFail(parser, "Invalid characters in closing tag")
11126                                 continue
11127
11128                             case S.TEXT_ENTITY:
11129                             case S.ATTRIB_VALUE_ENTITY_Q:
11130                             case S.ATTRIB_VALUE_ENTITY_U:
11131                                 switch (parser.state) {
11132                                     case S.TEXT_ENTITY:
11133                                         var returnState = S.TEXT,
11134                                             buffer = "textNode"
11135                                         break
11136
11137                                     case S.ATTRIB_VALUE_ENTITY_Q:
11138                                         var returnState = S.ATTRIB_VALUE_QUOTED,
11139                                             buffer = "attribValue"
11140                                         break
11141
11142                                     case S.ATTRIB_VALUE_ENTITY_U:
11143                                         var returnState = S.ATTRIB_VALUE_UNQUOTED,
11144                                             buffer = "attribValue"
11145                                         break
11146                                 }
11147                                 if (c === ";") {
11148                                     parser[buffer] += parseEntity(parser)
11149                                     parser.entity = ""
11150                                     parser.state = returnState
11151                                 } else if (is(entity, c)) parser.entity += c
11152                                 else {
11153                                     strictFail(parser, "Invalid character entity")
11154                                     parser[buffer] += "&" + parser.entity + c
11155                                     parser.entity = ""
11156                                     parser.state = returnState
11157                                 }
11158                                 continue
11159
11160                             default:
11161                                 throw new Error(parser, "Unknown state: " + parser.state)
11162                         }
11163                     } // while
11164                     // cdata blocks can get very big under normal conditions. emit and move on.
11165                     // if (parser.state === S.CDATA && parser.cdata) {
11166                     // emitNode(parser, "oncdata", parser.cdata)
11167                     // parser.cdata = ""
11168                     // }
11169                     if (parser.position >= parser.bufferCheckPosition) checkBufferLength(parser)
11170                     return parser
11171                 }
11172
11173                 /* ! http://mths.be/fromcodepoint v0.1.0 by @mathias */
11174                 if (!String.fromCodePoint) {
11175                     (function() {
11176                         var stringFromCharCode = String.fromCharCode;
11177                         var floor = Math.floor;
11178                         var fromCodePoint = function() {
11179                             var MAX_SIZE = 0x4000;
11180                             var codeUnits = [];
11181                             var highSurrogate;
11182                             var lowSurrogate;
11183                             var index = -1;
11184                             var length = arguments.length;
11185                             if (!length) {
11186                                 return '';
11187                             }
11188                             var result = '';
11189                             while (++index < length) {
11190                                 var codePoint = Number(arguments[index]);
11191                                 if (!isFinite(codePoint) || // `NaN`,
11192                                     // `+Infinity`,
11193                                     // or
11194                                     // `-Infinity`
11195                                     codePoint < 0 || // not a valid
11196                                     // Unicode code
11197                                     // point
11198                                     codePoint > 0x10FFFF || // not a valid
11199                                     // Unicode code
11200                                     // point
11201                                     floor(codePoint) != codePoint // not
11202                                     // an
11203                                     // integer
11204                                 ) {
11205                                     throw RangeError('Invalid code point: ' + codePoint);
11206                                 }
11207                                 if (codePoint <= 0xFFFF) { // BMP code point
11208                                     codeUnits.push(codePoint);
11209                                 } else { // Astral code point; split in
11210                                     // surrogate halves
11211                                     // http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae
11212                                     codePoint -= 0x10000;
11213                                     highSurrogate = (codePoint >> 10) + 0xD800;
11214                                     lowSurrogate = (codePoint % 0x400) + 0xDC00;
11215                                     codeUnits.push(highSurrogate, lowSurrogate);
11216                                 }
11217                                 if (index + 1 == length || codeUnits.length > MAX_SIZE) {
11218                                     result += stringFromCharCode.apply(null, codeUnits);
11219                                     codeUnits.length = 0;
11220                                 }
11221                             }
11222                             return result;
11223                         };
11224                         if (Object.defineProperty) {
11225                             Object.defineProperty(String, 'fromCodePoint', {
11226                                 'value': fromCodePoint,
11227                                 'configurable': true,
11228                                 'writable': true
11229                             });
11230                         } else {
11231                             String.fromCodePoint = fromCodePoint;
11232                         }
11233                     }());
11234                 }
11235
11236             })(typeof exports === "undefined" ? sax = {} : exports);
11237
11238         }).call(this, undefined)
11239     }, {
11240         "stream": false,
11241         "string_decoder": false
11242     }],
11243     "\\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) {
11244         /**
11245          * Tiny stack for browser or server
11246          * 
11247          * @author Jason Mulligan <jason.mulligan@avoidwork.com>
11248          * @copyright 2014 Jason Mulligan
11249          * @license BSD-3 <https://raw.github.com/avoidwork/tiny-stack/master/LICENSE>
11250          * @link http://avoidwork.github.io/tiny-stack
11251          * @module tiny-stack
11252          * @version 0.1.0
11253          */
11254
11255         (function(global) {
11256
11257             "use strict";
11258
11259             /**
11260              * TinyStack
11261              * 
11262              * @constructor
11263              */
11264             function TinyStack() {
11265                 this.data = [null];
11266                 this.top = 0;
11267             }
11268
11269             /**
11270              * Clears the stack
11271              * 
11272              * @method clear
11273              * @memberOf TinyStack
11274              * @return {Object} {@link TinyStack}
11275              */
11276             TinyStack.prototype.clear = function clear() {
11277                 this.data = [null];
11278                 this.top = 0;
11279
11280                 return this;
11281             };
11282
11283             /**
11284              * Gets the size of the stack
11285              * 
11286              * @method length
11287              * @memberOf TinyStack
11288              * @return {Number} Size of stack
11289              */
11290             TinyStack.prototype.length = function length() {
11291                 return this.top;
11292             };
11293
11294             /**
11295              * Gets the item at the top of the stack
11296              * 
11297              * @method peek
11298              * @memberOf TinyStack
11299              * @return {Mixed} Item at the top of the stack
11300              */
11301             TinyStack.prototype.peek = function peek() {
11302                 return this.data[this.top];
11303             };
11304
11305             /**
11306              * Gets & removes the item at the top of the stack
11307              * 
11308              * @method pop
11309              * @memberOf TinyStack
11310              * @return {Mixed} Item at the top of the stack
11311              */
11312             TinyStack.prototype.pop = function pop() {
11313                 if (this.top > 0) {
11314                     this.top--;
11315
11316                     return this.data.pop();
11317                 } else {
11318                     return undefined;
11319                 }
11320             };
11321
11322             /**
11323              * Pushes an item onto the stack
11324              * 
11325              * @method push
11326              * @memberOf TinyStack
11327              * @return {Object} {@link TinyStack}
11328              */
11329             TinyStack.prototype.push = function push(arg) {
11330                 this.data[++this.top] = arg;
11331
11332                 return this;
11333             };
11334
11335             /**
11336              * TinyStack factory
11337              * 
11338              * @method factory
11339              * @return {Object} {@link TinyStack}
11340              */
11341             function factory() {
11342                 return new TinyStack();
11343             }
11344
11345             // Node, AMD & window supported
11346             if (typeof exports != "undefined") {
11347                 module.exports = factory;
11348             } else if (typeof define == "function") {
11349                 define(function() {
11350                     return factory;
11351                 });
11352             } else {
11353                 global.stack = factory;
11354             }
11355         })(this);
11356
11357     }, {}],
11358     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle\\index.js": [function(require, module, exports) {
11359         module.exports = require('./lib/moddle');
11360     }, {
11361         "./lib/moddle": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle\\lib\\moddle.js"
11362     }],
11363     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle\\lib\\base.js": [function(require, module, exports) {
11364         'use strict';
11365
11366         function Base() {}
11367
11368         Base.prototype.get = function(name) {
11369             return this.$model.properties.get(this, name);
11370         };
11371
11372         Base.prototype.set = function(name, value) {
11373             this.$model.properties.set(this, name, value);
11374         };
11375
11376
11377         module.exports = Base;
11378     }, {}],
11379     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle\\lib\\descriptor-builder.js": [function(require, module, exports) {
11380         'use strict';
11381
11382         var pick = require('lodash/object/pick'),
11383             assign = require('lodash/object/assign'),
11384             forEach = require('lodash/collection/forEach');
11385
11386         var parseNameNs = require('./ns').parseName;
11387
11388
11389         function DescriptorBuilder(nameNs) {
11390             this.ns = nameNs;
11391             this.name = nameNs.name;
11392             this.allTypes = [];
11393             this.properties = [];
11394             this.propertiesByName = {};
11395         }
11396
11397         module.exports = DescriptorBuilder;
11398
11399
11400         DescriptorBuilder.prototype.build = function() {
11401             return pick(this, ['ns', 'name', 'allTypes', 'properties', 'propertiesByName', 'bodyProperty']);
11402         };
11403
11404         DescriptorBuilder.prototype.addProperty = function(p, idx) {
11405             this.addNamedProperty(p, true);
11406
11407             var properties = this.properties;
11408
11409             if (idx !== undefined) {
11410                 properties.splice(idx, 0, p);
11411             } else {
11412                 properties.push(p);
11413             }
11414         };
11415
11416
11417         DescriptorBuilder.prototype.replaceProperty = function(oldProperty, newProperty) {
11418             var oldNameNs = oldProperty.ns;
11419
11420             var props = this.properties,
11421                 propertiesByName = this.propertiesByName,
11422                 rename = oldProperty.name !== newProperty.name;
11423
11424             if (oldProperty.isBody) {
11425
11426                 if (!newProperty.isBody) {
11427                     throw new Error(
11428                         'property <' + newProperty.ns.name + '> must be body property ' +
11429                         'to refine <' + oldProperty.ns.name + '>');
11430                 }
11431
11432                 // TODO: Check compatibility
11433                 this.setBodyProperty(newProperty, false);
11434             }
11435
11436             // replacing the named property is intentional
11437             // thus, validate only if this is a "rename" operation
11438             this.addNamedProperty(newProperty, rename);
11439
11440             // replace old property at index with new one
11441             var idx = props.indexOf(oldProperty);
11442             if (idx === -1) {
11443                 throw new Error('property <' + oldNameNs.name + '> not found in property list');
11444             }
11445
11446             props[idx] = newProperty;
11447
11448             // replace propertiesByName entry with new property
11449             propertiesByName[oldNameNs.name] = propertiesByName[oldNameNs.localName] = newProperty;
11450         };
11451
11452
11453         DescriptorBuilder.prototype.redefineProperty = function(p) {
11454
11455             var nsPrefix = p.ns.prefix;
11456             var parts = p.redefines.split('#');
11457
11458             var name = parseNameNs(parts[0], nsPrefix);
11459             var attrName = parseNameNs(parts[1], name.prefix).name;
11460
11461             var redefinedProperty = this.propertiesByName[attrName];
11462             if (!redefinedProperty) {
11463                 throw new Error('refined property <' + attrName + '> not found');
11464             } else {
11465                 this.replaceProperty(redefinedProperty, p);
11466             }
11467
11468             delete p.redefines;
11469         };
11470
11471         DescriptorBuilder.prototype.addNamedProperty = function(p, validate) {
11472             var ns = p.ns,
11473                 propsByName = this.propertiesByName;
11474
11475             if (validate) {
11476                 this.assertNotDefined(p, ns.name);
11477                 this.assertNotDefined(p, ns.localName);
11478             }
11479
11480             propsByName[ns.name] = propsByName[ns.localName] = p;
11481         };
11482
11483         DescriptorBuilder.prototype.removeNamedProperty = function(p) {
11484             var ns = p.ns,
11485                 propsByName = this.propertiesByName;
11486
11487             delete propsByName[ns.name];
11488             delete propsByName[ns.localName];
11489         };
11490
11491         DescriptorBuilder.prototype.setBodyProperty = function(p, validate) {
11492
11493             if (validate && this.bodyProperty) {
11494                 throw new Error(
11495                     'body property defined multiple times ' +
11496                     '(<' + this.bodyProperty.ns.name + '>, <' + p.ns.name + '>)');
11497             }
11498
11499             this.bodyProperty = p;
11500         };
11501
11502         DescriptorBuilder.prototype.addIdProperty = function(name) {
11503             var nameNs = parseNameNs(name, this.ns.prefix);
11504
11505             var p = {
11506                 name: nameNs.localName,
11507                 type: 'String',
11508                 isAttr: true,
11509                 ns: nameNs
11510             };
11511
11512             // ensure that id is always the first attribute (if present)
11513             this.addProperty(p, 0);
11514         };
11515
11516         DescriptorBuilder.prototype.assertNotDefined = function(p, name) {
11517             var propertyName = p.name,
11518                 definedProperty = this.propertiesByName[propertyName];
11519
11520             if (definedProperty) {
11521                 throw new Error(
11522                     'property <' + propertyName + '> already defined; ' +
11523                     'override of <' + definedProperty.definedBy.ns.name + '#' + definedProperty.ns.name + '> by ' +
11524                     '<' + p.definedBy.ns.name + '#' + p.ns.name + '> not allowed without redefines');
11525             }
11526         };
11527
11528         DescriptorBuilder.prototype.hasProperty = function(name) {
11529             return this.propertiesByName[name];
11530         };
11531
11532         DescriptorBuilder.prototype.addTrait = function(t) {
11533
11534             var allTypes = this.allTypes;
11535
11536             if (allTypes.indexOf(t) !== -1) {
11537                 return;
11538             }
11539
11540             forEach(t.properties, function(p) {
11541
11542                 // clone property to allow extensions
11543                 p = assign({}, p, {
11544                     name: p.ns.localName
11545                 });
11546
11547                 Object.defineProperty(p, 'definedBy', {
11548                     value: t
11549                 });
11550
11551                 // add redefine support
11552                 if (p.redefines) {
11553                     this.redefineProperty(p);
11554                 } else {
11555                     if (p.isBody) {
11556                         this.setBodyProperty(p);
11557                     }
11558                     this.addProperty(p);
11559                 }
11560             }, this);
11561
11562             allTypes.push(t);
11563         };
11564
11565     }, {
11566         "./ns": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle\\lib\\ns.js",
11567         "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
11568         "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js",
11569         "lodash/object/pick": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\pick.js"
11570     }],
11571     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle\\lib\\factory.js": [function(require, module, exports) {
11572         'use strict';
11573
11574         var forEach = require('lodash/collection/forEach');
11575
11576         var Base = require('./base');
11577
11578
11579         function Factory(model, properties) {
11580             this.model = model;
11581             this.properties = properties;
11582         }
11583
11584         module.exports = Factory;
11585
11586
11587         Factory.prototype.createType = function(descriptor) {
11588
11589             var model = this.model;
11590
11591             var props = this.properties,
11592                 prototype = Object.create(Base.prototype);
11593
11594             // initialize default values
11595             forEach(descriptor.properties, function(p) {
11596                 if (!p.isMany && p.default !== undefined) {
11597                     prototype[p.name] = p.default;
11598                 }
11599             });
11600
11601             props.defineModel(prototype, model);
11602             props.defineDescriptor(prototype, descriptor);
11603
11604             var name = descriptor.ns.name;
11605
11606             /**
11607              * The new type constructor
11608              */
11609             function ModdleElement(attrs) {
11610                 props.define(this, '$type', {
11611                     value: name,
11612                     enumerable: true
11613                 });
11614                 props.define(this, '$attrs', {
11615                     value: {}
11616                 });
11617                 props.define(this, '$parent', {
11618                     writable: true
11619                 });
11620
11621                 forEach(attrs, function(val, key) {
11622                     this.set(key, val);
11623                 }, this);
11624             }
11625
11626             ModdleElement.prototype = prototype;
11627
11628             ModdleElement.hasType = prototype.$instanceOf = this.model.hasType;
11629
11630             // static links
11631             props.defineModel(ModdleElement, model);
11632             props.defineDescriptor(ModdleElement, descriptor);
11633
11634             return ModdleElement;
11635         };
11636     }, {
11637         "./base": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle\\lib\\base.js",
11638         "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js"
11639     }],
11640     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle\\lib\\moddle.js": [function(require, module, exports) {
11641         'use strict';
11642
11643         var isString = require('lodash/lang/isString'),
11644             isObject = require('lodash/lang/isObject'),
11645             forEach = require('lodash/collection/forEach'),
11646             find = require('lodash/collection/find');
11647
11648
11649         var Factory = require('./factory'),
11650             Registry = require('./registry'),
11651             Properties = require('./properties');
11652
11653         var parseNameNs = require('./ns').parseName;
11654
11655
11656         // // Moddle implementation /////////////////////////////////////////////////
11657
11658         /**
11659          * @class Moddle
11660          * 
11661          * A model that can be used to create elements of a specific type.
11662          * 
11663          * @example
11664          * 
11665          * var Moddle = require('moddle');
11666          * 
11667          * var pkg = { name: 'mypackage', prefix: 'my', types: [ { name: 'Root' } ] };
11668          * 
11669          * var moddle = new Moddle([pkg]);
11670          * 
11671          * @param {Array
11672          *            <Package>} packages the packages to contain
11673          * @param {Object}
11674          *            options additional options to pass to the model
11675          */
11676         function Moddle(packages, options) {
11677
11678             options = options || {};
11679
11680             this.properties = new Properties(this);
11681
11682             this.factory = new Factory(this, this.properties);
11683             this.registry = new Registry(packages, this.properties, options);
11684
11685             this.typeCache = {};
11686         }
11687
11688         module.exports = Moddle;
11689
11690
11691         /**
11692          * Create an instance of the specified type.
11693          * 
11694          * @method Moddle#create
11695          * 
11696          * @example
11697          * 
11698          * var foo = moddle.create('my:Foo'); var bar = moddle.create('my:Bar', { id:
11699          * 'BAR_1' });
11700          * 
11701          * @param {String|Object}
11702          *            descriptor the type descriptor or name know to the model
11703          * @param {Object}
11704          *            attrs a number of attributes to initialize the model instance with
11705          * @return {Object} model instance
11706          */
11707         Moddle.prototype.create = function(descriptor, attrs) {
11708             var Type = this.getType(descriptor);
11709
11710             if (!Type) {
11711                 throw new Error('unknown type <' + descriptor + '>');
11712             }
11713
11714             return new Type(attrs);
11715         };
11716
11717
11718         /**
11719          * Returns the type representing a given descriptor
11720          * 
11721          * @method Moddle#getType
11722          * 
11723          * @example
11724          * 
11725          * var Foo = moddle.getType('my:Foo'); var foo = new Foo({ 'id' : 'FOO_1' });
11726          * 
11727          * @param {String|Object}
11728          *            descriptor the type descriptor or name know to the model
11729          * @return {Object} the type representing the descriptor
11730          */
11731         Moddle.prototype.getType = function(descriptor) {
11732
11733             var cache = this.typeCache;
11734
11735             var name = isString(descriptor) ? descriptor : descriptor.ns.name;
11736
11737             var type = cache[name];
11738
11739             if (!type) {
11740                 descriptor = this.registry.getEffectiveDescriptor(name);
11741                 type = cache[name] = this.factory.createType(descriptor);
11742             }
11743
11744             return type;
11745         };
11746
11747
11748         /**
11749          * Creates an any-element type to be used within model instances.
11750          * 
11751          * This can be used to create custom elements that lie outside the meta-model.
11752          * The created element contains all the meta-data required to serialize it as
11753          * part of meta-model elements.
11754          * 
11755          * @method Moddle#createAny
11756          * 
11757          * @example
11758          * 
11759          * var foo = moddle.createAny('vendor:Foo', 'http://vendor', { value: 'bar' });
11760          * 
11761          * var container = moddle.create('my:Container', 'http://my', { any: [ foo ] });
11762          *  // go ahead and serialize the stuff
11763          * 
11764          * 
11765          * @param {String}
11766          *            name the name of the element
11767          * @param {String}
11768          *            nsUri the namespace uri of the element
11769          * @param {Object}
11770          *            [properties] a map of properties to initialize the instance with
11771          * @return {Object} the any type instance
11772          */
11773         Moddle.prototype.createAny = function(name, nsUri, properties) {
11774
11775             var nameNs = parseNameNs(name);
11776
11777             var element = {
11778                 $type: name
11779             };
11780
11781             var descriptor = {
11782                 name: name,
11783                 isGeneric: true,
11784                 ns: {
11785                     prefix: nameNs.prefix,
11786                     localName: nameNs.localName,
11787                     uri: nsUri
11788                 }
11789             };
11790
11791             this.properties.defineDescriptor(element, descriptor);
11792             this.properties.defineModel(element, this);
11793             this.properties.define(element, '$parent', {
11794                 enumerable: false,
11795                 writable: true
11796             });
11797
11798             forEach(properties, function(a, key) {
11799                 if (isObject(a) && a.value !== undefined) {
11800                     element[a.name] = a.value;
11801                 } else {
11802                     element[key] = a;
11803                 }
11804             });
11805
11806             return element;
11807         };
11808
11809         /**
11810          * Returns a registered package by uri or prefix
11811          * 
11812          * @return {Object} the package
11813          */
11814         Moddle.prototype.getPackage = function(uriOrPrefix) {
11815             return this.registry.getPackage(uriOrPrefix);
11816         };
11817
11818         /**
11819          * Returns a snapshot of all known packages
11820          * 
11821          * @return {Object} the package
11822          */
11823         Moddle.prototype.getPackages = function() {
11824             return this.registry.getPackages();
11825         };
11826
11827         /**
11828          * Returns the descriptor for an element
11829          */
11830         Moddle.prototype.getElementDescriptor = function(element) {
11831             return element.$descriptor;
11832         };
11833
11834         /**
11835          * Returns true if the given descriptor or instance represents the given type.
11836          * 
11837          * May be applied to this, if element is omitted.
11838          */
11839         Moddle.prototype.hasType = function(element, type) {
11840             if (type === undefined) {
11841                 type = element;
11842                 element = this;
11843             }
11844
11845             var descriptor = element.$model.getElementDescriptor(element);
11846
11847             return !!find(descriptor.allTypes, function(t) {
11848                 return t.name === type;
11849             });
11850         };
11851
11852
11853         /**
11854          * Returns the descriptor of an elements named property
11855          */
11856         Moddle.prototype.getPropertyDescriptor = function(element, property) {
11857             return this.getElementDescriptor(element).propertiesByName[property];
11858         };
11859
11860     }, {
11861         "./factory": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle\\lib\\factory.js",
11862         "./ns": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle\\lib\\ns.js",
11863         "./properties": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle\\lib\\properties.js",
11864         "./registry": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle\\lib\\registry.js",
11865         "lodash/collection/find": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\find.js",
11866         "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
11867         "lodash/lang/isObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isObject.js",
11868         "lodash/lang/isString": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isString.js"
11869     }],
11870     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle\\lib\\ns.js": [function(require, module, exports) {
11871         'use strict';
11872
11873         /**
11874          * Parses a namespaced attribute name of the form (ns:)localName to an object,
11875          * given a default prefix to assume in case no explicit namespace is given.
11876          * 
11877          * @param {String}
11878          *            name
11879          * @param {String}
11880          *            [defaultPrefix] the default prefix to take, if none is present.
11881          * 
11882          * @return {Object} the parsed name
11883          */
11884         module.exports.parseName = function(name, defaultPrefix) {
11885             var parts = name.split(/:/),
11886                 localName, prefix;
11887
11888             // no prefix (i.e. only local name)
11889             if (parts.length === 1) {
11890                 localName = name;
11891                 prefix = defaultPrefix;
11892             } else
11893             // prefix + local name
11894             if (parts.length === 2) {
11895                 localName = parts[1];
11896                 prefix = parts[0];
11897             } else {
11898                 throw new Error('expected <prefix:localName> or <localName>, got ' + name);
11899             }
11900
11901             name = (prefix ? prefix + ':' : '') + localName;
11902
11903             return {
11904                 name: name,
11905                 prefix: prefix,
11906                 localName: localName
11907             };
11908         };
11909     }, {}],
11910     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle\\lib\\properties.js": [function(require, module, exports) {
11911         'use strict';
11912
11913
11914         /**
11915          * A utility that gets and sets properties of model elements.
11916          * 
11917          * @param {Model}
11918          *            model
11919          */
11920         function Properties(model) {
11921             this.model = model;
11922         }
11923
11924         module.exports = Properties;
11925
11926
11927         /**
11928          * Sets a named property on the target element
11929          * 
11930          * @param {Object}
11931          *            target
11932          * @param {String}
11933          *            name
11934          * @param {Object}
11935          *            value
11936          */
11937         Properties.prototype.set = function(target, name, value) {
11938
11939             var property = this.model.getPropertyDescriptor(target, name);
11940
11941             if (!property) {
11942                 target.$attrs[name] = value;
11943             } else {
11944                 Object.defineProperty(target, property.name, {
11945                     enumerable: !property.isReference,
11946                     writable: true,
11947                     value: value
11948                 });
11949             }
11950         };
11951
11952         /**
11953          * Returns the named property of the given element
11954          * 
11955          * @param {Object}
11956          *            target
11957          * @param {String}
11958          *            name
11959          * 
11960          * @return {Object}
11961          */
11962         Properties.prototype.get = function(target, name) {
11963
11964             var property = this.model.getPropertyDescriptor(target, name);
11965
11966             if (!property) {
11967                 return target.$attrs[name];
11968             }
11969
11970             var propertyName = property.name;
11971
11972             // check if access to collection property and lazily initialize it
11973             if (!target[propertyName] && property.isMany) {
11974                 Object.defineProperty(target, propertyName, {
11975                     enumerable: !property.isReference,
11976                     writable: true,
11977                     value: []
11978                 });
11979             }
11980
11981             return target[propertyName];
11982         };
11983
11984
11985         /**
11986          * Define a property on the target element
11987          * 
11988          * @param {Object}
11989          *            target
11990          * @param {String}
11991          *            name
11992          * @param {Object}
11993          *            options
11994          */
11995         Properties.prototype.define = function(target, name, options) {
11996             Object.defineProperty(target, name, options);
11997         };
11998
11999
12000         /**
12001          * Define the descriptor for an element
12002          */
12003         Properties.prototype.defineDescriptor = function(target, descriptor) {
12004             this.define(target, '$descriptor', {
12005                 value: descriptor
12006             });
12007         };
12008
12009         /**
12010          * Define the model for an element
12011          */
12012         Properties.prototype.defineModel = function(target, model) {
12013             this.define(target, '$model', {
12014                 value: model
12015             });
12016         };
12017     }, {}],
12018     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle\\lib\\registry.js": [function(require, module, exports) {
12019         'use strict';
12020
12021         var assign = require('lodash/object/assign'),
12022             forEach = require('lodash/collection/forEach');
12023
12024         var Types = require('./types'),
12025             DescriptorBuilder = require('./descriptor-builder');
12026
12027         var parseNameNs = require('./ns').parseName,
12028             isBuiltInType = Types.isBuiltIn;
12029
12030
12031         function Registry(packages, properties, options) {
12032
12033             this.options = assign({
12034                 generateId: 'id'
12035             }, options || {});
12036
12037             this.packageMap = {};
12038             this.typeMap = {};
12039
12040             this.packages = [];
12041
12042             this.properties = properties;
12043
12044             forEach(packages, this.registerPackage, this);
12045         }
12046
12047         module.exports = Registry;
12048
12049
12050         Registry.prototype.getPackage = function(uriOrPrefix) {
12051             return this.packageMap[uriOrPrefix];
12052         };
12053
12054         Registry.prototype.getPackages = function() {
12055             return this.packages;
12056         };
12057
12058
12059         Registry.prototype.registerPackage = function(pkg) {
12060             // alert("pkg :: " + pkg);
12061             // copy package
12062             pkg = assign({}, pkg);
12063
12064             // register types
12065             forEach(pkg.types, function(descriptor) {
12066                 this.registerType(descriptor, pkg);
12067             }, this);
12068
12069             this.packageMap[pkg.uri] = this.packageMap[pkg.prefix] = pkg;
12070             this.packages.push(pkg);
12071         };
12072
12073
12074         /**
12075          * Register a type from a specific package with us
12076          */
12077         Registry.prototype.registerType = function(type, pkg) {
12078
12079             type = assign({}, type, {
12080                 superClass: (type.superClass || []).slice(),
12081                 extends: (type.extends || []).slice(),
12082                 properties: (type.properties || []).slice()
12083             });
12084
12085             var ns = parseNameNs(type.name, pkg.prefix),
12086                 name = ns.name,
12087                 propertiesByName = {};
12088
12089             // parse properties
12090             forEach(type.properties, function(p) {
12091
12092                 // namespace property names
12093                 var propertyNs = parseNameNs(p.name, ns.prefix),
12094                     propertyName = propertyNs.name;
12095
12096                 // namespace property types
12097                 if (!isBuiltInType(p.type)) {
12098                     p.type = parseNameNs(p.type, propertyNs.prefix).name;
12099                 }
12100
12101                 assign(p, {
12102                     ns: propertyNs,
12103                     name: propertyName
12104                 });
12105
12106                 propertiesByName[propertyName] = p;
12107             });
12108
12109             // update ns + name
12110             assign(type, {
12111                 ns: ns,
12112                 name: name,
12113                 propertiesByName: propertiesByName
12114             });
12115
12116             forEach(type.extends, function(extendsName) {
12117                 var extended = this.typeMap[extendsName];
12118
12119                 extended.traits = extended.traits || [];
12120                 extended.traits.push(name);
12121             }, this);
12122
12123             // link to package
12124             this.definePackage(type, pkg);
12125
12126             // register
12127             this.typeMap[name] = type;
12128         };
12129
12130
12131         /**
12132          * Traverse the type hierarchy from bottom to top.
12133          */
12134         Registry.prototype.mapTypes = function(nsName, iterator) {
12135
12136             // alert("nsName :: " + nsName.name);
12137             var type = isBuiltInType(nsName.name) ? {
12138                 name: nsName.name
12139             } : this.typeMap[nsName.name];
12140             // alert("Type :: " + type);
12141
12142             var self = this;
12143
12144             /**
12145              * Traverse the selected super type or trait
12146              * 
12147              * @param {String}
12148              *            cls
12149              */
12150             function traverseSuper(cls) {
12151                 var parentNs = parseNameNs(cls, isBuiltInType(cls) ? '' : nsName.prefix);
12152                 self.mapTypes(parentNs, iterator);
12153             }
12154
12155             if (!type) {
12156                 throw new Error('unknown type <' + nsName.name + '>');
12157             }
12158
12159             forEach(type.superClass, traverseSuper);
12160
12161             iterator(type);
12162
12163             forEach(type.traits, traverseSuper);
12164         };
12165
12166
12167         /**
12168          * Returns the effective descriptor for a type.
12169          * 
12170          * @param {String}
12171          *            type the namespaced name (ns:localName) of the type
12172          * 
12173          * @return {Descriptor} the resulting effective descriptor
12174          */
12175         Registry.prototype.getEffectiveDescriptor = function(name) {
12176
12177             var nsName = parseNameNs(name);
12178
12179             var builder = new DescriptorBuilder(nsName);
12180
12181             this.mapTypes(nsName, function(type) {
12182                 builder.addTrait(type);
12183             });
12184
12185             // check we have an id assigned
12186             var id = this.options.generateId;
12187             if (id && !builder.hasProperty(id)) {
12188                 builder.addIdProperty(id);
12189             }
12190
12191             var descriptor = builder.build();
12192
12193             // define package link
12194             this.definePackage(descriptor, descriptor.allTypes[descriptor.allTypes.length - 1].$pkg);
12195
12196             return descriptor;
12197         };
12198
12199
12200         Registry.prototype.definePackage = function(target, pkg) {
12201             this.properties.define(target, '$pkg', {
12202                 value: pkg
12203             });
12204         };
12205     }, {
12206         "./descriptor-builder": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle\\lib\\descriptor-builder.js",
12207         "./ns": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle\\lib\\ns.js",
12208         "./types": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle\\lib\\types.js",
12209         "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
12210         "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js"
12211     }],
12212     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\node_modules\\moddle\\lib\\types.js": [function(require, module, exports) {
12213         'use strict';
12214
12215         /**
12216          * Built-in moddle types
12217          */
12218         var BUILTINS = {
12219             String: true,
12220             Boolean: true,
12221             Integer: true,
12222             Real: true,
12223             Element: true
12224         };
12225
12226         /**
12227          * Converters for built in types from string representations
12228          */
12229         var TYPE_CONVERTERS = {
12230             String: function(s) {
12231                 return s;
12232             },
12233             Boolean: function(s) {
12234                 return s === 'true';
12235             },
12236             Integer: function(s) {
12237                 return parseInt(s, 10);
12238             },
12239             Real: function(s) {
12240                 return parseFloat(s, 10);
12241             }
12242         };
12243
12244         /**
12245          * Convert a type to its real representation
12246          */
12247         module.exports.coerceType = function(type, value) {
12248
12249             var converter = TYPE_CONVERTERS[type];
12250
12251             if (converter) {
12252                 return converter(value);
12253             } else {
12254                 return value;
12255             }
12256         };
12257
12258         /**
12259          * Return whether the given type is built-in
12260          */
12261         module.exports.isBuiltIn = function(type) {
12262             return !!BUILTINS[type];
12263         };
12264
12265         /**
12266          * Return whether the given type is simple
12267          */
12268         module.exports.isSimple = function(type) {
12269             return !!TYPE_CONVERTERS[type];
12270         };
12271     }, {}],
12272     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\resources\\bpmn\\json\\bpmn.json": [function(require, module, exports) {
12273         module.exports = {
12274             "name": "BPMN20",
12275             "uri": "http://www.omg.org/spec/BPMN/20100524/MODEL",
12276             "associations": [],
12277             "types": [{
12278                 "name": "Interface",
12279                 "superClass": [
12280                     "RootElement"
12281                 ],
12282                 "properties": [{
12283                     "name": "name",
12284                     "isAttr": true,
12285                     "type": "String"
12286                 }, {
12287                     "name": "operations",
12288                     "type": "Operation",
12289                     "isMany": true
12290                 }, {
12291                     "name": "implementationRef",
12292                     "type": "String",
12293                     "isAttr": true
12294                 }]
12295             }, {
12296                 "name": "Operation",
12297                 "superClass": [
12298                     "BaseElement"
12299                 ],
12300                 "properties": [{
12301                     "name": "name",
12302                     "isAttr": true,
12303                     "type": "String"
12304                 }, {
12305                     "name": "inMessageRef",
12306                     "type": "Message",
12307                     "isAttr": true,
12308                     "isReference": true
12309                 }, {
12310                     "name": "outMessageRef",
12311                     "type": "Message",
12312                     "isAttr": true,
12313                     "isReference": true
12314                 }, {
12315                     "name": "errorRefs",
12316                     "type": "Error",
12317                     "isMany": true,
12318                     "isReference": true
12319                 }, {
12320                     "name": "implementationRef",
12321                     "type": "String",
12322                     "isAttr": true
12323                 }]
12324             }, {
12325                 "name": "EndPoint",
12326                 "superClass": [
12327                     "RootElement"
12328                 ]
12329             }, {
12330                 "name": "Auditing",
12331                 "superClass": [
12332                     "BaseElement"
12333                 ]
12334             }, {
12335                 "name": "GlobalTask",
12336                 "superClass": [
12337                     "CallableElement"
12338                 ],
12339                 "properties": [{
12340                     "name": "resources",
12341                     "type": "ResourceRole",
12342                     "isMany": true
12343                 }]
12344             }, {
12345                 "name": "Monitoring",
12346                 "superClass": [
12347                     "BaseElement"
12348                 ]
12349             }, {
12350                 "name": "Performer",
12351                 "superClass": [
12352                     "ResourceRole"
12353                 ]
12354             }, {
12355                 "name": "Process",
12356                 "superClass": [
12357                     "FlowElementsContainer",
12358                     "CallableElement"
12359                 ],
12360                 "properties": [{
12361                     "name": "processType",
12362                     "type": "ProcessType",
12363                     "isAttr": true
12364                 }, {
12365                     "name": "isClosed",
12366                     "isAttr": true,
12367                     "type": "Boolean"
12368                 }, {
12369                     "name": "auditing",
12370                     "type": "Auditing"
12371                 }, {
12372                     "name": "monitoring",
12373                     "type": "Monitoring"
12374                 }, {
12375                     "name": "properties",
12376                     "type": "Property",
12377                     "isMany": true
12378                 }, {
12379                     "name": "supports",
12380                     "type": "Process",
12381                     "isMany": true,
12382                     "isReference": true
12383                 }, {
12384                     "name": "definitionalCollaborationRef",
12385                     "type": "Collaboration",
12386                     "isAttr": true,
12387                     "isReference": true
12388                 }, {
12389                     "name": "isExecutable",
12390                     "isAttr": true,
12391                     "type": "Boolean"
12392                 }, {
12393                     "name": "resources",
12394                     "type": "ResourceRole",
12395                     "isMany": true
12396                 }, {
12397                     "name": "artifacts",
12398                     "type": "Artifact",
12399                     "isMany": true
12400                 }, {
12401                     "name": "correlationSubscriptions",
12402                     "type": "CorrelationSubscription",
12403                     "isMany": true
12404                 }]
12405             }, {
12406                 "name": "LaneSet",
12407                 "superClass": [
12408                     "BaseElement"
12409                 ],
12410                 "properties": [{
12411                     "name": "lanes",
12412                     "type": "Lane",
12413                     "isMany": true
12414                 }, {
12415                     "name": "name",
12416                     "isAttr": true,
12417                     "type": "String"
12418                 }]
12419             }, {
12420                 "name": "Lane",
12421                 "superClass": [
12422                     "BaseElement"
12423                 ],
12424                 "properties": [{
12425                     "name": "name",
12426                     "isAttr": true,
12427                     "type": "String"
12428                 }, {
12429                     "name": "childLaneSet",
12430                     "type": "LaneSet",
12431                     "serialize": "xsi:type"
12432                 }, {
12433                     "name": "partitionElementRef",
12434                     "type": "BaseElement",
12435                     "isAttr": true,
12436                     "isReference": true
12437                 }, {
12438                     "name": "flowNodeRef",
12439                     "type": "FlowNode",
12440                     "isMany": true,
12441                     "isReference": true
12442                 }, {
12443                     "name": "partitionElement",
12444                     "type": "BaseElement"
12445                 }]
12446             }, {
12447                 "name": "GlobalManualTask",
12448                 "superClass": [
12449                     "GlobalTask"
12450                 ]
12451             }, {
12452                 "name": "ManualTask",
12453                 "superClass": [
12454                     "Task"
12455                 ]
12456             }, {
12457                 "name": "UserTask",
12458                 "superClass": [
12459                     "Task"
12460                 ],
12461                 "properties": [{
12462                     "name": "renderings",
12463                     "type": "Rendering",
12464                     "isMany": true
12465                 }, {
12466                     "name": "implementation",
12467                     "isAttr": true,
12468                     "type": "String"
12469                 }]
12470             }, {
12471                 "name": "Rendering",
12472                 "superClass": [
12473                     "BaseElement"
12474                 ]
12475             }, {
12476                 "name": "HumanPerformer",
12477                 "superClass": [
12478                     "Performer"
12479                 ]
12480             }, {
12481                 "name": "PotentialOwner",
12482                 "superClass": [
12483                     "HumanPerformer"
12484                 ]
12485             }, {
12486                 "name": "GlobalUserTask",
12487                 "superClass": [
12488                     "GlobalTask"
12489                 ],
12490                 "properties": [{
12491                     "name": "implementation",
12492                     "isAttr": true,
12493                     "type": "String"
12494                 }, {
12495                     "name": "renderings",
12496                     "type": "Rendering",
12497                     "isMany": true
12498                 }]
12499             }, {
12500                 "name": "Gateway",
12501                 "isAbstract": true,
12502                 "superClass": [
12503                     "FlowNode"
12504                 ],
12505                 "properties": [{
12506                     "name": "gatewayDirection",
12507                     "type": "GatewayDirection",
12508                     "default": "Unspecified",
12509                     "isAttr": true
12510                 }]
12511             }, {
12512                 "name": "EventBasedGateway",
12513                 "superClass": [
12514                     "Gateway"
12515                 ],
12516                 "properties": [{
12517                     "name": "instantiate",
12518                     "default": false,
12519                     "isAttr": true,
12520                     "type": "Boolean"
12521                 }, {
12522                     "name": "eventGatewayType",
12523                     "type": "EventBasedGatewayType",
12524                     "isAttr": true,
12525                     "default": "Exclusive"
12526                 }]
12527             }, {
12528                 "name": "ComplexGateway",
12529                 "superClass": [
12530                     "Gateway"
12531                 ],
12532                 "properties": [{
12533                     "name": "activationCondition",
12534                     "type": "Expression",
12535                     "serialize": "xsi:type"
12536                 }, {
12537                     "name": "default",
12538                     "type": "SequenceFlow",
12539                     "isAttr": true,
12540                     "isReference": true
12541                 }]
12542             }, {
12543                 "name": "ExclusiveGateway",
12544                 "superClass": [
12545                     "Gateway"
12546                 ],
12547                 "properties": [{
12548                     "name": "default",
12549                     "type": "SequenceFlow",
12550                     "isAttr": true,
12551                     "isReference": true
12552                 }]
12553             }, {
12554                 "name": "InclusiveGateway",
12555                 "superClass": [
12556                     "Gateway"
12557                 ],
12558                 "properties": [{
12559                     "name": "default",
12560                     "type": "SequenceFlow",
12561                     "isAttr": true,
12562                     "isReference": true
12563                 }]
12564             }, {
12565                 "name": "ParallelGateway",
12566                 "superClass": [
12567                     "Gateway"
12568                 ]
12569             }, {
12570                 "name": "RootElement",
12571                 "isAbstract": true,
12572                 "superClass": [
12573                     "BaseElement"
12574                 ]
12575             }, {
12576                 "name": "Relationship",
12577                 "superClass": [
12578                     "BaseElement"
12579                 ],
12580                 "properties": [{
12581                     "name": "type",
12582                     "isAttr": true,
12583                     "type": "String"
12584                 }, {
12585                     "name": "direction",
12586                     "type": "RelationshipDirection",
12587                     "isAttr": true
12588                 }, {
12589                     "name": "source",
12590                     "isMany": true,
12591                     "isReference": true,
12592                     "type": "Element"
12593                 }, {
12594                     "name": "target",
12595                     "isMany": true,
12596                     "isReference": true,
12597                     "type": "Element"
12598                 }]
12599             }, {
12600                 "name": "BaseElement",
12601                 "isAbstract": true,
12602                 "properties": [{
12603                     "name": "id",
12604                     "isAttr": true,
12605                     "type": "String"
12606                 }, {
12607                     "name": "documentation",
12608                     "type": "Documentation",
12609                     "isMany": true
12610                 }, {
12611                     "name": "extensionDefinitions",
12612                     "type": "ExtensionDefinition",
12613                     "isMany": true,
12614                     "isReference": true
12615                 }, {
12616                     "name": "extensionElements",
12617                     "type": "ExtensionElements"
12618                 }]
12619             }, {
12620                 "name": "Extension",
12621                 "properties": [{
12622                     "name": "mustUnderstand",
12623                     "default": false,
12624                     "isAttr": true,
12625                     "type": "Boolean"
12626                 }, {
12627                     "name": "definition",
12628                     "type": "ExtensionDefinition"
12629                 }]
12630             }, {
12631                 "name": "ExtensionDefinition",
12632                 "properties": [{
12633                     "name": "name",
12634                     "isAttr": true,
12635                     "type": "String"
12636                 }, {
12637                     "name": "extensionAttributeDefinitions",
12638                     "type": "ExtensionAttributeDefinition",
12639                     "isMany": true
12640                 }]
12641             }, {
12642                 "name": "ExtensionAttributeDefinition",
12643                 "properties": [{
12644                     "name": "name",
12645                     "isAttr": true,
12646                     "type": "String"
12647                 }, {
12648                     "name": "type",
12649                     "isAttr": true,
12650                     "type": "String"
12651                 }, {
12652                     "name": "isReference",
12653                     "default": false,
12654                     "isAttr": true,
12655                     "type": "Boolean"
12656                 }, {
12657                     "name": "extensionDefinition",
12658                     "type": "ExtensionDefinition",
12659                     "isAttr": true,
12660                     "isReference": true
12661                 }]
12662             }, {
12663                 "name": "ExtensionElements",
12664                 "properties": [{
12665                     "name": "valueRef",
12666                     "isAttr": true,
12667                     "isReference": true,
12668                     "type": "Element"
12669                 }, {
12670                     "name": "values",
12671                     "type": "Element",
12672                     "isMany": true
12673                 }, {
12674                     "name": "extensionAttributeDefinition",
12675                     "type": "ExtensionAttributeDefinition",
12676                     "isAttr": true,
12677                     "isReference": true
12678                 }]
12679             }, {
12680                 "name": "Documentation",
12681                 "superClass": [
12682                     "BaseElement"
12683                 ],
12684                 "properties": [{
12685                     "name": "text",
12686                     "type": "String",
12687                     "isBody": true
12688                 }, {
12689                     "name": "textFormat",
12690                     "default": "text/plain",
12691                     "isAttr": true,
12692                     "type": "String"
12693                 }]
12694             }, {
12695                 "name": "Event",
12696                 "isAbstract": true,
12697                 "superClass": [
12698                     "FlowNode",
12699                     "InteractionNode"
12700                 ],
12701                 "properties": [{
12702                     "name": "properties",
12703                     "type": "Property",
12704                     "isMany": true
12705                 }]
12706             }, {
12707                 "name": "IntermediateCatchEvent",
12708                 "superClass": [
12709                     "CatchEvent"
12710                 ]
12711             }, {
12712                 "name": "IntermediateThrowEvent",
12713                 "superClass": [
12714                     "ThrowEvent"
12715                 ]
12716             }, {
12717                 "name": "EndEvent",
12718                 "superClass": [
12719                     "ThrowEvent"
12720                 ]
12721             }, {
12722                 "name": "StartEvent",
12723                 "superClass": [
12724                     "CatchEvent"
12725                 ],
12726                 "properties": [{
12727                     "name": "isInterrupting",
12728                     "default": true,
12729                     "isAttr": true,
12730                     "type": "Boolean"
12731                 }]
12732             }, {
12733                 "name": "MultiBranchConnector",
12734                 "superClass": [
12735                     "CatchEvent"
12736                 ],
12737                 "properties": [{
12738                     "name": "isInterrupting",
12739                     "default": true,
12740                     "isAttr": true,
12741                     "type": "Boolean"
12742                 }]
12743             }, {
12744                 "name": "ParentReturn",
12745                 "superClass": [
12746                     "Activity",
12747                     "InteractionNode"
12748                 ]
12749             }, {
12750                 "name": "SubProcessCall",
12751                 "superClass": [
12752                     "Activity",
12753                     "InteractionNode"
12754                 ]
12755             }, {
12756                 "name": "ThrowEvent",
12757                 "isAbstract": true,
12758                 "superClass": [
12759                     "Event"
12760                 ],
12761                 "properties": [{
12762                     "name": "inputSet",
12763                     "type": "InputSet"
12764                 }, {
12765                     "name": "eventDefinitionRefs",
12766                     "type": "EventDefinition",
12767                     "isMany": true,
12768                     "isReference": true
12769                 }, {
12770                     "name": "dataInputAssociation",
12771                     "type": "DataInputAssociation",
12772                     "isMany": true
12773                 }, {
12774                     "name": "dataInputs",
12775                     "type": "DataInput",
12776                     "isMany": true
12777                 }, {
12778                     "name": "eventDefinitions",
12779                     "type": "EventDefinition",
12780                     "isMany": true
12781                 }]
12782             }, {
12783                 "name": "CatchEvent",
12784                 "isAbstract": true,
12785                 "superClass": [
12786                     "Event"
12787                 ],
12788                 "properties": [{
12789                     "name": "parallelMultiple",
12790                     "isAttr": true,
12791                     "type": "Boolean",
12792                     "default": false
12793                 }, {
12794                     "name": "outputSet",
12795                     "type": "OutputSet"
12796                 }, {
12797                     "name": "eventDefinitionRefs",
12798                     "type": "EventDefinition",
12799                     "isMany": true,
12800                     "isReference": true
12801                 }, {
12802                     "name": "dataOutputAssociation",
12803                     "type": "DataOutputAssociation",
12804                     "isMany": true
12805                 }, {
12806                     "name": "dataOutputs",
12807                     "type": "DataOutput",
12808                     "isMany": true
12809                 }, {
12810                     "name": "eventDefinitions",
12811                     "type": "EventDefinition",
12812                     "isMany": true
12813                 }]
12814             }, {
12815                 "name": "BoundaryEvent",
12816                 "superClass": [
12817                     "CatchEvent"
12818                 ],
12819                 "properties": [{
12820                     "name": "cancelActivity",
12821                     "default": true,
12822                     "isAttr": true,
12823                     "type": "Boolean"
12824                 }, {
12825                     "name": "attachedToRef",
12826                     "type": "Activity",
12827                     "isAttr": true,
12828                     "isReference": true
12829                 }]
12830             }, {
12831                 "name": "EventDefinition",
12832                 "isAbstract": true,
12833                 "superClass": [
12834                     "RootElement"
12835                 ]
12836             }, {
12837                 "name": "CancelEventDefinition",
12838                 "superClass": [
12839                     "EventDefinition"
12840                 ]
12841             }, {
12842                 "name": "ErrorEventDefinition",
12843                 "superClass": [
12844                     "EventDefinition"
12845                 ],
12846                 "properties": [{
12847                     "name": "errorRef",
12848                     "type": "Error",
12849                     "isAttr": true,
12850                     "isReference": true
12851                 }]
12852             }, {
12853                 "name": "TerminateEventDefinition",
12854                 "superClass": [
12855                     "EventDefinition"
12856                 ]
12857             }, {
12858                 "name": "EscalationEventDefinition",
12859                 "superClass": [
12860                     "EventDefinition"
12861                 ],
12862                 "properties": [{
12863                     "name": "escalationRef",
12864                     "type": "Escalation",
12865                     "isAttr": true,
12866                     "isReference": true
12867                 }]
12868             }, {
12869                 "name": "Escalation",
12870                 "properties": [{
12871                     "name": "structureRef",
12872                     "type": "ItemDefinition",
12873                     "isAttr": true,
12874                     "isReference": true
12875                 }, {
12876                     "name": "name",
12877                     "isAttr": true,
12878                     "type": "String"
12879                 }, {
12880                     "name": "escalationCode",
12881                     "isAttr": true,
12882                     "type": "String"
12883                 }],
12884                 "superClass": [
12885                     "RootElement"
12886                 ]
12887             }, {
12888                 "name": "CompensateEventDefinition",
12889                 "superClass": [
12890                     "EventDefinition"
12891                 ],
12892                 "properties": [{
12893                     "name": "waitForCompletion",
12894                     "isAttr": true,
12895                     "type": "Boolean"
12896                 }, {
12897                     "name": "activityRef",
12898                     "type": "Activity",
12899                     "isAttr": true,
12900                     "isReference": true
12901                 }]
12902             }, {
12903                 "name": "TimerEventDefinition",
12904                 "superClass": [
12905                     "EventDefinition"
12906                 ],
12907                 "properties": [{
12908                     "name": "timeDate",
12909                     "type": "Expression",
12910                     "serialize": "xsi:type"
12911                 }, {
12912                     "name": "timeCycle",
12913                     "type": "Expression",
12914                     "serialize": "xsi:type"
12915                 }, {
12916                     "name": "timeDuration",
12917                     "type": "Expression",
12918                     "serialize": "xsi:type"
12919                 }]
12920             }, {
12921                 "name": "LinkEventDefinition",
12922                 "superClass": [
12923                     "EventDefinition"
12924                 ],
12925                 "properties": [{
12926                     "name": "name",
12927                     "isAttr": true,
12928                     "type": "String"
12929                 }, {
12930                     "name": "target",
12931                     "type": "LinkEventDefinition",
12932                     "isAttr": true,
12933                     "isReference": true
12934                 }, {
12935                     "name": "source",
12936                     "type": "LinkEventDefinition",
12937                     "isMany": true,
12938                     "isReference": true
12939                 }]
12940             }, {
12941                 "name": "MessageEventDefinition",
12942                 "superClass": [
12943                     "EventDefinition"
12944                 ],
12945                 "properties": [{
12946                     "name": "messageRef",
12947                     "type": "Message",
12948                     "isAttr": true,
12949                     "isReference": true
12950                 }, {
12951                     "name": "operationRef",
12952                     "type": "Operation",
12953                     "isAttr": true,
12954                     "isReference": true
12955                 }]
12956             }, {
12957                 "name": "ConditionalEventDefinition",
12958                 "superClass": [
12959                     "EventDefinition"
12960                 ],
12961                 "properties": [{
12962                     "name": "condition",
12963                     "type": "Expression",
12964                     "serialize": "xsi:type"
12965                 }]
12966             }, {
12967                 "name": "SignalEventDefinition",
12968                 "superClass": [
12969                     "EventDefinition"
12970                 ],
12971                 "properties": [{
12972                     "name": "signalRef",
12973                     "type": "Signal",
12974                     "isAttr": true,
12975                     "isReference": true
12976                 }]
12977             }, {
12978                 "name": "Signal",
12979                 "superClass": [
12980                     "RootElement"
12981                 ],
12982                 "properties": [{
12983                     "name": "structureRef",
12984                     "type": "ItemDefinition",
12985                     "isAttr": true,
12986                     "isReference": true
12987                 }, {
12988                     "name": "name",
12989                     "isAttr": true,
12990                     "type": "String"
12991                 }]
12992             }, {
12993                 "name": "ImplicitThrowEvent",
12994                 "superClass": [
12995                     "ThrowEvent"
12996                 ]
12997             }, {
12998                 "name": "DataState",
12999                 "superClass": [
13000                     "BaseElement"
13001                 ],
13002                 "properties": [{
13003                     "name": "name",
13004                     "isAttr": true,
13005                     "type": "String"
13006                 }]
13007             }, {
13008                 "name": "ItemAwareElement",
13009                 "superClass": [
13010                     "BaseElement"
13011                 ],
13012                 "properties": [{
13013                     "name": "itemSubjectRef",
13014                     "type": "ItemDefinition",
13015                     "isAttr": true,
13016                     "isReference": true
13017                 }, {
13018                     "name": "dataState",
13019                     "type": "DataState"
13020                 }]
13021             }, {
13022                 "name": "DataAssociation",
13023                 "superClass": [
13024                     "BaseElement"
13025                 ],
13026                 "properties": [{
13027                     "name": "transformation",
13028                     "type": "FormalExpression"
13029                 }, {
13030                     "name": "assignment",
13031                     "type": "Assignment",
13032                     "isMany": true
13033                 }, {
13034                     "name": "sourceRef",
13035                     "type": "ItemAwareElement",
13036                     "isMany": true,
13037                     "isReference": true
13038                 }, {
13039                     "name": "targetRef",
13040                     "type": "ItemAwareElement",
13041                     "isReference": true
13042                 }]
13043             }, {
13044                 "name": "DataInput",
13045                 "superClass": [
13046                     "ItemAwareElement"
13047                 ],
13048                 "properties": [{
13049                     "name": "name",
13050                     "isAttr": true,
13051                     "type": "String"
13052                 }, {
13053                     "name": "isCollection",
13054                     "default": false,
13055                     "isAttr": true,
13056                     "type": "Boolean"
13057                 }, {
13058                     "name": "inputSetRefs",
13059                     "type": "InputSet",
13060                     "isVirtual": true,
13061                     "isMany": true,
13062                     "isReference": true
13063                 }, {
13064                     "name": "inputSetWithOptional",
13065                     "type": "InputSet",
13066                     "isVirtual": true,
13067                     "isMany": true,
13068                     "isReference": true
13069                 }, {
13070                     "name": "inputSetWithWhileExecuting",
13071                     "type": "InputSet",
13072                     "isVirtual": true,
13073                     "isMany": true,
13074                     "isReference": true
13075                 }]
13076             }, {
13077                 "name": "DataOutput",
13078                 "superClass": [
13079                     "ItemAwareElement"
13080                 ],
13081                 "properties": [{
13082                     "name": "name",
13083                     "isAttr": true,
13084                     "type": "String"
13085                 }, {
13086                     "name": "isCollection",
13087                     "default": false,
13088                     "isAttr": true,
13089                     "type": "Boolean"
13090                 }, {
13091                     "name": "outputSetRefs",
13092                     "type": "OutputSet",
13093                     "isVirtual": true,
13094                     "isMany": true,
13095                     "isReference": true
13096                 }, {
13097                     "name": "outputSetWithOptional",
13098                     "type": "OutputSet",
13099                     "isVirtual": true,
13100                     "isMany": true,
13101                     "isReference": true
13102                 }, {
13103                     "name": "outputSetWithWhileExecuting",
13104                     "type": "OutputSet",
13105                     "isVirtual": true,
13106                     "isMany": true,
13107                     "isReference": true
13108                 }]
13109             }, {
13110                 "name": "InputSet",
13111                 "superClass": [
13112                     "BaseElement"
13113                 ],
13114                 "properties": [{
13115                     "name": "name",
13116                     "isAttr": true,
13117                     "type": "String"
13118                 }, {
13119                     "name": "dataInputRefs",
13120                     "type": "DataInput",
13121                     "isMany": true,
13122                     "isReference": true
13123                 }, {
13124                     "name": "optionalInputRefs",
13125                     "type": "DataInput",
13126                     "isMany": true,
13127                     "isReference": true
13128                 }, {
13129                     "name": "whileExecutingInputRefs",
13130                     "type": "DataInput",
13131                     "isMany": true,
13132                     "isReference": true
13133                 }, {
13134                     "name": "outputSetRefs",
13135                     "type": "OutputSet",
13136                     "isMany": true,
13137                     "isReference": true
13138                 }]
13139             }, {
13140                 "name": "OutputSet",
13141                 "superClass": [
13142                     "BaseElement"
13143                 ],
13144                 "properties": [{
13145                     "name": "dataOutputRefs",
13146                     "type": "DataOutput",
13147                     "isMany": true,
13148                     "isReference": true
13149                 }, {
13150                     "name": "name",
13151                     "isAttr": true,
13152                     "type": "String"
13153                 }, {
13154                     "name": "inputSetRefs",
13155                     "type": "InputSet",
13156                     "isMany": true,
13157                     "isReference": true
13158                 }, {
13159                     "name": "optionalOutputRefs",
13160                     "type": "DataOutput",
13161                     "isMany": true,
13162                     "isReference": true
13163                 }, {
13164                     "name": "whileExecutingOutputRefs",
13165                     "type": "DataOutput",
13166                     "isMany": true,
13167                     "isReference": true
13168                 }]
13169             }, {
13170                 "name": "Property",
13171                 "superClass": [
13172                     "ItemAwareElement"
13173                 ],
13174                 "properties": [{
13175                     "name": "name",
13176                     "isAttr": true,
13177                     "type": "String"
13178                 }]
13179             }, {
13180                 "name": "DataInputAssociation",
13181                 "superClass": [
13182                     "DataAssociation"
13183                 ]
13184             }, {
13185                 "name": "DataOutputAssociation",
13186                 "superClass": [
13187                     "DataAssociation"
13188                 ]
13189             }, {
13190                 "name": "InputOutputSpecification",
13191                 "superClass": [
13192                     "BaseElement"
13193                 ],
13194                 "properties": [{
13195                     "name": "inputSets",
13196                     "type": "InputSet",
13197                     "isMany": true
13198                 }, {
13199                     "name": "outputSets",
13200                     "type": "OutputSet",
13201                     "isMany": true
13202                 }, {
13203                     "name": "dataInputs",
13204                     "type": "DataInput",
13205                     "isMany": true
13206                 }, {
13207                     "name": "dataOutputs",
13208                     "type": "DataOutput",
13209                     "isMany": true
13210                 }]
13211             }, {
13212                 "name": "DataObject",
13213                 "superClass": [
13214                     "FlowElement",
13215                     "ItemAwareElement"
13216                 ],
13217                 "properties": [{
13218                     "name": "isCollection",
13219                     "default": false,
13220                     "isAttr": true,
13221                     "type": "Boolean"
13222                 }]
13223             }, {
13224                 "name": "InputOutputBinding",
13225                 "properties": [{
13226                     "name": "inputDataRef",
13227                     "type": "InputSet",
13228                     "isAttr": true,
13229                     "isReference": true
13230                 }, {
13231                     "name": "outputDataRef",
13232                     "type": "OutputSet",
13233                     "isAttr": true,
13234                     "isReference": true
13235                 }, {
13236                     "name": "operationRef",
13237                     "type": "Operation",
13238                     "isAttr": true,
13239                     "isReference": true
13240                 }]
13241             }, {
13242                 "name": "Assignment",
13243                 "superClass": [
13244                     "BaseElement"
13245                 ],
13246                 "properties": [{
13247                     "name": "from",
13248                     "type": "Expression",
13249                     "serialize": "xsi:type"
13250                 }, {
13251                     "name": "to",
13252                     "type": "Expression",
13253                     "serialize": "xsi:type"
13254                 }]
13255             }, {
13256                 "name": "DataStore",
13257                 "superClass": [
13258                     "RootElement",
13259                     "ItemAwareElement"
13260                 ],
13261                 "properties": [{
13262                     "name": "name",
13263                     "isAttr": true,
13264                     "type": "String"
13265                 }, {
13266                     "name": "capacity",
13267                     "isAttr": true,
13268                     "type": "Integer"
13269                 }, {
13270                     "name": "isUnlimited",
13271                     "default": true,
13272                     "isAttr": true,
13273                     "type": "Boolean"
13274                 }]
13275             }, {
13276                 "name": "DataStoreReference",
13277                 "superClass": [
13278                     "ItemAwareElement",
13279                     "FlowElement"
13280                 ],
13281                 "properties": [{
13282                     "name": "dataStoreRef",
13283                     "type": "DataStore",
13284                     "isAttr": true,
13285                     "isReference": true
13286                 }]
13287             }, {
13288                 "name": "DataObjectReference",
13289                 "superClass": [
13290                     "ItemAwareElement",
13291                     "FlowElement"
13292                 ],
13293                 "properties": [{
13294                     "name": "dataObjectRef",
13295                     "type": "DataObject",
13296                     "isAttr": true,
13297                     "isReference": true
13298                 }]
13299             }, {
13300                 "name": "ConversationLink",
13301                 "superClass": [
13302                     "BaseElement"
13303                 ],
13304                 "properties": [{
13305                     "name": "sourceRef",
13306                     "type": "InteractionNode",
13307                     "isAttr": true,
13308                     "isReference": true
13309                 }, {
13310                     "name": "targetRef",
13311                     "type": "InteractionNode",
13312                     "isAttr": true,
13313                     "isReference": true
13314                 }, {
13315                     "name": "name",
13316                     "isAttr": true,
13317                     "type": "String"
13318                 }]
13319             }, {
13320                 "name": "ConversationAssociation",
13321                 "superClass": [
13322                     "BaseElement"
13323                 ],
13324                 "properties": [{
13325                     "name": "innerConversationNodeRef",
13326                     "type": "ConversationNode",
13327                     "isAttr": true,
13328                     "isReference": true
13329                 }, {
13330                     "name": "outerConversationNodeRef",
13331                     "type": "ConversationNode",
13332                     "isAttr": true,
13333                     "isReference": true
13334                 }]
13335             }, {
13336                 "name": "CallConversation",
13337                 "superClass": [
13338                     "ConversationNode"
13339                 ],
13340                 "properties": [{
13341                     "name": "calledCollaborationRef",
13342                     "type": "Collaboration",
13343                     "isAttr": true,
13344                     "isReference": true
13345                 }, {
13346                     "name": "participantAssociations",
13347                     "type": "ParticipantAssociation",
13348                     "isMany": true
13349                 }]
13350             }, {
13351                 "name": "Conversation",
13352                 "superClass": [
13353                     "ConversationNode"
13354                 ]
13355             }, {
13356                 "name": "SubConversation",
13357                 "superClass": [
13358                     "ConversationNode"
13359                 ],
13360                 "properties": [{
13361                     "name": "conversationNodes",
13362                     "type": "ConversationNode",
13363                     "isMany": true
13364                 }]
13365             }, {
13366                 "name": "ConversationNode",
13367                 "isAbstract": true,
13368                 "superClass": [
13369                     "InteractionNode",
13370                     "BaseElement"
13371                 ],
13372                 "properties": [{
13373                     "name": "name",
13374                     "isAttr": true,
13375                     "type": "String"
13376                 }, {
13377                     "name": "participantRefs",
13378                     "type": "Participant",
13379                     "isMany": true,
13380                     "isReference": true
13381                 }, {
13382                     "name": "messageFlowRefs",
13383                     "type": "MessageFlow",
13384                     "isMany": true,
13385                     "isReference": true
13386                 }, {
13387                     "name": "correlationKeys",
13388                     "type": "CorrelationKey",
13389                     "isMany": true
13390                 }]
13391             }, {
13392                 "name": "GlobalConversation",
13393                 "superClass": [
13394                     "Collaboration"
13395                 ]
13396             }, {
13397                 "name": "PartnerEntity",
13398                 "superClass": [
13399                     "RootElement"
13400                 ],
13401                 "properties": [{
13402                     "name": "name",
13403                     "isAttr": true,
13404                     "type": "String"
13405                 }, {
13406                     "name": "participantRef",
13407                     "type": "Participant",
13408                     "isMany": true,
13409                     "isReference": true
13410                 }]
13411             }, {
13412                 "name": "PartnerRole",
13413                 "superClass": [
13414                     "RootElement"
13415                 ],
13416                 "properties": [{
13417                     "name": "name",
13418                     "isAttr": true,
13419                     "type": "String"
13420                 }, {
13421                     "name": "participantRef",
13422                     "type": "Participant",
13423                     "isMany": true,
13424                     "isReference": true
13425                 }]
13426             }, {
13427                 "name": "CorrelationProperty",
13428                 "superClass": [
13429                     "RootElement"
13430                 ],
13431                 "properties": [{
13432                     "name": "correlationPropertyRetrievalExpression",
13433                     "type": "CorrelationPropertyRetrievalExpression",
13434                     "isMany": true
13435                 }, {
13436                     "name": "name",
13437                     "isAttr": true,
13438                     "type": "String"
13439                 }, {
13440                     "name": "type",
13441                     "type": "ItemDefinition",
13442                     "isAttr": true,
13443                     "isReference": true
13444                 }]
13445             }, {
13446                 "name": "Error",
13447                 "superClass": [
13448                     "RootElement"
13449                 ],
13450                 "properties": [{
13451                     "name": "structureRef",
13452                     "type": "ItemDefinition",
13453                     "isAttr": true,
13454                     "isReference": true
13455                 }, {
13456                     "name": "name",
13457                     "isAttr": true,
13458                     "type": "String"
13459                 }, {
13460                     "name": "errorCode",
13461                     "isAttr": true,
13462                     "type": "String"
13463                 }]
13464             }, {
13465                 "name": "CorrelationKey",
13466                 "superClass": [
13467                     "BaseElement"
13468                 ],
13469                 "properties": [{
13470                     "name": "correlationPropertyRef",
13471                     "type": "CorrelationProperty",
13472                     "isMany": true,
13473                     "isReference": true
13474                 }, {
13475                     "name": "name",
13476                     "isAttr": true,
13477                     "type": "String"
13478                 }]
13479             }, {
13480                 "name": "Expression",
13481                 "superClass": [
13482                     "BaseElement"
13483                 ],
13484                 "isAbstract": true
13485             }, {
13486                 "name": "FormalExpression",
13487                 "superClass": [
13488                     "Expression"
13489                 ],
13490                 "properties": [{
13491                     "name": "language",
13492                     "isAttr": true,
13493                     "type": "String"
13494                 }, {
13495                     "name": "body",
13496                     "type": "String",
13497                     "isBody": true
13498                 }, {
13499                     "name": "evaluatesToTypeRef",
13500                     "type": "ItemDefinition",
13501                     "isAttr": true,
13502                     "isReference": true
13503                 }]
13504             }, {
13505                 "name": "Message",
13506                 "superClass": [
13507                     "RootElement"
13508                 ],
13509                 "properties": [{
13510                     "name": "name",
13511                     "isAttr": true,
13512                     "type": "String"
13513                 }, {
13514                     "name": "itemRef",
13515                     "type": "ItemDefinition",
13516                     "isAttr": true,
13517                     "isReference": true
13518                 }]
13519             }, {
13520                 "name": "ItemDefinition",
13521                 "superClass": [
13522                     "RootElement"
13523                 ],
13524                 "properties": [{
13525                     "name": "itemKind",
13526                     "type": "ItemKind",
13527                     "isAttr": true
13528                 }, {
13529                     "name": "structureRef",
13530                     "type": "String",
13531                     "isAttr": true
13532                 }, {
13533                     "name": "isCollection",
13534                     "default": false,
13535                     "isAttr": true,
13536                     "type": "Boolean"
13537                 }, {
13538                     "name": "import",
13539                     "type": "Import",
13540                     "isAttr": true,
13541                     "isReference": true
13542                 }]
13543             }, {
13544                 "name": "FlowElement",
13545                 "isAbstract": true,
13546                 "superClass": [
13547                     "BaseElement"
13548                 ],
13549                 "properties": [{
13550                     "name": "name",
13551                     "isAttr": true,
13552                     "type": "String"
13553                 }, {
13554                     "name": "auditing",
13555                     "type": "Auditing"
13556                 }, {
13557                     "name": "monitoring",
13558                     "type": "Monitoring"
13559                 }, {
13560                     "name": "categoryValueRef",
13561                     "type": "CategoryValue",
13562                     "isMany": true,
13563                     "isReference": true
13564                 }]
13565             }, {
13566                 "name": "SequenceFlow",
13567                 "superClass": [
13568                     "FlowElement"
13569                 ],
13570                 "properties": [{
13571                     "name": "isImmediate",
13572                     "isAttr": true,
13573                     "type": "Boolean"
13574                 }, {
13575                     "name": "conditionExpression",
13576                     "type": "Expression",
13577                     "serialize": "xsi:type"
13578                 }, {
13579                     "name": "sourceRef",
13580                     "type": "FlowNode",
13581                     "isAttr": true,
13582                     "isReference": true
13583                 }, {
13584                     "name": "targetRef",
13585                     "type": "FlowNode",
13586                     "isAttr": true,
13587                     "isReference": true
13588                 }]
13589             }, {
13590                 "name": "FlowElementsContainer",
13591                 "isAbstract": true,
13592                 "superClass": [
13593                     "BaseElement"
13594                 ],
13595                 "properties": [{
13596                     "name": "laneSets",
13597                     "type": "LaneSet",
13598                     "isMany": true
13599                 }, {
13600                     "name": "flowElements",
13601                     "type": "FlowElement",
13602                     "isMany": true
13603                 }]
13604             }, {
13605                 "name": "CallableElement",
13606                 "isAbstract": true,
13607                 "superClass": [
13608                     "RootElement"
13609                 ],
13610                 "properties": [{
13611                     "name": "name",
13612                     "isAttr": true,
13613                     "type": "String"
13614                 }, {
13615                     "name": "ioSpecification",
13616                     "type": "InputOutputSpecification"
13617                 }, {
13618                     "name": "supportedInterfaceRefs",
13619                     "type": "Interface",
13620                     "isMany": true,
13621                     "isReference": true
13622                 }, {
13623                     "name": "ioBinding",
13624                     "type": "InputOutputBinding",
13625                     "isMany": true
13626                 }]
13627             }, {
13628                 "name": "FlowNode",
13629                 "isAbstract": true,
13630                 "superClass": [
13631                     "FlowElement"
13632                 ],
13633                 "properties": [{
13634                     "name": "incoming",
13635                     "type": "SequenceFlow",
13636                     "isMany": true,
13637                     "isReference": true
13638                 }, {
13639                     "name": "outgoing",
13640                     "type": "SequenceFlow",
13641                     "isMany": true,
13642                     "isReference": true
13643                 }, {
13644                     "name": "lanes",
13645                     "type": "Lane",
13646                     "isVirtual": true,
13647                     "isMany": true,
13648                     "isReference": true
13649                 }]
13650             }, {
13651                 "name": "CorrelationPropertyRetrievalExpression",
13652                 "superClass": [
13653                     "BaseElement"
13654                 ],
13655                 "properties": [{
13656                     "name": "messagePath",
13657                     "type": "FormalExpression"
13658                 }, {
13659                     "name": "messageRef",
13660                     "type": "Message",
13661                     "isAttr": true,
13662                     "isReference": true
13663                 }]
13664             }, {
13665                 "name": "CorrelationPropertyBinding",
13666                 "superClass": [
13667                     "BaseElement"
13668                 ],
13669                 "properties": [{
13670                     "name": "dataPath",
13671                     "type": "FormalExpression"
13672                 }, {
13673                     "name": "correlationPropertyRef",
13674                     "type": "CorrelationProperty",
13675                     "isAttr": true,
13676                     "isReference": true
13677                 }]
13678             }, {
13679                 "name": "Resource",
13680                 "superClass": [
13681                     "RootElement"
13682                 ],
13683                 "properties": [{
13684                     "name": "name",
13685                     "isAttr": true,
13686                     "type": "String"
13687                 }, {
13688                     "name": "resourceParameters",
13689                     "type": "ResourceParameter",
13690                     "isMany": true
13691                 }]
13692             }, {
13693                 "name": "ResourceParameter",
13694                 "superClass": [
13695                     "BaseElement"
13696                 ],
13697                 "properties": [{
13698                     "name": "name",
13699                     "isAttr": true,
13700                     "type": "String"
13701                 }, {
13702                     "name": "isRequired",
13703                     "isAttr": true,
13704                     "type": "Boolean"
13705                 }, {
13706                     "name": "type",
13707                     "type": "ItemDefinition",
13708                     "isAttr": true,
13709                     "isReference": true
13710                 }]
13711             }, {
13712                 "name": "CorrelationSubscription",
13713                 "superClass": [
13714                     "BaseElement"
13715                 ],
13716                 "properties": [{
13717                     "name": "correlationKeyRef",
13718                     "type": "CorrelationKey",
13719                     "isAttr": true,
13720                     "isReference": true
13721                 }, {
13722                     "name": "correlationPropertyBinding",
13723                     "type": "CorrelationPropertyBinding",
13724                     "isMany": true
13725                 }]
13726             }, {
13727                 "name": "MessageFlow",
13728                 "superClass": [
13729                     "BaseElement"
13730                 ],
13731                 "properties": [{
13732                     "name": "name",
13733                     "isAttr": true,
13734                     "type": "String"
13735                 }, {
13736                     "name": "sourceRef",
13737                     "type": "InteractionNode",
13738                     "isAttr": true,
13739                     "isReference": true
13740                 }, {
13741                     "name": "targetRef",
13742                     "type": "InteractionNode",
13743                     "isAttr": true,
13744                     "isReference": true
13745                 }, {
13746                     "name": "messageRef",
13747                     "type": "Message",
13748                     "isAttr": true,
13749                     "isReference": true
13750                 }]
13751             }, {
13752                 "name": "MessageFlowAssociation",
13753                 "superClass": [
13754                     "BaseElement"
13755                 ],
13756                 "properties": [{
13757                     "name": "innerMessageFlowRef",
13758                     "type": "MessageFlow",
13759                     "isAttr": true,
13760                     "isReference": true
13761                 }, {
13762                     "name": "outerMessageFlowRef",
13763                     "type": "MessageFlow",
13764                     "isAttr": true,
13765                     "isReference": true
13766                 }]
13767             }, {
13768                 "name": "InteractionNode",
13769                 "isAbstract": true,
13770                 "properties": [{
13771                     "name": "incomingConversationLinks",
13772                     "type": "ConversationLink",
13773                     "isVirtual": true,
13774                     "isMany": true,
13775                     "isReference": true
13776                 }, {
13777                     "name": "outgoingConversationLinks",
13778                     "type": "ConversationLink",
13779                     "isVirtual": true,
13780                     "isMany": true,
13781                     "isReference": true
13782                 }]
13783             }, {
13784                 "name": "Participant",
13785                 "superClass": [
13786                     "InteractionNode",
13787                     "BaseElement"
13788                 ],
13789                 "properties": [{
13790                     "name": "name",
13791                     "isAttr": true,
13792                     "type": "String"
13793                 }, {
13794                     "name": "interfaceRefs",
13795                     "type": "Interface",
13796                     "isMany": true,
13797                     "isReference": true
13798                 }, {
13799                     "name": "participantMultiplicity",
13800                     "type": "ParticipantMultiplicity"
13801                 }, {
13802                     "name": "endPointRefs",
13803                     "type": "EndPoint",
13804                     "isMany": true,
13805                     "isReference": true
13806                 }, {
13807                     "name": "processRef",
13808                     "type": "Process",
13809                     "isAttr": true,
13810                     "isReference": true
13811                 }]
13812             }, {
13813                 "name": "ParticipantAssociation",
13814                 "superClass": [
13815                     "BaseElement"
13816                 ],
13817                 "properties": [{
13818                     "name": "innerParticipantRef",
13819                     "type": "Participant",
13820                     "isAttr": true,
13821                     "isReference": true
13822                 }, {
13823                     "name": "outerParticipantRef",
13824                     "type": "Participant",
13825                     "isAttr": true,
13826                     "isReference": true
13827                 }]
13828             }, {
13829                 "name": "ParticipantMultiplicity",
13830                 "properties": [{
13831                     "name": "minimum",
13832                     "default": 0,
13833                     "isAttr": true,
13834                     "type": "Integer"
13835                 }, {
13836                     "name": "maximum",
13837                     "default": 1,
13838                     "isAttr": true,
13839                     "type": "Integer"
13840                 }]
13841             }, {
13842                 "name": "Collaboration",
13843                 "superClass": [
13844                     "RootElement"
13845                 ],
13846                 "properties": [{
13847                     "name": "name",
13848                     "isAttr": true,
13849                     "type": "String"
13850                 }, {
13851                     "name": "isClosed",
13852                     "isAttr": true,
13853                     "type": "Boolean"
13854                 }, {
13855                     "name": "choreographyRef",
13856                     "type": "Choreography",
13857                     "isMany": true,
13858                     "isReference": true
13859                 }, {
13860                     "name": "artifacts",
13861                     "type": "Artifact",
13862                     "isMany": true
13863                 }, {
13864                     "name": "participantAssociations",
13865                     "type": "ParticipantAssociation",
13866                     "isMany": true
13867                 }, {
13868                     "name": "messageFlowAssociations",
13869                     "type": "MessageFlowAssociation",
13870                     "isMany": true
13871                 }, {
13872                     "name": "conversationAssociations",
13873                     "type": "ConversationAssociation"
13874                 }, {
13875                     "name": "participants",
13876                     "type": "Participant",
13877                     "isMany": true
13878                 }, {
13879                     "name": "messageFlows",
13880                     "type": "MessageFlow",
13881                     "isMany": true
13882                 }, {
13883                     "name": "correlationKeys",
13884                     "type": "CorrelationKey",
13885                     "isMany": true
13886                 }, {
13887                     "name": "conversations",
13888                     "type": "ConversationNode",
13889                     "isMany": true
13890                 }, {
13891                     "name": "conversationLinks",
13892                     "type": "ConversationLink",
13893                     "isMany": true
13894                 }]
13895             }, {
13896                 "name": "ChoreographyActivity",
13897                 "isAbstract": true,
13898                 "superClass": [
13899                     "FlowNode"
13900                 ],
13901                 "properties": [{
13902                     "name": "participantRefs",
13903                     "type": "Participant",
13904                     "isMany": true,
13905                     "isReference": true
13906                 }, {
13907                     "name": "initiatingParticipantRef",
13908                     "type": "Participant",
13909                     "isAttr": true,
13910                     "isReference": true
13911                 }, {
13912                     "name": "correlationKeys",
13913                     "type": "CorrelationKey",
13914                     "isMany": true
13915                 }, {
13916                     "name": "loopType",
13917                     "type": "ChoreographyLoopType",
13918                     "default": "None",
13919                     "isAttr": true
13920                 }]
13921             }, {
13922                 "name": "CallChoreography",
13923                 "superClass": [
13924                     "ChoreographyActivity"
13925                 ],
13926                 "properties": [{
13927                     "name": "calledChoreographyRef",
13928                     "type": "Choreography",
13929                     "isAttr": true,
13930                     "isReference": true
13931                 }, {
13932                     "name": "participantAssociations",
13933                     "type": "ParticipantAssociation",
13934                     "isMany": true
13935                 }]
13936             }, {
13937                 "name": "SubChoreography",
13938                 "superClass": [
13939                     "ChoreographyActivity",
13940                     "FlowElementsContainer"
13941                 ],
13942                 "properties": [{
13943                     "name": "artifacts",
13944                     "type": "Artifact",
13945                     "isMany": true
13946                 }]
13947             }, {
13948                 "name": "ChoreographyTask",
13949                 "superClass": [
13950                     "ChoreographyActivity"
13951                 ],
13952                 "properties": [{
13953                     "name": "messageFlowRef",
13954                     "type": "MessageFlow",
13955                     "isMany": true,
13956                     "isReference": true
13957                 }]
13958             }, {
13959                 "name": "Choreography",
13960                 "superClass": [
13961                     "FlowElementsContainer",
13962                     "Collaboration"
13963                 ]
13964             }, {
13965                 "name": "GlobalChoreographyTask",
13966                 "superClass": [
13967                     "Choreography"
13968                 ],
13969                 "properties": [{
13970                     "name": "initiatingParticipantRef",
13971                     "type": "Participant",
13972                     "isAttr": true,
13973                     "isReference": true
13974                 }]
13975             }, {
13976                 "name": "TextAnnotation",
13977                 "superClass": [
13978                     "Artifact"
13979                 ],
13980                 "properties": [{
13981                     "name": "text",
13982                     "type": "String"
13983                 }, {
13984                     "name": "textFormat",
13985                     "default": "text/plain",
13986                     "isAttr": true,
13987                     "type": "String"
13988                 }]
13989             }, {
13990                 "name": "Group",
13991                 "superClass": [
13992                     "Artifact"
13993                 ],
13994                 "properties": [{
13995                     "name": "categoryValueRef",
13996                     "type": "CategoryValue",
13997                     "isAttr": true,
13998                     "isReference": true
13999                 }]
14000             }, {
14001                 "name": "Association",
14002                 "superClass": [
14003                     "Artifact"
14004                 ],
14005                 "properties": [{
14006                     "name": "associationDirection",
14007                     "type": "AssociationDirection",
14008                     "isAttr": true
14009                 }, {
14010                     "name": "sourceRef",
14011                     "type": "BaseElement",
14012                     "isAttr": true,
14013                     "isReference": true
14014                 }, {
14015                     "name": "targetRef",
14016                     "type": "BaseElement",
14017                     "isAttr": true,
14018                     "isReference": true
14019                 }]
14020             }, {
14021                 "name": "Category",
14022                 "superClass": [
14023                     "RootElement"
14024                 ],
14025                 "properties": [{
14026                     "name": "categoryValue",
14027                     "type": "CategoryValue",
14028                     "isMany": true
14029                 }, {
14030                     "name": "name",
14031                     "isAttr": true,
14032                     "type": "String"
14033                 }]
14034             }, {
14035                 "name": "Artifact",
14036                 "isAbstract": true,
14037                 "superClass": [
14038                     "BaseElement"
14039                 ]
14040             }, {
14041                 "name": "CategoryValue",
14042                 "superClass": [
14043                     "BaseElement"
14044                 ],
14045                 "properties": [{
14046                     "name": "categorizedFlowElements",
14047                     "type": "FlowElement",
14048                     "isVirtual": true,
14049                     "isMany": true,
14050                     "isReference": true
14051                 }, {
14052                     "name": "value",
14053                     "isAttr": true,
14054                     "type": "String"
14055                 }]
14056             }, {
14057                 "name": "Activity",
14058                 "isAbstract": true,
14059                 "superClass": [
14060                     "FlowNode"
14061                 ],
14062                 "properties": [{
14063                     "name": "isForCompensation",
14064                     "default": false,
14065                     "isAttr": true,
14066                     "type": "Boolean"
14067                 }, {
14068                     "name": "loopCharacteristics",
14069                     "type": "LoopCharacteristics"
14070                 }, {
14071                     "name": "resources",
14072                     "type": "ResourceRole",
14073                     "isMany": true
14074                 }, {
14075                     "name": "default",
14076                     "type": "SequenceFlow",
14077                     "isAttr": true,
14078                     "isReference": true
14079                 }, {
14080                     "name": "properties",
14081                     "type": "Property",
14082                     "isMany": true
14083                 }, {
14084                     "name": "ioSpecification",
14085                     "type": "InputOutputSpecification"
14086                 }, {
14087                     "name": "boundaryEventRefs",
14088                     "type": "BoundaryEvent",
14089                     "isMany": true,
14090                     "isReference": true
14091                 }, {
14092                     "name": "dataInputAssociations",
14093                     "type": "DataInputAssociation",
14094                     "isMany": true
14095                 }, {
14096                     "name": "dataOutputAssociations",
14097                     "type": "DataOutputAssociation",
14098                     "isMany": true
14099                 }, {
14100                     "name": "startQuantity",
14101                     "default": 1,
14102                     "isAttr": true,
14103                     "type": "Integer"
14104                 }, {
14105                     "name": "completionQuantity",
14106                     "default": 1,
14107                     "isAttr": true,
14108                     "type": "Integer"
14109                 }]
14110             }, {
14111                 "name": "ServiceTask",
14112                 "superClass": [
14113                     "Task"
14114                 ],
14115                 "properties": [{
14116                     "name": "implementation",
14117                     "isAttr": true,
14118                     "type": "String"
14119                 }, {
14120                     "name": "operationRef",
14121                     "type": "Operation",
14122                     "isAttr": true,
14123                     "isReference": true
14124                 }]
14125             }, {
14126                 "name": "SubProcess",
14127                 "superClass": [
14128                     "Activity",
14129                     "FlowElementsContainer",
14130                     "InteractionNode"
14131                 ],
14132                 "properties": [{
14133                     "name": "triggeredByEvent",
14134                     "default": false,
14135                     "isAttr": true,
14136                     "type": "Boolean"
14137                 }, {
14138                     "name": "artifacts",
14139                     "type": "Artifact",
14140                     "isMany": true
14141                 }]
14142             }, {
14143                 "name": "LoopCharacteristics",
14144                 "isAbstract": true,
14145                 "superClass": [
14146                     "BaseElement"
14147                 ]
14148             }, {
14149                 "name": "MultiInstanceLoopCharacteristics",
14150                 "superClass": [
14151                     "LoopCharacteristics"
14152                 ],
14153                 "properties": [{
14154                     "name": "isSequential",
14155                     "default": false,
14156                     "isAttr": true,
14157                     "type": "Boolean"
14158                 }, {
14159                     "name": "behavior",
14160                     "type": "MultiInstanceBehavior",
14161                     "default": "All",
14162                     "isAttr": true
14163                 }, {
14164                     "name": "loopCardinality",
14165                     "type": "Expression",
14166                     "serialize": "xsi:type"
14167                 }, {
14168                     "name": "loopDataInputRef",
14169                     "type": "ItemAwareElement",
14170                     "isAttr": true,
14171                     "isReference": true
14172                 }, {
14173                     "name": "loopDataOutputRef",
14174                     "type": "ItemAwareElement",
14175                     "isAttr": true,
14176                     "isReference": true
14177                 }, {
14178                     "name": "inputDataItem",
14179                     "type": "DataInput"
14180                 }, {
14181                     "name": "outputDataItem",
14182                     "type": "DataOutput"
14183                 }, {
14184                     "name": "completionCondition",
14185                     "type": "Expression",
14186                     "serialize": "xsi:type"
14187                 }, {
14188                     "name": "complexBehaviorDefinition",
14189                     "type": "ComplexBehaviorDefinition",
14190                     "isMany": true
14191                 }, {
14192                     "name": "oneBehaviorEventRef",
14193                     "type": "EventDefinition",
14194                     "isAttr": true,
14195                     "isReference": true
14196                 }, {
14197                     "name": "noneBehaviorEventRef",
14198                     "type": "EventDefinition",
14199                     "isAttr": true,
14200                     "isReference": true
14201                 }]
14202             }, {
14203                 "name": "StandardLoopCharacteristics",
14204                 "superClass": [
14205                     "LoopCharacteristics"
14206                 ],
14207                 "properties": [{
14208                     "name": "testBefore",
14209                     "default": false,
14210                     "isAttr": true,
14211                     "type": "Boolean"
14212                 }, {
14213                     "name": "loopCondition",
14214                     "type": "Expression",
14215                     "serialize": "xsi:type"
14216                 }, {
14217                     "name": "loopMaximum",
14218                     "type": "Expression",
14219                     "serialize": "xsi:type"
14220                 }]
14221             }, {
14222                 "name": "CallActivity",
14223                 "superClass": [
14224                     "Activity"
14225                 ],
14226                 "properties": [{
14227                     "name": "calledElement",
14228                     "type": "String",
14229                     "isAttr": true
14230                 }]
14231             }, {
14232                 "name": "Task",
14233                 "superClass": [
14234                     "Activity",
14235                     "InteractionNode"
14236                 ]
14237             }, {
14238                 "name": "InitiateProcess",
14239                 "superClass": [
14240                     "Activity",
14241                     "InteractionNode"
14242                 ]
14243             }, {
14244                 "name": "Collector",
14245                 "superClass": [
14246                     "Activity",
14247                     "InteractionNode"
14248                 ]
14249             },
14250                         {
14251                 "name": "StringMatch",
14252                 "superClass": [
14253                     "Activity",
14254                     "InteractionNode"
14255                 ]
14256             },
14257             {
14258                 "name": "TCA",
14259                 "superClass": [
14260                     "Activity",
14261                     "InteractionNode"
14262                 ]
14263             },
14264                         {
14265                 "name": "GOC",
14266                 "superClass": [
14267                     "Activity",
14268                     "InteractionNode"
14269                 ]
14270             },
14271                         {
14272                 "name": "Policy",
14273                 "superClass": [
14274                     "Activity",
14275                     "InteractionNode"
14276                 ]
14277             },
14278                         {
14279                 "name": "SendTask",
14280                 "superClass": [
14281                     "Task"
14282                 ],
14283                 "properties": [{
14284                     "name": "implementation",
14285                     "isAttr": true,
14286                     "type": "String"
14287                 }, {
14288                     "name": "operationRef",
14289                     "type": "Operation",
14290                     "isAttr": true,
14291                     "isReference": true
14292                 }, {
14293                     "name": "messageRef",
14294                     "type": "Message",
14295                     "isAttr": true,
14296                     "isReference": true
14297                 }]
14298             }, {
14299                 "name": "ReceiveTask",
14300                 "superClass": [
14301                     "Task"
14302                 ],
14303                 "properties": [{
14304                     "name": "implementation",
14305                     "isAttr": true,
14306                     "type": "String"
14307                 }, {
14308                     "name": "instantiate",
14309                     "default": false,
14310                     "isAttr": true,
14311                     "type": "Boolean"
14312                 }, {
14313                     "name": "operationRef",
14314                     "type": "Operation",
14315                     "isAttr": true,
14316                     "isReference": true
14317                 }, {
14318                     "name": "messageRef",
14319                     "type": "Message",
14320                     "isAttr": true,
14321                     "isReference": true
14322                 }]
14323             }, {
14324                 "name": "ScriptTask",
14325                 "superClass": [
14326                     "Task"
14327                 ],
14328                 "properties": [{
14329                     "name": "scriptFormat",
14330                     "isAttr": true,
14331                     "type": "String"
14332                 }, {
14333                     "name": "script",
14334                     "type": "String"
14335                 }]
14336             }, {
14337                 "name": "BusinessRuleTask",
14338                 "superClass": [
14339                     "Task"
14340                 ],
14341                 "properties": [{
14342                     "name": "implementation",
14343                     "isAttr": true,
14344                     "type": "String"
14345                 }]
14346             }, {
14347                 "name": "AdHocSubProcess",
14348                 "superClass": [
14349                     "SubProcess"
14350                 ],
14351                 "properties": [{
14352                     "name": "completionCondition",
14353                     "type": "Expression",
14354                     "serialize": "xsi:type"
14355                 }, {
14356                     "name": "ordering",
14357                     "type": "AdHocOrdering",
14358                     "isAttr": true
14359                 }, {
14360                     "name": "cancelRemainingInstances",
14361                     "default": true,
14362                     "isAttr": true,
14363                     "type": "Boolean"
14364                 }]
14365             }, {
14366                 "name": "Transaction",
14367                 "superClass": [
14368                     "SubProcess"
14369                 ],
14370                 "properties": [{
14371                     "name": "protocol",
14372                     "isAttr": true,
14373                     "type": "String"
14374                 }, {
14375                     "name": "method",
14376                     "isAttr": true,
14377                     "type": "String"
14378                 }]
14379             }, {
14380                 "name": "GlobalScriptTask",
14381                 "superClass": [
14382                     "GlobalTask"
14383                 ],
14384                 "properties": [{
14385                     "name": "scriptLanguage",
14386                     "isAttr": true,
14387                     "type": "String"
14388                 }, {
14389                     "name": "script",
14390                     "isAttr": true,
14391                     "type": "String"
14392                 }]
14393             }, {
14394                 "name": "GlobalBusinessRuleTask",
14395                 "superClass": [
14396                     "GlobalTask"
14397                 ],
14398                 "properties": [{
14399                     "name": "implementation",
14400                     "isAttr": true,
14401                     "type": "String"
14402                 }]
14403             }, {
14404                 "name": "ComplexBehaviorDefinition",
14405                 "superClass": [
14406                     "BaseElement"
14407                 ],
14408                 "properties": [{
14409                     "name": "condition",
14410                     "type": "FormalExpression"
14411                 }, {
14412                     "name": "event",
14413                     "type": "ImplicitThrowEvent"
14414                 }]
14415             }, {
14416                 "name": "ResourceRole",
14417                 "superClass": [
14418                     "BaseElement"
14419                 ],
14420                 "properties": [{
14421                     "name": "resourceRef",
14422                     "type": "Resource",
14423                     "isReference": true
14424                 }, {
14425                     "name": "resourceParameterBindings",
14426                     "type": "ResourceParameterBinding",
14427                     "isMany": true
14428                 }, {
14429                     "name": "resourceAssignmentExpression",
14430                     "type": "ResourceAssignmentExpression"
14431                 }, {
14432                     "name": "name",
14433                     "isAttr": true,
14434                     "type": "String"
14435                 }]
14436             }, {
14437                 "name": "ResourceParameterBinding",
14438                 "properties": [{
14439                     "name": "expression",
14440                     "type": "Expression",
14441                     "serialize": "xsi:type"
14442                 }, {
14443                     "name": "parameterRef",
14444                     "type": "ResourceParameter",
14445                     "isAttr": true,
14446                     "isReference": true
14447                 }]
14448             }, {
14449                 "name": "ResourceAssignmentExpression",
14450                 "properties": [{
14451                     "name": "expression",
14452                     "type": "Expression",
14453                     "serialize": "xsi:type"
14454                 }]
14455             }, {
14456                 "name": "Import",
14457                 "properties": [{
14458                     "name": "importType",
14459                     "isAttr": true,
14460                     "type": "String"
14461                 }, {
14462                     "name": "location",
14463                     "isAttr": true,
14464                     "type": "String"
14465                 }, {
14466                     "name": "namespace",
14467                     "isAttr": true,
14468                     "type": "String"
14469                 }]
14470             }, {
14471                 "name": "Definitions",
14472                 "superClass": [
14473                     "BaseElement"
14474                 ],
14475                 "properties": [{
14476                     "name": "name",
14477                     "isAttr": true,
14478                     "type": "String"
14479                 }, {
14480                     "name": "targetNamespace",
14481                     "isAttr": true,
14482                     "type": "String"
14483                 }, {
14484                     "name": "expressionLanguage",
14485                     "default": "http://www.w3.org/1999/XPath",
14486                     "isAttr": true,
14487                     "type": "String"
14488                 }, {
14489                     "name": "typeLanguage",
14490                     "default": "http://www.w3.org/2001/XMLSchema",
14491                     "isAttr": true,
14492                     "type": "String"
14493                 }, {
14494                     "name": "imports",
14495                     "type": "Import",
14496                     "isMany": true
14497                 }, {
14498                     "name": "extensions",
14499                     "type": "Extension",
14500                     "isMany": true
14501                 }, {
14502                     "name": "rootElements",
14503                     "type": "RootElement",
14504                     "isMany": true
14505                 }, {
14506                     "name": "diagrams",
14507                     "isMany": true,
14508                     "type": "bpmndi:BPMNDiagram"
14509                 }, {
14510                     "name": "exporter",
14511                     "isAttr": true,
14512                     "type": "String"
14513                 }, {
14514                     "name": "relationships",
14515                     "type": "Relationship",
14516                     "isMany": true
14517                 }, {
14518                     "name": "exporterVersion",
14519                     "isAttr": true,
14520                     "type": "String"
14521                 }]
14522             }],
14523             "emumerations": [{
14524                 "name": "ProcessType",
14525                 "literalValues": [{
14526                     "name": "None"
14527                 }, {
14528                     "name": "Public"
14529                 }, {
14530                     "name": "Private"
14531                 }]
14532             }, {
14533                 "name": "GatewayDirection",
14534                 "literalValues": [{
14535                     "name": "Unspecified"
14536                 }, {
14537                     "name": "Converging"
14538                 }, {
14539                     "name": "Diverging"
14540                 }, {
14541                     "name": "Mixed"
14542                 }]
14543             }, {
14544                 "name": "EventBasedGatewayType",
14545                 "literalValues": [{
14546                     "name": "Parallel"
14547                 }, {
14548                     "name": "Exclusive"
14549                 }]
14550             }, {
14551                 "name": "RelationshipDirection",
14552                 "literalValues": [{
14553                     "name": "None"
14554                 }, {
14555                     "name": "Forward"
14556                 }, {
14557                     "name": "Backward"
14558                 }, {
14559                     "name": "Both"
14560                 }]
14561             }, {
14562                 "name": "ItemKind",
14563                 "literalValues": [{
14564                     "name": "Physical"
14565                 }, {
14566                     "name": "Information"
14567                 }]
14568             }, {
14569                 "name": "ChoreographyLoopType",
14570                 "literalValues": [{
14571                     "name": "None"
14572                 }, {
14573                     "name": "Standard"
14574                 }, {
14575                     "name": "MultiInstanceSequential"
14576                 }, {
14577                     "name": "MultiInstanceParallel"
14578                 }]
14579             }, {
14580                 "name": "AssociationDirection",
14581                 "literalValues": [{
14582                     "name": "None"
14583                 }, {
14584                     "name": "One"
14585                 }, {
14586                     "name": "Both"
14587                 }]
14588             }, {
14589                 "name": "MultiInstanceBehavior",
14590                 "literalValues": [{
14591                     "name": "None"
14592                 }, {
14593                     "name": "One"
14594                 }, {
14595                     "name": "All"
14596                 }, {
14597                     "name": "Complex"
14598                 }]
14599             }, {
14600                 "name": "AdHocOrdering",
14601                 "literalValues": [{
14602                     "name": "Parallel"
14603                 }, {
14604                     "name": "Sequential"
14605                 }]
14606             }],
14607             "prefix": "bpmn",
14608             "xml": {
14609                 "tagAlias": "lowerCase",
14610                 "typePrefix": "t"
14611             }
14612         }
14613     }, {}],
14614     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\resources\\bpmn\\json\\bpmndi.json": [function(require, module, exports) {
14615         module.exports = {
14616             "name": "BPMNDI",
14617             "uri": "http://www.omg.org/spec/BPMN/20100524/DI",
14618             "types": [{
14619                 "name": "BPMNDiagram",
14620                 "properties": [{
14621                     "name": "plane",
14622                     "type": "BPMNPlane",
14623                     "redefines": "di:Diagram#rootElement"
14624                 }, {
14625                     "name": "labelStyle",
14626                     "type": "BPMNLabelStyle",
14627                     "isMany": true
14628                 }],
14629                 "superClass": [
14630                     "di:Diagram"
14631                 ]
14632             }, {
14633                 "name": "BPMNPlane",
14634                 "properties": [{
14635                     "name": "bpmnElement",
14636                     "isAttr": true,
14637                     "isReference": true,
14638                     "type": "bpmn:BaseElement",
14639                     "redefines": "di:DiagramElement#modelElement"
14640                 }],
14641                 "superClass": [
14642                     "di:Plane"
14643                 ]
14644             }, {
14645                 "name": "BPMNShape",
14646                 "properties": [{
14647                     "name": "bpmnElement",
14648                     "isAttr": true,
14649                     "isReference": true,
14650                     "type": "bpmn:BaseElement",
14651                     "redefines": "di:DiagramElement#modelElement"
14652                 }, {
14653                     "name": "isHorizontal",
14654                     "isAttr": true,
14655                     "type": "Boolean"
14656                 }, {
14657                     "name": "isExpanded",
14658                     "isAttr": true,
14659                     "type": "Boolean"
14660                 }, {
14661                     "name": "isMarkerVisible",
14662                     "isAttr": true,
14663                     "type": "Boolean"
14664                 }, {
14665                     "name": "label",
14666                     "type": "BPMNLabel"
14667                 }, {
14668                     "name": "isMessageVisible",
14669                     "isAttr": true,
14670                     "type": "Boolean"
14671                 }, {
14672                     "name": "participantBandKind",
14673                     "type": "ParticipantBandKind",
14674                     "isAttr": true
14675                 }, {
14676                     "name": "choreographyActivityShape",
14677                     "type": "BPMNShape",
14678                     "isAttr": true,
14679                     "isReference": true
14680                 }],
14681                 "superClass": [
14682                     "di:LabeledShape"
14683                 ]
14684             }, {
14685                 "name": "BPMNEdge",
14686                 "properties": [{
14687                     "name": "label",
14688                     "type": "BPMNLabel"
14689                 }, {
14690                     "name": "bpmnElement",
14691                     "isAttr": true,
14692                     "isReference": true,
14693                     "type": "bpmn:BaseElement",
14694                     "redefines": "di:DiagramElement#modelElement"
14695                 }, {
14696                     "name": "sourceElement",
14697                     "isAttr": true,
14698                     "isReference": true,
14699                     "type": "di:DiagramElement",
14700                     "redefines": "di:Edge#source"
14701                 }, {
14702                     "name": "targetElement",
14703                     "isAttr": true,
14704                     "isReference": true,
14705                     "type": "di:DiagramElement",
14706                     "redefines": "di:Edge#target"
14707                 }, {
14708                     "name": "messageVisibleKind",
14709                     "type": "MessageVisibleKind",
14710                     "isAttr": true,
14711                     "default": "initiating"
14712                 }],
14713                 "superClass": [
14714                     "di:LabeledEdge"
14715                 ]
14716             }, {
14717                 "name": "BPMNLabel",
14718                 "properties": [{
14719                     "name": "labelStyle",
14720                     "type": "BPMNLabelStyle",
14721                     "isAttr": true,
14722                     "isReference": true,
14723                     "redefines": "di:DiagramElement#style"
14724                 }],
14725                 "superClass": [
14726                     "di:Label"
14727                 ]
14728             }, {
14729                 "name": "BPMNLabelStyle",
14730                 "properties": [{
14731                     "name": "font",
14732                     "type": "dc:Font"
14733                 }],
14734                 "superClass": [
14735                     "di:Style"
14736                 ]
14737             }],
14738             "emumerations": [{
14739                 "name": "ParticipantBandKind",
14740                 "literalValues": [{
14741                     "name": "top_initiating"
14742                 }, {
14743                     "name": "middle_initiating"
14744                 }, {
14745                     "name": "bottom_initiating"
14746                 }, {
14747                     "name": "top_non_initiating"
14748                 }, {
14749                     "name": "middle_non_initiating"
14750                 }, {
14751                     "name": "bottom_non_initiating"
14752                 }]
14753             }, {
14754                 "name": "MessageVisibleKind",
14755                 "literalValues": [{
14756                     "name": "initiating"
14757                 }, {
14758                     "name": "non_initiating"
14759                 }]
14760             }],
14761             "associations": [],
14762             "prefix": "bpmndi"
14763         }
14764     }, {}],
14765     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\resources\\bpmn\\json\\dc.json": [function(require, module, exports) {
14766         module.exports = {
14767             "name": "DC",
14768             "uri": "http://www.omg.org/spec/DD/20100524/DC",
14769             "types": [{
14770                 "name": "Boolean"
14771             }, {
14772                 "name": "Integer"
14773             }, {
14774                 "name": "Real"
14775             }, {
14776                 "name": "String"
14777             }, {
14778                 "name": "Font",
14779                 "properties": [{
14780                     "name": "name",
14781                     "type": "String",
14782                     "isAttr": true
14783                 }, {
14784                     "name": "size",
14785                     "type": "Real",
14786                     "isAttr": true
14787                 }, {
14788                     "name": "isBold",
14789                     "type": "Boolean",
14790                     "isAttr": true
14791                 }, {
14792                     "name": "isItalic",
14793                     "type": "Boolean",
14794                     "isAttr": true
14795                 }, {
14796                     "name": "isUnderline",
14797                     "type": "Boolean",
14798                     "isAttr": true
14799                 }, {
14800                     "name": "isStrikeThrough",
14801                     "type": "Boolean",
14802                     "isAttr": true
14803                 }]
14804             }, {
14805                 "name": "Point",
14806                 "properties": [{
14807                     "name": "x",
14808                     "type": "Real",
14809                     "default": "0",
14810                     "isAttr": true
14811                 }, {
14812                     "name": "y",
14813                     "type": "Real",
14814                     "default": "0",
14815                     "isAttr": true
14816                 }]
14817             }, {
14818                 "name": "Bounds",
14819                 "properties": [{
14820                     "name": "x",
14821                     "type": "Real",
14822                     "default": "0",
14823                     "isAttr": true
14824                 }, {
14825                     "name": "y",
14826                     "type": "Real",
14827                     "default": "0",
14828                     "isAttr": true
14829                 }, {
14830                     "name": "width",
14831                     "type": "Real",
14832                     "isAttr": true
14833                 }, {
14834                     "name": "height",
14835                     "type": "Real",
14836                     "isAttr": true
14837                 }]
14838             }],
14839             "prefix": "dc",
14840             "associations": []
14841         }
14842     }, {}],
14843     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\bpmn-moddle\\resources\\bpmn\\json\\di.json": [function(require, module, exports) {
14844         module.exports = {
14845             "name": "DI",
14846             "uri": "http://www.omg.org/spec/DD/20100524/DI",
14847             "types": [{
14848                 "name": "DiagramElement",
14849                 "isAbstract": true,
14850                 "properties": [{
14851                     "name": "extension",
14852                     "type": "Extension"
14853                 }, {
14854                     "name": "owningDiagram",
14855                     "type": "Diagram",
14856                     "isReadOnly": true,
14857                     "isVirtual": true,
14858                     "isReference": true
14859                 }, {
14860                     "name": "owningElement",
14861                     "type": "DiagramElement",
14862                     "isReadOnly": true,
14863                     "isVirtual": true,
14864                     "isReference": true
14865                 }, {
14866                     "name": "modelElement",
14867                     "isReadOnly": true,
14868                     "isVirtual": true,
14869                     "isReference": true,
14870                     "type": "Element"
14871                 }, {
14872                     "name": "style",
14873                     "type": "Style",
14874                     "isReadOnly": true,
14875                     "isVirtual": true,
14876                     "isReference": true
14877                 }, {
14878                     "name": "ownedElement",
14879                     "type": "DiagramElement",
14880                     "isReadOnly": true,
14881                     "isVirtual": true,
14882                     "isMany": true
14883                 }]
14884             }, {
14885                 "name": "Node",
14886                 "isAbstract": true,
14887                 "superClass": [
14888                     "DiagramElement"
14889                 ]
14890             }, {
14891                 "name": "Edge",
14892                 "isAbstract": true,
14893                 "superClass": [
14894                     "DiagramElement"
14895                 ],
14896                 "properties": [{
14897                     "name": "source",
14898                     "type": "DiagramElement",
14899                     "isReadOnly": true,
14900                     "isVirtual": true,
14901                     "isReference": true
14902                 }, {
14903                     "name": "target",
14904                     "type": "DiagramElement",
14905                     "isReadOnly": true,
14906                     "isVirtual": true,
14907                     "isReference": true
14908                 }, {
14909                     "name": "waypoint",
14910                     "isUnique": false,
14911                     "isMany": true,
14912                     "type": "dc:Point",
14913                     "serialize": "xsi:type"
14914                 }]
14915             }, {
14916                 "name": "Diagram",
14917                 "isAbstract": true,
14918                 "properties": [{
14919                     "name": "rootElement",
14920                     "type": "DiagramElement",
14921                     "isReadOnly": true,
14922                     "isVirtual": true
14923                 }, {
14924                     "name": "name",
14925                     "isAttr": true,
14926                     "type": "String"
14927                 }, {
14928                     "name": "documentation",
14929                     "isAttr": true,
14930                     "type": "String"
14931                 }, {
14932                     "name": "resolution",
14933                     "isAttr": true,
14934                     "type": "Real"
14935                 }, {
14936                     "name": "ownedStyle",
14937                     "type": "Style",
14938                     "isReadOnly": true,
14939                     "isVirtual": true,
14940                     "isMany": true
14941                 }]
14942             }, {
14943                 "name": "Shape",
14944                 "isAbstract": true,
14945                 "superClass": [
14946                     "Node"
14947                 ],
14948                 "properties": [{
14949                     "name": "bounds",
14950                     "type": "dc:Bounds"
14951                 }]
14952             }, {
14953                 "name": "Plane",
14954                 "isAbstract": true,
14955                 "superClass": [
14956                     "Node"
14957                 ],
14958                 "properties": [{
14959                     "name": "planeElement",
14960                     "type": "DiagramElement",
14961                     "subsettedProperty": "DiagramElement-ownedElement",
14962                     "isMany": true
14963                 }]
14964             }, {
14965                 "name": "LabeledEdge",
14966                 "isAbstract": true,
14967                 "superClass": [
14968                     "Edge"
14969                 ],
14970                 "properties": [{
14971                     "name": "ownedLabel",
14972                     "type": "Label",
14973                     "isReadOnly": true,
14974                     "subsettedProperty": "DiagramElement-ownedElement",
14975                     "isVirtual": true,
14976                     "isMany": true
14977                 }]
14978             }, {
14979                 "name": "LabeledShape",
14980                 "isAbstract": true,
14981                 "superClass": [
14982                     "Shape"
14983                 ],
14984                 "properties": [{
14985                     "name": "ownedLabel",
14986                     "type": "Label",
14987                     "isReadOnly": true,
14988                     "subsettedProperty": "DiagramElement-ownedElement",
14989                     "isVirtual": true,
14990                     "isMany": true
14991                 }]
14992             }, {
14993                 "name": "Label",
14994                 "isAbstract": true,
14995                 "superClass": [
14996                     "Node"
14997                 ],
14998                 "properties": [{
14999                     "name": "bounds",
15000                     "type": "dc:Bounds"
15001                 }]
15002             }, {
15003                 "name": "Style",
15004                 "isAbstract": true
15005             }, {
15006                 "name": "Extension",
15007                 "properties": [{
15008                     "name": "values",
15009                     "type": "Element",
15010                     "isMany": true
15011                 }]
15012             }],
15013             "associations": [],
15014             "prefix": "di",
15015             "xml": {
15016                 "tagAlias": "lowerCase"
15017             }
15018         }
15019     }, {}],
15020     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\diagram-js-direct-editing\\index.js": [function(require, module, exports) {
15021         module.exports = {
15022             __depends__: [require('diagram-js/lib/features/interaction-events')],
15023             __init__: ['directEditing'],
15024             directEditing: ['type', require('./lib/DirectEditing')]
15025         };
15026     }, {
15027         "./lib/DirectEditing": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\diagram-js-direct-editing\\lib\\DirectEditing.js",
15028         "diagram-js/lib/features/interaction-events": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\interaction-events\\index.js"
15029     }],
15030     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\diagram-js-direct-editing\\lib\\DirectEditing.js": [function(require, module, exports) {
15031         'use strict';
15032
15033         var bind = require('lodash/function/bind'),
15034             find = require('lodash/collection/find');
15035
15036         var TextBox = require('./TextBox');
15037
15038
15039         /**
15040          * A direct editing component that allows users to edit an elements text
15041          * directly in the diagram
15042          * 
15043          * @param {EventBus}
15044          *            eventBus the event bus
15045          */
15046         function DirectEditing(eventBus, canvas) {
15047
15048             this._eventBus = eventBus;
15049
15050             this._providers = [];
15051             this._textbox = new TextBox({
15052                 container: canvas.getContainer(),
15053                 keyHandler: bind(this._handleKey, this)
15054             });
15055         }
15056
15057         DirectEditing.$inject = ['eventBus', 'canvas'];
15058
15059
15060         /**
15061          * Register a direct editing provider
15062          * 
15063          * @param {Object}
15064          *            provider the provider, must expose an #activate(element) method
15065          *            that returns an activation context ({ bounds: {x, y, width, height },
15066          *            text }) if direct editing is available for the given element.
15067          *            Additionally the provider must expose a #update(element, value)
15068          *            method to receive direct editing updates.
15069          */
15070         DirectEditing.prototype.registerProvider = function(provider) {
15071             this._providers.push(provider);
15072         };
15073
15074
15075         /**
15076          * Returns true if direct editing is currently active
15077          * 
15078          * @return {Boolean}
15079          */
15080         DirectEditing.prototype.isActive = function() {
15081             return !!this._active;
15082         };
15083
15084
15085         /**
15086          * Cancel direct editing, if it is currently active
15087          */
15088         DirectEditing.prototype.cancel = function() {
15089             if (!this._active) {
15090                 return;
15091             }
15092
15093             this._fire('cancel');
15094             this.close();
15095         };
15096
15097
15098         DirectEditing.prototype._fire = function(event) {
15099             this._eventBus.fire('directEditing.' + event, {
15100                 active: this._active
15101             });
15102         };
15103
15104         DirectEditing.prototype.close = function() {
15105             this._textbox.destroy();
15106
15107             this._fire('deactivate');
15108
15109             this._active = null;
15110         };
15111
15112
15113         DirectEditing.prototype.complete = function() {
15114
15115             var active = this._active;
15116
15117             if (!active) {
15118                 return;
15119             }
15120
15121             var text = this.getValue();
15122
15123             if (text !== active.context.text) {
15124                 active.provider.update(active.element, text, active.context.text);
15125             }
15126
15127             this._fire('complete');
15128
15129             this.close();
15130         };
15131
15132
15133         DirectEditing.prototype.getValue = function() {
15134             return this._textbox.getValue();
15135         };
15136
15137
15138         DirectEditing.prototype._handleKey = function(e) {
15139
15140             // stop bubble
15141             e.stopPropagation();
15142
15143             var key = e.keyCode || e.charCode;
15144
15145             // ESC
15146             if (key === 27) {
15147                 e.preventDefault();
15148                 return this.cancel();
15149             }
15150
15151             // Enter
15152             if (key === 13 && !e.shiftKey) {
15153                 e.preventDefault();
15154                 return this.complete();
15155             }
15156         };
15157
15158
15159         /**
15160          * Activate direct editing on the given element
15161          * 
15162          * @param {Object}
15163          *            ElementDescriptor the descriptor for a shape or connection
15164          * @return {Boolean} true if the activation was possible
15165          */
15166         DirectEditing.prototype.activate = function(element) {
15167
15168             if (this.isActive()) {
15169                 this.cancel();
15170             }
15171
15172             // the direct editing context
15173             var context;
15174
15175             var provider = find(this._providers, function(p) {
15176                 return !!(context = p.activate(element)) ? p : null;
15177             });
15178
15179             // check if activation took place
15180             if (context) {
15181                 this._textbox.create(context.bounds, context.style, context.text);
15182
15183                 this._active = {
15184                     element: element,
15185                     context: context,
15186                     provider: provider
15187                 };
15188
15189                 this._fire('activate');
15190             }
15191
15192             return !!context;
15193         };
15194
15195
15196         module.exports = DirectEditing;
15197     }, {
15198         "./TextBox": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\diagram-js-direct-editing\\lib\\TextBox.js",
15199         "lodash/collection/find": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\find.js",
15200         "lodash/function/bind": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\function\\bind.js"
15201     }],
15202     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\diagram-js-direct-editing\\lib\\TextBox.js": [function(require, module, exports) {
15203         'use strict';
15204
15205         var assign = require('lodash/object/assign'),
15206             domEvent = require('min-dom/lib/event'),
15207             domRemove = require('min-dom/lib/remove');
15208
15209         function stopPropagation(event) {
15210             event.stopPropagation();
15211         }
15212
15213         function TextBox(options) {
15214
15215             this.container = options.container;
15216             this.textarea = document.createElement('textarea');
15217
15218             this.keyHandler = options.keyHandler || function() {};
15219         }
15220
15221         module.exports = TextBox;
15222
15223
15224         TextBox.prototype.create = function(bounds, style, value) {
15225
15226             var textarea = this.textarea,
15227                 container = this.container;
15228
15229             assign(textarea.style, {
15230                 width: bounds.width + 'px',
15231                 height: bounds.height + 'px',
15232                 left: bounds.x + 'px',
15233                 top: bounds.y + 'px',
15234                 position: 'absolute',
15235                 textAlign: 'center',
15236                 boxSizing: 'border-box'
15237             }, style || {});
15238
15239             textarea.value = value;
15240             textarea.title = 'Press SHIFT+Enter for line feed';
15241
15242             domEvent.bind(textarea, 'keydown', this.keyHandler);
15243             domEvent.bind(textarea, 'mousedown', stopPropagation);
15244
15245             container.appendChild(textarea);
15246
15247             setTimeout(function() {
15248                 if (textarea.parent) {
15249                     textarea.select();
15250                 }
15251                 textarea.focus();
15252             }, 100);
15253         };
15254
15255         TextBox.prototype.destroy = function() {
15256             var textarea = this.textarea;
15257
15258             textarea.value = '';
15259
15260             domEvent.unbind(textarea, 'keydown', this.keyHandler);
15261             domEvent.unbind(textarea, 'mousedown', stopPropagation);
15262
15263             domRemove(textarea);
15264         };
15265
15266         TextBox.prototype.getValue = function() {
15267             return this.textarea.value;
15268         };
15269
15270     }, {
15271         "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js",
15272         "min-dom/lib/event": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\min-dom\\lib\\event.js",
15273         "min-dom/lib/remove": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\min-dom\\lib\\remove.js"
15274     }],
15275     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\ids\\index.js": [function(require, module, exports) {
15276         'use strict';
15277
15278         var hat = require('hat');
15279
15280
15281         /**
15282          * Create a new id generator / cache instance.
15283          * 
15284          * You may optionally provide a seed that is used internally.
15285          * 
15286          * @param {Seed}
15287          *            seed
15288          */
15289         function Ids(seed) {
15290             seed = seed || [128, 36, 1];
15291             this._seed = seed.length ? hat.rack(seed[0], seed[1], seed[2]) : seed;
15292         }
15293
15294         module.exports = Ids;
15295
15296         /**
15297          * Generate a next id.
15298          * 
15299          * @param {Object}
15300          *            [element] element to bind the id to
15301          * 
15302          * @return {String} id
15303          */
15304         Ids.prototype.next = function(element) {
15305             return this._seed(element || true);
15306         };
15307
15308         /**
15309          * Generate a next id with a given prefix.
15310          * 
15311          * @param {Object}
15312          *            [element] element to bind the id to
15313          * 
15314          * @return {String} id
15315          */
15316         Ids.prototype.nextPrefixed = function(prefix, element) {
15317             var id;
15318
15319             do {
15320                 id = prefix + this.next(true);
15321             } while (this.assigned(id));
15322
15323             // claim {prefix}{random}
15324             this.claim(id, element);
15325
15326             // return
15327             return id;
15328         };
15329
15330         /**
15331          * Manually claim an existing id.
15332          * 
15333          * @param {String}
15334          *            id
15335          * @param {String}
15336          *            [element] element the id is claimed by
15337          */
15338         Ids.prototype.claim = function(id, element) {
15339             this._seed.set(id, element || true);
15340         };
15341
15342         /**
15343          * Returns true if the given id has already been assigned.
15344          * 
15345          * @param {String}
15346          *            id
15347          * @return {Boolean}
15348          */
15349         Ids.prototype.assigned = function(id) {
15350             return this._seed.get(id) || false;
15351         };
15352     }, {
15353         "hat": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\ids\\node_modules\\hat\\index.js"
15354     }],
15355     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\ids\\node_modules\\hat\\index.js": [function(require, module, exports) {
15356         var hat = module.exports = function(bits, base) {
15357             if (!base) base = 16;
15358             if (bits === undefined) bits = 128;
15359             if (bits <= 0) return '0';
15360
15361             var digits = Math.log(Math.pow(2, bits)) / Math.log(base);
15362             for (var i = 2; digits === Infinity; i *= 2) {
15363                 digits = Math.log(Math.pow(2, bits / i)) / Math.log(base) * i;
15364             }
15365
15366             var rem = digits - Math.floor(digits);
15367
15368             var res = '';
15369
15370             for (var i = 0; i < Math.floor(digits); i++) {
15371                 var x = Math.floor(Math.random() * base).toString(base);
15372                 res = x + res;
15373             }
15374
15375             if (rem) {
15376                 var b = Math.pow(base, rem);
15377                 var x = Math.floor(Math.random() * b).toString(base);
15378                 res = x + res;
15379             }
15380
15381             var parsed = parseInt(res, base);
15382             if (parsed !== Infinity && parsed >= Math.pow(2, bits)) {
15383                 return hat(bits, base)
15384             } else return res;
15385         };
15386
15387         hat.rack = function(bits, base, expandBy) {
15388             var fn = function(data) {
15389                 var iters = 0;
15390                 do {
15391                     if (iters++ > 10) {
15392                         if (expandBy) bits += expandBy;
15393                         else throw new Error('too many ID collisions, use more bits')
15394                     }
15395
15396                     var id = hat(bits, base);
15397                 } while (Object.hasOwnProperty.call(hats, id));
15398
15399                 hats[id] = data;
15400                 return id;
15401             };
15402             var hats = fn.hats = {};
15403
15404             fn.get = function(id) {
15405                 return fn.hats[id];
15406             };
15407
15408             fn.set = function(id, value) {
15409                 fn.hats[id] = value;
15410                 return fn;
15411             };
15412
15413             fn.bits = bits || 128;
15414             fn.base = base || 16;
15415             return fn;
15416         };
15417
15418     }, {}],
15419     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\inherits\\inherits_browser.js": [function(require, module, exports) {
15420         if (typeof Object.create === 'function') {
15421             // implementation from standard node.js 'util' module
15422             module.exports = function inherits(ctor, superCtor) {
15423                 ctor.super_ = superCtor
15424                 ctor.prototype = Object.create(superCtor.prototype, {
15425                     constructor: {
15426                         value: ctor,
15427                         enumerable: false,
15428                         writable: true,
15429                         configurable: true
15430                     }
15431                 });
15432             };
15433         } else {
15434             // old school shim for old browsers
15435             module.exports = function inherits(ctor, superCtor) {
15436                 ctor.super_ = superCtor
15437                 var TempCtor = function() {}
15438                 TempCtor.prototype = superCtor.prototype
15439                 ctor.prototype = new TempCtor()
15440                 ctor.prototype.constructor = ctor
15441             }
15442         }
15443
15444     }, {}],
15445     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\min-dom\\lib\\domify.js": [function(require, module, exports) {
15446         module.exports = require('domify');
15447     }, {
15448         "domify": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\min-dom\\node_modules\\domify\\index.js"
15449     }],
15450     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\min-dom\\lib\\event.js": [function(require, module, exports) {
15451         module.exports = require('component-event');
15452     }, {
15453         "component-event": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\min-dom\\node_modules\\component-event\\index.js"
15454     }],
15455     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\min-dom\\lib\\query.js": [function(require, module, exports) {
15456         module.exports = require('component-query');
15457     }, {
15458         "component-query": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\min-dom\\node_modules\\component-query\\index.js"
15459     }],
15460     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\min-dom\\lib\\remove.js": [function(require, module, exports) {
15461         module.exports = function(el) {
15462             el.parentNode && el.parentNode.removeChild(el);
15463         };
15464     }, {}],
15465     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\min-dom\\node_modules\\component-event\\index.js": [function(require, module, exports) {
15466         var bind = window.addEventListener ? 'addEventListener' : 'attachEvent',
15467             unbind = window.removeEventListener ? 'removeEventListener' : 'detachEvent',
15468             prefix = bind !== 'addEventListener' ? 'on' : '';
15469
15470         /**
15471          * Bind `el` event `type` to `fn`.
15472          * 
15473          * @param {Element}
15474          *            el
15475          * @param {String}
15476          *            type
15477          * @param {Function}
15478          *            fn
15479          * @param {Boolean}
15480          *            capture
15481          * @return {Function}
15482          * @api public
15483          */
15484
15485         exports.bind = function(el, type, fn, capture) {
15486             el[bind](prefix + type, fn, capture || false);
15487             return fn;
15488         };
15489
15490         /**
15491          * Unbind `el` event `type`'s callback `fn`.
15492          * 
15493          * @param {Element}
15494          *            el
15495          * @param {String}
15496          *            type
15497          * @param {Function}
15498          *            fn
15499          * @param {Boolean}
15500          *            capture
15501          * @return {Function}
15502          * @api public
15503          */
15504
15505         exports.unbind = function(el, type, fn, capture) {
15506             el[unbind](prefix + type, fn, capture || false);
15507             return fn;
15508         };
15509     }, {}],
15510     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\min-dom\\node_modules\\component-query\\index.js": [function(require, module, exports) {
15511         function one(selector, el) {
15512             return el.querySelector(selector);
15513         }
15514
15515         exports = module.exports = function(selector, el) {
15516             el = el || document;
15517             return one(selector, el);
15518         };
15519
15520         exports.all = function(selector, el) {
15521             el = el || document;
15522             return el.querySelectorAll(selector);
15523         };
15524
15525         exports.engine = function(obj) {
15526             if (!obj.one) throw new Error('.one callback required');
15527             if (!obj.all) throw new Error('.all callback required');
15528             one = obj.one;
15529             exports.all = obj.all;
15530             return exports;
15531         };
15532
15533     }, {}],
15534     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\min-dom\\node_modules\\domify\\index.js": [function(require, module, exports) {
15535
15536         /**
15537          * Expose `parse`.
15538          */
15539
15540         module.exports = parse;
15541
15542         /**
15543          * Tests for browser support.
15544          */
15545
15546         var div = document.createElement('div');
15547         // Setup
15548         div.innerHTML = '  <link/><table></table><a href="/a">a</a><input type="checkbox"/>';
15549         // Make sure that link elements get serialized correctly by innerHTML
15550         // This requires a wrapper element in IE
15551         var innerHTMLBug = !div.getElementsByTagName('link').length;
15552         div = undefined;
15553
15554         /**
15555          * Wrap map from jquery.
15556          */
15557
15558         var map = {
15559             legend: [1, '<fieldset>', '</fieldset>'],
15560             tr: [2, '<table><tbody>', '</tbody></table>'],
15561             col: [2, '<table><tbody></tbody><colgroup>', '</colgroup></table>'],
15562             // for script/link/style tags to work in IE6-8, you have to wrap
15563             // in a div with a non-whitespace character in front, ha!
15564             _default: innerHTMLBug ? [1, 'X<div>', '</div>'] : [0, '', '']
15565         };
15566
15567         map.td =
15568             map.th = [3, '<table><tbody><tr>', '</tr></tbody></table>'];
15569
15570         map.option =
15571             map.optgroup = [1, '<select multiple="multiple">', '</select>'];
15572
15573         map.thead =
15574             map.tbody =
15575             map.colgroup =
15576             map.caption =
15577             map.tfoot = [1, '<table>', '</table>'];
15578
15579         map.polyline =
15580             map.ellipse =
15581             map.polygon =
15582             map.circle =
15583             map.text =
15584             map.line =
15585             map.path =
15586             map.rect =
15587             map.g = [1, '<svg xmlns="http://www.w3.org/2000/svg" version="1.1">', '</svg>'];
15588
15589         /**
15590          * Parse `html` and return a DOM Node instance, which could be a TextNode, HTML
15591          * DOM Node of some kind (<div> for example), or a DocumentFragment instance,
15592          * depending on the contents of the `html` string.
15593          * 
15594          * @param {String}
15595          *            html - HTML string to "domify"
15596          * @param {Document}
15597          *            doc - The `document` instance to create the Node for
15598          * @return {DOMNode} the TextNode, DOM Node, or DocumentFragment instance
15599          * @api private
15600          */
15601
15602         function parse(html, doc) {
15603             if ('string' != typeof html) throw new TypeError('String expected');
15604
15605             // default to the global `document` object
15606             if (!doc) doc = document;
15607
15608             // tag name
15609             var m = /<([\w:]+)/.exec(html);
15610             if (!m) return doc.createTextNode(html);
15611
15612             html = html.replace(/^\s+|\s+$/g, ''); // Remove leading/trailing
15613             // whitespace
15614
15615             var tag = m[1];
15616
15617             // body support
15618             if (tag == 'body') {
15619                 var el = doc.createElement('html');
15620                 el.innerHTML = html;
15621                 return el.removeChild(el.lastChild);
15622             }
15623
15624             // wrap map
15625             var wrap = map[tag] || map._default;
15626             var depth = wrap[0];
15627             var prefix = wrap[1];
15628             var suffix = wrap[2];
15629             var el = doc.createElement('div');
15630             el.innerHTML = prefix + html + suffix;
15631             while (depth--) el = el.lastChild;
15632
15633             // one element
15634             if (el.firstChild == el.lastChild) {
15635                 return el.removeChild(el.firstChild);
15636             }
15637
15638             // several elements
15639             var fragment = doc.createDocumentFragment();
15640             while (el.firstChild) {
15641                 fragment.appendChild(el.removeChild(el.firstChild));
15642             }
15643
15644             return fragment;
15645         }
15646
15647     }, {}],
15648     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\object-refs\\index.js": [function(require, module, exports) {
15649         module.exports = require('./lib/refs');
15650
15651         module.exports.Collection = require('./lib/collection');
15652     }, {
15653         "./lib/collection": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\object-refs\\lib\\collection.js",
15654         "./lib/refs": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\object-refs\\lib\\refs.js"
15655     }],
15656     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\object-refs\\lib\\collection.js": [function(require, module, exports) {
15657         'use strict';
15658
15659         /**
15660          * An empty collection stub. Use {@link RefsCollection.extend} to extend a
15661          * collection with ref semantics.
15662          * 
15663          * @classdesc A change and inverse-reference aware collection with set
15664          *            semantics.
15665          * 
15666          * @class RefsCollection
15667          */
15668         function RefsCollection() {}
15669
15670         /**
15671          * Extends a collection with {@link Refs} aware methods
15672          * 
15673          * @memberof RefsCollection
15674          * @static
15675          * 
15676          * @param {Array
15677          *            <Object>} collection
15678          * @param {Refs}
15679          *            refs instance
15680          * @param {Object}
15681          *            property represented by the collection
15682          * @param {Object}
15683          *            target object the collection is attached to
15684          * 
15685          * @return {RefsCollection<Object>} the extended array
15686          */
15687         function extend(collection, refs, property, target) {
15688
15689             var inverseProperty = property.inverse;
15690
15691             /**
15692              * Removes the given element from the array and returns it.
15693              * 
15694              * @method RefsCollection#remove
15695              * 
15696              * @param {Object}
15697              *            element the element to remove
15698              */
15699             collection.remove = function(element) {
15700                 var idx = this.indexOf(element);
15701                 if (idx !== -1) {
15702                     this.splice(idx, 1);
15703
15704                     // unset inverse
15705                     refs.unset(element, inverseProperty, target);
15706                 }
15707
15708                 return element;
15709             };
15710
15711             /**
15712              * Returns true if the collection contains the given element
15713              * 
15714              * @method RefsCollection#contains
15715              * 
15716              * @param {Object}
15717              *            element the element to check for
15718              */
15719             collection.contains = function(element) {
15720                 return this.indexOf(element) !== -1;
15721             };
15722
15723             /**
15724              * Adds an element to the array, unless it exists already (set semantics).
15725              * 
15726              * @method RefsCollection#add
15727              * 
15728              * @param {Object}
15729              *            element the element to add
15730              */
15731             collection.add = function(element) {
15732
15733                 if (!this.contains(element)) {
15734                     this.push(element);
15735
15736                     // set inverse
15737                     refs.set(element, inverseProperty, target);
15738                 }
15739             };
15740
15741             return collection;
15742         }
15743
15744
15745         module.exports.extend = extend;
15746     }, {}],
15747     "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\object-refs\\lib\\refs.js": [function(require, module, exports) {
15748         'use strict';
15749
15750         var Collection = require('./collection');
15751
15752         function hasOwnProperty(e, property) {
15753             return Object.prototype.hasOwnProperty.call(e, property.name || property);
15754         }
15755
15756
15757         function defineCollectionProperty(ref, property, target) {
15758             Object.defineProperty(target, property.name, {
15759                 enumerable: property.enumerable,
15760                 value: Collection.extend(target[property.name] || [], ref, property, target)
15761             });
15762         }
15763
15764
15765         function defineProperty(ref, property, target) {
15766
15767             var inverseProperty = property.inverse;
15768
15769             var _value = target[property.name];
15770
15771             Object.defineProperty(target, property.name, {
15772                 enumerable: property.enumerable,
15773
15774                 get: function() {
15775                     return _value;
15776                 },
15777
15778                 set: function(value) {
15779
15780                     // return if we already performed all changes
15781                     if (value === _value) {
15782                         return;
15783                     }
15784
15785                     var old = _value;
15786
15787                     // temporary set null
15788                     _value = null;
15789
15790                     if (old) {
15791                         ref.unset(old, inverseProperty, target);
15792                     }
15793
15794                     // set new value
15795                     _value = value;
15796
15797                     // set inverse value
15798                     ref.set(_value, inverseProperty, target);
15799                 }
15800             });
15801
15802         }
15803
15804         /**
15805          * Creates a new references object defining two inversly related attribute
15806          * descriptors a and b.
15807          * 
15808          * <p>
15809          * When bound to an object using {@link Refs#bind} the references get activated
15810          * and ensure that add and remove operations are applied reversely, too.
15811          * </p>
15812          * 
15813          * <p>
15814          * For attributes represented as collections {@link Refs} provides the
15815          * {@link RefsCollection#add}, {@link RefsCollection#remove} and
15816          * {@link RefsCollection#contains} extensions that must be used to properly hook
15817          * into the inverse change mechanism.
15818          * </p>
15819          * 
15820          * @class Refs
15821          * 
15822          * @classdesc A bi-directional reference between two attributes.
15823          * 
15824          * @param {Refs.AttributeDescriptor}
15825          *            a property descriptor
15826          * @param {Refs.AttributeDescriptor}
15827          *            b property descriptor
15828          * 
15829          * @example
15830          * 
15831          * var refs = Refs({ name: 'wheels', collection: true, enumerable: true }, {
15832          * name: 'car' });
15833          * 
15834          * var car = { name: 'toyota' }; var wheels = [{ pos: 'front-left' }, { pos:
15835          * 'front-right' }];
15836          * 
15837          * refs.bind(car, 'wheels');
15838          * 
15839          * car.wheels // [] car.wheels.add(wheels[0]); car.wheels.add(wheels[1]);
15840          * 
15841          * car.wheels // [{ pos: 'front-left' }, { pos: 'front-right' }]
15842          * 
15843          * wheels[0].car // { name: 'toyota' }; car.wheels.remove(wheels[0]);
15844          * 
15845          * wheels[0].car // undefined
15846          */
15847         function Refs(a, b) {
15848
15849             if (!(this instanceof Refs)) {
15850                 return new Refs(a, b);
15851             }
15852
15853             // link
15854             a.inverse = b;
15855             b.inverse = a;
15856
15857             this.props = {};
15858             this.props[a.name] = a;
15859             this.props[b.name] = b;
15860         }
15861
15862         /**
15863          * Binds one side of a bi-directional reference to a target object.
15864          * 
15865          * @memberOf Refs
15866          * 
15867          * @param {Object}
15868          *            target
15869          * @param {String}
15870          *            property
15871          */
15872         Refs.prototype.bind = function(target, property) {
15873             if (typeof property === 'string') {
15874                 if (!this.props[property]) {
15875                     throw new Error('no property <' + property + '> in ref');
15876                 }
15877                 property = this.props[property];
15878             }
15879
15880             if (property.collection) {
15881                 defineCollectionProperty(this, property, target);
15882             } else {
15883                 defineProperty(this, property, target);
15884             }
15885         };
15886
15887         Refs.prototype.ensureBound = function(target, property) {
15888             if (!hasOwnProperty(target, property)) {
15889                 this.bind(target, property);
15890             }
15891         };
15892
15893         Refs.prototype.unset = function(target, property, value) {
15894
15895             if (target) {
15896                 this.ensureBound(target, property);
15897
15898                 if (property.collection) {
15899                     target[property.name].remove(value);
15900                 } else {
15901                     target[property.name] = undefined;
15902                 }
15903             }
15904         };
15905
15906         Refs.prototype.set = function(target, property, value) {
15907
15908             if (target) {
15909                 this.ensureBound(target, property);
15910
15911                 if (property.collection) {
15912                     target[property.name].add(value);
15913                 } else {
15914                     target[property.name] = value;
15915                 }
15916             }
15917         };
15918
15919         module.exports = Refs;
15920
15921
15922         /**
15923          * An attribute descriptor to be used specify an attribute in a {@link Refs}
15924          * instance
15925          * 
15926          * @typedef {Object} Refs.AttributeDescriptor
15927          * @property {String} name
15928          * @property {boolean} [collection=false]
15929          * @property {boolean} [enumerable=false]
15930          */
15931     }, {
15932         "./collection": "\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\object-refs\\lib\\collection.js"
15933     }],
15934     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\index.js": [function(require, module, exports) {
15935         module.exports = require('./lib/Diagram');
15936     }, {
15937         "./lib/Diagram": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\Diagram.js"
15938     }],
15939     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\Diagram.js": [function(require, module, exports) {
15940         'use strict';
15941
15942         var di = require('didi');
15943
15944
15945         /**
15946          * Bootstrap an injector from a list of modules, instantiating a number of
15947          * default components
15948          * 
15949          * @ignore
15950          * @param {Array
15951          *            <didi.Module>} bootstrapModules
15952          * 
15953          * @return {didi.Injector} a injector to use to access the components
15954          */
15955         function bootstrap(bootstrapModules) {
15956
15957             var modules = [],
15958                 components = [];
15959
15960             function hasModule(m) {
15961                 return modules.indexOf(m) >= 0;
15962             }
15963
15964             function addModule(m) {
15965                 modules.push(m);
15966             }
15967
15968             function visit(m) {
15969                 if (hasModule(m)) {
15970                     return;
15971                 }
15972
15973                 (m.__depends__ || []).forEach(visit);
15974
15975                 if (hasModule(m)) {
15976                     return;
15977                 }
15978
15979                 addModule(m);
15980
15981                 (m.__init__ || []).forEach(function(c) {
15982                     components.push(c);
15983                 });
15984             }
15985
15986             bootstrapModules.forEach(visit);
15987
15988             var injector = new di.Injector(modules);
15989
15990             components.forEach(function(c) {
15991
15992                 try {
15993                     // eagerly resolve component (fn or string)
15994                     injector[typeof c === 'string' ? 'get' : 'invoke'](c);
15995                 } catch (e) {
15996                     console.error('Failed to instantiate component');
15997                     console.error(e.stack);
15998
15999                     throw e;
16000                 }
16001             });
16002
16003             return injector;
16004         }
16005
16006         /**
16007          * Creates an injector from passed options.
16008          * 
16009          * @ignore
16010          * @param {Object}
16011          *            options
16012          * @return {didi.Injector}
16013          */
16014         function createInjector(options) {
16015
16016             options = options || {};
16017
16018             var configModule = {
16019                 'config': ['value', options]
16020             };
16021
16022             var coreModule = require('./core');
16023
16024             var modules = [configModule, coreModule].concat(options.modules || []);
16025
16026             return bootstrap(modules);
16027         }
16028
16029
16030         /**
16031          * The main diagram-js entry point that bootstraps the diagram with the given
16032          * configuration.
16033          * 
16034          * To register extensions with the diagram, pass them as Array<didi.Module> to
16035          * the constructor.
16036          * 
16037          * @class djs.Diagram
16038          * @memberOf djs
16039          * @constructor
16040          * 
16041          * @example
16042          * 
16043          * <caption>Creating a plug-in that logs whenever a shape is added to the
16044          * canvas.</caption>
16045          *  // plug-in implemenentation function MyLoggingPlugin(eventBus) {
16046          * eventBus.on('shape.added', function(event) { console.log('shape ',
16047          * event.shape, ' was added to the diagram'); }); }
16048          *  // export as module module.exports = { __init__: [ 'myLoggingPlugin' ],
16049          * myLoggingPlugin: [ 'type', MyLoggingPlugin ] };
16050          * 
16051          *  // instantiate the diagram with the new plug-in
16052          * 
16053          * var diagram = new Diagram({ modules: [ require('path-to-my-logging-plugin') ]
16054          * });
16055          * 
16056          * diagram.invoke([ 'canvas', function(canvas) { // add shape to drawing canvas
16057          * canvas.addShape({ x: 10, y: 10 }); });
16058          *  // 'shape ... was added to the diagram' logged to console
16059          * 
16060          * @param {Object}
16061          *            options
16062          * @param {Array
16063          *            <didi.Module>} [options.modules] external modules to instantiate
16064          *            with the diagram
16065          * @param {didi.Injector}
16066          *            [injector] an (optional) injector to bootstrap the diagram with
16067          */
16068         function Diagram(options, injector) {
16069
16070             // create injector unless explicitly specified
16071             this.injector = injector = injector || createInjector(options);
16072
16073             // API
16074
16075             /**
16076              * Resolves a diagram service
16077              * 
16078              * @method Diagram#get
16079              * 
16080              * @param {String}
16081              *            name the name of the diagram service to be retrieved
16082              * @param {Object}
16083              *            [locals] a number of locals to use to resolve certain
16084              *            dependencies
16085              */
16086             this.get = injector.get;
16087
16088             /**
16089              * Executes a function into which diagram services are injected
16090              * 
16091              * @method Diagram#invoke
16092              * 
16093              * @param {Function|Object[]}
16094              *            fn the function to resolve
16095              * @param {Object}
16096              *            locals a number of locals to use to resolve certain
16097              *            dependencies
16098              */
16099             this.invoke = injector.invoke;
16100
16101             // init
16102
16103             // indicate via event
16104
16105
16106             /**
16107              * An event indicating that all plug-ins are loaded.
16108              * 
16109              * Use this event to fire other events to interested plug-ins
16110              * 
16111              * @memberOf Diagram
16112              * 
16113              * @event diagram.init
16114              * 
16115              * @example
16116              * 
16117              * eventBus.on('diagram.init', function() { eventBus.fire('my-custom-event', {
16118              * foo: 'BAR' }); });
16119              * 
16120              * @type {Object}
16121              */
16122             this.get('eventBus').fire('diagram.init');
16123         }
16124
16125         module.exports = Diagram;
16126
16127
16128         /**
16129          * Destroys the diagram
16130          * 
16131          * @method Diagram#destroy
16132          */
16133         Diagram.prototype.destroy = function() {
16134             this.get('eventBus').fire('diagram.destroy');
16135         };
16136     }, {
16137         "./core": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\core\\index.js",
16138         "didi": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\didi\\lib\\index.js"
16139     }],
16140     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\command\\CommandInterceptor.js": [function(require, module, exports) {
16141         'use strict';
16142
16143         var forEach = require('lodash/collection/forEach'),
16144             isFunction = require('lodash/lang/isFunction'),
16145             isArray = require('lodash/lang/isArray');
16146
16147
16148         /**
16149          * A utility that can be used to plug-in into the command execution for
16150          * extension and/or validation.
16151          * 
16152          * @param {EventBus}
16153          *            eventBus
16154          * 
16155          * @example
16156          * 
16157          * var inherits = require('inherits');
16158          * 
16159          * var CommandInterceptor =
16160          * require('diagram-js/lib/command/CommandInterceptor');
16161          * 
16162          * function CommandLogger(eventBus) { CommandInterceptor.call(this, eventBus);
16163          * 
16164          * this.preExecute(function(event) { console.log('command pre-execute', event);
16165          * }); }
16166          * 
16167          * inherits(CommandLogger, CommandInterceptor);
16168          * 
16169          */
16170         function CommandInterceptor(eventBus) {
16171             this._eventBus = eventBus;
16172         }
16173
16174         CommandInterceptor.$inject = ['eventBus'];
16175
16176         module.exports = CommandInterceptor;
16177
16178         function unwrapEvent(fn) {
16179             return function(event) {
16180                 return fn(event.context, event.command, event);
16181             };
16182         }
16183
16184         /**
16185          * Register an interceptor for a command execution
16186          * 
16187          * @param {String|Array
16188          *            <String>} [events] list of commands to register on
16189          * @param {String}
16190          *            [hook] command hook, i.e. preExecute, executed to listen on
16191          * @param {Function}
16192          *            handlerFn interceptor to be invoked with (event)
16193          * @param {Boolean}
16194          *            unwrap if true, unwrap the event and pass (context, command,
16195          *            event) to the listener instead
16196          */
16197         CommandInterceptor.prototype.on = function(events, hook, handlerFn, unwrap) {
16198
16199             if (isFunction(hook)) {
16200                 unwrap = handlerFn;
16201                 handlerFn = hook;
16202                 hook = null;
16203             }
16204
16205             if (!isFunction(handlerFn)) {
16206                 throw new Error('handlerFn must be a function');
16207             }
16208
16209             if (!isArray(events)) {
16210                 events = [events];
16211             }
16212
16213             var eventBus = this._eventBus;
16214
16215             forEach(events, function(event) {
16216                 // concat commandStack(.event)?(.hook)?
16217                 var fullEvent = ['commandStack', event, hook].filter(function(e) {
16218                     return e;
16219                 }).join('.');
16220
16221                 eventBus.on(fullEvent, unwrap ? unwrapEvent(handlerFn) : handlerFn);
16222             });
16223         };
16224
16225
16226         var hooks = [
16227             'canExecute',
16228             'preExecute',
16229             'execute',
16230             'executed',
16231             'postExecute',
16232             'revert',
16233             'reverted'
16234         ];
16235
16236         /*
16237          * Install hook shortcuts
16238          * 
16239          * This will generate the CommandInterceptor#(preExecute|...|reverted) methods
16240          * which will in term forward to CommandInterceptor#on.
16241          */
16242         forEach(hooks, function(hook) {
16243             CommandInterceptor.prototype[hook] = function(events, fn, unwrap) {
16244                 if (isFunction(events)) {
16245                     unwrap = fn;
16246                     fn = events;
16247                     events = null;
16248                 }
16249
16250                 this.on(events, hook, fn, unwrap);
16251             };
16252         });
16253     }, {
16254         "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
16255         "lodash/lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js",
16256         "lodash/lang/isFunction": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isFunction.js"
16257     }],
16258     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\command\\CommandStack.js": [function(require, module, exports) {
16259         'use strict';
16260
16261         var unique = require('lodash/array/unique'),
16262             isArray = require('lodash/lang/isArray'),
16263             assign = require('lodash/object/assign');
16264
16265         var InternalEvent = require('../core/EventBus').Event;
16266
16267
16268         /**
16269          * A service that offers un- and redoable execution of commands.
16270          * 
16271          * The command stack is responsible for executing modeling actions in a un- and
16272          * redoable manner. To do this it delegates the actual command execution to
16273          * {@link CommandHandler}s.
16274          * 
16275          * Command handlers provide {@link CommandHandler#execute(ctx)} and
16276          * {@link CommandHandler#revert(ctx)} methods to un- and redo a command
16277          * identified by a command context.
16278          * 
16279          *  ## Life-Cycle events
16280          * 
16281          * In the process the command stack fires a number of life-cycle events that
16282          * other components to participate in the command execution.
16283          *  * preExecute * execute * executed * postExecute * revert * reverted
16284          * 
16285          * A special event is used for validating, whether a command can be performed
16286          * prior to its execution.
16287          *  * canExecute
16288          * 
16289          * Each of the events is fired as `commandStack.{eventName}` and
16290          * `commandStack.{commandName}.{eventName}`, respectively. This gives components
16291          * fine grained control on where to hook into.
16292          * 
16293          * The event object fired transports `command`, the name of the command and
16294          * `context`, the command context.
16295          * 
16296          *  ## Creating Command Handlers
16297          * 
16298          * Command handlers should provide the {@link CommandHandler#execute(ctx)} and
16299          * {@link CommandHandler#revert(ctx)} methods to implement redoing and undoing
16300          * of a command. They must ensure undo is performed properly in order not to
16301          * break the undo chain.
16302          * 
16303          * Command handlers may execute other modeling operations (and thus commands) in
16304          * their `preExecute` and `postExecute` phases. The command stack will properly
16305          * group all commands together into a logical unit that may be re- and undone
16306          * atomically.
16307          * 
16308          * Command handlers must not execute other commands from within their core
16309          * implementation (`execute`, `revert`).
16310          * 
16311          *  ## Change Tracking
16312          * 
16313          * During the execution of the CommandStack it will keep track of all elements
16314          * that have been touched during the command's execution.
16315          * 
16316          * At the end of the CommandStack execution it will notify interested components
16317          * via an 'elements.changed' event with all the dirty elements.
16318          * 
16319          * The event can be picked up by components that are interested in the fact that
16320          * elements have been changed. One use case for this is updating their graphical
16321          * representation after moving / resizing or deletion.
16322          * 
16323          * 
16324          * @param {EventBus}
16325          *            eventBus
16326          * @param {Injector}
16327          *            injector
16328          */
16329         function CommandStack(eventBus, injector) {
16330             /**
16331              * A map of all registered command handlers.
16332              * 
16333              * @type {Object}
16334              */
16335             this._handlerMap = {};
16336
16337             /**
16338              * A stack containing all re/undoable actions on the diagram
16339              * 
16340              * @type {Array<Object>}
16341              */
16342             this._stack = [];
16343
16344             /**
16345              * The current index on the stack
16346              * 
16347              * @type {Number}
16348              */
16349             this._stackIdx = -1;
16350
16351             /**
16352              * Current active commandStack execution
16353              * 
16354              * @type {Object}
16355              */
16356             this._currentExecution = {
16357                 actions: [],
16358                 dirty: []
16359             };
16360
16361
16362             this._injector = injector;
16363             this._eventBus = eventBus;
16364
16365             this._uid = 1;
16366             this._selectedModel = selected_model;
16367             
16368             commandStackList.push(this);
16369         }
16370
16371         CommandStack.$inject = ['eventBus', 'injector'];
16372         
16373         module.exports = CommandStack;
16374
16375
16376         /**
16377          * Execute a command
16378          * 
16379          * @param {String}
16380          *            command the command to execute
16381          * @param {Object}
16382          *            context the environment to execute the command in
16383          */
16384         CommandStack.prototype.execute = function(command, context) {
16385             if (!command) {
16386                 throw new Error('command required');
16387             }
16388
16389             var action = {
16390                 command: command,
16391                 context: context
16392             };
16393
16394             this._pushAction(action);
16395             this._internalExecute(action);
16396             this._popAction(action);
16397         };
16398
16399
16400         /**
16401          * Ask whether a given command can be executed.
16402          * 
16403          * Implementors may hook into the mechanism on two ways:
16404          *  * in event listeners:
16405          * 
16406          * Users may prevent the execution via an event listener. It must prevent the
16407          * default action for `commandStack.(<command>.)canExecute` events.
16408          *  * in command handlers:
16409          * 
16410          * If the method {@link CommandHandler#canExecute} is implemented in a handler
16411          * it will be called to figure out whether the execution is allowed.
16412          * 
16413          * @param {String}
16414          *            command the command to execute
16415          * @param {Object}
16416          *            context the environment to execute the command in
16417          * 
16418          * @return {Boolean} true if the command can be executed
16419          */
16420         CommandStack.prototype.canExecute = function(command, context) {
16421
16422             var action = {
16423                 command: command,
16424                 context: context
16425             };
16426
16427             var handler = this._getHandler(command);
16428
16429             if (!handler) {
16430                 return false;
16431             }
16432
16433             var result = this._fire(command, 'canExecute', action);
16434
16435             // handler#canExecute will only be called if no listener
16436             // decided on a result already
16437             if (result === undefined && handler.canExecute) {
16438                 result = handler.canExecute(context);
16439             }
16440
16441             return result;
16442         };
16443
16444
16445         /**
16446          * Clear the command stack, erasing all undo / redo history
16447          */
16448         CommandStack.prototype.clear = function() {
16449             this._stack.length = 0;
16450             this._stackIdx = -1;
16451
16452             this._fire('changed');
16453         };
16454
16455
16456         /**
16457          * Undo last command(s)
16458          */
16459         CommandStack.prototype.undo = function() {
16460             var action = this._getUndoAction(),
16461                 next;
16462             if (action) {
16463                 this._pushAction(action);
16464
16465                 while (action) {
16466                     this._internalUndo(action);
16467                     next = this._getUndoAction();
16468
16469                     if (!next || next.id !== action.id) {
16470                         break;
16471                     }
16472
16473                     action = next;
16474                 }
16475
16476                 this._popAction();
16477             }
16478         };
16479
16480
16481         /**
16482          * Redo last command(s)
16483          */
16484         CommandStack.prototype.redo = function() {
16485             var action = this._getRedoAction(),
16486                 next;
16487
16488             if (action) {
16489                 this._pushAction(action);
16490
16491                 while (action) {
16492                     this._internalExecute(action, true);
16493                     next = this._getRedoAction();
16494
16495                     if (!next || next.id !== action.id) {
16496                         break;
16497                     }
16498
16499                     action = next;
16500                 }
16501
16502                 this._popAction();
16503             }
16504         };
16505
16506
16507         /**
16508          * Register a handler instance with the command stack
16509          * 
16510          * @param {String}
16511          *            command
16512          * @param {CommandHandler}
16513          *            handler
16514          */
16515         CommandStack.prototype.register = function(command, handler) {
16516             this._setHandler(command, handler);
16517         };
16518
16519
16520         /**
16521          * Register a handler type with the command stack by instantiating it and
16522          * injecting its dependencies.
16523          * 
16524          * @param {String}
16525          *            command
16526          * @param {Function}
16527          *            a constructor for a {@link CommandHandler}
16528          */
16529         CommandStack.prototype.registerHandler = function(command, handlerCls) {
16530
16531             if (!command || !handlerCls) {
16532                 throw new Error('command and handlerCls must be defined');
16533             }
16534
16535             var handler = this._injector.instantiate(handlerCls);
16536             this.register(command, handler);
16537         };
16538
16539         CommandStack.prototype.canUndo = function() {
16540             return !!this._getUndoAction();
16541         };
16542
16543         CommandStack.prototype.canRedo = function() {
16544             return !!this._getRedoAction();
16545         };
16546
16547         // //// stack access //////////////////////////////////////
16548
16549         CommandStack.prototype._getRedoAction = function() {
16550             return this._stack[this._stackIdx + 1];
16551         };
16552
16553
16554         CommandStack.prototype._getUndoAction = function() {
16555             return this._stack[this._stackIdx];
16556         };
16557
16558
16559         // //// internal functionality /////////////////////////////
16560
16561         CommandStack.prototype._internalUndo = function(action) {
16562             var command = action.command,
16563                 context = action.context;
16564
16565             var handler = this._getHandler(command);
16566
16567             this._fire(command, 'revert', action);
16568
16569             this._markDirty(handler.revert(context));
16570
16571             this._revertedAction(action);
16572
16573             this._fire(command, 'reverted', action);
16574         };
16575
16576
16577         CommandStack.prototype._fire = function(command, qualifier, event) {
16578             if (arguments.length < 3) {
16579                 event = qualifier;
16580                 qualifier = null;
16581             }
16582
16583             var names = qualifier ? [command + '.' + qualifier, qualifier] : [command],
16584                 i, name, result;
16585
16586             event = assign(new InternalEvent(), event);
16587
16588             for (i = 0; !!(name = names[i]); i++) {
16589                 result = this._eventBus.fire('commandStack.' + name, event);
16590
16591                 if (event.cancelBubble) {
16592                     break;
16593                 }
16594             }
16595
16596             return result;
16597         };
16598
16599         CommandStack.prototype._createId = function() {
16600             return this._uid++;
16601         };
16602
16603
16604         CommandStack.prototype._internalExecute = function(action, redo) {
16605             var command = action.command,
16606                 context = action.context;
16607
16608             var handler = this._getHandler(command);
16609
16610             if (!handler) {
16611                 throw new Error('no command handler registered for <' + command + '>');
16612             }
16613
16614             this._pushAction(action);
16615
16616             if (!redo) {
16617                 this._fire(command, 'preExecute', action);
16618
16619                 if (handler.preExecute) {
16620                     handler.preExecute(context);
16621                 }
16622             }
16623
16624             this._fire(command, 'execute', action);
16625
16626             // execute
16627             this._markDirty(handler.execute(context));
16628
16629             // log to stack
16630             this._executedAction(action, redo);
16631
16632             this._fire(command, 'executed', action);
16633
16634             if (!redo) {
16635                 if (handler.postExecute) {
16636                     handler.postExecute(context);
16637                 }
16638
16639                 this._fire(command, 'postExecute', action);
16640             }
16641
16642             this._popAction(action);
16643         };
16644
16645
16646         CommandStack.prototype._pushAction = function(action) {
16647
16648             var execution = this._currentExecution,
16649                 actions = execution.actions;
16650
16651             var baseAction = actions[0];
16652
16653             if (!action.id) {
16654                 action.id = (baseAction && baseAction.id) || this._createId();
16655             }
16656
16657             actions.push(action);
16658         };
16659
16660
16661         CommandStack.prototype._popAction = function() {
16662             var execution = this._currentExecution,
16663                 actions = execution.actions,
16664                 dirty = execution.dirty;
16665
16666             actions.pop();
16667
16668             if (!actions.length) {
16669                 this._eventBus.fire('elements.changed', {
16670                     elements: unique(dirty)
16671                 });
16672
16673                 dirty.length = 0;
16674
16675                 this._fire('changed');
16676             }
16677         };
16678
16679
16680         CommandStack.prototype._markDirty = function(elements) {
16681             var execution = this._currentExecution;
16682
16683             if (!elements) {
16684                 return;
16685             }
16686
16687             elements = isArray(elements) ? elements : [elements];
16688
16689             execution.dirty = execution.dirty.concat(elements);
16690         };
16691
16692
16693         CommandStack.prototype._executedAction = function(action, redo) {
16694             var stackIdx = ++this._stackIdx;
16695
16696             if (!redo) {
16697                 this._stack.splice(stackIdx, this._stack.length, action);
16698             }
16699         };
16700
16701
16702         CommandStack.prototype._revertedAction = function(action) {
16703             this._stackIdx--;
16704         };
16705
16706
16707         CommandStack.prototype._getHandler = function(command) {
16708             return this._handlerMap[command];
16709         };
16710
16711         CommandStack.prototype._setHandler = function(command, handler) {
16712             if (!command || !handler) {
16713                 throw new Error('command and handler required');
16714             }
16715
16716             if (this._handlerMap[command]) {
16717                 throw new Error('overriding handler for command <' + command + '>');
16718             }
16719
16720             this._handlerMap[command] = handler;
16721         };
16722
16723     }, {
16724         "../core/EventBus": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\core\\EventBus.js",
16725         "lodash/array/unique": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\array\\unique.js",
16726         "lodash/lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js",
16727         "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js"
16728     }],
16729     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\command\\index.js": [function(require, module, exports) {
16730         module.exports = {
16731             __depends__: [require('../core')],
16732             commandStack: ['type', require('./CommandStack')]
16733         };
16734     }, {
16735         "../core": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\core\\index.js",
16736         "./CommandStack": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\command\\CommandStack.js"
16737     }],
16738     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\core\\Canvas.js": [function(require, module, exports) {
16739         'use strict';
16740
16741         var isNumber = require('lodash/lang/isNumber'),
16742             assign = require('lodash/object/assign'),
16743             forEach = require('lodash/collection/forEach');
16744
16745         var Collections = require('../util/Collections');
16746
16747         var Snap = require('../../vendor/snapsvg');
16748
16749         function round(number, resolution) {
16750             return Math.round(number * resolution) / resolution;
16751         }
16752
16753         function ensurePx(number) {
16754             return isNumber(number) ? number + 'px' : number;
16755         }
16756
16757         /**
16758          * Creates a HTML container element for a SVG element with the given
16759          * configuration
16760          * 
16761          * @param {Object}
16762          *            options
16763          * @return {HTMLElement} the container element
16764          */
16765         function createContainer(options) {
16766
16767             options = assign({}, {
16768                 width: '100%',
16769                 height: '100%'
16770             }, options);
16771
16772             var container = options.container || document.body;
16773
16774             // create a <div> around the svg element with the respective size
16775             // this way we can always get the correct container size
16776             // (this is impossible for <svg> elements at the moment)
16777             var parent = document.createElement('div');
16778             parent.setAttribute('class', 'djs-container');
16779
16780             assign(parent.style, {
16781                 position: 'relative',
16782                 overflow: 'hidden',
16783                 width: ensurePx(options.width),
16784                 height: ensurePx(options.height)
16785             });
16786
16787             container.appendChild(parent);
16788
16789             return parent;
16790         }
16791
16792         function createGroup(parent, cls) {
16793             return parent.group().attr({
16794                 'class': cls
16795             });
16796         }
16797
16798         var BASE_LAYER = 'base';
16799
16800
16801         /**
16802          * The main drawing canvas.
16803          * 
16804          * @class
16805          * @constructor
16806          * 
16807          * @emits Canvas#canvas.init
16808          * 
16809          * @param {Object}
16810          *            config
16811          * @param {EventBus}
16812          *            eventBus
16813          * @param {GraphicsFactory}
16814          *            graphicsFactory
16815          * @param {ElementRegistry}
16816          *            elementRegistry
16817          */
16818         function Canvas(config, eventBus, graphicsFactory, elementRegistry) {
16819             this._eventBus = eventBus;
16820             this._elementRegistry = elementRegistry;
16821             this._graphicsFactory = graphicsFactory;
16822
16823             this._init(config || {});
16824         }
16825
16826         Canvas.$inject = ['config.canvas', 'eventBus', 'graphicsFactory', 'elementRegistry'];
16827
16828         module.exports = Canvas;
16829
16830
16831         Canvas.prototype._init = function(config) {
16832
16833             // Creates a <svg> element that is wrapped into a <div>.
16834             // This way we are always able to correctly figure out the size of the svg
16835             // element
16836             // by querying the parent node.
16837             //
16838             // (It is not possible to get the size of a svg element cross browser @
16839             // 2014-04-01)
16840             //
16841             // <div class="djs-container" style="width: {desired-width}, height:
16842             // {desired-height}">
16843             // <svg width="100%" height="100%">
16844             // ...
16845             // </svg>
16846             // </div>
16847
16848             // html container
16849             var eventBus = this._eventBus,
16850
16851                 container = createContainer(config),
16852                 svg = Snap.createSnapAt('100%', '100%', container),
16853                 viewport = createGroup(svg, 'viewport'),
16854
16855                 self = this;
16856
16857             this._container = container;
16858             this._svg = svg;
16859             this._viewport = viewport;
16860             this._layers = {};
16861
16862             eventBus.on('diagram.init', function(event) {
16863
16864                 /**
16865                  * An event indicating that the canvas is ready to be drawn on.
16866                  * 
16867                  * @memberOf Canvas
16868                  * 
16869                  * @event canvas.init
16870                  * 
16871                  * @type {Object}
16872                  * @property {Snap<SVGSVGElement>} svg the created svg element
16873                  * @property {Snap<SVGGroup>} viewport the direct parent of diagram
16874                  *           elements and shapes
16875                  */
16876                 eventBus.fire('canvas.init', {
16877                     svg: svg,
16878                     viewport: viewport
16879                 });
16880             });
16881
16882             eventBus.on('diagram.destroy', function() {
16883
16884                 var parent = self._container.parentNode;
16885
16886                 if (parent) {
16887                     parent.removeChild(container);
16888                 }
16889
16890                 eventBus.fire('canvas.destroy', {
16891                     svg: self._svg,
16892                     viewport: self._viewport
16893                 });
16894
16895                 self._svg.remove();
16896
16897                 self._svg = self._container = self._layers = self._viewport = null;
16898             });
16899
16900         };
16901
16902         /**
16903          * Returns the default layer on which all elements are drawn.
16904          * 
16905          * @returns {Snap<SVGGroup>}
16906          */
16907         Canvas.prototype.getDefaultLayer = function() {
16908             return this.getLayer(BASE_LAYER);
16909         };
16910
16911         /**
16912          * Returns a layer that is used to draw elements or annotations on it.
16913          * 
16914          * @param {String}
16915          *            name
16916          * 
16917          * @returns {Snap<SVGGroup>}
16918          */
16919         Canvas.prototype.getLayer = function(name) {
16920
16921             if (!name) {
16922                 throw new Error('must specify a name');
16923             }
16924
16925             var layer = this._layers[name];
16926             if (!layer) {
16927                 layer = this._layers[name] = createGroup(this._viewport, 'layer-' + name);
16928             }
16929
16930             return layer;
16931         };
16932
16933
16934         /**
16935          * Returns the html element that encloses the drawing canvas.
16936          * 
16937          * @return {DOMNode}
16938          */
16939         Canvas.prototype.getContainer = function() {
16940             return this._container;
16941         };
16942
16943
16944         // ///////////// markers ///////////////////////////////////
16945
16946         Canvas.prototype._updateMarker = function(element, marker, add) {
16947             var container;
16948
16949             if (!element.id) {
16950                 element = this._elementRegistry.get(element);
16951             }
16952
16953             // we need to access all
16954             container = this._elementRegistry._elements[element.id];
16955
16956             if (!container) {
16957                 return;
16958             }
16959
16960             forEach([container.gfx, container.secondaryGfx], function(gfx) {
16961                 if (gfx) {
16962                     // invoke either addClass or removeClass based on mode
16963                     gfx[add ? 'addClass' : 'removeClass'](marker);
16964                 }
16965             });
16966
16967             /**
16968              * An event indicating that a marker has been updated for an element
16969              * 
16970              * @event element.marker.update
16971              * @type {Object}
16972              * @property {djs.model.Element} element the shape
16973              * @property {Object} gfx the graphical representation of the shape
16974              * @property {String} marker
16975              * @property {Boolean} add true if the marker was added, false if it got
16976              *           removed
16977              */
16978             this._eventBus.fire('element.marker.update', {
16979                 element: element,
16980                 gfx: container.gfx,
16981                 marker: marker,
16982                 add: !!add
16983             });
16984         };
16985
16986
16987         /**
16988          * Adds a marker to an element (basically a css class).
16989          * 
16990          * Fires the element.marker.update event, making it possible to integrate
16991          * extension into the marker life-cycle, too.
16992          * 
16993          * @example canvas.addMarker('foo', 'some-marker');
16994          * 
16995          * var fooGfx = canvas.getGraphics('foo');
16996          * 
16997          * fooGfx; // <g class="... some-marker"> ... </g>
16998          * 
16999          * @param {String|djs.model.Base}
17000          *            element
17001          * @param {String}
17002          *            marker
17003          */
17004         Canvas.prototype.addMarker = function(element, marker) {
17005             this._updateMarker(element, marker, true);
17006         };
17007
17008
17009         /**
17010          * Remove a marker from an element.
17011          * 
17012          * Fires the element.marker.update event, making it possible to integrate
17013          * extension into the marker life-cycle, too.
17014          * 
17015          * @param {String|djs.model.Base}
17016          *            element
17017          * @param {String}
17018          *            marker
17019          */
17020         Canvas.prototype.removeMarker = function(element, marker) {
17021             this._updateMarker(element, marker, false);
17022         };
17023
17024         /**
17025          * Check the existence of a marker on element.
17026          * 
17027          * @param {String|djs.model.Base}
17028          *            element
17029          * @param {String}
17030          *            marker
17031          */
17032         Canvas.prototype.hasMarker = function(element, marker) {
17033             if (!element.id) {
17034                 element = this._elementRegistry.get(element);
17035             }
17036
17037             var gfx = this.getGraphics(element);
17038
17039             return gfx && gfx.hasClass(marker);
17040         };
17041
17042         /**
17043          * Toggles a marker on an element.
17044          * 
17045          * Fires the element.marker.update event, making it possible to integrate
17046          * extension into the marker life-cycle, too.
17047          * 
17048          * @param {String|djs.model.Base}
17049          *            element
17050          * @param {String}
17051          *            marker
17052          */
17053         Canvas.prototype.toggleMarker = function(element, marker) {
17054             if (this.hasMarker(element, marker)) {
17055                 this.removeMarker(element, marker);
17056             } else {
17057                 this.addMarker(element, marker);
17058             }
17059         };
17060
17061         Canvas.prototype.getRootElement = function() {
17062             if (!this._rootElement) {
17063                 this.setRootElement({
17064                     id: '__implicitroot'
17065                 });
17066             }
17067
17068             return this._rootElement;
17069         };
17070
17071
17072
17073         // ////////////// root element handling ///////////////////////////
17074
17075         /**
17076          * Sets a given element as the new root element for the canvas and returns the
17077          * new root element.
17078          * 
17079          * @param {Object|djs.model.Root}
17080          *            element
17081          * @param {Boolean}
17082          *            [override] whether to override the current root element, if any
17083          * 
17084          * @return {Object|djs.model.Root} new root element
17085          */
17086         Canvas.prototype.setRootElement = function(element, override) {
17087
17088             this._ensureValidId(element);
17089
17090             var oldRoot = this._rootElement,
17091                 elementRegistry = this._elementRegistry,
17092                 eventBus = this._eventBus;
17093
17094             if (oldRoot) {
17095                 if (!override) {
17096                     throw new Error('rootElement already set, need to specify override');
17097                 }
17098
17099                 // simulate element remove event sequence
17100                 eventBus.fire('root.remove', {
17101                     element: oldRoot
17102                 });
17103                 eventBus.fire('root.removed', {
17104                     element: oldRoot
17105                 });
17106
17107                 elementRegistry.remove(oldRoot);
17108             }
17109
17110             var gfx = this.getDefaultLayer();
17111
17112             // resemble element add event sequence
17113             eventBus.fire('root.add', {
17114                 element: element
17115             });
17116
17117             elementRegistry.add(element, gfx, this._svg);
17118
17119             eventBus.fire('root.added', {
17120                 element: element,
17121                 gfx: gfx
17122             });
17123
17124             this._rootElement = element;
17125
17126             return element;
17127         };
17128
17129
17130
17131         // /////////// add functionality ///////////////////////////////
17132
17133         Canvas.prototype._ensureValidId = function(element) {
17134             if (!element.id) {
17135                 throw new Error('element must have an id');
17136             }
17137
17138             if (this._elementRegistry.get(element.id)) {
17139                 throw new Error('element with id ' + element.id + ' already exists');
17140             }
17141         };
17142
17143         Canvas.prototype._setParent = function(element, parent) {
17144             Collections.add(parent.children, element);
17145             element.parent = parent;
17146         };
17147
17148         /**
17149          * Adds an element to the canvas.
17150          * 
17151          * This wires the parent <-> child relationship between the element and a
17152          * explicitly specified parent or an implicit root element.
17153          * 
17154          * During add it emits the events
17155          *  * <{type}.add> (element, parent) * <{type}.added> (element, gfx)
17156          * 
17157          * Extensions may hook into these events to perform their magic.
17158          * 
17159          * @param {String}
17160          *            type
17161          * @param {Object|djs.model.Base}
17162          *            element
17163          * @param {Object|djs.model.Base}
17164          *            [parent]
17165          * 
17166          * @return {Object|djs.model.Base} the added element
17167          */
17168         Canvas.prototype._addElement = function(type, element, parent) {
17169
17170             parent = parent || this.getRootElement();
17171
17172             var eventBus = this._eventBus,
17173                 graphicsFactory = this._graphicsFactory;
17174
17175             this._ensureValidId(element);
17176
17177             eventBus.fire(type + '.add', {
17178                 element: element,
17179                 parent: parent
17180             });
17181
17182             this._setParent(element, parent);
17183
17184             // create graphics
17185             var gfx = graphicsFactory.create(type, element);
17186
17187             this._elementRegistry.add(element, gfx);
17188
17189             // update its visual
17190             graphicsFactory.update(type, element, gfx);
17191
17192             eventBus.fire(type + '.added', {
17193                 element: element,
17194                 gfx: gfx
17195             });
17196
17197             return element;
17198         };
17199
17200         /**
17201          * Adds a shape to the canvas
17202          * 
17203          * @param {Object|djs.model.Shape}
17204          *            shape to add to the diagram
17205          * @param {djs.model.Base}
17206          *            [parent]
17207          * 
17208          * @return {djs.model.Shape} the added shape
17209          */
17210         Canvas.prototype.addShape = function(shape, parent) {
17211             return this._addElement('shape', shape, parent);
17212         };
17213
17214         /**
17215          * Adds a connection to the canvas
17216          * 
17217          * @param {Object|djs.model.Connection}
17218          *            connection to add to the diagram
17219          * @param {djs.model.Base}
17220          *            [parent]
17221          * 
17222          * @return {djs.model.Connection} the added connection
17223          */
17224         Canvas.prototype.addConnection = function(connection, parent) {
17225             return this._addElement('connection', connection, parent);
17226         };
17227
17228
17229         /**
17230          * Internal remove element
17231          */
17232         Canvas.prototype._removeElement = function(element, type) {
17233             console.log(element);
17234             var elementRegistry = this._elementRegistry,
17235                 graphicsFactory = this._graphicsFactory,
17236                 eventBus = this._eventBus;
17237
17238             element = elementRegistry.get(element.id || element);
17239
17240             if (!element) {
17241                 // element was removed already
17242                 return;
17243             }
17244
17245             eventBus.fire(type + '.remove', {
17246                 element: element
17247             });
17248
17249             graphicsFactory.remove(element);
17250
17251             // unset parent <-> child relationship
17252             Collections.remove(element.parent && element.parent.children, element);
17253             element.parent = null;
17254
17255             eventBus.fire(type + '.removed', {
17256                 element: element
17257             });
17258
17259             elementRegistry.remove(element);
17260
17261             return element;
17262         };
17263
17264
17265         /**
17266          * Removes a shape from the canvas
17267          * 
17268          * @param {String|djs.model.Shape}
17269          *            shape or shape id to be removed
17270          * 
17271          * @return {djs.model.Shape} the removed shape
17272          */
17273         Canvas.prototype.removeShape = function(shape) {
17274
17275             /**
17276              * An event indicating that a shape is about to be removed from the canvas.
17277              * 
17278              * @memberOf Canvas
17279              * 
17280              * @event shape.remove
17281              * @type {Object}
17282              * @property {djs.model.Shape} element the shape descriptor
17283              * @property {Object} gfx the graphical representation of the shape
17284              */
17285
17286             /**
17287              * An event indicating that a shape has been removed from the canvas.
17288              * 
17289              * @memberOf Canvas
17290              * 
17291              * @event shape.removed
17292              * @type {Object}
17293              * @property {djs.model.Shape} element the shape descriptor
17294              * @property {Object} gfx the graphical representation of the shape
17295              */
17296             return this._removeElement(shape, 'shape');
17297         };
17298
17299
17300         /**
17301          * Removes a connection from the canvas
17302          * 
17303          * @param {String|djs.model.Connection}
17304          *            connection or connection id to be removed
17305          * 
17306          * @return {djs.model.Connection} the removed connection
17307          */
17308         Canvas.prototype.removeConnection = function(connection) {
17309
17310             /**
17311              * An event indicating that a connection is about to be removed from the
17312              * canvas.
17313              * 
17314              * @memberOf Canvas
17315              * 
17316              * @event connection.remove
17317              * @type {Object}
17318              * @property {djs.model.Connection} element the connection descriptor
17319              * @property {Object} gfx the graphical representation of the connection
17320              */
17321
17322             /**
17323              * An event indicating that a connection has been removed from the canvas.
17324              * 
17325              * @memberOf Canvas
17326              * 
17327              * @event connection.removed
17328              * @type {Object}
17329              * @property {djs.model.Connection} element the connection descriptor
17330              * @property {Object} gfx the graphical representation of the connection
17331              */
17332             return this._removeElement(connection, 'connection');
17333         };
17334
17335
17336         /**
17337          * Sends a shape to the front.
17338          * 
17339          * This method takes parent / child relationships between shapes into account
17340          * and makes sure that children are properly handled, too.
17341          * 
17342          * @param {djs.model.Shape}
17343          *            shape descriptor of the shape to be sent to front
17344          * @param {boolean}
17345          *            [bubble=true] whether to send parent shapes to front, too
17346          */
17347         Canvas.prototype.sendToFront = function(shape, bubble) {
17348
17349             if (bubble !== false) {
17350                 bubble = true;
17351             }
17352
17353             if (bubble && shape.parent) {
17354                 this.sendToFront(shape.parent);
17355             }
17356
17357             forEach(shape.children, function(child) {
17358                 this.sendToFront(child, false);
17359             }, this);
17360
17361             var gfx = this.getGraphics(shape),
17362                 gfxParent = gfx.parent();
17363
17364             gfx.remove().appendTo(gfxParent);
17365         };
17366
17367
17368         /**
17369          * Return the graphical object underlaying a certain diagram element
17370          * 
17371          * @param {String|djs.model.Base}
17372          *            element descriptor of the element
17373          * @param {Boolean}
17374          *            [secondary=false] whether to return the secondary connected
17375          *            element
17376          * 
17377          * @return {SVGElement}
17378          */
17379         Canvas.prototype.getGraphics = function(element, secondary) {
17380             return this._elementRegistry.getGraphics(element, secondary);
17381         };
17382
17383
17384         Canvas.prototype._fireViewboxChange = function() {
17385             this._eventBus.fire('canvas.viewbox.changed', {
17386                 viewbox: this.viewbox(false)
17387             });
17388         };
17389
17390
17391         /**
17392          * Gets or sets the view box of the canvas, i.e. the area that is currently
17393          * displayed
17394          * 
17395          * @param {Object}
17396          *            [box] the new view box to set
17397          * @param {Number}
17398          *            box.x the top left X coordinate of the canvas visible in view box
17399          * @param {Number}
17400          *            box.y the top left Y coordinate of the canvas visible in view box
17401          * @param {Number}
17402          *            box.width the visible width
17403          * @param {Number}
17404          *            box.height
17405          * 
17406          * @example
17407          * 
17408          * canvas.viewbox({ x: 100, y: 100, width: 500, height: 500 })
17409          *  // sets the visible area of the diagram to (100|100) -> (600|100) // and and
17410          * scales it according to the diagram width
17411          * 
17412          * @return {Object} the current view box
17413          */
17414         Canvas.prototype.viewbox = function(box) {
17415
17416             if (box === undefined && this._cachedViewbox) {
17417                 return this._cachedViewbox;
17418             }
17419
17420             var viewport = this._viewport,
17421                 innerBox,
17422                 outerBox = this.getSize(),
17423                 matrix,
17424                 scale,
17425                 x, y;
17426
17427             if (!box) {
17428                 // compute the inner box based on the
17429                 // diagrams default layer. This allows us to exclude
17430                 // external components, such as overlays
17431                 innerBox = this.getDefaultLayer().getBBox(true);
17432
17433                 matrix = viewport.transform().localMatrix;
17434                 scale = round(matrix.a, 1000);
17435
17436                 x = round(-matrix.e || 0, 1000);
17437                 y = round(-matrix.f || 0, 1000);
17438
17439                 box = this._cachedViewbox = {
17440                     x: x ? x / scale : 0,
17441                     y: y ? y / scale : 0,
17442                     width: outerBox.width / scale,
17443                     height: outerBox.height / scale,
17444                     scale: scale,
17445                     inner: {
17446                         width: innerBox.width,
17447                         height: innerBox.height,
17448                         x: innerBox.x,
17449                         y: innerBox.y
17450                     },
17451                     outer: outerBox
17452                 };
17453
17454                 return box;
17455             } else {
17456                 scale = Math.min(outerBox.width / box.width, outerBox.height / box.height);
17457
17458                 matrix = new Snap.Matrix().scale(scale).translate(-box.x, -box.y);
17459                 viewport.transform(matrix);
17460
17461                 this._fireViewboxChange();
17462             }
17463
17464             return box;
17465         };
17466
17467
17468         /**
17469          * Gets or sets the scroll of the canvas.
17470          * 
17471          * @param {Object}
17472          *            [delta] the new scroll to apply.
17473          * 
17474          * @param {Number}
17475          *            [delta.dx]
17476          * @param {Number}
17477          *            [delta.dy]
17478          */
17479         Canvas.prototype.scroll = function(delta) {
17480             var node = this._viewport.node;
17481             var matrix = node.getCTM();
17482
17483             if (delta) {
17484                 delta = assign({
17485                     dx: 0,
17486                     dy: 0
17487                 }, delta || {});
17488
17489                 matrix = this._svg.node.createSVGMatrix().translate(delta.dx, delta.dy).multiply(matrix);
17490
17491                 setCTM(node, matrix);
17492
17493                 this._fireViewboxChange();
17494             }
17495
17496             return {
17497                 x: matrix.e,
17498                 y: matrix.f
17499             };
17500         };
17501
17502
17503         /**
17504          * Gets or sets the current zoom of the canvas, optionally zooming to the
17505          * specified position.
17506          * 
17507          * @param {String|Number}
17508          *            [newScale] the new zoom level, either a number, i.e. 0.9, or
17509          *            `fit-viewport` to adjust the size to fit the current viewport
17510          * @param {String|Point}
17511          *            [center] the reference point { x: .., y: ..} to zoom to, 'auto' to
17512          *            zoom into mid or null
17513          * 
17514          * @return {Number} the current scale
17515          */
17516         Canvas.prototype.zoom = function(newScale, center) {
17517
17518             if (newScale === 'fit-viewport') {
17519                 return this._fitViewport(center);
17520             }
17521
17522             var vbox = this.viewbox();
17523
17524             if (newScale === undefined) {
17525                 return vbox.scale;
17526             }
17527
17528             var outer = vbox.outer;
17529
17530             if (center === 'auto') {
17531                 center = {
17532                     x: outer.width / 2,
17533                     y: outer.height / 2
17534                 };
17535             }
17536
17537             var matrix = this._setZoom(newScale, center);
17538
17539             this._fireViewboxChange();
17540
17541             return round(matrix.a, 1000);
17542         };
17543
17544         function setCTM(node, m) {
17545             var mstr = 'matrix(' + m.a + ',' + m.b + ',' + m.c + ',' + m.d + ',' + m.e + ',' + m.f + ')';
17546             node.setAttribute('transform', mstr);
17547         }
17548
17549         Canvas.prototype._fitViewport = function(center) {
17550
17551             var vbox = this.viewbox(),
17552                 outer = vbox.outer,
17553                 inner = vbox.inner,
17554                 newScale,
17555                 newViewbox;
17556
17557             // display the complete diagram without zooming in.
17558             // instead of relying on internal zoom, we perform a
17559             // hard reset on the canvas viewbox to realize this
17560             //
17561             // if diagram does not need to be zoomed in, we focus it around
17562             // the diagram origin instead
17563
17564             if (inner.x >= 0 &&
17565                 inner.y >= 0 &&
17566                 inner.x + inner.width <= outer.width &&
17567                 inner.y + inner.height <= outer.height &&
17568                 !center) {
17569
17570                 newViewbox = {
17571                     x: 0,
17572                     y: 0,
17573                     width: Math.max(inner.width + inner.x, outer.width),
17574                     height: Math.max(inner.height + inner.y, outer.height)
17575                 };
17576             } else {
17577
17578                 newScale = Math.min(1, outer.width / inner.width, outer.height / inner.height);
17579                 newViewbox = {
17580                     x: inner.x + (center ? inner.width / 2 - outer.width / newScale / 2 : 0),
17581                     y: inner.y + (center ? inner.height / 2 - outer.height / newScale / 2 : 0),
17582                     width: outer.width / newScale,
17583                     height: outer.height / newScale
17584                 };
17585             }
17586
17587             this.viewbox(newViewbox);
17588
17589             return this.viewbox().scale;
17590         };
17591
17592
17593         Canvas.prototype._setZoom = function(scale, center) {
17594
17595             var svg = this._svg.node,
17596                 viewport = this._viewport.node;
17597
17598             var matrix = svg.createSVGMatrix();
17599             var point = svg.createSVGPoint();
17600
17601             var centerPoint,
17602                 originalPoint,
17603                 currentMatrix,
17604                 scaleMatrix,
17605                 newMatrix;
17606
17607             currentMatrix = viewport.getCTM();
17608
17609
17610             var currentScale = currentMatrix.a;
17611
17612             if (center) {
17613                 centerPoint = assign(point, center);
17614
17615                 // revert applied viewport transformations
17616                 originalPoint = centerPoint.matrixTransform(currentMatrix.inverse());
17617
17618                 // create scale matrix
17619                 scaleMatrix = matrix
17620                     .translate(originalPoint.x, originalPoint.y)
17621                     .scale(1 / currentScale * scale)
17622                     .translate(-originalPoint.x, -originalPoint.y);
17623
17624                 newMatrix = currentMatrix.multiply(scaleMatrix);
17625             } else {
17626                 newMatrix = matrix.scale(scale);
17627             }
17628
17629             setCTM(this._viewport.node, newMatrix);
17630
17631             return newMatrix;
17632         };
17633
17634
17635         /**
17636          * Returns the size of the canvas
17637          * 
17638          * @return {Dimensions}
17639          */
17640         Canvas.prototype.getSize = function() {
17641             return {
17642                 width: this._container.clientWidth,
17643                 height: this._container.clientHeight
17644             };
17645         };
17646
17647
17648         /**
17649          * Return the absolute bounding box for the given element
17650          * 
17651          * The absolute bounding box may be used to display overlays in the callers
17652          * (browser) coordinate system rather than the zoomed in/out canvas coordinates.
17653          * 
17654          * @param {ElementDescriptor}
17655          *            element
17656          * @return {Bounds} the absolute bounding box
17657          */
17658         Canvas.prototype.getAbsoluteBBox = function(element) {
17659             var vbox = this.viewbox();
17660             var bbox;
17661
17662             // connection
17663             // use svg bbox
17664             if (element.waypoints) {
17665                 var gfx = this.getGraphics(element);
17666
17667                 var transformBBox = gfx.getBBox(true);
17668                 bbox = gfx.getBBox();
17669
17670                 bbox.x -= transformBBox.x;
17671                 bbox.y -= transformBBox.y;
17672
17673                 bbox.width += 2 * transformBBox.x;
17674                 bbox.height += 2 * transformBBox.y;
17675             }
17676             // shapes
17677             // use data
17678             else {
17679                 bbox = element;
17680             }
17681
17682             var x = bbox.x * vbox.scale - vbox.x * vbox.scale;
17683             var y = bbox.y * vbox.scale - vbox.y * vbox.scale;
17684
17685             var width = bbox.width * vbox.scale;
17686             var height = bbox.height * vbox.scale;
17687
17688             return {
17689                 x: x,
17690                 y: y,
17691                 width: width,
17692                 height: height
17693             };
17694         };
17695
17696     }, {
17697         "../../vendor/snapsvg": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\vendor\\snapsvg.js",
17698         "../util/Collections": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Collections.js",
17699         "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
17700         "lodash/lang/isNumber": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isNumber.js",
17701         "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js"
17702     }],
17703     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\core\\ElementFactory.js": [function(require, module, exports) {
17704         'use strict';
17705
17706         var Model = require('../model');
17707
17708
17709         /**
17710          * A factory for diagram-js shapes
17711          */
17712         function ElementFactory() {
17713             this._uid = 12;
17714         }
17715
17716         module.exports = ElementFactory;
17717
17718
17719         ElementFactory.prototype.createRoot = function(attrs) {
17720             return this.create('root', attrs);
17721         };
17722
17723         ElementFactory.prototype.createLabel = function(attrs) {
17724             return this.create('label', attrs);
17725         };
17726
17727         ElementFactory.prototype.createShape = function(attrs) {
17728             // alert("In createShape");
17729             return this.create('shape', attrs);
17730         };
17731
17732         ElementFactory.prototype.createConnection = function(attrs) {
17733             return this.create('connection', attrs);
17734         };
17735
17736         /**
17737          * Create a model element with the given type and a number of pre-set
17738          * attributes.
17739          * 
17740          * @param {String}
17741          *            type
17742          * @param {Object}
17743          *            attrs
17744          * @return {djs.model.Base} the newly created model instance
17745          */
17746         ElementFactory.prototype.create = function(type, attrs) {
17747             // alert("In create");
17748
17749             attrs = attrs || {};
17750
17751             if (!attrs.id) {
17752                 attrs.id = type + '_' + (this._uid++);
17753             }
17754
17755             return Model.create(type, attrs);
17756         };
17757     }, {
17758         "../model": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\model\\index.js"
17759     }],
17760     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\core\\ElementRegistry.js": [function(require, module, exports) {
17761         'use strict';
17762
17763         var ELEMENT_ID = 'data-element-id';
17764
17765
17766         /**
17767          * @class
17768          * 
17769          * A registry that keeps track of all shapes in the diagram.
17770          */
17771         function ElementRegistry() {
17772             this._elements = {};
17773         }
17774
17775         module.exports = ElementRegistry;
17776
17777         /**
17778          * Register a pair of (element, gfx, (secondaryGfx)).
17779          * 
17780          * @param {djs.model.Base}
17781          *            element
17782          * @param {Snap
17783          *            <SVGElement>} gfx
17784          * @param {Snap
17785          *            <SVGElement>} [secondaryGfx] optional other element to register,
17786          *            too
17787          */
17788         ElementRegistry.prototype.add = function(element, gfx, secondaryGfx) {
17789
17790             var id = element.id;
17791
17792             this._validateId(id);
17793
17794             // associate dom node with element
17795             gfx.attr(ELEMENT_ID, id);
17796
17797             if (secondaryGfx) {
17798                 secondaryGfx.attr(ELEMENT_ID, id);
17799             }
17800
17801             this._elements[id] = {
17802                 element: element,
17803                 gfx: gfx,
17804                 secondaryGfx: secondaryGfx
17805             };
17806         };
17807
17808         /**
17809          * Removes an element from the registry.
17810          * 
17811          * @param {djs.model.Base}
17812          *            element
17813          */
17814         ElementRegistry.prototype.remove = function(element) {
17815             var elements = this._elements,
17816                 id = element.id || element,
17817                 container = id && elements[id];
17818
17819             if (container) {
17820
17821                 // unset element id on gfx
17822                 container.gfx.attr(ELEMENT_ID, null);
17823
17824                 if (container.secondaryGfx) {
17825                     container.secondaryGfx.attr(ELEMENT_ID, null);
17826                 }
17827
17828                 delete elements[id];
17829             }
17830         };
17831
17832         /**
17833          * Update the id of an element
17834          * 
17835          * @param {djs.model.Base}
17836          *            element
17837          * @param {String}
17838          *            newId
17839          */
17840         ElementRegistry.prototype.updateId = function(element, newId) {
17841
17842             this._validateId(newId);
17843
17844             if (typeof element === 'string') {
17845                 element = this.get(element);
17846             }
17847
17848             var gfx = this.getGraphics(element),
17849                 secondaryGfx = this.getGraphics(element, true);
17850
17851             this.remove(element);
17852
17853             element.id = newId;
17854
17855             this.add(element, gfx, secondaryGfx);
17856         };
17857
17858         /**
17859          * Return the model element for a given id or graphics.
17860          * 
17861          * @example
17862          * 
17863          * elementRegistry.get('SomeElementId_1'); elementRegistry.get(gfx);
17864          * 
17865          * 
17866          * @param {String|SVGElement}
17867          *            filter for selecting the element
17868          * 
17869          * @return {djs.model.Base}
17870          */
17871         ElementRegistry.prototype.get = function(filter) {
17872             var id;
17873
17874             if (typeof filter === 'string') {
17875                 id = filter;
17876             } else {
17877                 id = filter && filter.attr(ELEMENT_ID);
17878             }
17879
17880             var container = this._elements[id];
17881             return container && container.element;
17882         };
17883
17884         /**
17885          * Return all elements that match a given filter function.
17886          * 
17887          * @param {Function}
17888          *            fn
17889          * 
17890          * @return {Array<djs.model.Base>}
17891          */
17892         ElementRegistry.prototype.filter = function(fn) {
17893
17894             var filtered = [];
17895
17896             this.forEach(function(element, gfx) {
17897                 if (fn(element, gfx)) {
17898                     filtered.push(element);
17899                 }
17900             });
17901
17902             return filtered;
17903         };
17904
17905         /**
17906          * Iterate over all diagram elements.
17907          * 
17908          * @param {Function}
17909          *            fn
17910          */
17911         ElementRegistry.prototype.forEach = function(fn) {
17912
17913             var map = this._elements;
17914
17915             Object.keys(map).forEach(function(id) {
17916                 var container = map[id],
17917                     element = container.element,
17918                     gfx = container.gfx;
17919
17920                 return fn(element, gfx);
17921             });
17922         };
17923
17924         /**
17925          * Return the graphical representation of an element or its id.
17926          * 
17927          * @example elementRegistry.getGraphics('SomeElementId_1');
17928          *          elementRegistry.getGraphics(rootElement); // <g ...>
17929          * 
17930          * elementRegistry.getGraphics(rootElement, true); // <svg ...>
17931          * 
17932          * 
17933          * @param {String|djs.model.Base}
17934          *            filter
17935          * @param {Boolean}
17936          *            [secondary=false] whether to return the secondary connected
17937          *            element
17938          * 
17939          * @return {SVGElement}
17940          */
17941         ElementRegistry.prototype.getGraphics = function(filter, secondary) {
17942             var id = filter.id || filter;
17943
17944             var container = this._elements[id];
17945             return container && (secondary ? container.secondaryGfx : container.gfx);
17946         };
17947
17948         /**
17949          * Validate the suitability of the given id and signals a problem with an
17950          * exception.
17951          * 
17952          * @param {String}
17953          *            id
17954          * 
17955          * @throws {Error}
17956          *             if id is empty or already assigned
17957          */
17958         ElementRegistry.prototype._validateId = function(id) {
17959             if (!id) {
17960                 throw new Error('element must have an id');
17961             }
17962
17963             if (this._elements[id]) {
17964                 throw new Error('element with id ' + id + ' already added');
17965             }
17966         };
17967     }, {}],
17968     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\core\\EventBus.js": [function(require, module, exports) {
17969         'use strict';
17970
17971         var isFunction = require('lodash/lang/isFunction'),
17972             isArray = require('lodash/lang/isArray'),
17973             isNumber = require('lodash/lang/isNumber'),
17974             assign = require('lodash/object/assign');
17975
17976         var DEFAULT_PRIORITY = 1000;
17977
17978
17979         /**
17980          * A general purpose event bus.
17981          * 
17982          * This component is used to communicate across a diagram instance. Other parts
17983          * of a diagram can use it to listen to and broadcast events.
17984          * 
17985          *  ## Registering for Events
17986          * 
17987          * The event bus provides the {@link EventBus#on} and {@link EventBus#once}
17988          * methods to register for events. {@link EventBus#off} can be used to remove
17989          * event registrations. Listeners receive an instance of {@link Event} as the
17990          * first argument. It allows them to hook into the event execution.
17991          * 
17992          * ```javascript
17993          *  // listen for event eventBus.on('foo', function(event) {
17994          *  // access event type event.type; // 'foo'
17995          *  // stop propagation to other listeners event.stopPropagation();
17996          *  // prevent event default event.preventDefault(); });
17997          *  // listen for event with custom payload eventBus.on('bar', function(event,
17998          * payload) { console.log(payload); });
17999          *  // listen for event returning value eventBus.on('foobar', function(event) {
18000          *  // stop event propagation + prevent default return false;
18001          *  // stop event propagation + return custom result return { complex:
18002          * 'listening result' }; });
18003          * 
18004          *  // listen with custom priority (default=1000, higher is better)
18005          * eventBus.on('priorityfoo', 1500, function(event) { console.log('invoked
18006          * first!'); }); ```
18007          * 
18008          *  ## Emitting Events
18009          * 
18010          * Events can be emitted via the event bus using {@link EventBus#fire}.
18011          * 
18012          * ```javascript
18013          *  // false indicates that the default action // was prevented by listeners if
18014          * (eventBus.fire('foo') === false) { console.log('default has been
18015          * prevented!'); };
18016          * 
18017          *  // custom args + return value listener eventBus.on('sum', function(event, a,
18018          * b) { return a + b; });
18019          *  // you can pass custom arguments + retrieve result values. var sum =
18020          * eventBus.fire('sum', 1, 2); console.log(sum); // 3 ```
18021          */
18022         function EventBus() {
18023             this._listeners = {};
18024
18025             // cleanup on destroy
18026
18027             var self = this;
18028
18029             // destroy on lowest priority to allow
18030             // message passing until the bitter end
18031             this.on('diagram.destroy', 1, function() {
18032                 self._listeners = null;
18033             });
18034         }
18035
18036         module.exports = EventBus;
18037
18038
18039         /**
18040          * Register an event listener for events with the given name.
18041          * 
18042          * The callback will be invoked with `event, ...additionalArguments` that have
18043          * been passed to {@link EventBus#fire}.
18044          * 
18045          * Returning false from a listener will prevent the events default action (if
18046          * any is specified). To stop an event from being processed further in other
18047          * listeners execute {@link Event#stopPropagation}.
18048          * 
18049          * Returning anything but `undefined` from a listener will stop the listener
18050          * propagation.
18051          * 
18052          * @param {String|Array
18053          *            <String>} events
18054          * @param {Number}
18055          *            [priority=1000] the priority in which this listener is called,
18056          *            larger is higher
18057          * @param {Function}
18058          *            callback
18059          */
18060         EventBus.prototype.on = function(events, priority, callback) {
18061
18062             events = isArray(events) ? events : [events];
18063
18064             if (isFunction(priority)) {
18065                 callback = priority;
18066                 priority = DEFAULT_PRIORITY;
18067             }
18068
18069             if (!isNumber(priority)) {
18070                 throw new Error('priority must be a number');
18071             }
18072
18073             var self = this,
18074                 listener = {
18075                     priority: priority,
18076                     callback: callback
18077                 };
18078
18079             events.forEach(function(e) {
18080                 self._addListener(e, listener);
18081             });
18082         };
18083
18084
18085         /**
18086          * Register an event listener that is executed only once.
18087          * 
18088          * @param {String}
18089          *            event the event name to register for
18090          * @param {Function}
18091          *            callback the callback to execute
18092          */
18093         EventBus.prototype.once = function(event, callback) {
18094
18095             var self = this;
18096
18097             function wrappedCallback() {
18098                 callback.apply(self, arguments);
18099                 self.off(event, wrappedCallback);
18100             }
18101
18102             this.on(event, wrappedCallback);
18103         };
18104
18105
18106         /**
18107          * Removes event listeners by event and callback.
18108          * 
18109          * If no callback is given, all listeners for a given event name are being
18110          * removed.
18111          * 
18112          * @param {String}
18113          *            event
18114          * @param {Function}
18115          *            [callback]
18116          */
18117         EventBus.prototype.off = function(event, callback) {
18118             var listeners = this._getListeners(event),
18119                 listener, idx;
18120
18121             if (callback) {
18122
18123                 // move through listeners from back to front
18124                 // and remove matching listeners
18125                 for (idx = listeners.length - 1; !!(listener = listeners[idx]); idx--) {
18126                     if (listener.callback === callback) {
18127                         listeners.splice(idx, 1);
18128                     }
18129                 }
18130             } else {
18131                 // clear listeners
18132                 listeners.length = 0;
18133             }
18134         };
18135
18136
18137         /**
18138          * Fires a named event.
18139          * 
18140          * @example
18141          *  // fire event by name events.fire('foo');
18142          *  // fire event object with nested type var event = { type: 'foo' };
18143          * events.fire(event);
18144          *  // fire event with explicit type var event = { x: 10, y: 20 };
18145          * events.fire('element.moved', event);
18146          *  // pass additional arguments to the event events.on('foo', function(event,
18147          * bar) { alert(bar); });
18148          * 
18149          * events.fire({ type: 'foo' }, 'I am bar!');
18150          * 
18151          * @param {String}
18152          *            [name] the optional event name
18153          * @param {Object}
18154          *            [event] the event object
18155          * @param {...Object}
18156          *            additional arguments to be passed to the callback functions
18157          * 
18158          * @return {Boolean} the events return value, if specified or false if the
18159          *         default action was prevented by listeners
18160          */
18161         EventBus.prototype.fire = function(type, data) {
18162
18163             var event,
18164                 originalType,
18165                 listeners, idx, listener,
18166                 returnValue,
18167                 args;
18168
18169             args = Array.prototype.slice.call(arguments);
18170
18171             if (typeof type === 'object') {
18172                 event = type;
18173                 type = event.type;
18174             }
18175
18176             if (!type) {
18177                 throw new Error('no event type specified');
18178             }
18179
18180             listeners = this._listeners[type];
18181
18182             if (!listeners) {
18183                 return;
18184             }
18185
18186             // we make sure we fire instances of our home made
18187             // events here. We wrap them only once, though
18188             if (data instanceof Event) {
18189                 // we are fine, we alread have an event
18190                 event = data;
18191             } else {
18192                 event = new Event();
18193                 event.init(data);
18194             }
18195
18196             // ensure we pass the event as the first parameter
18197             args[0] = event;
18198
18199             // original event type (in case we delegate)
18200             originalType = event.type;
18201
18202             try {
18203
18204                 // update event type before delegation
18205                 if (type !== originalType) {
18206                     event.type = type;
18207                 }
18208
18209                 for (idx = 0; !!(listener = listeners[idx]); idx++) {
18210
18211                     // handle stopped propagation
18212                     if (event.cancelBubble) {
18213                         break;
18214                     }
18215
18216                     try {
18217                         // returning false prevents the default action
18218                         returnValue = event.returnValue = listener.callback.apply(null, args);
18219
18220                         // stop propagation on return value
18221                         if (returnValue !== undefined) {
18222                             event.stopPropagation();
18223                         }
18224
18225                         // prevent default on return false
18226                         if (returnValue === false) {
18227                             event.preventDefault();
18228                         }
18229                     } catch (e) {
18230                         if (!this.handleError(e)) {
18231                             console.error('unhandled error in event listener');
18232                             console.error(e.stack);
18233
18234                             throw e;
18235                         }
18236                     }
18237                 }
18238             } finally {
18239                 // reset event type after delegation
18240                 if (type !== originalType) {
18241                     event.type = originalType;
18242                 }
18243             }
18244
18245             // set the return value to false if the event default
18246             // got prevented and no other return value exists
18247             if (returnValue === undefined && event.defaultPrevented) {
18248                 returnValue = false;
18249             }
18250
18251             return returnValue;
18252         };
18253
18254
18255         EventBus.prototype.handleError = function(error) {
18256             return this.fire('error', {
18257                 error: error
18258             }) === false;
18259         };
18260
18261
18262         /*
18263          * Add new listener with a certain priority to the list of listeners (for the
18264          * given event).
18265          * 
18266          * The semantics of listener registration / listener execution are first
18267          * register, first serve: New listeners will always be inserted after existing
18268          * listeners with the same priority.
18269          * 
18270          * Example: Inserting two listeners with priority 1000 and 1300
18271          *  * before: [ 1500, 1500, 1000, 1000 ] * after: [ 1500, 1500, (new=1300),
18272          * 1000, 1000, (new=1000) ]
18273          * 
18274          * @param {String} event @param {Object} listener { priority, callback }
18275          */
18276         EventBus.prototype._addListener = function(event, newListener) {
18277
18278             var listeners = this._getListeners(event),
18279                 existingListener,
18280                 idx;
18281
18282             // ensure we order listeners by priority from
18283             // 0 (high) to n > 0 (low)
18284             for (idx = 0; !!(existingListener = listeners[idx]); idx++) {
18285                 if (existingListener.priority < newListener.priority) {
18286
18287                     // prepend newListener at before existingListener
18288                     listeners.splice(idx, 0, newListener);
18289                     return;
18290                 }
18291             }
18292
18293             listeners.push(newListener);
18294         };
18295
18296
18297         EventBus.prototype._getListeners = function(name) {
18298             var listeners = this._listeners[name];
18299
18300             if (!listeners) {
18301                 this._listeners[name] = listeners = [];
18302             }
18303
18304             return listeners;
18305         };
18306
18307
18308         /**
18309          * A event that is emitted via the event bus.
18310          */
18311         function Event() {}
18312
18313         module.exports.Event = Event;
18314
18315         Event.prototype.stopPropagation = function() {
18316             this.cancelBubble = true;
18317         };
18318
18319         Event.prototype.preventDefault = function() {
18320             this.defaultPrevented = true;
18321         };
18322
18323         Event.prototype.init = function(data) {
18324             assign(this, data || {});
18325         };
18326
18327     }, {
18328         "lodash/lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js",
18329         "lodash/lang/isFunction": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isFunction.js",
18330         "lodash/lang/isNumber": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isNumber.js",
18331         "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js"
18332     }],
18333     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\core\\GraphicsFactory.js": [function(require, module, exports) {
18334         'use strict';
18335
18336         var forEach = require('lodash/collection/forEach'),
18337             reduce = require('lodash/collection/reduce');
18338
18339         var GraphicsUtil = require('../util/GraphicsUtil'),
18340             domClear = require('min-dom/lib/clear');
18341
18342         /**
18343          * A factory that creates graphical elements
18344          * 
18345          * @param {Renderer}
18346          *            renderer
18347          */
18348         function GraphicsFactory(renderer, elementRegistry) {
18349             this._renderer = renderer;
18350             this._elementRegistry = elementRegistry;
18351         }
18352
18353         GraphicsFactory.$inject = ['renderer', 'elementRegistry'];
18354
18355         module.exports = GraphicsFactory;
18356
18357
18358         GraphicsFactory.prototype._getChildren = function(element) {
18359
18360             var gfx = this._elementRegistry.getGraphics(element);
18361
18362             var childrenGfx;
18363
18364             // root element
18365             if (!element.parent) {
18366                 childrenGfx = gfx;
18367             } else {
18368                 childrenGfx = GraphicsUtil.getChildren(gfx);
18369                 if (!childrenGfx) {
18370                     childrenGfx = gfx.parent().group().attr('class', 'djs-children');
18371                 }
18372             }
18373
18374             return childrenGfx;
18375         };
18376
18377         /**
18378          * Clears the graphical representation of the element and returns the cleared
18379          * visual (the <g class="djs-visual" /> element).
18380          */
18381         GraphicsFactory.prototype._clear = function(gfx) {
18382             var visual = GraphicsUtil.getVisual(gfx);
18383
18384             domClear(visual.node);
18385
18386             return visual;
18387         };
18388
18389         /**
18390          * Creates a gfx container for shapes and connections
18391          * 
18392          * The layout is as follows:
18393          * 
18394          * <g class="djs-group">
18395          * 
18396          * <!-- the gfx --> <g class="djs-element djs-(shape|connection)"> <g
18397          * class="djs-visual"> <!-- the renderer draws in here --> </g>
18398          * 
18399          * <!-- extensions (overlays, click box, ...) goes here </g>
18400          * 
18401          * <!-- the gfx child nodes --> <g class="djs-children"></g> </g>
18402          * 
18403          * @param {Object}
18404          *            parent
18405          * @param {String}
18406          *            type the type of the element, i.e. shape | connection
18407          */
18408         GraphicsFactory.prototype._createContainer = function(type, parentGfx) {
18409             var outerGfx = parentGfx.group().attr('class', 'djs-group'),
18410                 gfx = outerGfx.group().attr('class', 'djs-element djs-' + type);
18411
18412             // create visual
18413             gfx.group().attr('class', 'djs-visual');
18414
18415             return gfx;
18416         };
18417
18418         GraphicsFactory.prototype.create = function(type, element) {
18419             var childrenGfx = this._getChildren(element.parent);
18420             return this._createContainer(type, childrenGfx);
18421         };
18422
18423
18424         GraphicsFactory.prototype.updateContainments = function(elements) {
18425
18426             var self = this,
18427                 elementRegistry = this._elementRegistry,
18428                 parents;
18429
18430
18431             parents = reduce(elements, function(map, e) {
18432
18433                 if (e.parent) {
18434                     map[e.parent.id] = e.parent;
18435                 }
18436
18437                 return map;
18438             }, {});
18439
18440             // update all parents of changed and reorganized their children
18441             // in the correct order (as indicated in our model)
18442             forEach(parents, function(parent) {
18443
18444                 var childGfx = self._getChildren(parent),
18445                     children = parent.children;
18446
18447                 if (!children) {
18448                     return;
18449                 }
18450
18451                 forEach(children.slice().reverse(), function(c) {
18452                     var gfx = elementRegistry.getGraphics(c);
18453                     gfx.parent().prependTo(childGfx);
18454                 });
18455             });
18456
18457         };
18458
18459         GraphicsFactory.prototype.update = function(type, element, gfx) {
18460
18461             // Do not update root element
18462             if (!element.parent) {
18463                 return;
18464             }
18465
18466             var visual = this._clear(gfx);
18467
18468             // redraw
18469             if (type === 'shape') {
18470                 this._renderer.drawShape(visual, element);
18471
18472                 // update positioning
18473                 gfx.translate(element.x, element.y);
18474             } else
18475             if (type === 'connection') {
18476                 this._renderer.drawConnection(visual, element);
18477             } else {
18478                 throw new Error('unknown type: ' + type);
18479             }
18480
18481             gfx.attr('display', element.hidden ? 'none' : 'block');
18482         };
18483
18484
18485         GraphicsFactory.prototype.remove = function(element) {
18486             var gfx = this._elementRegistry.getGraphics(element);
18487
18488             // remove
18489             gfx.parent().remove();
18490         };
18491
18492     }, {
18493         "../util/GraphicsUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\GraphicsUtil.js",
18494         "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
18495         "lodash/collection/reduce": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\reduce.js",
18496         "min-dom/lib/clear": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\clear.js"
18497     }],
18498     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\core\\index.js": [function(require, module, exports) {
18499         module.exports = {
18500             __depends__: [require('../draw')],
18501             __init__: ['canvas'],
18502             canvas: ['type', require('./Canvas')],
18503             elementRegistry: ['type', require('./ElementRegistry')],
18504             elementFactory: ['type', require('./ElementFactory')],
18505             eventBus: ['type', require('./EventBus')],
18506             graphicsFactory: ['type', require('./GraphicsFactory')]
18507         };
18508     }, {
18509         "../draw": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\draw\\index.js",
18510         "./Canvas": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\core\\Canvas.js",
18511         "./ElementFactory": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\core\\ElementFactory.js",
18512         "./ElementRegistry": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\core\\ElementRegistry.js",
18513         "./EventBus": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\core\\EventBus.js",
18514         "./GraphicsFactory": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\core\\GraphicsFactory.js"
18515     }],
18516     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\draw\\Renderer.js": [function(require, module, exports) {
18517         'use strict';
18518
18519         var Snap = require('../../vendor/snapsvg');
18520
18521
18522         /**
18523          * The default renderer used for shapes and connections.
18524          * 
18525          * @param {Styles}
18526          *            styles
18527          */
18528         function Renderer(styles) {
18529             this.CONNECTION_STYLE = styles.style(['no-fill'], {
18530                 strokeWidth: 5,
18531                 stroke: 'fuchsia'
18532             });
18533             this.SHAPE_STYLE = styles.style({
18534                 fill: 'white',
18535                 stroke: 'fuchsia',
18536                 strokeWidth: 2
18537             });
18538         }
18539
18540         module.exports = Renderer;
18541
18542         Renderer.$inject = ['styles'];
18543
18544
18545         Renderer.prototype.drawShape = function drawShape(gfxGroup, data) {
18546             return gfxGroup.rect(0, 0, data.width || 0, data.height || 0).attr(this.SHAPE_STYLE);
18547         };
18548
18549         Renderer.prototype.drawConnection = function drawConnection(gfxGroup, data) {
18550             return createLine(data.waypoints, this.CONNECTION_STYLE).appendTo(gfxGroup);
18551         };
18552
18553         function componentsToPath(components) {
18554             return components.join(',').replace(/,?([A-z]),?/g, '$1');
18555         }
18556
18557         /**
18558          * Gets the default SVG path of a shape that represents it's visual bounds.
18559          * 
18560          * @param {djs.model.Shape}
18561          *            shape
18562          * @return {string} svg path
18563          */
18564         Renderer.prototype.getShapePath = function getShapePath(shape) {
18565
18566             var x = shape.x,
18567                 y = shape.y,
18568                 width = shape.width,
18569                 height = shape.height;
18570
18571             var shapePath = [
18572                 ['M', x, y],
18573                 ['l', width, 0],
18574                 ['l', 0, height],
18575                 ['l', -width, 0],
18576                 ['z']
18577             ];
18578
18579             return componentsToPath(shapePath);
18580         };
18581
18582         /**
18583          * Gets the default SVG path of a connection that represents it's visual bounds.
18584          * 
18585          * @param {djs.model.Connection}
18586          *            connection
18587          * @return {string} svg path
18588          */
18589         Renderer.prototype.getConnectionPath = function getConnectionPath(connection) {
18590             var waypoints = connection.waypoints;
18591
18592             var idx, point, connectionPath = [];
18593
18594             for (idx = 0; !!(point = waypoints[idx]); idx++) {
18595
18596                 // take invisible docking into account
18597                 // when creating the path
18598                 point = point.original || point;
18599
18600                 connectionPath.push([idx === 0 ? 'M' : 'L', point.x, point.y]);
18601             }
18602
18603             return componentsToPath(connectionPath);
18604         };
18605
18606
18607         function toSVGPoints(points) {
18608             var result = '';
18609
18610             for (var i = 0, p; !!(p = points[i]); i++) {
18611                 result += p.x + ',' + p.y + ' ';
18612             }
18613
18614             return result;
18615         }
18616
18617         function createLine(points, attrs) {
18618             return Snap.create('polyline', {
18619                 points: toSVGPoints(points)
18620             }).attr(attrs || {});
18621         }
18622
18623         function updateLine(gfx, points) {
18624             return gfx.attr({
18625                 points: toSVGPoints(points)
18626             });
18627         }
18628
18629         module.exports.createLine = createLine;
18630         module.exports.updateLine = updateLine;
18631     }, {
18632         "../../vendor/snapsvg": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\vendor\\snapsvg.js"
18633     }],
18634     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\draw\\Styles.js": [function(require, module, exports) {
18635         'use strict';
18636
18637         var isArray = require('lodash/lang/isArray'),
18638             assign = require('lodash/object/assign'),
18639             reduce = require('lodash/collection/reduce');
18640
18641
18642         /**
18643          * A component that manages shape styles
18644          */
18645         function Styles() {
18646
18647             var defaultTraits = {
18648
18649                 'no-fill': {
18650                     fill: 'none'
18651                 },
18652                 'no-border': {
18653                     strokeOpacity: 0.0
18654                 },
18655                 'no-events': {
18656                     pointerEvents: 'none'
18657                 }
18658             };
18659
18660             /**
18661              * Builds a style definition from a className, a list of traits and an
18662              * object of additional attributes.
18663              * 
18664              * @param {String}
18665              *            className
18666              * @param {Array
18667              *            <String>} traits
18668              * @param {Object}
18669              *            additionalAttrs
18670              * 
18671              * @return {Object} the style defintion
18672              */
18673             this.cls = function(className, traits, additionalAttrs) {
18674                 var attrs = this.style(traits, additionalAttrs);
18675
18676                 return assign(attrs, {
18677                     'class': className
18678                 });
18679             };
18680
18681             /**
18682              * Builds a style definition from a list of traits and an object of
18683              * additional attributes.
18684              * 
18685              * @param {Array
18686              *            <String>} traits
18687              * @param {Object}
18688              *            additionalAttrs
18689              * 
18690              * @return {Object} the style defintion
18691              */
18692             this.style = function(traits, additionalAttrs) {
18693
18694                 if (!isArray(traits) && !additionalAttrs) {
18695                     additionalAttrs = traits;
18696                     traits = [];
18697                 }
18698
18699                 var attrs = reduce(traits, function(attrs, t) {
18700                     return assign(attrs, defaultTraits[t] || {});
18701                 }, {});
18702
18703                 return additionalAttrs ? assign(attrs, additionalAttrs) : attrs;
18704             };
18705         }
18706
18707         module.exports = Styles;
18708     }, {
18709         "lodash/collection/reduce": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\reduce.js",
18710         "lodash/lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js",
18711         "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js"
18712     }],
18713     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\draw\\index.js": [function(require, module, exports) {
18714         module.exports = {
18715             renderer: ['type', require('./Renderer')],
18716             styles: ['type', require('./Styles')]
18717         };
18718     }, {
18719         "./Renderer": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\draw\\Renderer.js",
18720         "./Styles": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\draw\\Styles.js"
18721     }],
18722     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\bendpoints\\BendpointMove.js": [function(require, module, exports) {
18723         'use strict';
18724
18725         var Geometry = require('../../util/Geometry'),
18726             Util = require('./Util');
18727
18728         var MARKER_OK = 'connect-ok',
18729             MARKER_NOT_OK = 'connect-not-ok',
18730             MARKER_CONNECT_HOVER = 'connect-hover',
18731             MARKER_CONNECT_UPDATING = 'djs-updating';
18732
18733         var COMMAND_BENDPOINT_UPDATE = 'connection.updateWaypoints',
18734             COMMAND_RECONNECT_START = 'connection.reconnectStart',
18735             COMMAND_RECONNECT_END = 'connection.reconnectEnd';
18736
18737         var round = Math.round;
18738
18739
18740         /**
18741          * A component that implements moving of bendpoints
18742          */
18743         function BendpointMove(injector, eventBus, canvas, dragging, graphicsFactory, rules, modeling) {
18744
18745             var connectionDocking;
18746
18747             // optional connection docking integration
18748             try {
18749                 connectionDocking = injector.get('connectionDocking');
18750             } catch (e) {}
18751
18752
18753             // API
18754
18755             this.start = function(event, connection, bendpointIndex, insert) {
18756
18757                 var type,
18758                     context,
18759                     waypoints = connection.waypoints,
18760                     gfx = canvas.getGraphics(connection);
18761
18762                 if (!insert && bendpointIndex === 0) {
18763                     type = COMMAND_RECONNECT_START;
18764                 } else
18765                 if (!insert && bendpointIndex === waypoints.length - 1) {
18766                     type = COMMAND_RECONNECT_END;
18767                 } else {
18768                     type = COMMAND_BENDPOINT_UPDATE;
18769                 }
18770
18771                 context = {
18772                     connection: connection,
18773                     bendpointIndex: bendpointIndex,
18774                     insert: insert,
18775                     type: type
18776                 };
18777
18778                 dragging.activate(event, 'bendpoint.move', {
18779                     data: {
18780                         connection: connection,
18781                         connectionGfx: gfx,
18782                         context: context
18783                     }
18784                 });
18785             };
18786
18787
18788             // DRAGGING IMPLEMENTATION
18789
18790
18791             function redrawConnection(data) {
18792                 graphicsFactory.update('connection', data.connection, data.connectionGfx);
18793             }
18794
18795             function filterRedundantWaypoints(waypoints) {
18796                 return waypoints.filter(function(r, idx) {
18797                     return !Geometry.pointsOnLine(waypoints[idx - 1], waypoints[idx + 1], r);
18798                 });
18799             }
18800
18801             eventBus.on('bendpoint.move.start', function(e) {
18802
18803                 var context = e.context,
18804                     connection = context.connection,
18805                     originalWaypoints = connection.waypoints,
18806                     waypoints = originalWaypoints.slice(),
18807                     insert = context.insert,
18808                     idx = context.bendpointIndex;
18809
18810                 context.originalWaypoints = originalWaypoints;
18811
18812                 if (insert) {
18813                     // insert placeholder for bendpoint to-be-added
18814                     waypoints.splice(idx, 0, null);
18815                 }
18816
18817                 connection.waypoints = waypoints;
18818
18819                 // add dragger gfx
18820                 context.draggerGfx = Util.addBendpoint(canvas.getLayer('overlays'));
18821                 context.draggerGfx.addClass('djs-dragging');
18822
18823                 canvas.addMarker(connection, MARKER_CONNECT_UPDATING);
18824             });
18825
18826             eventBus.on('bendpoint.move.hover', function(e) {
18827                 e.context.hover = e.hover;
18828
18829                 canvas.addMarker(e.hover, MARKER_CONNECT_HOVER);
18830             });
18831
18832             eventBus.on([
18833                 'bendpoint.move.out',
18834                 'bendpoint.move.cleanup'
18835             ], function(e) {
18836
18837                 // remove connect marker
18838                 // if it was added
18839                 var hover = e.context.hover;
18840
18841                 if (hover) {
18842                     canvas.removeMarker(hover, MARKER_CONNECT_HOVER);
18843                     canvas.removeMarker(hover, e.context.target ? MARKER_OK : MARKER_NOT_OK);
18844                 }
18845             });
18846
18847             eventBus.on('bendpoint.move.move', function(e) {
18848
18849                 var context = e.context,
18850                     moveType = context.type,
18851                     connection = e.connection,
18852                     source, target;
18853
18854                 connection.waypoints[context.bendpointIndex] = {
18855                     x: e.x,
18856                     y: e.y
18857                 };
18858
18859                 if (connectionDocking) {
18860
18861                     if (context.hover) {
18862                         if (moveType === COMMAND_RECONNECT_START) {
18863                             source = context.hover;
18864                         }
18865
18866                         if (moveType === COMMAND_RECONNECT_END) {
18867                             target = context.hover;
18868                         }
18869                     }
18870
18871                     connection.waypoints = connectionDocking.getCroppedWaypoints(connection, source, target);
18872                 }
18873
18874                 // asks whether reconnect / bendpoint move / bendpoint add
18875                 // is allowed at the given position
18876                 var allowed = context.allowed = rules.allowed(context.type, context);
18877
18878                 if (allowed) {
18879
18880                     if (context.hover) {
18881                         canvas.removeMarker(context.hover, MARKER_NOT_OK);
18882                         canvas.addMarker(context.hover, MARKER_OK);
18883
18884                         context.target = context.hover;
18885                     }
18886                 } else
18887                 if (allowed === false) {
18888                     if (context.hover) {
18889                         canvas.removeMarker(context.hover, MARKER_OK);
18890                         canvas.addMarker(context.hover, MARKER_NOT_OK);
18891
18892                         context.target = null;
18893                     }
18894                 }
18895
18896                 // add dragger gfx
18897                 context.draggerGfx.translate(e.x, e.y);
18898
18899                 redrawConnection(e);
18900             });
18901
18902             eventBus.on([
18903                 'bendpoint.move.end',
18904                 'bendpoint.move.cancel'
18905             ], function(e) {
18906
18907                 var context = e.context,
18908                     connection = context.connection;
18909
18910                 // remove dragger gfx
18911                 context.draggerGfx.remove();
18912
18913                 context.newWaypoints = connection.waypoints.slice();
18914
18915                 connection.waypoints = context.originalWaypoints;
18916
18917                 canvas.removeMarker(connection, MARKER_CONNECT_UPDATING);
18918             });
18919
18920             eventBus.on('bendpoint.move.end', function(e) {
18921
18922                 var context = e.context,
18923                     waypoints = context.newWaypoints,
18924                     bendpointIndex = context.bendpointIndex,
18925                     bendpoint = waypoints[bendpointIndex],
18926                     allowed = context.allowed;
18927
18928                 // ensure we have actual pixel values bendpoint
18929                 // coordinates (important when zoom level was > 1 during move)
18930                 bendpoint.x = round(bendpoint.x);
18931                 bendpoint.y = round(bendpoint.y);
18932
18933                 if (allowed === true && context.type === COMMAND_RECONNECT_START) {
18934                     modeling.reconnectStart(context.connection, context.target, bendpoint);
18935                 } else
18936                 if (allowed === true && context.type === COMMAND_RECONNECT_END) {
18937                     modeling.reconnectEnd(context.connection, context.target, bendpoint);
18938                 } else
18939                 if (allowed !== false && context.type === COMMAND_BENDPOINT_UPDATE) {
18940                     modeling.updateWaypoints(context.connection, filterRedundantWaypoints(waypoints));
18941                 } else {
18942                     redrawConnection(e);
18943
18944                     return false;
18945                 }
18946             });
18947
18948             eventBus.on('bendpoint.move.cancel', function(e) {
18949                 redrawConnection(e);
18950             });
18951         }
18952
18953         BendpointMove.$inject = ['injector', 'eventBus', 'canvas', 'dragging', 'graphicsFactory', 'rules', 'modeling'];
18954
18955         module.exports = BendpointMove;
18956     }, {
18957         "../../util/Geometry": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Geometry.js",
18958         "./Util": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\bendpoints\\Util.js"
18959     }],
18960     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\bendpoints\\BendpointSnapping.js": [function(require, module, exports) {
18961         'use strict';
18962
18963         var assign = require('lodash/object/assign'),
18964             pick = require('lodash/object/pick'),
18965             forEach = require('lodash/collection/forEach');
18966
18967         var Snap = require('../../../vendor/snapsvg');
18968
18969         var round = Math.round;
18970
18971
18972         function BendpointSnapping(eventBus) {
18973
18974             function snapTo(candidates, point) {
18975                 return Snap.snapTo(candidates, point);
18976             }
18977
18978             function toPoint(e) {
18979                 return pick(e, ['x', 'y']);
18980             }
18981
18982             function mid(element) {
18983                 if (element.width) {
18984                     return {
18985                         x: round(element.width / 2 + element.x),
18986                         y: round(element.height / 2 + element.y)
18987                     };
18988                 }
18989             }
18990
18991             function getSnapPoints(context) {
18992
18993                 var snapPoints = context.snapPoints,
18994                     waypoints = context.connection.waypoints,
18995                     bendpointIndex = context.bendpointIndex,
18996                     referenceWaypoints = [waypoints[bendpointIndex - 1], waypoints[bendpointIndex + 1]];
18997
18998                 if (!snapPoints) {
18999                     context.snapPoints = snapPoints = {
19000                         horizontal: [],
19001                         vertical: []
19002                     };
19003
19004                     forEach(referenceWaypoints, function(p) {
19005                         // we snap on existing bendpoints only,
19006                         // not placeholders that are inserted during add
19007                         if (p) {
19008                             p = p.original || p;
19009
19010                             snapPoints.horizontal.push(p.y);
19011                             snapPoints.vertical.push(p.x);
19012                         }
19013                     });
19014                 }
19015
19016                 return snapPoints;
19017             }
19018
19019             eventBus.on('bendpoint.move.start', function(event) {
19020                 event.context.snapStart = toPoint(event);
19021             });
19022
19023             eventBus.on('bendpoint.move.move', 1500, function(event) {
19024
19025                 var context = event.context,
19026                     snapPoints = getSnapPoints(context),
19027                     start = context.snapStart,
19028                     target = context.target,
19029                     targetMid = target && mid(target),
19030                     x = start.x + event.dx,
19031                     y = start.y + event.dy,
19032                     sx, sy;
19033
19034                 if (!snapPoints) {
19035                     return;
19036                 }
19037
19038                 // snap
19039                 sx = snapTo(targetMid ? snapPoints.vertical.concat([targetMid.x]) : snapPoints.vertical, x);
19040                 sy = snapTo(targetMid ? snapPoints.horizontal.concat([targetMid.y]) : snapPoints.horizontal, y);
19041
19042
19043                 // correction x/y
19044                 var cx = (x - sx),
19045                     cy = (y - sy);
19046
19047                 // update delta
19048                 assign(event, {
19049                     dx: event.dx - cx,
19050                     dy: event.dy - cy,
19051                     x: event.x - cx,
19052                     y: event.y - cy
19053                 });
19054             });
19055         }
19056
19057
19058         BendpointSnapping.$inject = ['eventBus'];
19059
19060         module.exports = BendpointSnapping;
19061     }, {
19062         "../../../vendor/snapsvg": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\vendor\\snapsvg.js",
19063         "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
19064         "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js",
19065         "lodash/object/pick": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\pick.js"
19066     }],
19067     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\bendpoints\\Bendpoints.js": [function(require, module, exports) {
19068         'use strict';
19069
19070         var domEvent = require('min-dom/lib/event'),
19071             Util = require('./Util');
19072
19073         var BENDPOINT_CLS = Util.BENDPOINT_CLS;
19074
19075
19076         /**
19077          * A service that adds editable bendpoints to connections.
19078          */
19079         function Bendpoints(injector, eventBus, canvas, interactionEvents, bendpointMove) {
19080
19081             function getConnectionIntersection(waypoints, event) {
19082                 var localPosition = Util.toCanvasCoordinates(canvas, event);
19083                 return Util.getApproxIntersection(waypoints, localPosition);
19084             }
19085
19086             function activateBendpointMove(event, connection) {
19087                 var waypoints = connection.waypoints,
19088                     intersection = getConnectionIntersection(waypoints, event);
19089
19090                 if (!intersection) {
19091                     return;
19092                 }
19093
19094                 bendpointMove.start(event, connection, intersection.index, !intersection.bendpoint);
19095             }
19096
19097             function getBendpointsContainer(element, create) {
19098
19099                 var layer = canvas.getLayer('overlays'),
19100                     gfx = layer.select('.djs-bendpoints[data-element-id=' + element.id + ']');
19101
19102                 if (!gfx && create) {
19103                     gfx = layer.group().addClass('djs-bendpoints').attr('data-element-id', element.id);
19104
19105                     domEvent.bind(gfx.node, 'mousedown', function(event) {
19106                         activateBendpointMove(event, element);
19107                     });
19108                 }
19109
19110                 return gfx;
19111             }
19112
19113             function createBendpoints(gfx, connection) {
19114                 connection.waypoints.forEach(function(p, idx) {
19115                     Util.addBendpoint(gfx).translate(p.x, p.y);
19116                 });
19117
19118                 // add floating bendpoint
19119                 Util.addBendpoint(gfx).addClass('floating');
19120             }
19121
19122             function clearBendpoints(gfx) {
19123                 gfx.selectAll('.' + BENDPOINT_CLS).forEach(function(s) {
19124                     s.remove();
19125                 });
19126             }
19127
19128             function addBendpoints(connection) {
19129                 var gfx = getBendpointsContainer(connection);
19130
19131                 if (!gfx) {
19132                     gfx = getBendpointsContainer(connection, true);
19133                     createBendpoints(gfx, connection);
19134                 }
19135
19136                 return gfx;
19137             }
19138
19139             function updateBendpoints(connection) {
19140
19141                 var gfx = getBendpointsContainer(connection);
19142
19143                 if (gfx) {
19144                     clearBendpoints(gfx);
19145                     createBendpoints(gfx, connection);
19146                 }
19147             }
19148
19149             eventBus.on('connection.changed', function(event) {
19150                 updateBendpoints(event.element);
19151             });
19152
19153             eventBus.on('connection.remove', function(event) {
19154                 var gfx = getBendpointsContainer(event.element);
19155                 if (gfx) {
19156                     gfx.remove();
19157                 }
19158             });
19159
19160             eventBus.on('element.marker.update', function(event) {
19161
19162                 var element = event.element,
19163                     bendpointsGfx;
19164
19165                 if (!element.waypoints) {
19166                     return;
19167                 }
19168
19169                 bendpointsGfx = addBendpoints(element);
19170                 bendpointsGfx[event.add ? 'addClass' : 'removeClass'](event.marker);
19171             });
19172
19173             eventBus.on('element.mousemove', function(event) {
19174
19175                 var element = event.element,
19176                     waypoints = element.waypoints,
19177                     bendpointsGfx,
19178                     floating,
19179                     intersection;
19180
19181                 if (waypoints) {
19182
19183                     bendpointsGfx = getBendpointsContainer(element, true);
19184                     floating = bendpointsGfx.select('.floating');
19185
19186                     if (!floating) {
19187                         return;
19188                     }
19189
19190                     intersection = getConnectionIntersection(waypoints, event.originalEvent);
19191
19192                     if (intersection) {
19193                         floating.translate(intersection.point.x, intersection.point.y);
19194                     }
19195                 }
19196             });
19197
19198             eventBus.on('element.mousedown', function(event) {
19199
19200                 var originalEvent = event.originalEvent,
19201                     element = event.element,
19202                     waypoints = element.waypoints;
19203
19204                 if (!waypoints) {
19205                     return;
19206                 }
19207
19208                 activateBendpointMove(originalEvent, element, waypoints);
19209             });
19210
19211             eventBus.on('selection.changed', function(event) {
19212                 var newSelection = event.newSelection,
19213                     primary = newSelection[0];
19214
19215                 if (primary && primary.waypoints) {
19216                     addBendpoints(primary);
19217                 }
19218             });
19219
19220             eventBus.on('element.hover', function(event) {
19221                 var element = event.element;
19222
19223                 if (element.waypoints) {
19224                     addBendpoints(element);
19225
19226                     interactionEvents.registerEvent(event.gfx.node, 'mousemove', 'element.mousemove');
19227                 }
19228             });
19229
19230             eventBus.on('element.out', function(event) {
19231                 interactionEvents.unregisterEvent(event.gfx.node, 'mousemove', 'element.mousemove');
19232             });
19233         }
19234
19235         Bendpoints.$inject = ['injector', 'eventBus', 'canvas', 'interactionEvents', 'bendpointMove'];
19236
19237         module.exports = Bendpoints;
19238     }, {
19239         "./Util": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\bendpoints\\Util.js",
19240         "min-dom/lib/event": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\event.js"
19241     }],
19242     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\bendpoints\\Util.js": [function(require, module, exports) {
19243         'use strict';
19244
19245         var Snap = require('../../../vendor/snapsvg');
19246
19247         var Events = require('../../util/Event'),
19248             Geometry = require('../../util/Geometry');
19249
19250         var BENDPOINT_CLS = module.exports.BENDPOINT_CLS = 'djs-bendpoint';
19251
19252         module.exports.toCanvasCoordinates = function(canvas, event) {
19253
19254             var position = Events.toPoint(event),
19255                 clientRect = canvas._container.getBoundingClientRect(),
19256                 offset;
19257
19258             // canvas relative position
19259
19260             offset = {
19261                 x: clientRect.left,
19262                 y: clientRect.top
19263             };
19264
19265             // update actual event payload with canvas relative measures
19266
19267             var viewbox = canvas.viewbox();
19268
19269             return {
19270                 x: viewbox.x + (position.x - offset.x) / viewbox.scale,
19271                 y: viewbox.y + (position.y - offset.y) / viewbox.scale
19272             };
19273         };
19274
19275         module.exports.addBendpoint = function(parentGfx) {
19276             var groupGfx = parentGfx.group().addClass(BENDPOINT_CLS);
19277
19278             groupGfx.circle(0, 0, 4).addClass('djs-visual');
19279             groupGfx.circle(0, 0, 10).addClass('djs-hit');
19280
19281             return groupGfx;
19282         };
19283
19284
19285         function circlePath(center, r) {
19286             var x = center.x,
19287                 y = center.y;
19288
19289             return [
19290                 ['M', x, y],
19291                 ['m', 0, -r],
19292                 ['a', r, r, 0, 1, 1, 0, 2 * r],
19293                 ['a', r, r, 0, 1, 1, 0, -2 * r],
19294                 ['z']
19295             ];
19296         }
19297
19298         function linePath(points) {
19299             var segments = [];
19300
19301             points.forEach(function(p, idx) {
19302                 segments.push([idx === 0 ? 'M' : 'L', p.x, p.y]);
19303             });
19304
19305             return segments;
19306         }
19307
19308
19309         var INTERSECTION_THRESHOLD = 10;
19310
19311         function getBendpointIntersection(waypoints, reference) {
19312
19313             var i, w;
19314
19315             for (i = 0; !!(w = waypoints[i]); i++) {
19316
19317                 if (Geometry.distance(w, reference) <= INTERSECTION_THRESHOLD) {
19318                     return {
19319                         point: waypoints[i],
19320                         bendpoint: true,
19321                         index: i
19322                     };
19323                 }
19324             }
19325
19326             return null;
19327         }
19328
19329         function getPathIntersection(waypoints, reference) {
19330
19331             var intersections = Snap.path.intersection(circlePath(reference, INTERSECTION_THRESHOLD), linePath(waypoints));
19332
19333             var a = intersections[0],
19334                 b = intersections[intersections.length - 1],
19335                 idx;
19336
19337             if (!a) {
19338                 // no intersection
19339                 return null;
19340             }
19341
19342             if (a !== b) {
19343
19344                 if (a.segment2 !== b.segment2) {
19345                     // we use the bendpoint in between both segments
19346                     // as the intersection point
19347
19348                     idx = Math.max(a.segment2, b.segment2) - 1;
19349
19350                     return {
19351                         point: waypoints[idx],
19352                         bendpoint: true,
19353                         index: idx
19354                     };
19355                 }
19356
19357                 return {
19358                     point: {
19359                         x: (Math.round(a.x + b.x) / 2),
19360                         y: (Math.round(a.y + b.y) / 2)
19361                     },
19362                     index: a.segment2
19363                 };
19364             }
19365
19366             return {
19367                 point: {
19368                     x: Math.round(a.x),
19369                     y: Math.round(a.y)
19370                 },
19371                 index: a.segment2
19372             };
19373         }
19374
19375         /**
19376          * Returns the closest point on the connection towards a given reference point.
19377          * 
19378          * @param {Array
19379          *            <Point>} waypoints
19380          * @param {Point}
19381          *            reference
19382          * 
19383          * @return {Object} intersection data (segment, point)
19384          */
19385         module.exports.getApproxIntersection = function(waypoints, reference) {
19386             return getBendpointIntersection(waypoints, reference) || getPathIntersection(waypoints, reference);
19387         };
19388     }, {
19389         "../../../vendor/snapsvg": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\vendor\\snapsvg.js",
19390         "../../util/Event": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Event.js",
19391         "../../util/Geometry": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Geometry.js"
19392     }],
19393     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\bendpoints\\index.js": [function(require, module, exports) {
19394         module.exports = {
19395             __depends__: [require('../dragging'), require('../rules')],
19396             __init__: ['bendpoints', 'bendpointSnapping'],
19397             bendpoints: ['type', require('./Bendpoints')],
19398             bendpointMove: ['type', require('./BendpointMove')],
19399             bendpointSnapping: ['type', require('./BendpointSnapping')]
19400         };
19401     }, {
19402         "../dragging": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\dragging\\index.js",
19403         "../rules": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\rules\\index.js",
19404         "./BendpointMove": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\bendpoints\\BendpointMove.js",
19405         "./BendpointSnapping": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\bendpoints\\BendpointSnapping.js",
19406         "./Bendpoints": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\bendpoints\\Bendpoints.js"
19407     }],
19408     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\change-support\\ChangeSupport.js": [function(require, module, exports) {
19409         'use strict';
19410
19411         /**
19412          * Adds change support to the diagram, including
19413          * 
19414          * <ul>
19415          * <li>redrawing shapes and connections on change</li>
19416          * </ul>
19417          * 
19418          * @param {EventBus}
19419          *            eventBus
19420          * @param {ElementRegistry}
19421          *            elementRegistry
19422          * @param {GraphicsFactory}
19423          *            graphicsFactory
19424          */
19425         function ChangeSupport(eventBus, elementRegistry, graphicsFactory) {
19426
19427             // redraw shapes / connections on change
19428
19429             eventBus.on('element.changed', function(event) {
19430
19431                 var element = event.element;
19432
19433                 if (!event.gfx) {
19434                     event.gfx = elementRegistry.getGraphics(element);
19435                 }
19436
19437                 // shape + gfx may have been deleted
19438                 if (!event.gfx) {
19439                     return;
19440                 }
19441
19442                 if (element.waypoints) {
19443                     eventBus.fire('connection.changed', event);
19444                 } else {
19445                     eventBus.fire('shape.changed', event);
19446                 }
19447             });
19448
19449             eventBus.on('elements.changed', function(event) {
19450
19451                 var elements = event.elements;
19452
19453                 elements.forEach(function(e) {
19454                     eventBus.fire('element.changed', {
19455                         element: e
19456                     });
19457                 });
19458
19459                 graphicsFactory.updateContainments(elements);
19460             });
19461
19462             eventBus.on('shape.changed', function(event) {
19463                 graphicsFactory.update('shape', event.element, event.gfx);
19464             });
19465
19466             eventBus.on('connection.changed', function(event) {
19467                 graphicsFactory.update('connection', event.element, event.gfx);
19468             });
19469         }
19470
19471         ChangeSupport.$inject = ['eventBus', 'elementRegistry', 'graphicsFactory'];
19472
19473         module.exports = ChangeSupport;
19474
19475     }, {}],
19476     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\change-support\\index.js": [function(require, module, exports) {
19477         module.exports = {
19478             __init__: ['changeSupport'],
19479             changeSupport: ['type', require('./ChangeSupport')]
19480         };
19481     }, {
19482         "./ChangeSupport": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\change-support\\ChangeSupport.js"
19483     }],
19484     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\connect\\Connect.js": [function(require, module, exports) {
19485         'use strict';
19486
19487         var LayoutUtil = require('../../layout/LayoutUtil');
19488
19489         var MARKER_OK = 'connect-ok',
19490             MARKER_NOT_OK = 'connect-not-ok';
19491
19492
19493         function Connect(eventBus, dragging, modeling, rules, canvas, renderer) {
19494
19495             // TODO(nre): separate UI and events
19496
19497             // rules
19498
19499             function canConnect(source, target) {
19500                 return rules.allowed('connection.create', {
19501                     source: source,
19502                     target: target
19503                 });
19504             }
19505
19506
19507             // layouting
19508
19509             function crop(start, end, source, target) {
19510
19511                 var sourcePath = renderer.getShapePath(source),
19512                     targetPath = target && renderer.getShapePath(target),
19513                     connectionPath = renderer.getConnectionPath({
19514                         waypoints: [start, end]
19515                     });
19516
19517                 start = LayoutUtil.getElementLineIntersection(sourcePath, connectionPath, true) || start;
19518                 end = (target && LayoutUtil.getElementLineIntersection(targetPath, connectionPath, false)) || end;
19519
19520                 return [start, end];
19521             }
19522
19523
19524             // event handlers
19525
19526             eventBus.on('connect.move', function(event) {
19527
19528                 var context = event.context,
19529                     source = context.source,
19530                     target = context.target,
19531                     visual = context.visual,
19532                     start, end, waypoints;
19533
19534                 // update connection visuals during drag
19535
19536                 start = LayoutUtil.getMidPoint(source);
19537
19538                 end = {
19539                     x: event.x,
19540                     y: event.y
19541                 };
19542
19543                 waypoints = crop(start, end, source, target);
19544
19545                 visual.attr('points', [waypoints[0].x, waypoints[0].y, waypoints[1].x, waypoints[1].y]);
19546             });
19547
19548             eventBus.on('connect.hover', function(event) {
19549                 var context = event.context,
19550                     source = context.source,
19551                     hover = event.hover,
19552                     canExecute;
19553
19554                 canExecute = context.canExecute = canConnect(source, hover);
19555
19556                 // simply ignore hover
19557                 if (canExecute === null) {
19558                     return;
19559                 }
19560
19561                 context.target = hover;
19562
19563                 canvas.addMarker(hover, canExecute ? MARKER_OK : MARKER_NOT_OK);
19564             });
19565
19566             eventBus.on(['connect.out', 'connect.cleanup'], function(event) {
19567                 var context = event.context;
19568
19569                 if (context.target) {
19570                     canvas.removeMarker(context.target, context.canExecute ? MARKER_OK : MARKER_NOT_OK);
19571                 }
19572
19573                 context.target = null;
19574             });
19575
19576             eventBus.on('connect.cleanup', function(event) {
19577                 var context = event.context;
19578
19579                 if (context.visual) {
19580                     context.visual.remove();
19581                 }
19582             });
19583
19584             eventBus.on('connect.start', function(event) {
19585                 var context = event.context,
19586                     visual;
19587
19588                 visual = canvas.getDefaultLayer().polyline().attr({
19589                     'stroke': '#333',
19590                     'strokeDasharray': [1],
19591                     'strokeWidth': 2,
19592                     'pointer-events': 'none'
19593                 });
19594
19595                 context.visual = visual;
19596             });
19597
19598             eventBus.on('connect.end', function(event) {
19599
19600                 var context = event.context,
19601                     source = context.source,
19602                     target = context.target,
19603                     canExecute = context.canExecute || canConnect(source, target);
19604
19605                 if (!canExecute) {
19606                     return false;
19607                 }
19608
19609                 modeling.connect(source, target);
19610             });
19611
19612
19613             // API
19614
19615             this.start = function(event, source, autoActivate) {
19616
19617                 dragging.activate(event, 'connect', {
19618                     autoActivate: autoActivate,
19619                     data: {
19620                         shape: source,
19621                         context: {
19622                             source: source
19623                         }
19624                     }
19625                 });
19626             };
19627         }
19628
19629         Connect.$inject = ['eventBus', 'dragging', 'modeling', 'rules', 'canvas', 'renderer'];
19630
19631         module.exports = Connect;
19632     }, {
19633         "../../layout/LayoutUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\layout\\LayoutUtil.js"
19634     }],
19635     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\connect\\index.js": [function(require, module, exports) {
19636         module.exports = {
19637             __depends__: [
19638                 require('../selection'),
19639                 require('../rules'),
19640                 require('../dragging')
19641             ],
19642             connect: ['type', require('./Connect')]
19643         };
19644
19645     }, {
19646         "../dragging": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\dragging\\index.js",
19647         "../rules": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\rules\\index.js",
19648         "../selection": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\selection\\index.js",
19649         "./Connect": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\connect\\Connect.js"
19650     }],
19651     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\context-pad\\ContextPad.js": [function(require, module, exports) {
19652         'use strict';
19653
19654         var isFunction = require('lodash/lang/isFunction'),
19655             forEach = require('lodash/collection/forEach'),
19656
19657             domDelegate = require('min-dom/lib/delegate'),
19658             domClear = require('min-dom/lib/clear'),
19659             domEvent = require('min-dom/lib/event'),
19660             domAttr = require('min-dom/lib/attr'),
19661             domQuery = require('min-dom/lib/query'),
19662             domClasses = require('min-dom/lib/classes'),
19663             domify = require('min-dom/lib/domify');
19664
19665
19666         var entrySelector = '.entry';
19667
19668
19669         /**
19670          * A context pad that displays element specific, contextual actions next to a
19671          * diagram element.
19672          * 
19673          * @param {EventBus}
19674          *            eventBus
19675          * @param {Overlays}
19676          *            overlays
19677          */
19678         function ContextPad(eventBus, overlays) {
19679
19680             this._providers = [];
19681
19682             this._eventBus = eventBus;
19683             this._overlays = overlays;
19684
19685             this._current = null;
19686
19687             this._init();
19688         }
19689
19690         ContextPad.$inject = ['eventBus', 'overlays'];
19691
19692         /**
19693          * Registers events needed for interaction with other components
19694          */
19695         ContextPad.prototype._init = function() {
19696
19697             var eventBus = this._eventBus;
19698
19699             var self = this;
19700
19701             eventBus.on('selection.changed', function(e) {
19702
19703                 var selection = e.newSelection;
19704
19705                 if (selection.length === 1) {
19706                     self.open(selection[0]);
19707                 } else {
19708                     self.close();
19709                 }
19710             });
19711         };
19712
19713
19714         /**
19715          * Register a provider with the context pad
19716          * 
19717          * @param {ContextPadProvider}
19718          *            provider
19719          */
19720         ContextPad.prototype.registerProvider = function(provider) {
19721             this._providers.push(provider);
19722         };
19723
19724
19725         /**
19726          * Returns the context pad entries for a given element
19727          * 
19728          * @param {djs.element.Base}
19729          *            element
19730          * 
19731          * @return {Array<ContextPadEntryDescriptor>} list of entries
19732          */
19733         ContextPad.prototype.getEntries = function(element) {
19734             var entries = {};
19735
19736             // loop through all providers and their entries.
19737             // group entries by id so that overriding an entry is possible
19738             forEach(this._providers, function(provider) {
19739                 var e = provider.getContextPadEntries(element);
19740
19741                 forEach(e, function(entry, id) {
19742                     entries[id] = entry;
19743                 });
19744             });
19745
19746             return entries;
19747         };
19748
19749
19750         /**
19751          * Trigger an action available on the opened context pad
19752          * 
19753          * @param {String}
19754          *            action
19755          * @param {Event}
19756          *            event
19757          */
19758         ContextPad.prototype.trigger = function(action, event, autoActivate) {
19759
19760             var current = this._current,
19761                 element = current.element,
19762                 entries = current.entries,
19763                 entry,
19764                 handler,
19765                 originalEvent,
19766                 button = event.delegateTarget || event.target;
19767
19768             if (!button) {
19769                 return event.preventDefault();
19770             }
19771
19772             entry = entries[domAttr(button, 'data-action')];
19773             handler = entry.action;
19774
19775             originalEvent = event.originalEvent || event;
19776
19777             // simple action (via callback function)
19778             if (isFunction(handler)) {
19779                 if (action === 'click') {
19780                     return handler(originalEvent, element, autoActivate);
19781                 }
19782             } else {
19783                 if (handler[action]) {
19784                     return handler[action](originalEvent, element, autoActivate);
19785                 }
19786             }
19787
19788             // silence other actions
19789             event.preventDefault();
19790         };
19791
19792
19793         /**
19794          * Open the context pad for the given element
19795          * 
19796          * @param {djs.model.Base}
19797          *            element
19798          */
19799         ContextPad.prototype.open = function(element) {
19800
19801             if (this._current && this._current.open) {
19802
19803                 if (this._current.element === element) {
19804                     // no change needed
19805                     return;
19806                 }
19807
19808                 this.close();
19809             }
19810
19811             this._updateAndOpen(element);
19812         };
19813
19814
19815         ContextPad.prototype._updateAndOpen = function(element) {
19816
19817             var entries = this.getEntries(element),
19818                 pad = this.getPad(element),
19819                 html = pad.html;
19820
19821             domClear(html);
19822
19823             forEach(entries, function(entry, id) {
19824                 var grouping = entry.group || 'default',
19825                     control = domify(entry.html || '<div class="entry" draggable="true"></div>'),
19826                     container;
19827
19828                 domAttr(control, 'data-action', id);
19829
19830                 container = domQuery('[data-group=' + grouping + ']', html);
19831                 if (!container) {
19832                     container = domify('<div class="group" data-group="' + grouping + '"></div>');
19833                     html.appendChild(container);
19834                 }
19835
19836                 container.appendChild(control);
19837
19838                 if (entry.className) {
19839                     domClasses(control).add(entry.className);
19840                 }
19841
19842                 if (entry.title) {
19843                     domAttr(control, 'title', entry.title);
19844                 }
19845
19846                 if (entry.imageUrl) {
19847                     control.appendChild(domify('<img src="' + entry.imageUrl + '">'));
19848                 }
19849             });
19850
19851             domClasses(html).add('open');
19852
19853             this._current = {
19854                 element: element,
19855                 pad: pad,
19856                 entries: entries,
19857                 open: true
19858             };
19859
19860             this._eventBus.fire('contextPad.open', {
19861                 current: this._current
19862             });
19863         };
19864
19865         ContextPad.prototype.getPad = function(element) {
19866
19867             var self = this;
19868
19869             var overlays = this._overlays,
19870                 pads = overlays.get({
19871                     element: element,
19872                     type: 'context-pad'
19873                 });
19874
19875             // create context pad on demand if needed
19876             if (!pads.length) {
19877
19878                 var html = domify('<div class="djs-context-pad"></div>');
19879
19880                 domDelegate.bind(html, entrySelector, 'click', function(event) {
19881                     self.trigger('click', event);
19882                 });
19883
19884                 domDelegate.bind(html, entrySelector, 'dragstart', function(event) {
19885                     self.trigger('dragstart', event);
19886                 });
19887
19888                 // stop propagation of mouse events
19889                 domEvent.bind(html, 'mousedown', function(event) {
19890                     event.stopPropagation();
19891                 });
19892
19893
19894                 overlays.add(element, 'context-pad', {
19895                     position: {
19896                         right: -9,
19897                         top: -6
19898                     },
19899                     html: html
19900                 });
19901
19902                 pads = overlays.get({
19903                     element: element,
19904                     type: 'context-pad'
19905                 });
19906
19907                 this._eventBus.fire('contextPad.create', {
19908                     element: element,
19909                     pad: pads[0]
19910                 });
19911             }
19912
19913             return pads[0];
19914         };
19915
19916
19917         /**
19918          * Close the context pad
19919          */
19920         ContextPad.prototype.close = function() {
19921
19922             var html;
19923
19924             if (this._current) {
19925                 if (this._current.open) {
19926                     html = this._current.pad.html;
19927                     domClasses(html).remove('open');
19928                 }
19929
19930                 this._current.open = false;
19931
19932                 this._eventBus.fire('contextPad.close', {
19933                     current: this._current
19934                 });
19935             }
19936         };
19937
19938
19939         /**
19940          * Return the element the context pad is currently opened for, if it is opened.
19941          * 
19942          * @example
19943          * 
19944          * contextPad.open(shape1);
19945          * 
19946          * if (contextPad.isOpen()) { // yes, we are open }
19947          * 
19948          * @return {djs.model.Base} element
19949          */
19950         ContextPad.prototype.isOpen = function() {
19951             return this._current && this._current.open;
19952         };
19953
19954         module.exports = ContextPad;
19955
19956     }, {
19957         "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
19958         "lodash/lang/isFunction": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isFunction.js",
19959         "min-dom/lib/attr": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\attr.js",
19960         "min-dom/lib/classes": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\classes.js",
19961         "min-dom/lib/clear": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\clear.js",
19962         "min-dom/lib/delegate": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\delegate.js",
19963         "min-dom/lib/domify": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\domify.js",
19964         "min-dom/lib/event": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\event.js",
19965         "min-dom/lib/query": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\query.js"
19966     }],
19967     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\context-pad\\index.js": [function(require, module, exports) {
19968         module.exports = {
19969             __depends__: [
19970                 require('../interaction-events'),
19971                 require('../overlays')
19972             ],
19973             contextPad: ['type', require('./ContextPad')]
19974         };
19975     }, {
19976         "../interaction-events": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\interaction-events\\index.js",
19977         "../overlays": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\overlays\\index.js",
19978         "./ContextPad": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\context-pad\\ContextPad.js"
19979     }],
19980     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\create\\Create.js": [function(require, module, exports) {
19981         'use strict';
19982
19983         var MARKER_OK = 'drop-ok',
19984             MARKER_NOT_OK = 'drop-not-ok';
19985
19986
19987         function Create(eventBus, dragging, rules, modeling, canvas, elementFactory, renderer, styles) {
19988
19989             // rules
19990
19991             function canCreate(shape, target, source) {
19992
19993                 if (source) {
19994                     return rules.allowed('shape.append', {
19995                         source: source,
19996                         shape: shape,
19997                         parent: target
19998                     });
19999                 } else {
20000                     return rules.allowed('shape.create', {
20001                         shape: shape,
20002                         parent: target
20003                     });
20004                 }
20005             }
20006
20007
20008             // visual helpers
20009
20010             function createVisual(shape) {
20011                 var group, preview, visual;
20012
20013                 group = canvas.getDefaultLayer().group().attr(styles.cls('djs-drag-group', ['no-events']));
20014
20015                 preview = group.group().addClass('djs-dragger');
20016
20017                 preview.translate(shape.width / -2, shape.height / -2);
20018
20019                 visual = preview.group().addClass('djs-visual');
20020
20021                 // hijack renderer to draw preview
20022                 renderer.drawShape(visual, shape);
20023
20024                 return group;
20025             }
20026
20027
20028             // event handlers
20029
20030             eventBus.on('create.move', function(event) {
20031
20032                 var context = event.context,
20033                     shape = context.shape,
20034                     visual = context.visual;
20035
20036                 // lazy init drag visual once we received the first real
20037                 // drag move event (this allows us to get the proper canvas local
20038                 // coordinates)
20039                 if (!visual) {
20040                     visual = context.visual = createVisual(shape);
20041                 }
20042
20043                 visual.translate(event.x, event.y);
20044
20045                 var hover = event.hover,
20046                     canExecute;
20047
20048                 canExecute = context.canExecute = hover && canCreate(context.shape, hover, context.source);
20049
20050                 // ignore hover visually if canExecute is null
20051                 if (hover && canExecute !== null) {
20052                     context.target = hover;
20053                     canvas.addMarker(hover, canExecute ? MARKER_OK : MARKER_NOT_OK);
20054                 }
20055             });
20056
20057             eventBus.on(['create.end', 'create.out', 'create.cleanup'], function(event) {
20058                 var context = event.context;
20059
20060                 if (context.target) {
20061                     canvas.removeMarker(context.target, context.canExecute ? MARKER_OK : MARKER_NOT_OK);
20062                 }
20063             });
20064
20065             eventBus.on('create.end', function(event) {
20066                 var context = event.context,
20067                     source = context.source,
20068                     shape = context.shape,
20069                     target = context.target,
20070                     canExecute = context.canExecute,
20071                     position = {
20072                         x: event.x,
20073                         y: event.y
20074                     };
20075
20076                 if (!canExecute) {
20077                     return false;
20078                 }
20079
20080                 if (source) {
20081                     modeling.appendShape(source, shape, position, target);
20082                 } else {
20083                     modeling.createShape(shape, position, target);
20084                 }
20085             });
20086
20087
20088             eventBus.on('create.cleanup', function(event) {
20089                 var context = event.context;
20090
20091                 if (context.visual) {
20092                     context.visual.remove();
20093                 }
20094             });
20095
20096             // API
20097
20098             this.start = function(event, shape, source) {
20099
20100                 dragging.activate(event, 'create', {
20101                     cursor: 'grabbing',
20102                     autoActivate: true,
20103                     data: {
20104                         shape: shape,
20105                         context: {
20106                             shape: shape,
20107                             source: source
20108                         }
20109                     }
20110                 });
20111             };
20112         }
20113
20114         Create.$inject = ['eventBus', 'dragging', 'rules', 'modeling', 'canvas', 'elementFactory', 'renderer', 'styles'];
20115
20116         module.exports = Create;
20117     }, {}],
20118     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\create\\index.js": [function(require, module, exports) {
20119         module.exports = {
20120             __depends__: [
20121                 require('../dragging'),
20122                 require('../selection')
20123             ],
20124             create: ['type', require('./Create')]
20125         };
20126     }, {
20127         "../dragging": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\dragging\\index.js",
20128         "../selection": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\selection\\index.js",
20129         "./Create": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\create\\Create.js"
20130     }],
20131     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\dragging\\Dragging.js": [function(require, module, exports) {
20132         'use strict';
20133
20134         /* global TouchEvent */
20135
20136         var assign = require('lodash/object/assign');
20137
20138         var domEvent = require('min-dom/lib/event'),
20139             Event = require('../../util/Event'),
20140             ClickTrap = require('../../util/ClickTrap'),
20141             Cursor = require('../../util/Cursor');
20142
20143         function suppressEvent(event) {
20144             if (event instanceof MouseEvent) {
20145                 Event.stopEvent(event, true);
20146             } else {
20147                 Event.preventDefault(event);
20148             }
20149         }
20150
20151         function getLength(point) {
20152             return Math.sqrt(Math.pow(point.x, 2) + Math.pow(point.y, 2));
20153         }
20154
20155         function substract(p1, p2) {
20156             return {
20157                 x: p1.x - p2.x,
20158                 y: p1.y - p2.y
20159             };
20160         }
20161
20162         /**
20163          * A helper that fires canvas localized drag events and realizes the general
20164          * "drag-and-drop" look and feel.
20165          * 
20166          * Calling {@link Dragging#activate} activates dragging on a canvas.
20167          * 
20168          * It provides the following:
20169          *  * emits the events `start`, `move`, `end`, `cancel` and `cleanup` via the
20170          * {@link EventBus}. Each of the events is prefixed with a prefix that is
20171          * assigned during activate. * sets and restores the cursor * sets and restores
20172          * the selection * ensures there can be only one drag operation active at a time
20173          * 
20174          * Dragging may be canceled manually by calling {@link Dragging#cancel} or by
20175          * pressing ESC.
20176          * 
20177          * @example
20178          * 
20179          * function MyDragComponent(eventBus, dragging) {
20180          * 
20181          * eventBus.on('mydrag.start', function(event) { console.log('yes, we start
20182          * dragging'); });
20183          * 
20184          * eventBus.on('mydrag.move', function(event) { console.log('canvas local
20185          * coordinates', event.x, event.y, event.dx, event.dy);
20186          *  // local drag data is passed with the event event.context.foo; // "BAR"
20187          *  // the original mouse event, too event.originalEvent; // MouseEvent(...) });
20188          * 
20189          * eventBus.on('element.click', function(event) { dragging.activate(event,
20190          * 'mydrag', { cursor: 'grabbing', data: { context: { foo: "BAR" } } }); }); }
20191          */
20192         function Dragging(eventBus, canvas, selection) {
20193
20194             var defaultOptions = {
20195                 threshold: 5
20196             };
20197
20198             // the currently active drag operation
20199             // dragging is active as soon as this context exists.
20200             //
20201             // it is visually _active_ only when a context.active flag is set to true.
20202             var context;
20203
20204
20205             // helpers
20206
20207             function fire(type) {
20208
20209                 var ActualEvent = require('../../core/EventBus').Event;
20210
20211                 var event = assign(new ActualEvent(), context.payload, context.data);
20212
20213                 // default integration
20214                 if (eventBus.fire('drag.' + type, event) === false) {
20215                     return false;
20216                 }
20217
20218                 return eventBus.fire(context.prefix + '.' + type, event);
20219             }
20220
20221             // event listeners
20222
20223             function move(event, activate) {
20224
20225                 var payload = context.payload,
20226                     start = context.start,
20227                     position = Event.toPoint(event),
20228                     delta = substract(position, start),
20229                     clientRect = canvas._container.getBoundingClientRect(),
20230                     offset;
20231
20232                 // canvas relative position
20233
20234                 offset = {
20235                     x: clientRect.left,
20236                     y: clientRect.top
20237                 };
20238
20239                 // update actual event payload with canvas relative measures
20240
20241                 var viewbox = canvas.viewbox();
20242
20243                 var movement = {
20244                     x: viewbox.x + (position.x - offset.x) / viewbox.scale,
20245                     y: viewbox.y + (position.y - offset.y) / viewbox.scale,
20246                     dx: delta.x / viewbox.scale,
20247                     dy: delta.y / viewbox.scale
20248                 };
20249
20250                 // activate context explicitly or once threshold is reached
20251
20252                 if (!context.active && (activate || getLength(delta) > context.threshold)) {
20253
20254                     // fire start event with original
20255                     // starting coordinates
20256
20257                     assign(payload, {
20258                         x: movement.x - movement.dx,
20259                         y: movement.y - movement.dy,
20260                         dx: 0,
20261                         dy: 0
20262                     }, {
20263                         originalEvent: event
20264                     });
20265
20266                     if (false === fire('start')) {
20267                         return cancel();
20268                     }
20269
20270                     context.active = true;
20271
20272                     // unset selection
20273                     if (!context.keepSelection) {
20274                         context.previousSelection = selection.get();
20275                         selection.select(null);
20276                     }
20277
20278                     // allow custom cursor
20279                     if (context.cursor) {
20280                         Cursor.set(context.cursor);
20281                     }
20282                 }
20283
20284                 suppressEvent(event);
20285
20286                 if (context.active) {
20287
20288                     // fire move event with actual coordinates
20289                     assign(payload, movement, {
20290                         originalEvent: event
20291                     });
20292
20293                     fire('move');
20294                 }
20295             }
20296
20297             function end(event) {
20298
20299                 var returnValue = true;
20300
20301                 if (context.active) {
20302
20303                     if (event) {
20304                         context.payload.originalEvent = event;
20305
20306                         // suppress original event (click, ...)
20307                         // because we just ended a drag operation
20308                         suppressEvent(event);
20309                     }
20310
20311                     // implementations may stop restoring the
20312                     // original state (selections, ...) by preventing the
20313                     // end events default action
20314                     returnValue = fire('end');
20315                 }
20316
20317                 if (returnValue === false) {
20318                     fire('rejected');
20319                 }
20320
20321                 cleanup(returnValue !== true);
20322             }
20323
20324
20325             // cancel active drag operation if the user presses
20326             // the ESC key on the keyboard
20327
20328             function checkCancel(event) {
20329
20330                 if (event.which === 27) {
20331                     event.preventDefault();
20332
20333                     cancel();
20334                 }
20335             }
20336
20337
20338             // prevent ghost click that might occur after a finished
20339             // drag and drop session
20340
20341             function trapClickAndEnd(event) {
20342
20343                 var untrap;
20344
20345                 // trap the click in case we are part of an active
20346                 // drag operation. This will effectively prevent
20347                 // the ghost click that cannot be canceled otherwise.
20348                 if (context.active) {
20349                     untrap = ClickTrap.install();
20350                     setTimeout(untrap, 400);
20351                 }
20352
20353                 end(event);
20354             }
20355
20356             function trapTouch(event) {
20357                 move(event);
20358             }
20359
20360             // update the drag events hover (djs.model.Base) and hoverGfx
20361             // (Snap<SVGElement>)
20362             // properties during hover and out and fire {prefix}.hover and {prefix}.out
20363             // properties
20364             // respectively
20365
20366             function hover(event) {
20367                 var payload = context.payload;
20368
20369                 payload.hoverGfx = event.gfx;
20370                 payload.hover = event.element;
20371
20372                 fire('hover');
20373             }
20374
20375             function out(event) {
20376                 fire('out');
20377
20378                 var payload = context.payload;
20379
20380                 payload.hoverGfx = null;
20381                 payload.hover = null;
20382             }
20383
20384
20385             // life-cycle methods
20386
20387             function cancel(restore) {
20388
20389                 if (!context) {
20390                     return;
20391                 }
20392
20393                 if (context.active) {
20394                     fire('cancel');
20395                 }
20396
20397                 cleanup(restore);
20398             }
20399
20400             function cleanup(restore) {
20401
20402                 fire('cleanup');
20403
20404                 // reset cursor
20405                 Cursor.unset();
20406
20407                 // reset dom listeners
20408                 domEvent.unbind(document, 'mousemove', move);
20409
20410                 domEvent.unbind(document, 'mousedown', trapClickAndEnd, true);
20411                 domEvent.unbind(document, 'mouseup', trapClickAndEnd, true);
20412
20413                 domEvent.unbind(document, 'keyup', checkCancel);
20414
20415                 domEvent.unbind(document, 'touchstart', trapTouch, true);
20416                 domEvent.unbind(document, 'touchcancel', cancel, true);
20417                 domEvent.unbind(document, 'touchmove', move, true);
20418                 domEvent.unbind(document, 'touchend', end, true);
20419
20420                 eventBus.off('element.hover', hover);
20421                 eventBus.off('element.out', out);
20422
20423                 // restore selection, unless it has changed
20424                 if (restore !== false && context.previousSelection && !selection.get().length) {
20425                     selection.select(context.previousSelection);
20426                 }
20427
20428                 context = null;
20429             }
20430
20431             /**
20432              * Activate a drag operation
20433              * 
20434              * @param {MouseEvent|TouchEvent}
20435              *            [event]
20436              * @param {String}
20437              *            prefix
20438              * @param {Object}
20439              *            [options]
20440              */
20441             function activate(event, prefix, options) {
20442
20443                 // only one drag operation may be active, at a time
20444                 if (context) {
20445                     cancel(false);
20446                 }
20447
20448                 options = assign({}, defaultOptions, options || {});
20449
20450                 var data = options.data || {},
20451                     originalEvent,
20452                     start;
20453
20454                 if (event) {
20455                     originalEvent = Event.getOriginal(event) || event;
20456                     start = Event.toPoint(event);
20457
20458                     suppressEvent(event);
20459                 } else {
20460                     originalEvent = null;
20461                     start = {
20462                         x: 0,
20463                         y: 0
20464                     };
20465                 }
20466
20467                 context = assign({
20468                     prefix: prefix,
20469                     data: data,
20470                     payload: {},
20471                     start: start
20472                 }, options);
20473
20474                 // skip dom registration if trigger
20475                 // is set to manual (during testing)
20476                 if (!options.manual) {
20477
20478                     // add dom listeners
20479
20480                     // fixes TouchEvent not being available on desktop Firefox
20481                     if (typeof TouchEvent !== 'undefined' && originalEvent instanceof TouchEvent) {
20482                         domEvent.bind(document, 'touchstart', trapTouch, true);
20483                         domEvent.bind(document, 'touchcancel', cancel, true);
20484                         domEvent.bind(document, 'touchmove', move, true);
20485                         domEvent.bind(document, 'touchend', end, true);
20486                     } else {
20487                         // assume we use the mouse to interact per default
20488                         domEvent.bind(document, 'mousemove', move);
20489
20490                         domEvent.bind(document, 'mousedown', trapClickAndEnd, true);
20491                         domEvent.bind(document, 'mouseup', trapClickAndEnd, true);
20492                     }
20493
20494                     domEvent.bind(document, 'keyup', checkCancel);
20495
20496                     eventBus.on('element.hover', hover);
20497                     eventBus.on('element.out', out);
20498                 }
20499
20500                 fire('activate');
20501
20502                 if (options.autoActivate) {
20503                     move(event, true);
20504                 }
20505             }
20506
20507             // cancel on diagram destruction
20508             eventBus.on('diagram.destroy', cancel);
20509
20510
20511             // API
20512
20513             this.activate = activate;
20514             this.move = move;
20515             this.hover = hover;
20516             this.out = out;
20517             this.end = end;
20518
20519             this.cancel = cancel;
20520
20521             // for introspection
20522
20523             this.active = function() {
20524                 return context;
20525             };
20526
20527             this.setOptions = function(options) {
20528                 assign(defaultOptions, options);
20529             };
20530         }
20531
20532         Dragging.$inject = ['eventBus', 'canvas', 'selection'];
20533
20534         module.exports = Dragging;
20535     }, {
20536         "../../core/EventBus": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\core\\EventBus.js",
20537         "../../util/ClickTrap": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\ClickTrap.js",
20538         "../../util/Cursor": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Cursor.js",
20539         "../../util/Event": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Event.js",
20540         "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js",
20541         "min-dom/lib/event": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\event.js"
20542     }],
20543     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\dragging\\index.js": [function(require, module, exports) {
20544         module.exports = {
20545             __depends__: [
20546                 require('../selection')
20547             ],
20548             dragging: ['type', require('./Dragging')]
20549         };
20550     }, {
20551         "../selection": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\selection\\index.js",
20552         "./Dragging": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\dragging\\Dragging.js"
20553     }],
20554     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\interaction-events\\InteractionEvents.js": [function(require, module, exports) {
20555         'use strict';
20556
20557         var forEach = require('lodash/collection/forEach'),
20558             domDelegate = require('min-dom/lib/delegate'),
20559             Renderer = require('../../draw/Renderer'),
20560             createLine = Renderer.createLine,
20561             updateLine = Renderer.updateLine;
20562
20563
20564         var isPrimaryButton = require('../../util/Mouse').isPrimaryButton;
20565
20566         var Snap = require('../../../vendor/snapsvg');
20567
20568         /**
20569          * A plugin that provides interaction events for diagram elements.
20570          * 
20571          * It emits the following events:
20572          *  * element.hover * element.out * element.click * element.dblclick *
20573          * element.mousedown
20574          * 
20575          * Each event is a tuple { element, gfx, originalEvent }.
20576          * 
20577          * Canceling the event via Event#preventDefault() prevents the original DOM
20578          * operation.
20579          * 
20580          * @param {EventBus}
20581          *            eventBus
20582          */
20583         function InteractionEvents(eventBus, elementRegistry, styles) {
20584
20585             var HIT_STYLE = styles.cls('djs-hit', ['no-fill', 'no-border'], {
20586                 stroke: 'white',
20587                 strokeWidth: 15
20588             });
20589
20590             function fire(type, event) {
20591                 var target = event.delegateTarget || event.target,
20592                     gfx = target && new Snap(target),
20593                     element = elementRegistry.get(gfx),
20594                     returnValue;
20595
20596                 if (!gfx || !element) {
20597                     return;
20598                 }
20599
20600                 returnValue = eventBus.fire(type, {
20601                     element: element,
20602                     gfx: gfx,
20603                     originalEvent: event
20604                 });
20605
20606                 if (returnValue === false) {
20607                     event.stopPropagation();
20608                     event.preventDefault();
20609                 }
20610             }
20611
20612             var handlers = {};
20613
20614             function mouseHandler(type) {
20615
20616                 var fn = handlers[type];
20617
20618                 if (!fn) {
20619                     fn = handlers[type] = function(event) {
20620                         // only indicate left mouse button interactions
20621                         if (isPrimaryButton(event)) {
20622                             fire(type, event);
20623                         }
20624                     };
20625                 }
20626
20627                 return fn;
20628             }
20629
20630             var bindings = {
20631                 mouseover: 'element.hover',
20632                 mouseout: 'element.out',
20633                 click: 'element.click',
20634                 dblclick: 'element.dblclick',
20635                 mousedown: 'element.mousedown',
20636                 mouseup: 'element.mouseup',
20637                 keydown: 'element.keyup'
20638
20639             };
20640
20641             var elementSelector = 'svg, .djs-element';
20642
20643             // /// event registration
20644
20645             function registerEvent(node, event, localEvent) {
20646                 var handler = mouseHandler(localEvent);
20647                 handler.$delegate = domDelegate.bind(node, elementSelector, event, handler);
20648             }
20649
20650             function unregisterEvent(node, event, localEvent) {
20651                 domDelegate.unbind(node, event, mouseHandler(localEvent).$delegate);
20652             }
20653
20654             function registerEvents(svg) {
20655                 forEach(bindings, function(val, key) {
20656                     registerEvent(svg.node, key, val);
20657                 });
20658             }
20659
20660             function unregisterEvents(svg) {
20661                 forEach(bindings, function(val, key) {
20662                     unregisterEvent(svg.node, key, val);
20663                 });
20664             }
20665
20666             eventBus.on('canvas.destroy', function(event) {
20667                 unregisterEvents(event.svg);
20668             });
20669
20670             eventBus.on('canvas.init', function(event) {
20671                 registerEvents(event.svg);
20672             });
20673
20674
20675             eventBus.on(['shape.added', 'connection.added'], function(event) {
20676                 var element = event.element,
20677                     gfx = event.gfx,
20678                     hit,
20679                     type;
20680
20681                 if (element.waypoints) {
20682                     hit = createLine(element.waypoints);
20683                     type = 'connection';
20684                 } else {
20685                     hit = Snap.create('rect', {
20686                         x: 0,
20687                         y: 0,
20688                         width: element.width,
20689                         height: element.height
20690                     });
20691                     type = 'shape';
20692                 }
20693
20694                 hit.attr(HIT_STYLE).appendTo(gfx.node);
20695             });
20696
20697             // update djs-hit on change
20698
20699             eventBus.on('shape.changed', function(event) {
20700
20701                 var element = event.element,
20702                     gfx = event.gfx,
20703                     hit = gfx.select('.djs-hit');
20704
20705                 hit.attr({
20706                     width: element.width,
20707                     height: element.height
20708                 });
20709             });
20710
20711             eventBus.on('connection.changed', function(event) {
20712
20713                 var element = event.element,
20714                     gfx = event.gfx,
20715                     hit = gfx.select('.djs-hit');
20716
20717                 updateLine(hit, element.waypoints);
20718             });
20719
20720
20721             // API
20722
20723             this.fire = fire;
20724
20725             this.mouseHandler = mouseHandler;
20726
20727             this.registerEvent = registerEvent;
20728             this.unregisterEvent = unregisterEvent;
20729         }
20730
20731
20732         InteractionEvents.$inject = ['eventBus', 'elementRegistry', 'styles'];
20733
20734         module.exports = InteractionEvents;
20735
20736
20737         /**
20738          * An event indicating that the mouse hovered over an element
20739          * 
20740          * @event element.hover
20741          * 
20742          * @type {Object}
20743          * @property {djs.model.Base} element
20744          * @property {Snap<Element>} gfx
20745          * @property {Event} originalEvent
20746          */
20747
20748         /**
20749          * An event indicating that the mouse has left an element
20750          * 
20751          * @event element.out
20752          * 
20753          * @type {Object}
20754          * @property {djs.model.Base} element
20755          * @property {Snap<Element>} gfx
20756          * @property {Event} originalEvent
20757          */
20758
20759         /**
20760          * An event indicating that the mouse has clicked an element
20761          * 
20762          * @event element.click
20763          * 
20764          * @type {Object}
20765          * @property {djs.model.Base} element
20766          * @property {Snap<Element>} gfx
20767          * @property {Event} originalEvent
20768          */
20769
20770         /**
20771          * An event indicating that the mouse has double clicked an element
20772          * 
20773          * @event element.dblclick
20774          * 
20775          * @type {Object}
20776          * @property {djs.model.Base} element
20777          * @property {Snap<Element>} gfx
20778          * @property {Event} originalEvent
20779          */
20780
20781         /**
20782          * An event indicating that the mouse has gone down on an element.
20783          * 
20784          * @event element.mousedown
20785          * 
20786          * @type {Object}
20787          * @property {djs.model.Base} element
20788          * @property {Snap<Element>} gfx
20789          * @property {Event} originalEvent
20790          */
20791
20792         /**
20793          * An event indicating that the mouse has gone up on an element.
20794          * 
20795          * @event element.mouseup
20796          * 
20797          * @type {Object}
20798          * @property {djs.model.Base} element
20799          * @property {Snap<Element>} gfx
20800          * @property {Event} originalEvent
20801          */
20802     }, {
20803         "../../../vendor/snapsvg": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\vendor\\snapsvg.js",
20804         "../../draw/Renderer": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\draw\\Renderer.js",
20805         "../../util/Mouse": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Mouse.js",
20806         "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
20807         "min-dom/lib/delegate": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\delegate.js"
20808     }],
20809     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\interaction-events\\index.js": [function(require, module, exports) {
20810         module.exports = {
20811             __init__: ['interactionEvents'],
20812             interactionEvents: ['type', require('./InteractionEvents')]
20813         };
20814     }, {
20815         "./InteractionEvents": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\interaction-events\\InteractionEvents.js"
20816     }],
20817     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\keyboard\\Keyboard.js": [function(require, module, exports) {
20818         'use strict';
20819
20820         var domEvent = require('min-dom/lib/event'),
20821             domMatches = require('min-dom/lib/matches');
20822         //keyboard.bindTo=DOMElement;
20823        // var $ = require('jquery'),
20824        
20825        
20826         
20827         
20828         /**
20829          * A keyboard abstraction that may be activated and
20830          * deactivated by users at will, consuming key events
20831          * and triggering diagram actions.
20832          *
20833          * The implementation fires the following key events that allow
20834          * other components to hook into key handling:
20835          *
20836          *  - keyboard.bind
20837          *  - keyboard.unbind
20838          *  - keyboard.init
20839          *  - keyboard.destroy
20840          *
20841          * All events contain the fields (node, listeners).
20842          *
20843          * A default binding for the keyboard may be specified via the
20844          * `keyboard.bindTo` configuration option.
20845          *
20846          * @param {EventBus} eventBus
20847          * @param {CommandStack} commandStack
20848          * @param {Modeling} modeling
20849          * @param {Selection} selection
20850          * 
20851          */
20852         
20853         function Keyboard(config, eventBus, commandStack, modeling, selection, zoomScroll, canvas) {
20854           
20855           $(document).keydown(function(e){
20856                   if(commandStack._selectedModel == selected_model){
20857                           if(commandStack._eventBus._listeners != null){
20858                                   
20859                                   var model_commandStack = [];
20860                                   for(var i = 0; i < commandStackList.length; i++){
20861                                           if(commandStackList[i]._selectedModel == selected_model){
20862                                                   if(commandStackList[i]._stack.length > 0){
20863                                                           model_commandStack.push(commandStackList[i]); 
20864                                                   }
20865                                           }
20866                                   }
20867                                   
20868                                   var selected_commandStack;
20869                                   for(var i = model_commandStack.length-1; i >= 0; i--){
20870                                           if(model_commandStack[i]._stackIdx > -1){
20871                                                   selected_commandStack = model_commandStack[i];
20872                                                   break;
20873                                           }
20874                                   }
20875                                   
20876                                if(e.which == 90 && e.ctrlKey){
20877                                    if(commandStack == selected_commandStack){
20878                                                    commandStack.undo();
20879                                                    return true;
20880                                    }
20881                                    } else if(e.which == 89 && e.ctrlKey){
20882                                            commandStack.redo();
20883                                            return true;
20884                                    } 
20885                           }
20886                         
20887                         
20888                   }
20889                         
20890
20891                 });
20892                 
20893           var self = this;
20894
20895           this._commandStack = commandStack;
20896           this._modeling = modeling;
20897           this._selection = selection;
20898           this._eventBus = eventBus;
20899           this._zoomScroll = zoomScroll;
20900           this._canvas = canvas;
20901
20902           this._listeners = [];
20903
20904           // our key handler is a singleton that passes
20905           // (keycode, modifiers) to each listener.
20906           //
20907           // listeners must indicate that they handled a key event
20908           // by returning true. This stops the event propagation.
20909           //
20910           this._keyHandler = function(event) {
20911
20912             var i, l,
20913                 target = event.target,
20914                 listeners = self._listeners,
20915                 code = event.keyCode || event.charCode || -1;
20916
20917             if (domMatches(target, 'input, textarea')) {
20918               return;
20919             }
20920
20921             for (i = 0; !!(l = listeners[i]); i++) {
20922               if (l(code, event)) {
20923                 event.preventDefault();
20924                 event.stopPropagation();
20925               }
20926             }
20927           };
20928
20929           // properly clean dom registrations
20930           eventBus.on('diagram.destroy', function() {
20931             self._fire('destroy');
20932
20933             self.unbind();
20934             self._listeners = null;
20935           });
20936
20937           eventBus.on('diagram.init', function() {
20938             self._fire('init');
20939
20940             if (config && config.bindTo) {
20941               self.bind(config.bindTo);
20942             }
20943           });
20944
20945           this._init();
20946         }
20947
20948         Keyboard.$inject = [
20949           'config.keyboard',
20950           'eventBus',
20951           'commandStack',
20952           'modeling',
20953           'selection',
20954           'zoomScroll',
20955           'canvas'];
20956
20957         module.exports = Keyboard;
20958
20959
20960         Keyboard.prototype.bind = function(node) {
20961           this._node = node;
20962
20963           // bind key events
20964           domEvent.bind(node, 'keydown', this._keyHandler, true);
20965
20966           this._fire('bind');
20967         };
20968
20969         Keyboard.prototype.getBinding = function() {
20970           return this._node;
20971         };
20972
20973         Keyboard.prototype.unbind = function() {
20974           var node = this._node;
20975
20976           if (node) {
20977             this._fire('unbind');
20978
20979             // unbind key events
20980             domEvent.unbind(node, 'keydown', this._keyHandler, true);
20981           }
20982
20983           this._node = null;
20984         };
20985
20986
20987         Keyboard.prototype._fire = function(event) {
20988           this._eventBus.fire('keyboard.' + event, { node: this._node, listeners: this._listeners });
20989           
20990           
20991         };
20992       
20993
20994         
20995         Keyboard.prototype._init = function() {
20996
20997           var listeners = this._listeners,
20998               commandStack = this._commandStack,
20999               modeling = this._modeling,
21000               selection = this._selection,
21001               zoomScroll = this._zoomScroll,
21002               canvas = this._canvas;
21003           
21004           // init default listeners
21005
21006           // undo
21007           // (CTRL|CMD) + Z
21008           function undo(key, modifiers) {
21009                   
21010             if (isCmd(modifiers) && !isShift(modifiers) && key === 90) {
21011               commandStack.undo();
21012
21013               return true;
21014             }
21015           }
21016
21017           // redo
21018           // CTRL + Y
21019           // CMD + SHIFT + Z
21020           function redo(key, modifiers) {
21021
21022             if (isCmd(modifiers) && (key === 89 || (key === 90 && isShift(modifiers)))) {
21023               commandStack.redo();
21024
21025               return true;
21026             }
21027           }
21028
21029           /**
21030            * zoom in one step
21031            * CTRL + +
21032            *
21033            * 107 = numpad plus
21034            * 187 = regular plus
21035            * 171 = regular plus in Firefox (german keyboard layout)
21036            *  61 = regular plus in Firefox (US keyboard layout)
21037            */
21038           function zoomIn(key, modifiers) {
21039
21040             if ((key === 107 || key === 187 || key === 171 || key === 61) && isCmd(modifiers)) {
21041
21042               zoomScroll.stepZoom(1);
21043
21044               return true;
21045             }
21046           }
21047
21048           /**
21049            * zoom out one step
21050            * CTRL + -
21051            *
21052            * 109 = numpad minus
21053            * 189 = regular minus
21054            * 173 = regular minus in Firefox (US and german keyboard layout)
21055            */
21056           function zoomOut(key, modifiers) {
21057
21058             if ((key === 109 || key === 189 || key === 173)  && isCmd(modifiers)) {
21059
21060               zoomScroll.stepZoom(-1);
21061
21062               return true;
21063             }
21064           }
21065
21066           /**
21067            * zoom to the default level
21068            * CTRL + 0
21069            *
21070            * 96 = numpad zero
21071            * 48 = regular zero
21072            */
21073           function zoomDefault(key, modifiers) {
21074
21075             if ((key === 96 || key === 48) && isCmd(modifiers)) {
21076
21077               canvas.zoom(1);
21078
21079               return true;
21080             }
21081           }
21082
21083           // delete selected element
21084           // DEL
21085           function remove(key, modifiers) {
21086
21087             if (key === 46) {
21088
21089               var selectedElements = selection.get();
21090               console.log(selectedElements);
21091               if (selectedElements.length) {
21092                 modeling.removeElements(selectedElements.slice());
21093               }
21094
21095               return true;
21096             }
21097           }
21098
21099           listeners.push(undo);
21100           listeners.push(redo);
21101           listeners.push(remove);
21102           listeners.push(zoomIn);
21103           listeners.push(zoomOut);
21104           listeners.push(zoomDefault);
21105         };
21106
21107
21108         /**
21109          * Add a listener function that is notified with (key, modifiers) whenever
21110          * the keyboard is bound and the user presses a key.
21111          *
21112          * @param {Function} listenerFn
21113          */
21114         Keyboard.prototype.addListener = function(listenerFn) {
21115                 
21116           this._listeners.push(listenerFn);
21117         };
21118
21119         Keyboard.prototype.hasModifier = hasModifier;
21120         Keyboard.prototype.isCmd = isCmd;
21121         Keyboard.prototype.isShift = isShift;
21122
21123
21124         function hasModifier(modifiers) {
21125           return (modifiers.ctrlKey || modifiers.metaKey || modifiers.shiftKey || modifiers.altKey);
21126         }
21127
21128         function isCmd(modifiers) {
21129           return modifiers.ctrlKey || modifiers.metaKey;
21130         }
21131
21132         function isShift(modifiers) {
21133           return modifiers.shiftKey;
21134         }
21135
21136     }, {
21137         "min-dom/lib/event": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\event.js",
21138         "min-dom/lib/matches": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\matches.js"
21139     }],
21140     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\keyboard\\index.js": [function(require, module, exports) {
21141         module.exports = {
21142             __init__: ['keyboard'],
21143             keyboard: ['type', require('./Keyboard')]
21144         };
21145
21146     }, {
21147         "./Keyboard": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\keyboard\\Keyboard.js"
21148     }],
21149     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\lasso-tool\\LassoTool.js": [function(require, module, exports) {
21150         'use strict';
21151
21152         var values = require('lodash/object/values');
21153
21154         var getEnclosedElements = require('../../util/Elements').getEnclosedElements;
21155
21156         var hasPrimaryModifier = require('../../util/Mouse').hasPrimaryModifier;
21157
21158         var Snap = require('../../../vendor/snapsvg');
21159
21160
21161         function LassoTool(eventBus, canvas, dragging, elementRegistry, selection) {
21162
21163             this._selection = selection;
21164             this._dragging = dragging;
21165
21166             var self = this;
21167
21168             // lasso visuals implementation
21169
21170             /**
21171              * A helper that realizes the selection box visual
21172              */
21173             var visuals = {
21174
21175                 create: function(context) {
21176                     var container = canvas.getDefaultLayer(),
21177                         frame;
21178
21179                     frame = context.frame = Snap.create('rect', {
21180                         class: 'djs-lasso-overlay',
21181                         width: 1,
21182                         height: 1,
21183                         x: 0,
21184                         y: 0
21185                     });
21186
21187                     frame.appendTo(container);
21188                 },
21189
21190                 update: function(context) {
21191                     var frame = context.frame,
21192                         bbox = context.bbox;
21193
21194                     frame.attr({
21195                         x: bbox.x,
21196                         y: bbox.y,
21197                         width: bbox.width,
21198                         height: bbox.height
21199                     });
21200                 },
21201
21202                 remove: function(context) {
21203
21204                     if (context.frame) {
21205                         context.frame.remove();
21206                     }
21207                 }
21208             };
21209
21210
21211             eventBus.on('lasso.selection.end', function(event) {
21212
21213                 setTimeout(function() {
21214                     self.activateLasso(event.originalEvent, true);
21215                 });
21216             });
21217
21218             // lasso interaction implementation
21219
21220             eventBus.on('lasso.end', function(event) {
21221
21222                 var bbox = toBBox(event);
21223
21224                 var elements = elementRegistry.filter(function(element) {
21225                     return element;
21226                 });
21227
21228                 self.select(elements, bbox);
21229             });
21230
21231             eventBus.on('lasso.start', function(event) {
21232
21233                 var context = event.context;
21234
21235                 context.bbox = toBBox(event);
21236                 visuals.create(context);
21237             });
21238
21239             eventBus.on('lasso.move', function(event) {
21240
21241                 var context = event.context;
21242
21243                 context.bbox = toBBox(event);
21244                 visuals.update(context);
21245             });
21246
21247             eventBus.on('lasso.end', function(event) {
21248
21249                 var context = event.context;
21250
21251                 visuals.remove(context);
21252             });
21253
21254             eventBus.on('lasso.cleanup', function(event) {
21255
21256                 var context = event.context;
21257
21258                 visuals.remove(context);
21259             });
21260
21261
21262             // event integration
21263
21264             eventBus.on('element.mousedown', 1500, function(event) {
21265
21266                 if (hasPrimaryModifier(event)) {
21267                     self.activateLasso(event.originalEvent);
21268
21269                     event.stopPropagation();
21270                 }
21271             });
21272         }
21273
21274         LassoTool.$inject = [
21275             'eventBus',
21276             'canvas',
21277             'dragging',
21278             'elementRegistry',
21279             'selection'
21280         ];
21281
21282         module.exports = LassoTool;
21283
21284
21285         LassoTool.prototype.activateLasso = function(event, autoActivate) {
21286
21287             this._dragging.activate(event, 'lasso', {
21288                 autoActivate: autoActivate,
21289                 cursor: 'crosshair',
21290                 data: {
21291                     context: {}
21292                 }
21293             });
21294         };
21295
21296         LassoTool.prototype.activateSelection = function(event) {
21297
21298             this._dragging.activate(event, 'lasso.selection', {
21299                 cursor: 'crosshair'
21300             });
21301         };
21302
21303         LassoTool.prototype.select = function(elements, bbox) {
21304             var selectedElements = getEnclosedElements(elements, bbox);
21305
21306             this._selection.select(values(selectedElements));
21307         };
21308
21309
21310         function toBBox(event) {
21311
21312             var start = {
21313
21314                 x: event.x - event.dx,
21315                 y: event.y - event.dy
21316             };
21317
21318             var end = {
21319                 x: event.x,
21320                 y: event.y
21321             };
21322
21323             var bbox;
21324
21325             if ((start.x <= end.x && start.y < end.y) ||
21326                 (start.x < end.x && start.y <= end.y)) {
21327
21328                 bbox = {
21329                     x: start.x,
21330                     y: start.y,
21331                     width: end.x - start.x,
21332                     height: end.y - start.y
21333                 };
21334             } else if ((start.x >= end.x && start.y < end.y) ||
21335                 (start.x > end.x && start.y <= end.y)) {
21336
21337                 bbox = {
21338                     x: end.x,
21339                     y: start.y,
21340                     width: start.x - end.x,
21341                     height: end.y - start.y
21342                 };
21343             } else if ((start.x <= end.x && start.y > end.y) ||
21344                 (start.x < end.x && start.y >= end.y)) {
21345
21346                 bbox = {
21347                     x: start.x,
21348                     y: end.y,
21349                     width: end.x - start.x,
21350                     height: start.y - end.y
21351                 };
21352             } else if ((start.x >= end.x && start.y > end.y) ||
21353                 (start.x > end.x && start.y >= end.y)) {
21354
21355                 bbox = {
21356                     x: end.x,
21357                     y: end.y,
21358                     width: start.x - end.x,
21359                     height: start.y - end.y
21360                 };
21361             } else {
21362
21363                 bbox = {
21364                     x: end.x,
21365                     y: end.y,
21366                     width: 0,
21367                     height: 0
21368                 };
21369             }
21370             return bbox;
21371         }
21372     }, {
21373         "../../../vendor/snapsvg": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\vendor\\snapsvg.js",
21374         "../../util/Elements": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Elements.js",
21375         "../../util/Mouse": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Mouse.js",
21376         "lodash/object/values": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\values.js"
21377     }],
21378     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\lasso-tool\\index.js": [function(require, module, exports) {
21379         'use strict';
21380
21381         module.exports = {
21382             __init__: ['lassoTool'],
21383             lassoTool: ['type', require('./LassoTool')]
21384         };
21385
21386     }, {
21387         "./LassoTool": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\lasso-tool\\LassoTool.js"
21388     }],
21389     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\Modeling.js": [function(require, module, exports) {
21390         'use strict';
21391
21392         var forEach = require('lodash/collection/forEach');
21393
21394         var model = require('../../model');
21395
21396
21397         /**
21398          * The basic modeling entry point.
21399          * 
21400          * @param {EventBus}
21401          *            eventBus
21402          * @param {ElementFactory}
21403          *            elementFactory
21404          * @param {CommandStack}
21405          *            commandStack
21406          */
21407         function Modeling(eventBus, elementFactory, commandStack) {
21408             this._eventBus = eventBus;
21409             this._elementFactory = elementFactory;
21410             this._commandStack = commandStack;
21411             var self = this;
21412
21413             eventBus.on('diagram.init', function() {
21414                 // register modeling handlers
21415                 self.registerHandlers(commandStack);
21416             });
21417         }
21418
21419         Modeling.$inject = ['eventBus', 'elementFactory', 'commandStack'];
21420
21421         module.exports = Modeling;
21422
21423
21424         Modeling.prototype.getHandlers = function() {
21425             return {
21426                 'shape.append': require('./cmd/AppendShapeHandler'),
21427                 'shape.create': require('./cmd/CreateShapeHandler'),
21428                 'shape.delete': require('./cmd/DeleteShapeHandler'),
21429                 'shape.move': require('./cmd/MoveShapeHandler'),
21430                 'shapes.move': require('./cmd/MoveShapesHandler'),
21431                 'shape.resize': require('./cmd/ResizeShapeHandler'),
21432                 'shape.replace': require('./cmd/ReplaceShapeHandler'),
21433
21434                 'spaceTool': require('./cmd/SpaceToolHandler'),
21435
21436                 'label.create': require('./cmd/CreateLabelHandler'),
21437
21438                 'connection.create': require('./cmd/CreateConnectionHandler'),
21439                 'connection.delete': require('./cmd/DeleteConnectionHandler'),
21440                 'connection.move': require('./cmd/MoveConnectionHandler'),
21441                 'connection.layout': require('./cmd/LayoutConnectionHandler'),
21442
21443                 'connection.updateWaypoints': require('./cmd/UpdateWaypointsHandler'),
21444
21445                 'connection.reconnectStart': require('./cmd/ReconnectConnectionHandler'),
21446                 'connection.reconnectEnd': require('./cmd/ReconnectConnectionHandler'),
21447
21448                 'elements.delete': require('./cmd/DeleteElementsHandler'),
21449                 'element.updateAnchors': require('./cmd/UpdateAnchorsHandler')
21450             };
21451         };
21452
21453         /**
21454          * Register handlers with the command stack
21455          * 
21456          * @param {CommandStack}
21457          *            commandStack
21458          */
21459         Modeling.prototype.registerHandlers = function(commandStack) {
21460             forEach(this.getHandlers(), function(handler, id) {
21461                 commandStack.registerHandler(id, handler);
21462             });
21463         };
21464
21465
21466         // /// modeling helpers /////////////////////////////////////////
21467
21468
21469         Modeling.prototype.moveShape = function(shape, delta, newParent, hints) {
21470
21471             var context = {
21472                 shape: shape,
21473                 delta: delta,
21474                 newParent: newParent,
21475                 hints: hints || {}
21476             };
21477
21478             this._commandStack.execute('shape.move', context);
21479         };
21480
21481
21482         Modeling.prototype.moveShapes = function(shapes, delta, newParent, hints) {
21483
21484             var context = {
21485                 shapes: shapes,
21486                 delta: delta,
21487                 newParent: newParent,
21488                 hints: hints || {}
21489             };
21490
21491             this._commandStack.execute('shapes.move', context);
21492         };
21493
21494         /**
21495          * Update the anchors on the element with the given delta movement
21496          * 
21497          * @param {djs.model.Element}
21498          *            element
21499          * @param {Point}
21500          *            delta
21501          */
21502         Modeling.prototype.updateAnchors = function(element, delta) {
21503             var context = {
21504                 element: element,
21505                 delta: delta
21506             };
21507
21508             this._commandStack.execute('element.updateAnchors', context);
21509         };
21510
21511         Modeling.prototype.moveConnection = function(connection, delta, newParent, hints) {
21512
21513             var context = {
21514                 connection: connection,
21515                 delta: delta,
21516                 newParent: newParent,
21517                 hints: hints || {}
21518             };
21519
21520             this._commandStack.execute('connection.move', context);
21521         };
21522
21523
21524         Modeling.prototype.layoutConnection = function(connection, hints) {
21525
21526             var context = {
21527                 connection: connection,
21528                 hints: hints || {}
21529             };
21530
21531             this._commandStack.execute('connection.layout', context);
21532         };
21533
21534
21535         Modeling.prototype.createConnection = function(source, target, connection, parent) {
21536
21537             connection = this._create('connection', connection);
21538
21539             var context = {
21540                 source: source,
21541                 target: target,
21542                 parent: parent,
21543                 connection: connection
21544             };
21545
21546             this._commandStack.execute('connection.create', context);
21547
21548             return context.connection;
21549         };
21550
21551         Modeling.prototype.createShape = function(shape, position, parent) {
21552
21553             shape = this._create('shape', shape);
21554
21555             var context = {
21556                 position: position,
21557                 parent: parent,
21558                 shape: shape
21559             };
21560
21561             this._commandStack.execute('shape.create', context);
21562
21563             return context.shape;
21564         };
21565
21566
21567         Modeling.prototype.createLabel = function(labelTarget, position, label, parent) {
21568
21569             label = this._create('label', label);
21570
21571             var context = {
21572                 labelTarget: labelTarget,
21573                 position: position,
21574                 parent: parent,
21575                 shape: label
21576             };
21577
21578             this._commandStack.execute('label.create', context);
21579
21580             return context.shape;
21581         };
21582
21583
21584         Modeling.prototype.appendShape = function(source, shape, position, parent, connection, connectionParent) {
21585
21586             shape = this._create('shape', shape);
21587
21588             var context = {
21589                 source: source,
21590                 position: position,
21591                 parent: parent,
21592                 shape: shape,
21593                 connection: connection,
21594                 connectionParent: connectionParent
21595             };
21596
21597             this._commandStack.execute('shape.append', context);
21598
21599             return context.shape;
21600         };
21601
21602
21603         Modeling.prototype.removeElements = function(elements) {
21604           console.log(elements);
21605             var context = {
21606                 elements: elements
21607             };
21608
21609             this._commandStack.execute('elements.delete', context);
21610         };
21611
21612
21613         Modeling.prototype.removeShape = function(shape) {
21614             var context = {
21615                 shape: shape
21616             };
21617
21618             this._commandStack.execute('shape.delete', context);
21619         };
21620
21621
21622         Modeling.prototype.removeConnection = function(connection) {
21623             var context = {
21624                 connection: connection
21625             };
21626
21627             this._commandStack.execute('connection.delete', context);
21628         };
21629
21630         Modeling.prototype.replaceShape = function(oldShape, newShape, options) {
21631             var context = {
21632                 oldShape: oldShape,
21633                 newData: newShape,
21634                 options: options
21635             };
21636
21637             this._commandStack.execute('shape.replace', context);
21638
21639             return context.newShape;
21640         };
21641
21642         Modeling.prototype.resizeShape = function(shape, newBounds) {
21643             var context = {
21644                 shape: shape,
21645                 newBounds: newBounds
21646             };
21647
21648             this._commandStack.execute('shape.resize', context);
21649         };
21650
21651         Modeling.prototype.createSpace = function(movingShapes, resizingShapes, delta, direction) {
21652             var context = {
21653                 movingShapes: movingShapes,
21654                 resizingShapes: resizingShapes,
21655                 delta: delta,
21656                 direction: direction
21657             };
21658
21659             this._commandStack.execute('spaceTool', context);
21660         };
21661
21662         Modeling.prototype.updateWaypoints = function(connection, newWaypoints) {
21663             var context = {
21664                 connection: connection,
21665                 newWaypoints: newWaypoints
21666             };
21667
21668             this._commandStack.execute('connection.updateWaypoints', context);
21669         };
21670
21671         Modeling.prototype.reconnectStart = function(connection, newSource, dockingPoint) {
21672             var context = {
21673                 connection: connection,
21674                 newSource: newSource,
21675                 dockingPoint: dockingPoint
21676             };
21677
21678             this._commandStack.execute('connection.reconnectStart', context);
21679         };
21680
21681         Modeling.prototype.reconnectEnd = function(connection, newTarget, dockingPoint) {
21682             var context = {
21683                 connection: connection,
21684                 newTarget: newTarget,
21685                 dockingPoint: dockingPoint
21686             };
21687
21688             this._commandStack.execute('connection.reconnectEnd', context);
21689         };
21690
21691         Modeling.prototype.connect = function(source, target, attrs) {
21692             return this.createConnection(source, target, attrs || {}, source.parent);
21693         };
21694
21695
21696         Modeling.prototype._create = function(type, attrs) {
21697             if (attrs instanceof model.Base) {
21698                 return attrs;
21699             } else {
21700                 return this._elementFactory.create(type, attrs);
21701             }
21702         };
21703
21704     }, {
21705         "../../model": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\model\\index.js",
21706         "./cmd/AppendShapeHandler": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\AppendShapeHandler.js",
21707         "./cmd/CreateConnectionHandler": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\CreateConnectionHandler.js",
21708         "./cmd/CreateLabelHandler": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\CreateLabelHandler.js",
21709         "./cmd/CreateShapeHandler": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\CreateShapeHandler.js",
21710         "./cmd/DeleteConnectionHandler": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\DeleteConnectionHandler.js",
21711         "./cmd/DeleteElementsHandler": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\DeleteElementsHandler.js",
21712         "./cmd/DeleteShapeHandler": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\DeleteShapeHandler.js",
21713         "./cmd/LayoutConnectionHandler": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\LayoutConnectionHandler.js",
21714         "./cmd/MoveConnectionHandler": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\MoveConnectionHandler.js",
21715         "./cmd/MoveShapeHandler": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\MoveShapeHandler.js",
21716         "./cmd/MoveShapesHandler": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\MoveShapesHandler.js",
21717         "./cmd/ReconnectConnectionHandler": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\ReconnectConnectionHandler.js",
21718         "./cmd/ReplaceShapeHandler": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\ReplaceShapeHandler.js",
21719         "./cmd/ResizeShapeHandler": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\ResizeShapeHandler.js",
21720         "./cmd/SpaceToolHandler": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\SpaceToolHandler.js",
21721         "./cmd/UpdateAnchorsHandler": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\UpdateAnchorsHandler.js",
21722         "./cmd/UpdateWaypointsHandler": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\UpdateWaypointsHandler.js",
21723         "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js"
21724     }],
21725     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\AppendShapeHandler.js": [function(require, module, exports) {
21726         'use strict';
21727
21728         var inherits = require('inherits');
21729
21730
21731         /**
21732          * A handler that implements reversible appending of shapes to a source shape.
21733          * 
21734          * @param {canvas}
21735          *            Canvas
21736          * @param {elementFactory}
21737          *            ElementFactory
21738          * @param {modeling}
21739          *            Modeling
21740          */
21741         function AppendShapeHandler(modeling) {
21742             this._modeling = modeling;
21743         }
21744
21745         inherits(AppendShapeHandler, require('./NoopHandler'));
21746
21747
21748         AppendShapeHandler.$inject = ['modeling'];
21749
21750         module.exports = AppendShapeHandler;
21751
21752
21753         // //// api /////////////////////////////////////////////
21754
21755         /**
21756          * Creates a new shape
21757          * 
21758          * @param {Object}
21759          *            context
21760          * @param {ElementDescriptor}
21761          *            context.shape the new shape
21762          * @param {ElementDescriptor}
21763          *            context.source the source object
21764          * @param {ElementDescriptor}
21765          *            context.parent the parent object
21766          * @param {Point}
21767          *            context.position position of the new element
21768          */
21769         AppendShapeHandler.prototype.preExecute = function(context) {
21770
21771             if (!context.source) {
21772                 throw new Error('source required');
21773             }
21774
21775             var parent = context.parent || context.source.parent,
21776                 shape = this._modeling.createShape(context.shape, context.position, parent);
21777
21778             context.shape = shape;
21779         };
21780
21781         AppendShapeHandler.prototype.postExecute = function(context) {
21782             var parent = context.connectionParent || context.shape.parent;
21783
21784             // create connection
21785             this._modeling.connect(context.source, context.shape, context.connection, parent);
21786         };
21787     }, {
21788         "./NoopHandler": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\NoopHandler.js",
21789         "inherits": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\inherits\\inherits_browser.js"
21790     }],
21791     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\CreateConnectionHandler.js": [function(require, module, exports) {
21792         'use strict';
21793
21794
21795         function CreateConnectionHandler(canvas, layouter) {
21796             this._canvas = canvas;
21797             this._layouter = layouter;
21798         }
21799
21800         CreateConnectionHandler.$inject = ['canvas', 'layouter'];
21801
21802         module.exports = CreateConnectionHandler;
21803
21804
21805
21806         // //// api /////////////////////////////////////////
21807
21808         /**
21809          * Appends a shape to a target shape
21810          * 
21811          * @param {Object}
21812          *            context
21813          * @param {djs.element.Base}
21814          *            context.source the source object
21815          * @param {djs.element.Base}
21816          *            context.target the parent object
21817          * @param {Point}
21818          *            context.position position of the new element
21819          */
21820         CreateConnectionHandler.prototype.execute = function(context) {
21821
21822             var source = context.source,
21823                 target = context.target,
21824                 parent = context.parent;
21825
21826             if (!source || !target) {
21827                 throw new Error('source and target required');
21828             }
21829
21830             if (!parent) {
21831                 throw new Error('parent required');
21832             }
21833
21834             var connection = context.connection;
21835
21836             connection.source = source;
21837             connection.target = target;
21838
21839             if (!connection.waypoints) {
21840                 connection.waypoints = this._layouter.layoutConnection(connection);
21841             }
21842
21843             // add connection
21844             this._canvas.addConnection(connection, parent);
21845
21846             return connection;
21847         };
21848
21849         CreateConnectionHandler.prototype.revert = function(context) {
21850             var connection = context.connection;
21851
21852             this._canvas.removeConnection(connection);
21853
21854             connection.source = null;
21855             connection.target = null;
21856         };
21857     }, {}],
21858     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\CreateLabelHandler.js": [function(require, module, exports) {
21859         'use strict';
21860
21861         var inherits = require('inherits');
21862
21863         var CreateShapeHandler = require('./CreateShapeHandler');
21864
21865
21866         /**
21867          * A handler that attaches a label to a given target shape.
21868          * 
21869          * @param {canvas}
21870          *            Canvas
21871          */
21872         function CreateLabelHandler(canvas) {
21873             CreateShapeHandler.call(this, canvas);
21874         }
21875
21876         inherits(CreateLabelHandler, CreateShapeHandler);
21877
21878         CreateLabelHandler.$inject = ['canvas'];
21879
21880         module.exports = CreateLabelHandler;
21881
21882
21883
21884         // //// api /////////////////////////////////////////
21885
21886
21887         /**
21888          * Appends a label to a target shape.
21889          * 
21890          * @method CreateLabelHandler#execute
21891          * 
21892          * @param {Object}
21893          *            context
21894          * @param {ElementDescriptor}
21895          *            context.target the element the label is attached to
21896          * @param {ElementDescriptor}
21897          *            context.parent the parent object
21898          * @param {Point}
21899          *            context.position position of the new element
21900          */
21901
21902         /**
21903          * Undo append by removing the shape
21904          */
21905         CreateLabelHandler.prototype.revert = function(context) {
21906             context.shape.labelTarget = null;
21907             this._canvas.removeShape(context.shape);
21908         };
21909
21910
21911         // //// helpers /////////////////////////////////////////
21912
21913         CreateLabelHandler.prototype.getParent = function(context) {
21914             return context.parent || context.labelTarget && context.labelTarget.parent;
21915         };
21916
21917         CreateLabelHandler.prototype.addElement = function(shape, parent, context) {
21918             shape.labelTarget = context.labelTarget;
21919             this._canvas.addShape(shape, parent, true);
21920         };
21921     }, {
21922         "./CreateShapeHandler": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\CreateShapeHandler.js",
21923         "inherits": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\inherits\\inherits_browser.js"
21924     }],
21925     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\CreateShapeHandler.js": [function(require, module, exports) {
21926         'use strict';
21927
21928         var assign = require('lodash/object/assign');
21929
21930
21931         /**
21932          * A handler that implements reversible addition of shapes.
21933          * 
21934          * @param {canvas}
21935          *            Canvas
21936          */
21937         function CreateShapeHandler(canvas) {
21938             this._canvas = canvas;
21939         }
21940
21941         CreateShapeHandler.$inject = ['canvas'];
21942
21943         module.exports = CreateShapeHandler;
21944
21945
21946
21947         // //// api /////////////////////////////////////////
21948
21949
21950         /**
21951          * Appends a shape to a target shape
21952          * 
21953          * @param {Object}
21954          *            context
21955          * @param {djs.model.Base}
21956          *            context.parent the parent object
21957          * @param {Point}
21958          *            context.position position of the new element
21959          */
21960         CreateShapeHandler.prototype.execute = function(context) {
21961
21962             var parent = this.getParent(context);
21963
21964             var shape = context.shape;
21965
21966             this.setPosition(shape, context);
21967
21968             this.addElement(shape, parent, context);
21969
21970             return shape;
21971         };
21972
21973
21974         /**
21975          * Undo append by removing the shape
21976          */
21977         CreateShapeHandler.prototype.revert = function(context) {
21978             this._canvas.removeShape(context.shape);
21979         };
21980
21981
21982         // //// helpers /////////////////////////////////////////
21983
21984         CreateShapeHandler.prototype.getParent = function(context) {
21985             var parent = context.parent;
21986
21987             if (!parent) {
21988                 throw new Error('parent required');
21989             }
21990
21991             return parent;
21992         };
21993
21994         CreateShapeHandler.prototype.getPosition = function(context) {
21995             if (!context.position) {
21996                 throw new Error('no position given');
21997             }
21998
21999             return context.position;
22000         };
22001
22002         CreateShapeHandler.prototype.addElement = function(shape, parent) {
22003             this._canvas.addShape(shape, parent);
22004         };
22005
22006         CreateShapeHandler.prototype.setPosition = function(shape, context) {
22007             var position = this.getPosition(context);
22008
22009             // update to center position
22010             // specified in create context
22011             assign(shape, {
22012                 x: position.x - shape.width / 2,
22013                 y: position.y - shape.height / 2
22014             });
22015         };
22016     }, {
22017         "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js"
22018     }],
22019     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\DeleteConnectionHandler.js": [function(require, module, exports) {
22020         'use strict';
22021
22022         var Collections = require('../../../util/Collections');
22023
22024
22025         /**
22026          * A handler that implements reversible deletion of Connections.
22027          * 
22028          */
22029         function DeleteConnectionHandler(canvas, modeling) {
22030             this._canvas = canvas;
22031             this._modeling = modeling;
22032         }
22033
22034         DeleteConnectionHandler.$inject = ['canvas', 'modeling'];
22035
22036         module.exports = DeleteConnectionHandler;
22037
22038
22039         /**
22040          * - Remove attached label
22041          */
22042         DeleteConnectionHandler.prototype.preExecute = function(context) {
22043
22044             var connection = context.connection;
22045
22046             // Remove label
22047             if (connection.label) {
22048                 this._modeling.removeShape(connection.label);
22049             }
22050         };
22051
22052         DeleteConnectionHandler.prototype.execute = function(context) {
22053
22054             var connection = context.connection,
22055                 parent = connection.parent;
22056
22057             context.parent = parent;
22058             context.parentIndex = Collections.indexOf(parent.children, connection);
22059
22060             context.source = connection.source;
22061             context.target = connection.target;
22062
22063             this._canvas.removeConnection(connection);
22064
22065             connection.source = null;
22066             connection.target = null;
22067             connection.label = null;
22068         };
22069
22070         /**
22071          * Command revert implementation.
22072          */
22073         DeleteConnectionHandler.prototype.revert = function(context) {
22074
22075             var connection = context.connection,
22076                 parent = context.parent,
22077                 parentIndex = context.parentIndex;
22078
22079             connection.source = context.source;
22080             connection.target = context.target;
22081
22082             // restore previous location in old parent
22083             Collections.add(parent.children, connection, parentIndex);
22084
22085             this._canvas.addConnection(connection, parent);
22086         };
22087
22088     }, {
22089         "../../../util/Collections": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Collections.js"
22090     }],
22091     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\DeleteElementsHandler.js": [function(require, module, exports) {
22092         'use strict';
22093
22094         var forEach = require('lodash/collection/forEach'),
22095             inherits = require('inherits');
22096
22097
22098         function DeleteElementsHandler(modeling, elementRegistry) {
22099             this._modeling = modeling;
22100             this._elementRegistry = elementRegistry;
22101         }
22102
22103         inherits(DeleteElementsHandler, require('./NoopHandler'));
22104
22105         DeleteElementsHandler.$inject = ['modeling', 'elementRegistry'];
22106
22107         module.exports = DeleteElementsHandler;
22108
22109
22110         DeleteElementsHandler.prototype.postExecute = function(context) {
22111
22112             var modeling = this._modeling,
22113                 elementRegistry = this._elementRegistry,
22114                 elements = context.elements;
22115
22116             forEach(elements, function(element) {
22117
22118                 // element may have been removed with previous
22119                 // remove operations already (e.g. in case of nesting)
22120                 if (!elementRegistry.get(element.id)) {
22121                     return;
22122                 }
22123
22124                 if (element.waypoints) {
22125                     modeling.removeConnection(element);
22126                 } else {
22127                     modeling.removeShape(element);
22128                 }
22129             });
22130         };
22131     }, {
22132         "./NoopHandler": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\NoopHandler.js",
22133         "inherits": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\inherits\\inherits_browser.js",
22134         "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js"
22135     }],
22136     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\DeleteShapeHandler.js": [function(require, module, exports) {
22137         'use strict';
22138
22139         var Collections = require('../../../util/Collections');
22140
22141
22142         /**
22143          * A handler that implements reversible deletion of shapes.
22144          * 
22145          */
22146         function DeleteShapeHandler(canvas, modeling) {
22147             this._canvas = canvas;
22148             this._modeling = modeling;
22149         }
22150
22151         DeleteShapeHandler.$inject = ['canvas', 'modeling'];
22152
22153         module.exports = DeleteShapeHandler;
22154
22155
22156         /**
22157          * - Remove connections - Remove all direct children
22158          */
22159         DeleteShapeHandler.prototype.preExecute = function(context) {
22160
22161             var shape = context.shape,
22162                 label = shape.label,
22163                 modeling = this._modeling;
22164
22165             // Clean up on removeShape(label)
22166             if (shape.labelTarget) {
22167                 context.labelTarget = shape.labelTarget;
22168                 shape.labelTarget = null;
22169             }
22170
22171             // Remove label
22172             if (label) {
22173                 this._modeling.removeShape(label);
22174             }
22175
22176             // remove connections
22177             this._saveClear(shape.incoming, function(connection) {
22178                 // To make sure that the connection isn't removed twice
22179                 // For example if a container is removed
22180                 modeling.removeConnection(connection);
22181             });
22182
22183             this._saveClear(shape.outgoing, function(connection) {
22184                 modeling.removeConnection(connection);
22185             });
22186
22187
22188             // remove children
22189             this._saveClear(shape.children, function(e) {
22190                 modeling.removeShape(e);
22191             });
22192         };
22193
22194
22195         DeleteShapeHandler.prototype._saveClear = function(collection, remove) {
22196
22197             var e;
22198
22199             while (!!(e = collection[0])) {
22200                 remove(e);
22201             }
22202         };
22203
22204
22205         /**
22206          * Remove shape and remember the parent
22207          */
22208         DeleteShapeHandler.prototype.execute = function(context) {
22209
22210             var shape = context.shape,
22211                 parent = shape.parent;
22212
22213             context.parent = parent;
22214             context.parentIndex = Collections.indexOf(parent.children, shape);
22215
22216             shape.label = null;
22217
22218             this._canvas.removeShape(shape);
22219         };
22220
22221
22222         /**
22223          * Command revert implementation
22224          */
22225         DeleteShapeHandler.prototype.revert = function(context) {
22226
22227             var shape = context.shape,
22228                 parent = context.parent,
22229                 parentIndex = context.parentIndex,
22230                 labelTarget = context.labelTarget;
22231
22232             // restore previous location in old parent
22233             Collections.add(parent.children, shape, parentIndex);
22234
22235             if (labelTarget) {
22236                 labelTarget.label = shape;
22237             }
22238
22239             this._canvas.addShape(shape, parent);
22240         };
22241
22242     }, {
22243         "../../../util/Collections": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Collections.js"
22244     }],
22245     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\LayoutConnectionHandler.js": [function(require, module, exports) {
22246         'use strict';
22247
22248         var assign = require('lodash/object/assign');
22249
22250
22251         /**
22252          * A handler that implements reversible moving of shapes.
22253          */
22254         function LayoutConnectionHandler(layouter, canvas) {
22255             this._layouter = layouter;
22256             this._canvas = canvas;
22257         }
22258
22259         LayoutConnectionHandler.$inject = ['layouter', 'canvas'];
22260
22261         module.exports = LayoutConnectionHandler;
22262
22263         LayoutConnectionHandler.prototype.execute = function(context) {
22264
22265             var connection = context.connection,
22266                 parent = connection.parent,
22267                 connectionSiblings = parent.children;
22268
22269             var oldIndex = connectionSiblings.indexOf(connection);
22270
22271             assign(context, {
22272                 oldWaypoints: connection.waypoints,
22273                 oldIndex: oldIndex
22274             });
22275
22276             sendToFront(connection);
22277
22278             connection.waypoints = this._layouter.layoutConnection(connection, context.hints);
22279
22280             return connection;
22281         };
22282
22283         LayoutConnectionHandler.prototype.revert = function(context) {
22284
22285             var connection = context.connection,
22286                 parent = connection.parent,
22287                 connectionSiblings = parent.children,
22288                 currentIndex = connectionSiblings.indexOf(connection),
22289                 oldIndex = context.oldIndex;
22290
22291             connection.waypoints = context.oldWaypoints;
22292
22293             if (oldIndex !== currentIndex) {
22294
22295                 // change position of connection in shape
22296                 connectionSiblings.splice(currentIndex, 1);
22297                 connectionSiblings.splice(oldIndex, 0, connection);
22298             }
22299
22300             return connection;
22301         };
22302
22303         // connections should have a higher z-order as there source and targets
22304         function sendToFront(connection) {
22305
22306             var connectionSiblings = connection.parent.children;
22307
22308             var connectionIdx = connectionSiblings.indexOf(connection),
22309                 sourceIdx = findIndex(connectionSiblings, connection.source),
22310                 targetIdx = findIndex(connectionSiblings, connection.target),
22311
22312                 // ensure we do not send the connection back
22313                 // if it is already in front
22314                 insertIndex = Math.max(sourceIdx + 1, targetIdx + 1, connectionIdx);
22315
22316             if (connectionIdx < insertIndex) {
22317                 connectionSiblings.splice(insertIndex, 0, connection); // add to new
22318                 // position
22319                 connectionSiblings.splice(connectionIdx, 1); // remove from old position
22320             }
22321
22322             function findIndex(array, obj) {
22323
22324                 var index = array.indexOf(obj);
22325                 if (index < 0 && obj) {
22326                     var parent = obj.parent;
22327                     index = findIndex(array, parent);
22328                 }
22329                 return index;
22330             }
22331
22332             return insertIndex;
22333         }
22334
22335     }, {
22336         "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js"
22337     }],
22338     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\MoveConnectionHandler.js": [function(require, module, exports) {
22339         'use strict';
22340
22341         var forEach = require('lodash/collection/forEach');
22342
22343         var Collections = require('../../../util/Collections');
22344
22345
22346         /**
22347          * A handler that implements reversible moving of connections.
22348          * 
22349          * The handler differs from the layout connection handler in a sense that it
22350          * preserves the connection layout.
22351          */
22352         function MoveConnectionHandler() {}
22353
22354         module.exports = MoveConnectionHandler;
22355
22356
22357         MoveConnectionHandler.prototype.execute = function(context) {
22358
22359             var updateAnchors = (context.hints.updateAnchors !== false);
22360
22361             var connection = context.connection,
22362                 delta = context.delta;
22363
22364             var newParent = this.getNewParent(connection, context),
22365                 oldParent = connection.parent;
22366
22367             // save old position + parent in context
22368             context.oldParent = oldParent;
22369             context.oldParentIndex = Collections.indexOf(oldParent.children, connection);
22370
22371             // update waypoint positions
22372             forEach(connection.waypoints, function(p) {
22373                 p.x += delta.x;
22374                 p.y += delta.y;
22375
22376                 if (updateAnchors && p.original) {
22377                     p.original.x += delta.x;
22378                     p.original.y += delta.y;
22379                 }
22380             });
22381
22382             // update parent
22383             connection.parent = newParent;
22384
22385             return connection;
22386         };
22387
22388         MoveConnectionHandler.prototype.revert = function(context) {
22389
22390             var updateAnchors = (context.hints.updateAnchors !== false);
22391
22392             var connection = context.connection,
22393                 oldParent = context.oldParent,
22394                 oldParentIndex = context.oldParentIndex,
22395                 delta = context.delta;
22396
22397             // restore previous location in old parent
22398             Collections.add(oldParent.children, connection, oldParentIndex);
22399
22400             // restore parent
22401             connection.parent = oldParent;
22402
22403             // revert to old waypoint positions
22404             forEach(connection.waypoints, function(p) {
22405                 p.x -= delta.x;
22406                 p.y -= delta.y;
22407
22408                 if (updateAnchors && p.original) {
22409                     p.original.x -= delta.x;
22410                     p.original.y -= delta.y;
22411                 }
22412             });
22413
22414             return connection;
22415         };
22416
22417
22418         MoveConnectionHandler.prototype.getNewParent = function(connection, context) {
22419             return context.newParent || connection.parent;
22420         };
22421
22422     }, {
22423         "../../../util/Collections": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Collections.js",
22424         "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js"
22425     }],
22426     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\MoveShapeHandler.js": [function(require, module, exports) {
22427         'use strict';
22428
22429         var assign = require('lodash/object/assign'),
22430             forEach = require('lodash/collection/forEach');
22431
22432         var MoveHelper = require('./helper/MoveHelper'),
22433             Collections = require('../../../util/Collections');
22434
22435
22436         /**
22437          * A handler that implements reversible moving of shapes.
22438          */
22439         function MoveShapeHandler(modeling) {
22440             this._modeling = modeling;
22441
22442             this._helper = new MoveHelper(modeling);
22443         }
22444
22445         MoveShapeHandler.$inject = ['modeling'];
22446
22447         module.exports = MoveShapeHandler;
22448
22449
22450         MoveShapeHandler.prototype.execute = function(context) {
22451
22452             var shape = context.shape,
22453                 delta = context.delta,
22454                 newParent = this.getNewParent(context),
22455                 oldParent = shape.parent;
22456
22457             // save old parent in context
22458             context.oldParent = oldParent;
22459             context.oldParentIndex = Collections.indexOf(oldParent.children, shape);
22460
22461             // update shape parent + position
22462             assign(shape, {
22463                 parent: newParent,
22464                 x: shape.x + delta.x,
22465                 y: shape.y + delta.y
22466             });
22467
22468             return shape;
22469         };
22470
22471         MoveShapeHandler.prototype.postExecute = function(context) {
22472
22473             var shape = context.shape,
22474                 delta = context.delta;
22475
22476             var modeling = this._modeling;
22477
22478             if (context.hints.updateAnchors !== false) {
22479                 modeling.updateAnchors(shape, delta);
22480             }
22481
22482             if (context.hints.layout !== false) {
22483                 forEach(shape.incoming, function(c) {
22484                     modeling.layoutConnection(c, {
22485                         endChanged: true
22486                     });
22487                 });
22488
22489                 forEach(shape.outgoing, function(c) {
22490                     modeling.layoutConnection(c, {
22491                         startChanged: true
22492                     });
22493                 });
22494             }
22495
22496             if (context.hints.recurse !== false) {
22497                 this.moveChildren(context);
22498             }
22499         };
22500
22501         MoveShapeHandler.prototype.revert = function(context) {
22502
22503             var shape = context.shape,
22504                 oldParent = context.oldParent,
22505                 oldParentIndex = context.oldParentIndex,
22506                 delta = context.delta;
22507
22508             // restore previous location in old parent
22509             Collections.add(oldParent.children, shape, oldParentIndex);
22510
22511             // revert to old position and parent
22512             assign(shape, {
22513                 parent: oldParent,
22514                 x: shape.x - delta.x,
22515                 y: shape.y - delta.y
22516             });
22517
22518             return shape;
22519         };
22520
22521         MoveShapeHandler.prototype.moveChildren = function(context) {
22522
22523             var delta = context.delta,
22524                 shape = context.shape;
22525
22526             this._helper.moveRecursive(shape.children, delta, null);
22527         };
22528
22529         MoveShapeHandler.prototype.getNewParent = function(context) {
22530             return context.newParent || context.shape.parent;
22531         };
22532     }, {
22533         "../../../util/Collections": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Collections.js",
22534         "./helper/MoveHelper": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\helper\\MoveHelper.js",
22535         "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
22536         "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js"
22537     }],
22538     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\MoveShapesHandler.js": [function(require, module, exports) {
22539         'use strict';
22540
22541         var MoveHelper = require('./helper/MoveHelper');
22542
22543
22544         /**
22545          * A handler that implements reversible moving of shapes.
22546          */
22547         function MoveShapesHandler(modeling) {
22548             this._helper = new MoveHelper(modeling);
22549         }
22550
22551         MoveShapesHandler.$inject = ['modeling'];
22552
22553         module.exports = MoveShapesHandler;
22554
22555         MoveShapesHandler.prototype.preExecute = function(context) {
22556             context.closure = this._helper.getClosure(context.shapes);
22557         };
22558
22559         MoveShapesHandler.prototype.postExecute = function(context) {
22560             this._helper.moveClosure(context.closure, context.delta, context.newParent);
22561         };
22562
22563
22564         MoveShapesHandler.prototype.execute = function(context) {};
22565         MoveShapesHandler.prototype.revert = function(context) {};
22566
22567     }, {
22568         "./helper/MoveHelper": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\helper\\MoveHelper.js"
22569     }],
22570     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\NoopHandler.js": [function(require, module, exports) {
22571         'use strict';
22572
22573         function NoopHandler() {}
22574
22575         module.exports = NoopHandler;
22576
22577         NoopHandler.prototype.execute = function() {};
22578         NoopHandler.prototype.revert = function() {};
22579     }, {}],
22580     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\ReconnectConnectionHandler.js": [function(require, module, exports) {
22581         'use strict';
22582
22583
22584         function ReconnectConnectionHandler(layouter) {}
22585
22586         ReconnectConnectionHandler.$inject = ['layouter'];
22587
22588         module.exports = ReconnectConnectionHandler;
22589
22590         ReconnectConnectionHandler.prototype.execute = function(context) {
22591
22592             var newSource = context.newSource,
22593                 newTarget = context.newTarget,
22594                 connection = context.connection;
22595
22596             if (!newSource && !newTarget) {
22597                 throw new Error('newSource or newTarget are required');
22598             }
22599
22600             if (newSource && newTarget) {
22601                 throw new Error('must specify either newSource or newTarget');
22602             }
22603
22604             if (newSource) {
22605                 context.oldSource = connection.source;
22606                 connection.source = newSource;
22607
22608                 context.oldDockingPoint = connection.waypoints[0];
22609                 connection.waypoints[0] = context.dockingPoint;
22610             }
22611
22612             if (newTarget) {
22613                 context.oldTarget = connection.target;
22614                 connection.target = newTarget;
22615
22616                 context.oldDockingPoint = connection.waypoints[connection.waypoints.length - 1];
22617                 connection.waypoints[connection.waypoints.length - 1] = context.dockingPoint;
22618             }
22619
22620             return connection;
22621         };
22622
22623         ReconnectConnectionHandler.prototype.revert = function(context) {
22624
22625             var newSource = context.newSource,
22626                 newTarget = context.newTarget,
22627                 connection = context.connection;
22628
22629             if (newSource) {
22630                 connection.source = context.oldSource;
22631                 connection.waypoints[0] = context.oldDockingPoint;
22632             }
22633
22634             if (newTarget) {
22635                 connection.target = context.oldTarget;
22636                 connection.waypoints[connection.waypoints.length - 1] = context.oldDockingPoint;
22637             }
22638
22639             return connection;
22640         };
22641     }, {}],
22642     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\ReplaceShapeHandler.js": [function(require, module, exports) {
22643         'use strict';
22644
22645         var forEach = require('lodash/collection/forEach');
22646
22647
22648         /**
22649          * A handler that implements reversible replacing of shapes. Internally the old
22650          * shape will be removed and the new shape will be added.
22651          * 
22652          * 
22653          * @class
22654          * @constructor
22655          * 
22656          * @param {canvas}
22657          *            Canvas
22658          */
22659         function ReplaceShapeHandler(modeling, rules) {
22660             this._modeling = modeling;
22661             this._rules = rules;
22662         }
22663
22664         ReplaceShapeHandler.$inject = ['modeling', 'rules'];
22665
22666         module.exports = ReplaceShapeHandler;
22667
22668
22669
22670         // //// api /////////////////////////////////////////
22671
22672
22673         /**
22674          * Replaces a shape with an replacement Element.
22675          * 
22676          * The newData object should contain type, x, y.
22677          * 
22678          * If possible also the incoming/outgoing connection will be restored.
22679          * 
22680          * @param {Object}
22681          *            context
22682          */
22683         ReplaceShapeHandler.prototype.preExecute = function(context) {
22684
22685             var modeling = this._modeling,
22686                 rules = this._rules;
22687
22688             var oldShape = context.oldShape,
22689                 newData = context.newData,
22690                 newShape;
22691
22692
22693             // (1) place a new shape at the given position
22694
22695             var position = {
22696                 x: newData.x,
22697                 y: newData.y
22698             };
22699
22700             newShape = context.newShape = context.newShape || modeling.createShape(newData, position, oldShape.parent);
22701
22702
22703             // (2) reconnect connections to the new shape (where allowed)
22704
22705             var incoming = oldShape.incoming.slice(),
22706                 outgoing = oldShape.outgoing.slice();
22707
22708             forEach(incoming, function(connection) {
22709                 var waypoints = connection.waypoints,
22710                     docking = waypoints[waypoints.length - 1],
22711                     allowed = rules.allowed('connection.reconnectEnd', {
22712                         source: connection.source,
22713                         target: newShape,
22714                         connection: connection
22715                     });
22716
22717                 if (allowed) {
22718                     modeling.reconnectEnd(connection, newShape, docking);
22719                 }
22720             });
22721
22722             forEach(outgoing, function(connection) {
22723                 var waypoints = connection.waypoints,
22724                     docking = waypoints[0],
22725                     allowed = rules.allowed('connection.reconnectStart', {
22726                         source: newShape,
22727                         target: connection.target,
22728                         connection: connection
22729                     });
22730
22731                 if (allowed) {
22732                     modeling.reconnectStart(connection, newShape, docking);
22733                 }
22734             });
22735         };
22736
22737
22738         ReplaceShapeHandler.prototype.postExecute = function(context) {
22739             var modeling = this._modeling;
22740
22741             var oldShape = context.oldShape;
22742
22743             modeling.removeShape(oldShape);
22744         };
22745
22746
22747         ReplaceShapeHandler.prototype.execute = function(context) {};
22748
22749         ReplaceShapeHandler.prototype.revert = function(context) {};
22750
22751     }, {
22752         "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js"
22753     }],
22754     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\ResizeShapeHandler.js": [function(require, module, exports) {
22755         'use strict';
22756
22757         var assign = require('lodash/object/assign'),
22758             forEach = require('lodash/collection/forEach');
22759
22760
22761         /**
22762          * A handler that implements reversible resizing of shapes.
22763          * 
22764          */
22765         function ResizeShapeHandler(modeling) {
22766             this._modeling = modeling;
22767         }
22768
22769         ResizeShapeHandler.$inject = ['modeling'];
22770
22771         module.exports = ResizeShapeHandler;
22772
22773         /**
22774          * { shape: {....} newBounds: { width: 20, height: 40, x: 5, y: 10 }
22775          *  }
22776          */
22777         ResizeShapeHandler.prototype.execute = function(context) {
22778
22779             var shape = context.shape,
22780                 newBounds = context.newBounds;
22781
22782             if (newBounds.x === undefined || newBounds.y === undefined ||
22783                 newBounds.width === undefined || newBounds.height === undefined) {
22784                 throw new Error('newBounds must have {x, y, width, height} properties');
22785             }
22786
22787             if (newBounds.width < 10 || newBounds.height < 10) {
22788                 throw new Error('width and height cannot be less than 10px');
22789             }
22790
22791             // save old bbox in context
22792             context.oldBounds = {
22793                 width: shape.width,
22794                 height: shape.height,
22795                 x: shape.x,
22796                 y: shape.y
22797             };
22798
22799             // update shape
22800             assign(shape, {
22801                 width: newBounds.width,
22802                 height: newBounds.height,
22803                 x: newBounds.x,
22804                 y: newBounds.y
22805             });
22806
22807             return shape;
22808         };
22809
22810         ResizeShapeHandler.prototype.postExecute = function(context) {
22811
22812             var shape = context.shape;
22813
22814             var modeling = this._modeling;
22815
22816             forEach(shape.incoming, function(c) {
22817                 modeling.layoutConnection(c, {
22818                     endChanged: true
22819                 });
22820             });
22821
22822             forEach(shape.outgoing, function(c) {
22823                 modeling.layoutConnection(c, {
22824                     startChanged: true
22825                 });
22826             });
22827
22828         };
22829
22830         ResizeShapeHandler.prototype.revert = function(context) {
22831
22832             var shape = context.shape,
22833                 oldBounds = context.oldBounds;
22834
22835             // restore previous bbox
22836             assign(shape, {
22837                 width: oldBounds.width,
22838                 height: oldBounds.height,
22839                 x: oldBounds.x,
22840                 y: oldBounds.y
22841             });
22842
22843             return shape;
22844         };
22845
22846     }, {
22847         "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
22848         "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js"
22849     }],
22850     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\SpaceToolHandler.js": [function(require, module, exports) {
22851         'use strict';
22852
22853         var forEach = require('lodash/collection/forEach');
22854
22855         var SpaceUtil = require('../../space-tool/SpaceUtil');
22856
22857         /**
22858          * A handler that implements reversible creating and removing of space.
22859          * 
22860          * It executes in two phases:
22861          * 
22862          * (1) resize all affected resizeShapes (2) move all affected moveShapes
22863          */
22864         function SpaceToolHandler(modeling) {
22865             this._modeling = modeling;
22866         }
22867
22868         SpaceToolHandler.$inject = ['modeling'];
22869
22870         module.exports = SpaceToolHandler;
22871
22872
22873         SpaceToolHandler.prototype.preExecute = function(context) {
22874
22875             // resize
22876             var modeling = this._modeling,
22877                 resizingShapes = context.resizingShapes,
22878                 delta = context.delta,
22879                 direction = context.direction;
22880
22881             forEach(resizingShapes, function(shape) {
22882                 var newBounds = SpaceUtil.resizeBounds(shape, direction, delta);
22883
22884                 modeling.resizeShape(shape, newBounds);
22885             });
22886         };
22887
22888         SpaceToolHandler.prototype.postExecute = function(context) {
22889             // move
22890             var modeling = this._modeling,
22891                 movingShapes = context.movingShapes,
22892                 delta = context.delta;
22893
22894             modeling.moveShapes(movingShapes, delta);
22895         };
22896
22897         SpaceToolHandler.prototype.execute = function(context) {};
22898         SpaceToolHandler.prototype.revert = function(context) {};
22899
22900     }, {
22901         "../../space-tool/SpaceUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\space-tool\\SpaceUtil.js",
22902         "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js"
22903     }],
22904     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\UpdateAnchorsHandler.js": [function(require, module, exports) {
22905         'use strict';
22906
22907         var forEach = require('lodash/collection/forEach'),
22908             assign = require('lodash/object/assign');
22909
22910
22911         /**
22912          * Update the anchors of
22913          */
22914         function UpdateAnchorsHandler() {}
22915
22916         module.exports = UpdateAnchorsHandler;
22917
22918
22919         UpdateAnchorsHandler.prototype.execute = function(context) {
22920
22921             // update connection anchors
22922             return this.updateAnchors(context.element, context.delta);
22923         };
22924
22925         UpdateAnchorsHandler.prototype.revert = function(context) {
22926
22927             var delta = context.delta,
22928                 revertedDelta = {
22929                     x: -1 * delta.x,
22930                     y: -1 * delta.y
22931                 };
22932
22933             // revert update connection anchors
22934             return this.updateAnchors(context.element, revertedDelta);
22935         };
22936
22937         /**
22938          * Update anchors on the element according to the delta movement.
22939          * 
22940          * @param {djs.model.Element}
22941          *            element
22942          * @param {Point}
22943          *            delta
22944          * 
22945          * @return Array<djs.model.Connection>
22946          */
22947         UpdateAnchorsHandler.prototype.updateAnchors = function(element, delta) {
22948
22949             function add(point, delta) {
22950                 return {
22951                     x: point.x + delta.x,
22952                     y: point.y + delta.y
22953                 };
22954             }
22955
22956             function updateAnchor(waypoint) {
22957                 var original = waypoint.original;
22958
22959                 waypoint.original = assign(original || {}, add(original || waypoint, delta));
22960             }
22961
22962             var changed = [];
22963
22964             forEach(element.incoming, function(c) {
22965                 var waypoints = c.waypoints;
22966                 updateAnchor(waypoints[waypoints.length - 1]);
22967
22968                 changed.push(c);
22969             });
22970
22971             forEach(element.outgoing, function(c) {
22972                 var waypoints = c.waypoints;
22973                 updateAnchor(waypoints[0]);
22974
22975                 changed.push(c);
22976             });
22977
22978             return changed;
22979         };
22980     }, {
22981         "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
22982         "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js"
22983     }],
22984     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\UpdateWaypointsHandler.js": [function(require, module, exports) {
22985         'use strict';
22986
22987         function UpdateWaypointsHandler() {}
22988
22989         module.exports = UpdateWaypointsHandler;
22990
22991         UpdateWaypointsHandler.prototype.execute = function(context) {
22992
22993             var connection = context.connection,
22994                 newWaypoints = context.newWaypoints;
22995
22996             context.oldWaypoints = connection.waypoints;
22997
22998             connection.waypoints = newWaypoints;
22999
23000             return connection;
23001         };
23002
23003         UpdateWaypointsHandler.prototype.revert = function(context) {
23004
23005             var connection = context.connection,
23006                 oldWaypoints = context.oldWaypoints;
23007
23008             connection.waypoints = oldWaypoints;
23009
23010             return connection;
23011         };
23012     }, {}],
23013     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\cmd\\helper\\MoveHelper.js": [function(require, module, exports) {
23014         'use strict';
23015
23016         var forEach = require('lodash/collection/forEach');
23017
23018         var Elements = require('../../../../util/Elements');
23019
23020
23021         /**
23022          * A helper that is able to carry out serialized move operations on multiple
23023          * elements.
23024          * 
23025          * @param {Modeling}
23026          *            modeling
23027          */
23028         function MoveHelper(modeling) {
23029             this._modeling = modeling;
23030         }
23031
23032         module.exports = MoveHelper;
23033
23034         /**
23035          * Move the specified elements and all children by the given delta.
23036          * 
23037          * This moves all enclosed connections, too and layouts all affected external
23038          * connections.
23039          * 
23040          * @param {Array
23041          *            <djs.model.Base>} elements
23042          * @param {Point}
23043          *            delta
23044          * @param {djs.model.Base}
23045          *            newParent applied to the first level of shapes
23046          * 
23047          * @return {Array<djs.model.Base>} list of touched elements
23048          */
23049         MoveHelper.prototype.moveRecursive = function(elements, delta, newParent) {
23050             return this.moveClosure(this.getClosure(elements), delta, newParent);
23051         };
23052
23053         /**
23054          * Move the given closure of elmements
23055          */
23056         MoveHelper.prototype.moveClosure = function(closure, delta, newParent) {
23057
23058             var modeling = this._modeling;
23059
23060             var allShapes = closure.allShapes,
23061                 allConnections = closure.allConnections,
23062                 enclosedConnections = closure.enclosedConnections,
23063                 topLevel = closure.topLevel;
23064
23065             // move all shapes
23066             forEach(allShapes, function(s) {
23067
23068                 modeling.moveShape(s, delta, topLevel[s.id] && newParent, {
23069                     recurse: false,
23070                     layout: false
23071                 });
23072             });
23073
23074             // move all child connections / layout external connections
23075             forEach(allConnections, function(c) {
23076
23077                 var startMoved = !!allShapes[c.source.id],
23078                     endMoved = !!allShapes[c.target.id];
23079
23080                 if (enclosedConnections[c.id] &&
23081                     startMoved && endMoved) {
23082                     modeling.moveConnection(c, delta, topLevel[c.id] && newParent, {
23083                         updateAnchors: false
23084                     });
23085                 } else {
23086                     modeling.layoutConnection(c, {
23087                         startChanged: startMoved,
23088                         endChanged: endMoved
23089                     });
23090                 }
23091             });
23092         };
23093
23094         /**
23095          * Returns the closure for the selected elements
23096          * 
23097          * @param {Array
23098          *            <djs.model.Base>} elements
23099          * @return {Object} closure
23100          */
23101         MoveHelper.prototype.getClosure = function(elements) {
23102             return Elements.getClosure(elements);
23103         };
23104
23105     }, {
23106         "../../../../util/Elements": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Elements.js",
23107         "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js"
23108     }],
23109     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\index.js": [function(require, module, exports) {
23110         module.exports = {
23111             __depends__: [
23112                 require('../../command'),
23113                 require('../change-support'),
23114                 require('../rules')
23115             ],
23116             __init__: ['modeling'],
23117             modeling: ['type', require('./Modeling')],
23118             layouter: ['type', require('../../layout/BaseLayouter')]
23119         };
23120
23121     }, {
23122         "../../command": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\command\\index.js",
23123         "../../layout/BaseLayouter": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\layout\\BaseLayouter.js",
23124         "../change-support": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\change-support\\index.js",
23125         "../rules": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\rules\\index.js",
23126         "./Modeling": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\Modeling.js"
23127     }],
23128     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\move\\Move.js": [function(require, module, exports) {
23129         'use strict';
23130
23131         var assign = require('lodash/object/assign'),
23132             filter = require('lodash/collection/filter'),
23133             groupBy = require('lodash/collection/groupBy');
23134
23135
23136         var LOW_PRIORITY = 500,
23137             HIGH_PRIORITY = 1500;
23138
23139         var getOriginalEvent = require('../../util/Event').getOriginal;
23140
23141         var round = Math.round;
23142
23143
23144         /**
23145          * Return a filtered list of elements that do not contain those nested into
23146          * others.
23147          * 
23148          * @param {Array
23149          *            <djs.model.Base>} elements
23150          * 
23151          * @return {Array<djs.model.Base>} filtered
23152          */
23153         function removeNested(elements) {
23154
23155             var ids = groupBy(elements, 'id');
23156
23157             return filter(elements, function(element) {
23158                 while (!!(element = element.parent)) {
23159                     if (ids[element.id]) {
23160                         return false;
23161                     }
23162                 }
23163
23164                 return true;
23165             });
23166         }
23167
23168
23169
23170         /**
23171          * A plugin that makes shapes draggable / droppable.
23172          * 
23173          * @param {EventBus}
23174          *            eventBus
23175          * @param {Dragging}
23176          *            dragging
23177          * @param {Modeling}
23178          *            modeling
23179          * @param {Selection}
23180          *            selection
23181          * @param {Rules}
23182          *            rules
23183          */
23184         function MoveEvents(eventBus, dragging, modeling, selection, rules) {
23185
23186             // rules
23187
23188             function canMove(shapes, delta, target) {
23189
23190                 return rules.allowed('shapes.move', {
23191                     shapes: shapes,
23192                     delta: delta,
23193                     newParent: target
23194                 });
23195             }
23196
23197
23198             // move events
23199
23200             // assign a high priority to this handler to setup the environment
23201             // others may hook up later, e.g. at default priority and modify
23202             // the move environment
23203             //
23204             eventBus.on('shape.move.start', HIGH_PRIORITY, function(event) {
23205                 
23206                 var context = event.context,
23207                     shape = event.shape,
23208                     shapes = selection.get().slice();
23209
23210                 // move only single shape shape if the dragged element
23211                 // is not part of the current selection
23212                 if (shapes.indexOf(shape) === -1) {
23213                     shapes = [shape];
23214                 }
23215
23216                 // ensure we remove nested elements in the collection
23217                 shapes = removeNested(shapes);
23218
23219                 // attach shapes to drag context
23220                 assign(context, {
23221                     shapes: shapes,
23222                     shape: shape
23223                 });
23224
23225                 // check if we can move the elements
23226                 if (!canMove(shapes)) {
23227                     // suppress move operation
23228                     event.stopPropagation();
23229
23230                     return false;
23231                 }
23232             });
23233
23234             // assign a low priority to this handler
23235             // to let others modify the move event before we update
23236             // the context
23237             //
23238             eventBus.on('shape.move.move', LOW_PRIORITY, function(event) {
23239
23240                 var context = event.context,
23241                     shapes = context.shapes,
23242                     hover = event.hover,
23243                     delta = {
23244                         x: event.dx,
23245                         y: event.dy
23246                     },
23247                     canExecute;
23248
23249                 // check if we can move the elements
23250                 canExecute = canMove(shapes, delta, hover);
23251
23252                 context.delta = delta;
23253                 context.canExecute = canExecute;
23254
23255                 // simply ignore move over
23256                 if (canExecute === null) {
23257                     context.target = null;
23258
23259                     return;
23260                 }
23261
23262                 context.target = hover;
23263             });
23264
23265             eventBus.on('shape.move.end', function(event) {
23266
23267                 var context = event.context;
23268
23269                 var delta = context.delta,
23270                     canExecute = context.canExecute;
23271
23272                 if (!canExecute) {
23273                     return false;
23274                 }
23275
23276                 // ensure we have actual pixel values deltas
23277                 // (important when zoom level was > 1 during move)
23278                 delta.x = round(delta.x);
23279                 delta.y = round(delta.y);
23280
23281                 modeling.moveShapes(context.shapes, delta, context.target);
23282             });
23283
23284
23285             // move activation
23286
23287             eventBus.on('element.mousedown', function(event) {
23288
23289                 var originalEvent = getOriginalEvent(event);
23290
23291                 if (!originalEvent) {
23292                     throw new Error('must supply DOM mousedown event');
23293                 }
23294
23295                 start(originalEvent, event.element);
23296             });
23297
23298
23299             function start(event, element, activate) {
23300
23301                 // do not move connections or the root element
23302                 if (element.waypoints || !element.parent) {
23303                     return;
23304                 }
23305
23306                 dragging.activate(event, 'shape.move', {
23307                     cursor: 'grabbing',
23308                     autoActivate: activate,
23309                     data: {
23310                         shape: element,
23311                         context: {}
23312                     }
23313                 });
23314             }
23315
23316             // API
23317
23318             this.start = start;
23319         }
23320
23321         MoveEvents.$inject = ['eventBus', 'dragging', 'modeling', 'selection', 'rules'];
23322
23323         module.exports = MoveEvents;
23324
23325     }, {
23326         "../../util/Event": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Event.js",
23327         "lodash/collection/filter": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\filter.js",
23328         "lodash/collection/groupBy": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\groupBy.js",
23329         "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js"
23330     }],
23331     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\move\\MoveVisuals.js": [function(require, module, exports) {
23332         'use strict';
23333
23334         var flatten = require('lodash/array/flatten'),
23335             forEach = require('lodash/collection/forEach'),
23336             filter = require('lodash/collection/filter'),
23337             find = require('lodash/collection/find'),
23338             map = require('lodash/collection/map');
23339
23340         var Elements = require('../../util/Elements');
23341
23342         var LOW_PRIORITY = 500;
23343
23344         var MARKER_DRAGGING = 'djs-dragging',
23345             MARKER_OK = 'drop-ok',
23346             MARKER_NOT_OK = 'drop-not-ok';
23347
23348
23349         /**
23350          * A plugin that makes shapes draggable / droppable.
23351          * 
23352          * @param {EventBus}
23353          *            eventBus
23354          * @param {ElementRegistry}
23355          *            elementRegistry
23356          * @param {Canvas}
23357          *            canvas
23358          * @param {Styles}
23359          *            styles
23360          */
23361         function MoveVisuals(eventBus, elementRegistry, canvas, styles) {
23362
23363             function getGfx(e) {
23364                 return elementRegistry.getGraphics(e);
23365             }
23366
23367             function getVisualDragShapes(shapes) {
23368
23369                 var elements = Elements.selfAndDirectChildren(shapes, true);
23370                 var filteredElements = removeEdges(elements);
23371
23372                 return filteredElements;
23373             }
23374
23375             function getAllDraggedElements(shapes) {
23376                 var allShapes = Elements.selfAndAllChildren(shapes, true);
23377
23378                 var allConnections = map(allShapes, function(shape) {
23379                     return (shape.incoming || []).concat(shape.outgoing || []);
23380                 });
23381
23382                 return flatten(allShapes.concat(allConnections), true);
23383             }
23384
23385             function addDragger(shape, dragGroup) {
23386                 var gfx = getGfx(shape);
23387                 var dragger = gfx.clone();
23388                 var bbox = gfx.getBBox();
23389
23390                 dragger.attr(styles.cls('djs-dragger', [], {
23391                     x: bbox.x,
23392                     y: bbox.y
23393                 }));
23394
23395                 dragGroup.add(dragger);
23396             }
23397
23398             // assign a low priority to this handler
23399             // to let others modify the move context before
23400             // we draw things
23401             //
23402             eventBus.on('shape.move.start', LOW_PRIORITY, function(event) {
23403
23404                 var context = event.context,
23405                     dragShapes = context.shapes;
23406
23407                 var dragGroup = canvas.getDefaultLayer().group().attr(styles.cls('djs-drag-group', ['no-events']));
23408
23409                 var visuallyDraggedShapes = getVisualDragShapes(dragShapes);
23410
23411                 visuallyDraggedShapes.forEach(function(shape) {
23412                     addDragger(shape, dragGroup);
23413                 });
23414
23415
23416                 // cache all dragged elements / gfx
23417                 // so that we can quickly undo their state changes later
23418                 var allDraggedElements = context.allDraggedElements = getAllDraggedElements(dragShapes);
23419
23420                 // add dragging marker
23421                 forEach(allDraggedElements, function(e) {
23422                     canvas.addMarker(e, MARKER_DRAGGING);
23423                 });
23424
23425                 context.dragGroup = dragGroup;
23426             });
23427
23428             // assign a low priority to this handler
23429             // to let others modify the move context before
23430             // we draw things
23431             //
23432             eventBus.on('shape.move.move', LOW_PRIORITY, function(event) {
23433
23434                 var context = event.context,
23435                     dragGroup = context.dragGroup,
23436                     target = context.target;
23437
23438                 if (target) {
23439                     canvas.addMarker(target, context.canExecute ? MARKER_OK : MARKER_NOT_OK);
23440                 }
23441
23442                 dragGroup.translate(event.dx, event.dy);
23443             });
23444
23445             eventBus.on(['shape.move.out', 'shape.move.cleanup'], function(event) {
23446                 var context = event.context;
23447
23448                 if (context.target) {
23449                     canvas.removeMarker(context.target, context.canExecute ? MARKER_OK : MARKER_NOT_OK);
23450                 }
23451             });
23452
23453             eventBus.on('shape.move.cleanup', function(event) {
23454
23455                 var context = event.context,
23456                     allDraggedElements = context.allDraggedElements,
23457                     dragGroup = context.dragGroup;
23458
23459
23460                 // remove dragging marker
23461                 forEach(allDraggedElements, function(e) {
23462                     canvas.removeMarker(e, MARKER_DRAGGING);
23463                 });
23464
23465                 if (dragGroup) {
23466                     dragGroup.remove();
23467                 }
23468             });
23469         }
23470
23471         // returns elements minus all connections
23472         // where source or target is not elements
23473         function removeEdges(elements) {
23474
23475             var filteredElements = filter(elements, function(element) {
23476
23477                 if (!element.waypoints) { // shapes
23478                     return true;
23479                 } else { // connections
23480                     var srcFound = find(elements, element.source);
23481                     var targetFound = find(elements, element.target);
23482
23483                     return srcFound && targetFound;
23484                 }
23485             });
23486
23487             return filteredElements;
23488         }
23489
23490         MoveVisuals.$inject = ['eventBus', 'elementRegistry', 'canvas', 'styles'];
23491
23492         module.exports = MoveVisuals;
23493
23494     }, {
23495         "../../util/Elements": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Elements.js",
23496         "lodash/array/flatten": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\array\\flatten.js",
23497         "lodash/collection/filter": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\filter.js",
23498         "lodash/collection/find": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\find.js",
23499         "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
23500         "lodash/collection/map": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\map.js"
23501     }],
23502     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\move\\index.js": [function(require, module, exports) {
23503         module.exports = {
23504             __depends__: [
23505                 require('../interaction-events'),
23506                 require('../selection'),
23507                 require('../outline'),
23508                 require('../rules'),
23509                 require('../dragging')
23510             ],
23511             __init__: ['move', 'moveVisuals'],
23512             move: ['type', require('./Move')],
23513             moveVisuals: ['type', require('./MoveVisuals')]
23514         };
23515
23516     }, {
23517         "../dragging": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\dragging\\index.js",
23518         "../interaction-events": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\interaction-events\\index.js",
23519         "../outline": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\outline\\index.js",
23520         "../rules": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\rules\\index.js",
23521         "../selection": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\selection\\index.js",
23522         "./Move": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\move\\Move.js",
23523         "./MoveVisuals": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\move\\MoveVisuals.js"
23524     }],
23525     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\outline\\Outline.js": [function(require, module, exports) {
23526         'use strict';
23527
23528         var Snap = require('../../../vendor/snapsvg');
23529         var getBBox = require('../../util/Elements').getBBox;
23530
23531
23532         /**
23533          * @class
23534          * 
23535          * A plugin that adds an outline to shapes and connections that may be activated
23536          * and styled via CSS classes.
23537          * 
23538          * @param {EventBus}
23539          *            events the event bus
23540          */
23541         function Outline(eventBus, styles, elementRegistry) {
23542
23543             var OUTLINE_OFFSET = 6;
23544
23545             var OUTLINE_STYLE = styles.cls('djs-outline', ['no-fill']);
23546
23547             function createOutline(gfx, bounds) {
23548                 return Snap.create('rect', OUTLINE_STYLE).prependTo(gfx);
23549             }
23550
23551             function updateShapeOutline(outline, bounds) {
23552
23553                 outline.attr({
23554                     x: -OUTLINE_OFFSET,
23555                     y: -OUTLINE_OFFSET,
23556                     width: bounds.width + OUTLINE_OFFSET * 2,
23557                     height: bounds.height + OUTLINE_OFFSET * 2
23558                 });
23559             }
23560
23561             function updateConnectionOutline(outline, connection) {
23562
23563                 var bbox = getBBox(connection);
23564
23565                 outline.attr({
23566                     x: bbox.x - OUTLINE_OFFSET,
23567                     y: bbox.y - OUTLINE_OFFSET,
23568                     width: bbox.width + OUTLINE_OFFSET * 2,
23569                     height: bbox.height + OUTLINE_OFFSET * 2
23570                 });
23571             }
23572
23573             eventBus.on(['shape.added', 'shape.changed'], function(event) {
23574                 var element = event.element,
23575                     gfx = event.gfx;
23576
23577                 var outline = gfx.select('.djs-outline');
23578
23579                 if (!outline) {
23580                     outline = createOutline(gfx, element);
23581                 }
23582
23583                 updateShapeOutline(outline, element);
23584             });
23585
23586             eventBus.on(['connection.added', 'connection.changed'], function(event) {
23587                 var element = event.element,
23588                     gfx = event.gfx;
23589
23590                 var outline = gfx.select('.djs-outline');
23591
23592                 if (!outline) {
23593                     outline = createOutline(gfx, element);
23594                 }
23595
23596                 updateConnectionOutline(outline, element);
23597             });
23598
23599
23600         }
23601
23602
23603         Outline.$inject = ['eventBus', 'styles', 'elementRegistry'];
23604
23605         module.exports = Outline;
23606
23607     }, {
23608         "../../../vendor/snapsvg": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\vendor\\snapsvg.js",
23609         "../../util/Elements": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Elements.js"
23610     }],
23611     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\outline\\index.js": [function(require, module, exports) {
23612         'use strict';
23613
23614         module.exports = {
23615             __init__: ['outline'],
23616             outline: ['type', require('./Outline')]
23617         };
23618     }, {
23619         "./Outline": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\outline\\Outline.js"
23620     }],
23621     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\overlays\\Overlays.js": [function(require, module, exports) {
23622         'use strict';
23623
23624         var isArray = require('lodash/lang/isArray'),
23625             isString = require('lodash/lang/isString'),
23626             isObject = require('lodash/lang/isObject'),
23627             assign = require('lodash/object/assign'),
23628             forEach = require('lodash/collection/forEach'),
23629             filter = require('lodash/collection/filter'),
23630             debounce = require('lodash/function/debounce');
23631
23632         var domify = require('min-dom/lib/domify'),
23633             domClasses = require('min-dom/lib/classes'),
23634             domRemove = require('min-dom/lib/remove');
23635
23636         var getBBox = require('../../util/Elements').getBBox;
23637
23638         // document wide unique overlay ids
23639         var ids = new(require('../../util/IdGenerator'))('ov');
23640
23641
23642         function createRoot(parent) {
23643             var root = domify('<div class="djs-overlay-container" style="position: absolute; width: 0; height: 0;" />');
23644             parent.insertBefore(root, parent.firstChild);
23645
23646             return root;
23647         }
23648
23649
23650         function setPosition(el, x, y) {
23651             assign(el.style, {
23652                 left: x + 'px',
23653                 top: y + 'px'
23654             });
23655         }
23656
23657         function setVisible(el, visible) {
23658             el.style.display = visible === false ? 'none' : '';
23659         }
23660
23661         /**
23662          * A service that allows users to attach overlays to diagram elements.
23663          * 
23664          * The overlay service will take care of overlay positioning during updates.
23665          * 
23666          * @example
23667          *  // add a pink badge on the top left of the shape overlays.add(someShape, {
23668          * position: { top: -5, left: -5 }, html: '<div style="width: 10px; background:
23669          * fuchsia; color: white;">0</div>' });
23670          *  // or add via shape id
23671          * 
23672          * overlays.add('some-element-id', { position: { top: -5, left: -5 } html: '<div
23673          * style="width: 10px; background: fuchsia; color: white;">0</div>' });
23674          *  // or add with optional type
23675          * 
23676          * overlays.add(someShape, 'badge', { position: { top: -5, left: -5 } html: '<div
23677          * style="width: 10px; background: fuchsia; color: white;">0</div>' });
23678          * 
23679          *  // remove an overlay
23680          * 
23681          * var id = overlays.add(...); overlays.remove(id);
23682          * 
23683          * @param {EventBus}
23684          *            eventBus
23685          * @param {Canvas}
23686          *            canvas
23687          * @param {ElementRegistry}
23688          *            elementRegistry
23689          */
23690         function Overlays(config, eventBus, canvas, elementRegistry) {
23691
23692             this._eventBus = eventBus;
23693             this._canvas = canvas;
23694             this._elementRegistry = elementRegistry;
23695
23696             this._ids = ids;
23697
23698             this._overlayDefaults = {
23699                 show: {
23700                     minZoom: 0.7,
23701                     maxZoom: 5.0
23702                 }
23703             };
23704
23705             /**
23706              * Mapping overlayId -> overlay
23707              */
23708             this._overlays = {};
23709
23710             /**
23711              * Mapping elementId -> overlay container
23712              */
23713             this._overlayContainers = {};
23714
23715             // root html element for all overlays
23716             this._overlayRoot = createRoot(canvas.getContainer());
23717
23718             this._init(config);
23719         }
23720
23721
23722         Overlays.$inject = ['config.overlays', 'eventBus', 'canvas', 'elementRegistry'];
23723
23724         module.exports = Overlays;
23725
23726
23727         /**
23728          * Returns the overlay with the specified id or a list of overlays for an
23729          * element with a given type.
23730          * 
23731          * @example
23732          *  // return the single overlay with the given id overlays.get('some-id');
23733          *  // return all overlays for the shape overlays.get({ element: someShape });
23734          *  // return all overlays on shape with type 'badge' overlays.get({ element:
23735          * someShape, type: 'badge' });
23736          *  // shape can also be specified as id overlays.get({ element: 'element-id',
23737          * type: 'badge' });
23738          * 
23739          * 
23740          * @param {Object}
23741          *            search
23742          * @param {String}
23743          *            [search.id]
23744          * @param {String|djs.model.Base}
23745          *            [search.element]
23746          * @param {String}
23747          *            [search.type]
23748          * 
23749          * @return {Object|Array<Object>} the overlay(s)
23750          */
23751         Overlays.prototype.get = function(search) {
23752
23753             if (isString(search)) {
23754                 search = {
23755                     id: search
23756                 };
23757             }
23758
23759             if (search.element) {
23760                 var container = this._getOverlayContainer(search.element, true);
23761
23762                 // return a list of overlays when searching by element (+type)
23763                 if (container) {
23764                     return search.type ? filter(container.overlays, {
23765                         type: search.type
23766                     }) : container.overlays.slice();
23767                 } else {
23768                     return [];
23769                 }
23770             } else
23771             if (search.type) {
23772                 return filter(this._overlays, {
23773                     type: search.type
23774                 });
23775             } else {
23776                 // return single element when searching by id
23777                 return search.id ? this._overlays[search.id] : null;
23778             }
23779         };
23780
23781         /**
23782          * Adds a HTML overlay to an element.
23783          * 
23784          * @param {String|djs.model.Base}
23785          *            element attach overlay to this shape
23786          * @param {String}
23787          *            [type] optional type to assign to the overlay
23788          * @param {Object}
23789          *            overlay the overlay configuration
23790          * 
23791          * @param {String|DOMElement}
23792          *            overlay.html html element to use as an overlay
23793          * @param {Object}
23794          *            [overlay.show] show configuration
23795          * @param {Number}
23796          *            [overlay.show.minZoom] minimal zoom level to show the overlay
23797          * @param {Number}
23798          *            [overlay.show.maxZoom] maximum zoom level to show the overlay
23799          * @param {Object}
23800          *            overlay.position where to attach the overlay
23801          * @param {Number}
23802          *            [overlay.position.left] relative to element bbox left attachment
23803          * @param {Number}
23804          *            [overlay.position.top] relative to element bbox top attachment
23805          * @param {Number}
23806          *            [overlay.position.bottom] relative to element bbox bottom
23807          *            attachment
23808          * @param {Number}
23809          *            [overlay.position.right] relative to element bbox right attachment
23810          * 
23811          * @return {String} id that may be used to reference the overlay for update or
23812          *         removal
23813          */
23814         Overlays.prototype.add = function(element, type, overlay) {
23815
23816             if (isObject(type)) {
23817                 overlay = type;
23818                 type = null;
23819             }
23820
23821             if (!element.id) {
23822                 element = this._elementRegistry.get(element);
23823             }
23824
23825             if (!overlay.position) {
23826                 throw new Error('must specifiy overlay position');
23827             }
23828
23829             if (!overlay.html) {
23830                 throw new Error('must specifiy overlay html');
23831             }
23832
23833             if (!element) {
23834                 throw new Error('invalid element specified');
23835             }
23836
23837             var id = this._ids.next();
23838
23839             overlay = assign({}, this._overlayDefaults, overlay, {
23840                 id: id,
23841                 type: type,
23842                 element: element,
23843                 html: overlay.html
23844             });
23845
23846             this._addOverlay(overlay);
23847
23848             return id;
23849         };
23850
23851
23852         /**
23853          * Remove an overlay with the given id or all overlays matching the given
23854          * filter.
23855          * 
23856          * @see Overlays#get for filter options.
23857          * 
23858          * @param {String}
23859          *            [id]
23860          * @param {Object}
23861          *            [filter]
23862          */
23863         Overlays.prototype.remove = function(filter) {
23864
23865             var overlays = this.get(filter) || [];
23866
23867             if (!isArray(overlays)) {
23868                 overlays = [overlays];
23869             }
23870
23871             var self = this;
23872
23873             forEach(overlays, function(overlay) {
23874
23875                 var container = self._getOverlayContainer(overlay.element, true);
23876
23877                 if (overlay) {
23878                     domRemove(overlay.html);
23879                     domRemove(overlay.htmlContainer);
23880
23881                     delete overlay.htmlContainer;
23882                     delete overlay.element;
23883
23884                     delete self._overlays[overlay.id];
23885                 }
23886
23887                 if (container) {
23888                     var idx = container.overlays.indexOf(overlay);
23889                     if (idx !== -1) {
23890                         container.overlays.splice(idx, 1);
23891                     }
23892                 }
23893             });
23894
23895         };
23896
23897
23898         Overlays.prototype.show = function() {
23899             setVisible(this._overlayRoot);
23900         };
23901
23902
23903         Overlays.prototype.hide = function() {
23904             setVisible(this._overlayRoot, false);
23905         };
23906
23907
23908         Overlays.prototype._updateOverlayContainer = function(container) {
23909             var element = container.element,
23910                 html = container.html;
23911
23912             // update container left,top according to the elements x,y coordinates
23913             // this ensures we can attach child elements relative to this container
23914
23915             var x = element.x,
23916                 y = element.y;
23917
23918             if (element.waypoints) {
23919                 var bbox = getBBox(element);
23920                 x = bbox.x;
23921                 y = bbox.y;
23922             }
23923
23924             setPosition(html, x, y);
23925         };
23926
23927
23928         Overlays.prototype._updateOverlay = function(overlay) {
23929
23930             var position = overlay.position,
23931                 htmlContainer = overlay.htmlContainer,
23932                 element = overlay.element;
23933
23934             // update overlay html relative to shape because
23935             // it is already positioned on the element
23936
23937             // update relative
23938             var left = position.left,
23939                 top = position.top;
23940
23941             if (position.right !== undefined) {
23942
23943                 var width;
23944
23945                 if (element.waypoints) {
23946                     width = getBBox(element).width;
23947                 } else {
23948                     width = element.width;
23949                 }
23950
23951                 left = position.right * -1 + width;
23952             }
23953
23954             if (position.bottom !== undefined) {
23955
23956                 var height;
23957
23958                 if (element.waypoints) {
23959                     height = getBBox(element).height;
23960                 } else {
23961                     height = element.height;
23962                 }
23963
23964                 top = position.bottom * -1 + height;
23965             }
23966
23967             setPosition(htmlContainer, left || 0, top || 0);
23968         };
23969
23970
23971         Overlays.prototype._createOverlayContainer = function(element) {
23972             var html = domify('<div class="djs-overlays djs-overlays-' + element.id + '" style="position: absolute" />');
23973
23974             this._overlayRoot.appendChild(html);
23975
23976             var container = {
23977                 html: html,
23978                 element: element,
23979                 overlays: []
23980             };
23981
23982             this._updateOverlayContainer(container);
23983
23984             return container;
23985         };
23986
23987
23988         Overlays.prototype._updateRoot = function(viewbox) {
23989             var a = viewbox.scale || 1;
23990             var d = viewbox.scale || 1;
23991
23992             var matrix = 'matrix(' + a + ',0,0,' + d + ',' + (-1 * viewbox.x * a) + ',' + (-1 * viewbox.y * d) + ')';
23993
23994             this._overlayRoot.style.transform = matrix;
23995             this._overlayRoot.style['-ms-transform'] = matrix;
23996         };
23997
23998
23999         Overlays.prototype._getOverlayContainer = function(element, raw) {
24000             var id = (element && element.id) || element;
24001
24002             var container = this._overlayContainers[id];
24003             if (!container && !raw) {
24004                 container = this._overlayContainers[id] = this._createOverlayContainer(element);
24005             }
24006
24007             return container;
24008         };
24009
24010
24011         Overlays.prototype._addOverlay = function(overlay) {
24012
24013             var id = overlay.id,
24014                 element = overlay.element,
24015                 html = overlay.html,
24016                 htmlContainer,
24017                 overlayContainer;
24018
24019             // unwrap jquery (for those who need it)
24020             if (html.get) {
24021                 html = html.get(0);
24022             }
24023
24024             // create proper html elements from
24025             // overlay HTML strings
24026             if (isString(html)) {
24027                 html = domify(html);
24028             }
24029
24030             overlayContainer = this._getOverlayContainer(element);
24031
24032             htmlContainer = domify('<div class="djs-overlay" data-overlay-id="' + id + '" style="position: absolute">');
24033
24034             htmlContainer.appendChild(html);
24035
24036             if (overlay.type) {
24037                 domClasses(htmlContainer).add('djs-overlay-' + overlay.type);
24038             }
24039
24040             overlay.htmlContainer = htmlContainer;
24041
24042             overlayContainer.overlays.push(overlay);
24043             overlayContainer.html.appendChild(htmlContainer);
24044
24045             this._overlays[id] = overlay;
24046
24047             this._updateOverlay(overlay);
24048         };
24049
24050         Overlays.prototype._updateOverlayVisibilty = function(viewbox) {
24051
24052             forEach(this._overlays, function(overlay) {
24053                 var show = overlay.show,
24054                     htmlContainer = overlay.htmlContainer,
24055                     visible = true;
24056
24057                 if (show) {
24058                     if (show.minZoom > viewbox.scale ||
24059                         show.maxZoom < viewbox.scale) {
24060                         visible = false;
24061                     }
24062
24063                     setVisible(htmlContainer, visible);
24064                 }
24065             });
24066         };
24067
24068         Overlays.prototype._init = function(config) {
24069
24070             var eventBus = this._eventBus;
24071
24072             var self = this;
24073
24074
24075             // scroll/zoom integration
24076
24077             var updateViewbox = function(viewbox) {
24078                 self._updateRoot(viewbox);
24079                 self._updateOverlayVisibilty(viewbox);
24080
24081                 self.show();
24082             };
24083
24084             if (!config || config.deferUpdate !== false) {
24085                 updateViewbox = debounce(updateViewbox, 300);
24086             }
24087
24088             eventBus.on('canvas.viewbox.changed', function(event) {
24089                 self.hide();
24090                 updateViewbox(event.viewbox);
24091             });
24092
24093
24094             // remove integration
24095
24096             eventBus.on(['shape.remove', 'connection.remove'], function(e) {
24097                 var overlays = self.get({
24098                     element: e.element
24099                 });
24100
24101                 forEach(overlays, function(o) {
24102                     self.remove(o.id);
24103                 });
24104             });
24105
24106
24107             // move integration
24108
24109             eventBus.on([
24110                 'element.changed'
24111             ], function(e) {
24112                 var element = e.element;
24113
24114                 var container = self._getOverlayContainer(element, true);
24115
24116                 if (container) {
24117                     forEach(container.overlays, function(overlay) {
24118                         self._updateOverlay(overlay);
24119                     });
24120
24121                     self._updateOverlayContainer(container);
24122                 }
24123             });
24124
24125
24126             // marker integration, simply add them on the overlays as classes, too.
24127
24128             eventBus.on('element.marker.update', function(e) {
24129                 var container = self._getOverlayContainer(e.element, true);
24130                 if (container) {
24131                     domClasses(container.html)[e.add ? 'add' : 'remove'](e.marker);
24132                 }
24133             });
24134         };
24135
24136     }, {
24137         "../../util/Elements": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Elements.js",
24138         "../../util/IdGenerator": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\IdGenerator.js",
24139         "lodash/collection/filter": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\filter.js",
24140         "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
24141         "lodash/function/debounce": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\function\\debounce.js",
24142         "lodash/lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js",
24143         "lodash/lang/isObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isObject.js",
24144         "lodash/lang/isString": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isString.js",
24145         "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js",
24146         "min-dom/lib/classes": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\classes.js",
24147         "min-dom/lib/domify": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\domify.js",
24148         "min-dom/lib/remove": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\remove.js"
24149     }],
24150     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\overlays\\index.js": [function(require, module, exports) {
24151         module.exports = {
24152             __init__: ['overlays'],
24153             overlays: ['type', require('./Overlays')]
24154         };
24155     }, {
24156         "./Overlays": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\overlays\\Overlays.js"
24157     }],
24158     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\palette\\Palette.js": [function(require, module, exports) {
24159         'use strict';
24160
24161         var isFunction = require('lodash/lang/isFunction'),
24162             forEach = require('lodash/collection/forEach');
24163
24164         var domify = require('min-dom/lib/domify'),
24165             domQuery = require('min-dom/lib/query'),
24166             domAttr = require('min-dom/lib/attr'),
24167             domClear = require('min-dom/lib/clear'),
24168             domClasses = require('min-dom/lib/classes'),
24169             domMatches = require('min-dom/lib/matches'),
24170             domDelegate = require('min-dom/lib/delegate'),
24171             domEvent = require('min-dom/lib/event');
24172
24173
24174         var toggleSelector = '.djs-palette-toggle',
24175             entrySelector = '.entry',
24176             elementSelector = toggleSelector + ', ' + entrySelector;
24177
24178
24179         /**
24180          * A palette containing modeling elements.
24181          */
24182         function Palette(eventBus, canvas) {
24183
24184             this._eventBus = eventBus;
24185             this._canvas = canvas;
24186
24187             this._providers = [];
24188         }
24189
24190         Palette.$inject = ['eventBus', 'canvas'];
24191
24192         module.exports = Palette;
24193
24194
24195         /**
24196          * Register a provider with the palette
24197          * 
24198          * @param {PaletteProvider}
24199          *            provider
24200          */
24201         Palette.prototype.registerProvider = function(provider) {
24202             this._providers.push(provider);
24203
24204             if (!this._container) {
24205                 this._init();
24206             }
24207
24208             this._update();
24209         };
24210
24211
24212         /**
24213          * Returns the palette entries for a given element
24214          * 
24215          * @return {Array<PaletteEntryDescriptor>} list of entries
24216          */
24217         Palette.prototype.getEntries = function() {
24218
24219             var entries = {};
24220
24221             // loop through all providers and their entries.
24222             // group entries by id so that overriding an entry is possible
24223             forEach(this._providers, function(provider) {
24224                 var e = provider.getPaletteEntries();
24225
24226                 forEach(e, function(entry, id) {
24227                     entries[id] = entry;
24228                 });
24229             });
24230
24231             return entries;
24232         };
24233
24234
24235         /**
24236          * Initialize
24237          */
24238         Palette.prototype._init = function() {
24239             var parent = this._canvas.getContainer(),
24240                 container = this._container = domify(Palette.HTML_MARKUP),
24241                 self = this;
24242
24243             parent.appendChild(container);
24244
24245             domDelegate.bind(container, elementSelector, 'click', function(event) {
24246
24247                 var target = event.delegateTarget;
24248
24249                 if (domMatches(target, toggleSelector)) {
24250                     return self.toggle();
24251                 }
24252
24253                 self.trigger('click', event);
24254             });
24255
24256             // prevent drag propagation
24257             domEvent.bind(container, 'mousedown', function(event) {
24258                 event.stopPropagation();
24259             });
24260
24261             // prevent drag propagation
24262             domDelegate.bind(container, entrySelector, 'dragstart', function(event) {
24263                 self.trigger('dragstart', event);
24264             });
24265
24266             this._eventBus.fire('palette.create', {
24267                 html: container
24268             });
24269         };
24270
24271
24272         Palette.prototype._update = function() {
24273
24274             var entriesContainer = domQuery('.djs-palette-entries', this._container),
24275                 entries = this._entries = this.getEntries();
24276
24277             domClear(entriesContainer);
24278
24279             forEach(entries, function(entry, id) {
24280
24281                 var grouping = entry.group || 'default';
24282
24283                 var container = domQuery('[data-group=' + grouping + ']', entriesContainer);
24284                 if (!container) {
24285                     container = domify('<div class="group" data-group="' + grouping + '"></div>');
24286                     entriesContainer.appendChild(container);
24287                 }
24288
24289                 var html = entry.html || (
24290                     entry.separator ?
24291                     '<hr class="separator" />' :
24292                     '<div class="entry" draggable="true"></div>');
24293
24294
24295                 var control = domify(html);
24296                 // alert("Control ::" + control + " HTML :: " + html);
24297
24298                 container.appendChild(control);
24299
24300                 if (!entry.separator) {
24301                     domAttr(control, 'data-action', id);
24302
24303                     if (entry.title) {
24304                         domAttr(control, 'title', entry.title);
24305                     }
24306
24307
24308
24309                     if (entry.className) {
24310                         domClasses(control).add(entry.className);
24311                     }
24312
24313                     if (entry.imageUrl) {
24314                         control.appendChild(domify('<img src="' + entry.imageUrl + '">'));
24315                     }
24316                 }
24317
24318                 // alert("Entry Title :: " + entry.title + " Entry HTML :: " + html);
24319             });
24320
24321             // open after update
24322             this.open(true);
24323         };
24324
24325
24326         /**
24327          * Trigger an action available on the palette
24328          * 
24329          * @param {String}
24330          *            action
24331          * @param {Event}
24332          *            event
24333          */
24334         Palette.prototype.trigger = function(action, event, autoActivate) {
24335
24336             var entries = this._entries,
24337                 entry,
24338                 handler,
24339                 originalEvent,
24340                 button = event.delegateTarget || event.target;
24341
24342             if (!button) {
24343                 return event.preventDefault();
24344             }
24345
24346
24347             entry = entries[domAttr(button, 'data-action')];
24348             handler = entry.action;
24349
24350             originalEvent = event.originalEvent || event;
24351
24352             // simple action (via callback function)
24353             if (isFunction(handler)) {
24354                 if (action === 'click') {
24355                     return handler(originalEvent, autoActivate);
24356                 }
24357             } else {
24358                 if (handler[action]) {
24359                     return handler[action](originalEvent, autoActivate);
24360                 }
24361             }
24362
24363             // silence other actions
24364             event.preventDefault();
24365         };
24366
24367
24368         /**
24369          * Close the palette
24370          */
24371         Palette.prototype.close = function() {
24372             domClasses(this._container).remove('open');
24373         };
24374
24375
24376         /**
24377          * Open the palette
24378          */
24379         Palette.prototype.open = function() {
24380             domClasses(this._container).add('open');
24381         };
24382
24383
24384         Palette.prototype.toggle = function(open) {
24385             if (this.isOpen()) {
24386                 this.close();
24387             } else {
24388                 this.open();
24389             }
24390         };
24391
24392
24393         /**
24394          * Return true if the palette is opened.
24395          * 
24396          * @example
24397          * 
24398          * palette.open();
24399          * 
24400          * if (palette.isOpen()) { // yes, we are open }
24401          * 
24402          * @return {boolean} true if palette is opened
24403          */
24404         Palette.prototype.isOpen = function() {
24405             return this._container && domClasses(this._container).has('open');
24406         };
24407
24408
24409         /* markup definition */
24410
24411         Palette.HTML_MARKUP =
24412             '<div class="djs-palette">' +
24413             '<div class="djs-palette-entries"></div>' +
24414             '<div class="djs-palette-toggle"></div>' +
24415             '</div>';
24416     }, {
24417         "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
24418         "lodash/lang/isFunction": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isFunction.js",
24419         "min-dom/lib/attr": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\attr.js",
24420         "min-dom/lib/classes": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\classes.js",
24421         "min-dom/lib/clear": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\clear.js",
24422         "min-dom/lib/delegate": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\delegate.js",
24423         "min-dom/lib/domify": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\domify.js",
24424         "min-dom/lib/event": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\event.js",
24425         "min-dom/lib/matches": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\matches.js",
24426         "min-dom/lib/query": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\query.js"
24427     }],
24428     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\palette\\index.js": [function(require, module, exports) {
24429         module.exports = {
24430             __init__: ['palette'],
24431             palette: ['type', require('./Palette')]
24432         };
24433
24434     }, {
24435         "./Palette": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\palette\\Palette.js"
24436     }],
24437     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\popup-menu\\PopupMenu.js": [function(require, module, exports) {
24438         'use strict';
24439
24440         var forEach = require('lodash/collection/forEach'),
24441             assign = require('lodash/object/assign'),
24442             domEvent = require('min-dom/lib/event'),
24443             domify = require('min-dom/lib/domify'),
24444             domClasses = require('min-dom/lib/classes'),
24445             domAttr = require('min-dom/lib/attr'),
24446             domRemove = require('min-dom/lib/remove');
24447
24448
24449         function PopupMenu(eventBus, canvas) {
24450
24451             this._eventBus = eventBus;
24452             this._canvas = canvas;
24453             this._instances = {};
24454         }
24455
24456         PopupMenu.$inject = ['eventBus', 'canvas'];
24457
24458         module.exports = PopupMenu;
24459
24460         PopupMenu.prototype.open = function(name, position, entries, options) {
24461
24462             var outer = this,
24463                 canvas = this._canvas,
24464                 instances = outer._instances;
24465
24466             // return existing instance
24467             if (instances[name]) {
24468                 return instances[name];
24469             }
24470
24471             var parent = canvas.getContainer();
24472
24473             // ------------------------
24474             function PopupMenuInstance() {
24475
24476                 var self = this;
24477
24478                 self._actions = {};
24479                 self.name = name || 'popup-menu';
24480
24481                 var _options = {
24482                     entryClassName: 'entry'
24483                 };
24484                 assign(_options, options);
24485
24486                 // Container setup
24487                 var container = this._container = domify('<div class="djs-popup">');
24488
24489                 assign(container.style, {
24490                     position: 'absolute',
24491                     left: position.x + 'px',
24492                     top: position.y + 'px'
24493                 });
24494                 domClasses(container).add(name);
24495
24496                 // Add entries
24497                 forEach(entries, function(entry) {
24498
24499                     var entryContainer = domify('<div>');
24500                     domClasses(entryContainer).add(entry.className || _options.entryClassName);
24501                     domClasses(entryContainer).add('djs-popup-entry');
24502
24503                     if (entry.style) {
24504                         domAttr(entryContainer, 'style', entry.style);
24505                     }
24506
24507                     if (entry.action) {
24508                         domAttr(entryContainer, 'data-action', entry.action.name);
24509                         self._actions[entry.action.name] = entry.action.handler;
24510                     }
24511
24512                     var title = domify('<span>');
24513                     title.textContent = entry.label;
24514                     entryContainer.appendChild(title);
24515
24516                     container.appendChild(entryContainer);
24517                 });
24518
24519                 // Event handler
24520                 domEvent.bind(container, 'click', function(event) {
24521                     self.trigger(event);
24522                 });
24523
24524
24525
24526                 // apply canvas zoom level
24527                 var zoom = canvas.zoom();
24528
24529                 container.style.transformOrigin = 'top left';
24530                 container.style.transform = 'scale(' + zoom + ')';
24531
24532                 // Attach to DOM
24533                 parent.appendChild(container);
24534
24535                 // Add Handler
24536                 this.bindHandlers();
24537             }
24538
24539             PopupMenuInstance.prototype.close = function() {
24540                 this.unbindHandlers();
24541                 domRemove(this._container);
24542                 delete outer._instances[this.name];
24543             };
24544
24545             PopupMenuInstance.prototype.bindHandlers = function() {
24546
24547                 var self = this,
24548                     eventBus = outer._eventBus;
24549
24550                 this._closeHandler = function() {
24551                     self.close();
24552                 };
24553
24554                 eventBus.once('contextPad.close', this._closeHandler);
24555                 eventBus.once('canvas.viewbox.changed', this._closeHandler);
24556             };
24557
24558             PopupMenuInstance.prototype.unbindHandlers = function() {
24559
24560                 var eventBus = outer._eventBus;
24561
24562                 eventBus.off('contextPad.close', this._closeHandler);
24563                 eventBus.off('canvas.viewbox.changed', this._closeHandler);
24564             };
24565
24566             PopupMenuInstance.prototype.trigger = function(event) {
24567
24568                 var element = event.target,
24569                     actionName = element.getAttribute('data-action') ||
24570                     element.parentNode.getAttribute('data-action');
24571
24572                 var action = this._actions[actionName];
24573
24574
24575                 if (action) {
24576                     action();
24577                 }
24578
24579                 // silence other actions
24580                 event.preventDefault();
24581             };
24582
24583             var instance = outer._instances[name] = new PopupMenuInstance(position, entries, parent, options);
24584
24585             return instance;
24586         };
24587
24588     }, {
24589         "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
24590         "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js",
24591         "min-dom/lib/attr": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\attr.js",
24592         "min-dom/lib/classes": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\classes.js",
24593         "min-dom/lib/domify": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\domify.js",
24594         "min-dom/lib/event": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\event.js",
24595         "min-dom/lib/remove": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\remove.js"
24596     }],
24597     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\popup-menu\\index.js": [function(require, module, exports) {
24598         'use strict';
24599
24600         module.exports = {
24601             __init__: ['popupMenu'],
24602             popupMenu: ['type', require('./PopupMenu')]
24603         };
24604
24605     }, {
24606         "./PopupMenu": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\popup-menu\\PopupMenu.js"
24607     }],
24608     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\replace\\Replace.js": [function(require, module, exports) {
24609         'use strict';
24610
24611
24612         /**
24613          * Service that allow replacing of elements.
24614          * 
24615          * 
24616          * @class
24617          * @constructor
24618          */
24619         function Replace(modeling) {
24620
24621             this._modeling = modeling;
24622         }
24623
24624         module.exports = Replace;
24625
24626         Replace.$inject = ['modeling'];
24627
24628         /**
24629          * @param {Element}
24630          *            oldElement - Element to be replaced
24631          * @param {Object}
24632          *            newElementData - Containing information about the new Element, for
24633          *            example height, width, type.
24634          * @param {Object}
24635          *            options - Custom options that will be attached to the context. It
24636          *            can be used to inject data that is needed in the command chain.
24637          *            For example it could be used in
24638          *            eventbus.on('commandStack.shape.replace.postExecute') to change
24639          *            shape attributes after shape creation.
24640          */
24641         Replace.prototype.replaceElement = function(oldElement, newElementData, options) {
24642
24643             var modeling = this._modeling;
24644
24645             var newElement = null;
24646
24647             if (oldElement.waypoints) {
24648                 // TODO
24649                 // modeling.replaceConnection
24650             } else {
24651                 // set center of element for modeling API
24652                 // if no new width / height is given use old elements size
24653                 newElementData.x = oldElement.x + (newElementData.width || oldElement.width) / 2;
24654                 newElementData.y = oldElement.y + (newElementData.height || oldElement.height) / 2;
24655
24656                 newElement = modeling.replaceShape(oldElement, newElementData, options);
24657             }
24658
24659             return newElement;
24660         };
24661
24662     }, {}],
24663     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\replace\\index.js": [function(require, module, exports) {
24664         'use strict';
24665
24666         module.exports = {
24667             __init__: ['replace'],
24668             replace: ['type', require('./Replace')]
24669         };
24670
24671     }, {
24672         "./Replace": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\replace\\Replace.js"
24673     }],
24674     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\resize\\Resize.js": [function(require, module, exports) {
24675         'use strict';
24676
24677         var forEach = require('lodash/collection/forEach'),
24678             filter = require('lodash/collection/filter'),
24679             pick = require('lodash/object/pick');
24680
24681         var ResizeUtil = require('./ResizeUtil'),
24682             domEvent = require('min-dom/lib/event'),
24683             Elements = require('../../util/Elements');
24684
24685         var isPrimaryButton = require('../../util/Mouse').isPrimaryButton;
24686
24687         var round = Math.round;
24688
24689         var Snap = require('../../../vendor/snapsvg');
24690
24691         var HANDLE_OFFSET = -2,
24692             HANDLE_SIZE = 5,
24693             HANDLE_HIT_SIZE = 20;
24694
24695         var MARKER_RESIZING = 'djs-resizing',
24696             MARKER_RESIZE_NOT_OK = 'resize-not-ok',
24697             CLS_RESIZER = 'djs-resizer';
24698
24699
24700         /**
24701          * Implements resize on shapes by
24702          *  * adding resize handles, * creating a visual during resize * checking resize
24703          * rules * committing a change once finished
24704          * 
24705          *  ## Customizing
24706          * 
24707          * It's possible to customize the resizing behaviour by intercepting
24708          * 'resize.start' and providing the following parameters through the 'context':
24709          *  * minDimensions ({ width, height }) - Minimum shape dimensions *
24710          * childrenBoxPadding (number) - Gap between the minimum bounding box and the
24711          * container
24712          * 
24713          * f.ex:
24714          * 
24715          * eventBus.on('resize.start', 1500, function(event) { var context =
24716          * event.context,
24717          * 
24718          * context.minDimensions = { width: 140, height: 120 };
24719          * context.childrenBoxPadding = 30; });
24720          */
24721
24722         function Resize(eventBus, elementRegistry, rules, modeling, canvas, selection, dragging) {
24723
24724             function canResize(context) {
24725                 var ctx = pick(context, ['newBounds', 'shape', 'delta', 'direction']);
24726                 return rules.allowed('shape.resize', ctx);
24727             }
24728
24729
24730             // resizing implementation //////////////////////////////////
24731
24732             /**
24733              * A helper that realizes the resize visuals
24734              */
24735             var visuals = {
24736                 create: function(context) {
24737                     var container = canvas.getDefaultLayer(),
24738                         shape = context.shape,
24739                         frame;
24740
24741                     frame = context.frame = Snap.create('rect', {
24742                         class: 'djs-resize-overlay',
24743                         width: shape.width + 10,
24744                         height: shape.height + 10,
24745                         x: shape.x - 5,
24746                         y: shape.y - 5
24747                     });
24748
24749                     frame.appendTo(container);
24750                 },
24751
24752                 update: function(context) {
24753                     var frame = context.frame,
24754                         bounds = context.newBounds;
24755
24756                     if (bounds.width > 5) {
24757                         frame.attr({
24758                             x: bounds.x,
24759                             width: bounds.width
24760                         });
24761                     }
24762
24763                     if (bounds.height > 5) {
24764                         frame.attr({
24765                             y: bounds.y,
24766                             height: bounds.height
24767                         });
24768                     }
24769
24770                     frame[context.canExecute ? 'removeClass' : 'addClass'](MARKER_RESIZE_NOT_OK);
24771                 },
24772
24773                 remove: function(context) {
24774                     if (context.frame) {
24775                         context.frame.remove();
24776                     }
24777                 }
24778             };
24779
24780             function computeMinBoundaryBox(context) {
24781
24782                 var shape = context.shape,
24783                     direction = context.direction,
24784                     minDimensions = context.minDimensions || {},
24785                     childrenBoxPadding = context.childrenBoxPadding || 20,
24786                     children,
24787                     minBoundaryBox;
24788
24789                 // grab all the shapes that are NOT labels or connections
24790                 children = filter(shape.children, function(child) {
24791                     // connections
24792                     if (child.waypoints) {
24793                         return false;
24794                     }
24795
24796                     // labels
24797                     if (child.type === 'label') {
24798                         return false;
24799                     }
24800
24801                     return true;
24802                 });
24803
24804                 // compute a minimum bounding box
24805                 // around the existing children
24806                 if (children.length) {
24807                     minBoundaryBox = Elements.getBBox(children);
24808
24809                     // add a gap between the minBoundaryBox and the resizable container
24810                     minBoundaryBox.width += childrenBoxPadding * 2;
24811                     minBoundaryBox.height += childrenBoxPadding * 2;
24812                     minBoundaryBox.x -= childrenBoxPadding;
24813                     minBoundaryBox.y -= childrenBoxPadding;
24814                 } else {
24815                     minBoundaryBox = ResizeUtil.getMinResizeBounds(direction, shape, {
24816                         width: minDimensions.width || 10,
24817                         height: minDimensions.height || 10
24818                     });
24819                 }
24820
24821                 return minBoundaryBox;
24822             }
24823
24824             eventBus.on('resize.start', function(event) {
24825
24826                 var context = event.context,
24827                     shape = context.shape,
24828                     minBoundaryBox = context.minBoundaryBox;
24829
24830                 if (minBoundaryBox === undefined) {
24831                     context.minBoundaryBox = computeMinBoundaryBox(context);
24832                 }
24833
24834                 // add resizable indicator
24835                 canvas.addMarker(shape, MARKER_RESIZING);
24836
24837                 visuals.create(context);
24838             });
24839
24840             eventBus.on('resize.move', function(event) {
24841
24842                 var context = event.context,
24843                     shape = context.shape,
24844                     direction = context.direction,
24845                     minBoundaryBox = context.minBoundaryBox,
24846                     delta;
24847
24848                 delta = {
24849                     x: event.dx,
24850                     y: event.dy
24851                 };
24852
24853                 context.delta = delta;
24854
24855                 context.newBounds = ResizeUtil.resizeBounds(shape, direction, delta);
24856
24857                 if (minBoundaryBox) {
24858                     context.newBounds = ResizeUtil.ensureMinBounds(context.newBounds, minBoundaryBox);
24859                 }
24860
24861                 // update + cache executable state
24862                 context.canExecute = canResize(context);
24863
24864                 // update resize frame visuals
24865                 visuals.update(context);
24866             });
24867
24868             eventBus.on('resize.end', function(event) {
24869                 var context = event.context,
24870                     shape = context.shape;
24871
24872                 var newBounds = context.newBounds;
24873
24874
24875                 // ensure we have actual pixel values for new bounds
24876                 // (important when zoom level was > 1 during move)
24877                 newBounds.x = round(newBounds.x);
24878                 newBounds.y = round(newBounds.y);
24879                 newBounds.width = round(newBounds.width);
24880                 newBounds.height = round(newBounds.height);
24881
24882                 // perform the actual resize
24883                 if (context.canExecute) {
24884                     modeling.resizeShape(shape, context.newBounds);
24885                 }
24886             });
24887
24888             eventBus.on('resize.cleanup', function(event) {
24889
24890                 var context = event.context,
24891                     shape = context.shape;
24892
24893                 // remove resizable indicator
24894                 canvas.removeMarker(shape, MARKER_RESIZING);
24895
24896                 // remove frame + destroy context
24897                 visuals.remove(context);
24898             });
24899
24900
24901             function activate(event, shape, direction) {
24902
24903                 dragging.activate(event, 'resize', {
24904                     autoActivate: true,
24905                     cursor: 'resize-' + (/nw|se/.test(direction) ? 'nwse' : 'nesw'),
24906                     data: {
24907                         shape: shape,
24908                         context: {
24909                             direction: direction,
24910                             shape: shape
24911                         }
24912                     }
24913                 });
24914             }
24915
24916             function makeDraggable(element, gfx, direction) {
24917
24918                 function listener(event) {
24919                     // only trigger on left mouse button
24920                     if (isPrimaryButton(event)) {
24921                         activate(event, element, direction);
24922                     }
24923                 }
24924
24925                 domEvent.bind(gfx.node, 'mousedown', listener);
24926                 domEvent.bind(gfx.node, 'touchstart', listener);
24927             }
24928
24929             function __createResizer(gfx, x, y, rotation, direction) {
24930
24931                 var group = gfx.group().addClass(CLS_RESIZER).addClass(CLS_RESIZER + '-' + direction);
24932
24933                 var origin = -HANDLE_SIZE + HANDLE_OFFSET;
24934
24935                 // Create four drag indicators on the outline
24936                 group.rect(origin, origin, HANDLE_SIZE, HANDLE_SIZE).addClass(CLS_RESIZER + '-visual');
24937                 group.rect(origin, origin, HANDLE_HIT_SIZE, HANDLE_HIT_SIZE).addClass(CLS_RESIZER + '-hit');
24938
24939                 var matrix = new Snap.Matrix().translate(x, y).rotate(rotation, 0, 0);
24940                 group.transform(matrix);
24941
24942                 return group;
24943             }
24944
24945             function createResizer(element, gfx, direction) {
24946
24947                 var resizer;
24948
24949                 if (direction === 'nw') {
24950                     resizer = __createResizer(gfx, 0, 0, 0, direction);
24951                 } else if (direction === 'ne') {
24952                     resizer = __createResizer(gfx, element.width, 0, 90, direction);
24953                 } else if (direction === 'se') {
24954                     resizer = __createResizer(gfx, element.width, element.height, 180, direction);
24955                 } else {
24956                     resizer = __createResizer(gfx, 0, element.height, 270, direction);
24957                 }
24958
24959                 makeDraggable(element, resizer, direction);
24960             }
24961
24962             // resize handles implementation ///////////////////////////////
24963
24964             function addResize(shape) {
24965
24966                 if (!canResize({
24967                         shape: shape
24968                     })) {
24969                     return;
24970                 }
24971
24972                 var gfx = elementRegistry.getGraphics(shape);
24973
24974                 createResizer(shape, gfx, 'nw');
24975                 createResizer(shape, gfx, 'ne');
24976                 createResizer(shape, gfx, 'se');
24977                 createResizer(shape, gfx, 'sw');
24978             }
24979
24980             function removeResize(shape) {
24981
24982                 var gfx = elementRegistry.getGraphics(shape);
24983                 var resizers = gfx.selectAll('.' + CLS_RESIZER);
24984
24985                 forEach(resizers, function(resizer) {
24986                     resizer.remove();
24987                 });
24988             }
24989
24990             eventBus.on('selection.changed', function(e) {
24991
24992                 var oldSelection = e.oldSelection,
24993                     newSelection = e.newSelection;
24994
24995                 // remove old selection markers
24996                 forEach(oldSelection, removeResize);
24997
24998                 // add new selection markers ONLY if single selection
24999                 if (newSelection.length === 1) {
25000                     forEach(newSelection, addResize);
25001                 }
25002             });
25003
25004             eventBus.on('shape.changed', function(e) {
25005                 var shape = e.element;
25006
25007                 removeResize(shape);
25008
25009                 if (selection.isSelected(shape)) {
25010                     addResize(shape);
25011                 }
25012             });
25013
25014
25015             // API
25016
25017             this.activate = activate;
25018         }
25019
25020         Resize.$inject = ['eventBus', 'elementRegistry', 'rules', 'modeling', 'canvas', 'selection', 'dragging'];
25021
25022         module.exports = Resize;
25023
25024     }, {
25025         "../../../vendor/snapsvg": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\vendor\\snapsvg.js",
25026         "../../util/Elements": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Elements.js",
25027         "../../util/Mouse": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Mouse.js",
25028         "./ResizeUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\resize\\ResizeUtil.js",
25029         "lodash/collection/filter": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\filter.js",
25030         "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
25031         "lodash/object/pick": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\pick.js",
25032         "min-dom/lib/event": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\event.js"
25033     }],
25034     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\resize\\ResizeUtil.js": [function(require, module, exports) {
25035         'use strict';
25036
25037         /**
25038          * Resize the given bounds by the specified delta from a given anchor point.
25039          * 
25040          * @param {Bounds}
25041          *            bounds the bounding box that should be resized
25042          * @param {String}
25043          *            direction in which the element is resized (nw, ne, se, sw)
25044          * @param {Point}
25045          *            delta of the resize operation
25046          * 
25047          * @return {Bounds} resized bounding box
25048          */
25049         module.exports.resizeBounds = function(bounds, direction, delta) {
25050
25051             var dx = delta.x,
25052                 dy = delta.y;
25053
25054             switch (direction) {
25055
25056                 case 'nw':
25057                     return {
25058                         x: bounds.x + dx,
25059                         y: bounds.y + dy,
25060                         width: bounds.width - dx,
25061                         height: bounds.height - dy
25062                     };
25063
25064                 case 'sw':
25065                     return {
25066                         x: bounds.x + dx,
25067                         y: bounds.y,
25068                         width: bounds.width - dx,
25069                         height: bounds.height + dy
25070                     };
25071
25072                 case 'ne':
25073                     return {
25074                         x: bounds.x,
25075                         y: bounds.y + dy,
25076                         width: bounds.width + dx,
25077                         height: bounds.height - dy
25078                     };
25079
25080                 case 'se':
25081                     return {
25082                         x: bounds.x,
25083                         y: bounds.y,
25084                         width: bounds.width + dx,
25085                         height: bounds.height + dy
25086                     };
25087
25088                 default:
25089                     throw new Error('unrecognized direction: ' + direction);
25090             }
25091         };
25092
25093         module.exports.reattachPoint = function(bounds, newBounds, point) {
25094
25095             var sx = bounds.width / newBounds.width,
25096                 sy = bounds.height / newBounds.height;
25097
25098             return {
25099                 x: Math.round((newBounds.x + newBounds.width / 2)) - Math.floor(((bounds.x + bounds.width / 2) - point.x) / sx),
25100                 y: Math.round((newBounds.y + newBounds.height / 2)) - Math.floor(((bounds.y + bounds.height / 2) - point.y) / sy)
25101             };
25102         };
25103
25104
25105         module.exports.ensureMinBounds = function(currentBounds, minBounds) {
25106             var topLeft = {
25107                 x: Math.min(currentBounds.x, minBounds.x),
25108                 y: Math.min(currentBounds.y, minBounds.y)
25109             };
25110
25111             var bottomRight = {
25112                 x: Math.max(currentBounds.x + currentBounds.width, minBounds.x + minBounds.width),
25113                 y: Math.max(currentBounds.y + currentBounds.height, minBounds.y + minBounds.height)
25114             };
25115
25116             return {
25117                 x: topLeft.x,
25118                 y: topLeft.y,
25119                 width: bottomRight.x - topLeft.x,
25120                 height: bottomRight.y - topLeft.y
25121             };
25122         };
25123
25124
25125         module.exports.getMinResizeBounds = function(direction, currentBounds, minDimensions) {
25126
25127             switch (direction) {
25128                 case 'nw':
25129                     return {
25130                         x: currentBounds.x + currentBounds.width - minDimensions.width,
25131                         y: currentBounds.y + currentBounds.height - minDimensions.height,
25132                         width: minDimensions.width,
25133                         height: minDimensions.height
25134                     };
25135                 case 'sw':
25136                     return {
25137                         x: currentBounds.x + currentBounds.width - minDimensions.width,
25138                         y: currentBounds.y,
25139                         width: minDimensions.width,
25140                         height: minDimensions.height
25141                     };
25142                 case 'ne':
25143                     return {
25144                         x: currentBounds.x,
25145                         y: currentBounds.y + currentBounds.height - minDimensions.height,
25146                         width: minDimensions.width,
25147                         height: minDimensions.height
25148                     };
25149                 case 'se':
25150                     return {
25151                         x: currentBounds.x,
25152                         y: currentBounds.y,
25153                         width: minDimensions.width,
25154                         height: minDimensions.height
25155                     };
25156                 default:
25157                     throw new Error('unrecognized direction: ' + direction);
25158             }
25159         };
25160
25161
25162
25163     }, {}],
25164     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\resize\\index.js": [function(require, module, exports) {
25165         module.exports = {
25166             __depends__: [
25167                 require('../modeling'),
25168                 require('../rules'),
25169                 require('../dragging')
25170             ],
25171             __init__: ['resize'],
25172             resize: ['type', require('./Resize')]
25173         };
25174
25175     }, {
25176         "../dragging": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\dragging\\index.js",
25177         "../modeling": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\index.js",
25178         "../rules": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\rules\\index.js",
25179         "./Resize": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\resize\\Resize.js"
25180     }],
25181     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\rules\\RuleProvider.js": [function(require, module, exports) {
25182         'use strict';
25183
25184         var inherits = require('inherits');
25185
25186         var CommandInterceptor = require('../../command/CommandInterceptor');
25187
25188         /**
25189          * A basic provider that may be extended to implement modeling rules.
25190          * 
25191          * Extensions should implement the init method to actually add their custom
25192          * modeling checks. Checks may be added via the #addRule(action, fn) method.
25193          * 
25194          * @param {EventBus}
25195          *            eventBus
25196          */
25197         function RuleProvider(eventBus) {
25198             CommandInterceptor.call(this, eventBus);
25199
25200             this.init();
25201         }
25202
25203         RuleProvider.$inject = ['eventBus'];
25204
25205         inherits(RuleProvider, CommandInterceptor);
25206
25207         module.exports = RuleProvider;
25208
25209
25210         /**
25211          * Adds a modeling rule for the given action, implemented through a callback
25212          * function.
25213          * 
25214          * The function will receive the modeling specific action context to perform its
25215          * check. It must return false or null to disallow the action from happening.
25216          * 
25217          * Returning <code>null</code> may encode simply ignoring the action.
25218          * 
25219          * @example
25220          * 
25221          * ResizableRules.prototype.init = function() {
25222          * 
25223          * this.addRule('shape.resize', function(context) {
25224          * 
25225          * var shape = context.shape;
25226          * 
25227          * if (!context.newBounds) { // check general resizability if (!shape.resizable) {
25228          * return false; } } else { // element must have minimum size of 10*10 points
25229          * return context.newBounds.width > 10 && context.newBounds.height > 10; } }); };
25230          * 
25231          * @param {String|Array
25232          *            <String>} actions the identifier for the modeling action to check
25233          * @param {Function}
25234          *            fn the callback function that performs the actual check
25235          */
25236         RuleProvider.prototype.addRule = function(actions, fn) {
25237
25238             var self = this;
25239
25240             if (typeof actions === 'string') {
25241                 actions = [actions];
25242             }
25243
25244             actions.forEach(function(action) {
25245
25246                 self.canExecute(action, function(context, action, event) {
25247                     return fn(context);
25248                 }, true);
25249             });
25250         };
25251     }, {
25252         "../../command/CommandInterceptor": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\command\\CommandInterceptor.js",
25253         "inherits": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\inherits\\inherits_browser.js"
25254     }],
25255     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\rules\\Rules.js": [function(require, module, exports) {
25256         'use strict';
25257
25258         /**
25259          * A service that provides rules for certain diagram actions.
25260          * 
25261          * @param {CommandStack}
25262          *            commandStack
25263          */
25264         function Rules(commandStack) {
25265             this._commandStack = commandStack;
25266         }
25267
25268         Rules.$inject = ['commandStack'];
25269
25270         module.exports = Rules;
25271
25272
25273         /**
25274          * This method can be queried to ask whether certain modeling actions are
25275          * allowed or not.
25276          * 
25277          * @param {String}
25278          *            action the action to be checked
25279          * @param {Object}
25280          *            [context] the context to check the action in
25281          * 
25282          * @return {Boolean} returns true, false or null depending on whether the
25283          *         operation is allowed, not allowed or should be ignored.
25284          */
25285         Rules.prototype.allowed = function(action, context) {
25286             var allowed = this._commandStack.canExecute(action, context);
25287
25288             // map undefined to true, i.e. no rules
25289             return allowed === undefined ? true : allowed;
25290         };
25291     }, {}],
25292     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\rules\\index.js": [function(require, module, exports) {
25293         module.exports = {
25294             __depends__: [require('../../command')],
25295             __init__: ['rules'],
25296             rules: ['type', require('./Rules')]
25297         };
25298
25299     }, {
25300         "../../command": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\command\\index.js",
25301         "./Rules": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\rules\\Rules.js"
25302     }],
25303     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\selection\\Selection.js": [function(require, module, exports) {
25304         'use strict';
25305
25306         var isArray = require('lodash/lang/isArray'),
25307             forEach = require('lodash/collection/forEach');
25308
25309
25310         /**
25311          * A service that offers the current selection in a diagram. Offers the api to
25312          * control the selection, too.
25313          * 
25314          * @class
25315          * 
25316          * @param {EventBus}
25317          *            eventBus the event bus
25318          */
25319         function Selection(eventBus) {
25320
25321             this._eventBus = eventBus;
25322
25323             this._selectedElements = [];
25324
25325             var self = this;
25326
25327             eventBus.on(['shape.remove', 'connection.remove'], function(e) {
25328                 var element = e.element;
25329                 self.deselect(element);
25330             });
25331         }
25332
25333         Selection.$inject = ['eventBus'];
25334
25335         module.exports = Selection;
25336
25337
25338         Selection.prototype.deselect = function(element) {
25339             var selectedElements = this._selectedElements;
25340
25341             var idx = selectedElements.indexOf(element);
25342
25343             if (idx !== -1) {
25344                 var oldSelection = selectedElements.slice();
25345
25346                 selectedElements.splice(idx, 1);
25347
25348                 this._eventBus.fire('selection.changed', {
25349                     oldSelection: oldSelection,
25350                     newSelection: selectedElements
25351                 });
25352             }
25353         };
25354
25355
25356         Selection.prototype.get = function() {
25357             return this._selectedElements;
25358         };
25359
25360         Selection.prototype.isSelected = function(element) {
25361             return this._selectedElements.indexOf(element) !== -1;
25362         };
25363
25364
25365         /**
25366          * This method selects one or more elements on the diagram.
25367          * 
25368          * By passing an additional add parameter you can decide whether or not the
25369          * element(s) should be added to the already existing selection or not.
25370          * 
25371          * @method Selection#select
25372          * 
25373          * @param {Object|Object[]}
25374          *            elements element or array of elements to be selected
25375          * @param {boolean}
25376          *            [add] whether the element(s) should be appended to the current
25377          *            selection, defaults to false
25378          */
25379         Selection.prototype.select = function(elements, add) {
25380             var selectedElements = this._selectedElements,
25381                 oldSelection = selectedElements.slice();
25382
25383             if (!isArray(elements)) {
25384                 elements = elements ? [elements] : [];
25385             }
25386
25387             // selection may be cleared by passing an empty array or null
25388             // to the method
25389             if (add) {
25390                 forEach(elements, function(element) {
25391                     if (selectedElements.indexOf(element) !== -1) {
25392                         // already selected
25393                         return;
25394                     } else {
25395                         selectedElements.push(element);
25396                     }
25397                 });
25398             } else {
25399                 this._selectedElements = selectedElements = elements.slice();
25400             }
25401             this._eventBus.fire('selection.changed', {
25402                 oldSelection: oldSelection,
25403                 newSelection: selectedElements
25404             });
25405         };
25406
25407     }, {
25408         "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
25409         "lodash/lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js"
25410     }],
25411     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\selection\\SelectionBehavior.js": [function(require, module, exports) {
25412         'use strict';
25413
25414         var hasPrimaryModifier = require('../../util/Mouse').hasPrimaryModifier;
25415
25416
25417         function SelectionBehavior(eventBus, selection, canvas) {
25418
25419             eventBus.on('create.end', 500, function(e) {
25420                 if (e.context.canExecute) {
25421                     selection.select(e.shape);
25422                 }
25423             });
25424
25425             eventBus.on('connect.end', 500, function(e) {
25426                 if (e.context.canExecute && e.context.target) {
25427                     selection.select(e.context.target);
25428                 }
25429             });
25430
25431             eventBus.on('shape.move.end', 500, function(e) {
25432                 selection.select(e.context.shapes);
25433             });
25434
25435             eventBus.on('element.keydown', function(event) {
25436                 alert("Key Down Elements ");
25437             });
25438             // Shift + click selection
25439             eventBus.on('element.click', function(event) {
25440
25441                 var element = event.element;
25442
25443                 // do not select the root element
25444                 // or connections
25445                 if (element === canvas.getRootElement()) {
25446                     element = null;
25447                 }
25448
25449                 var isSelected = selection.isSelected(element),
25450                     isMultiSelect = selection.get().length > 1;
25451
25452                 // mouse-event: SELECTION_KEY
25453                 var add = hasPrimaryModifier(event);
25454
25455                 // select OR deselect element in multi selection
25456                 if (isSelected && isMultiSelect) {
25457                     if (add) {
25458                         return selection.deselect(element);
25459                     } else {
25460                         return selection.select(element);
25461                     }
25462                 } else
25463                 if (!isSelected) {
25464                     selection.select(element, add);
25465                 } else {
25466                     selection.deselect(element);
25467                 }
25468             });
25469
25470         }
25471
25472         SelectionBehavior.$inject = ['eventBus', 'selection', 'canvas'];
25473
25474         module.exports = SelectionBehavior;
25475
25476     }, {
25477         "../../util/Mouse": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Mouse.js"
25478     }],
25479     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\selection\\SelectionVisuals.js": [function(require, module, exports) {
25480         'use strict';
25481
25482         var forEach = require('lodash/collection/forEach');
25483
25484         var MARKER_HOVER = 'hover',
25485             MARKER_SELECTED = 'selected';
25486
25487
25488         /**
25489          * A plugin that adds a visible selection UI to shapes and connections by
25490          * appending the <code>hover</code> and <code>selected</code> classes to
25491          * them.
25492          * 
25493          * @class
25494          * 
25495          * Makes elements selectable, too.
25496          * 
25497          * @param {EventBus}
25498          *            events
25499          * @param {SelectionService}
25500          *            selection
25501          * @param {Canvas}
25502          *            canvas
25503          */
25504         function SelectionVisuals(events, canvas, selection, graphicsFactory, styles) {
25505
25506             this._multiSelectionBox = null;
25507
25508             function addMarker(e, cls) {
25509                 canvas.addMarker(e, cls);
25510             }
25511
25512             function removeMarker(e, cls) {
25513                 canvas.removeMarker(e, cls);
25514             }
25515
25516             events.on('element.hover', function(event) {
25517                 addMarker(event.element, MARKER_HOVER);
25518             });
25519
25520             events.on('element.out', function(event) {
25521                 removeMarker(event.element, MARKER_HOVER);
25522             });
25523
25524             events.on('selection.changed', function(event) {
25525
25526                 function deselect(s) {
25527                     removeMarker(s, MARKER_SELECTED);
25528                 }
25529
25530                 function select(s) {
25531                     addMarker(s, MARKER_SELECTED);
25532                 }
25533
25534                 var oldSelection = event.oldSelection,
25535                     newSelection = event.newSelection;
25536
25537                 forEach(oldSelection, function(e) {
25538                     if (newSelection.indexOf(e) === -1) {
25539                         deselect(e);
25540                     }
25541                 });
25542
25543                 forEach(newSelection, function(e) {
25544                     if (oldSelection.indexOf(e) === -1) {
25545                         select(e);
25546                     }
25547                 });
25548             });
25549         }
25550
25551         SelectionVisuals.$inject = [
25552             'eventBus',
25553             'canvas',
25554             'selection',
25555             'graphicsFactory',
25556             'styles'
25557         ];
25558
25559         module.exports = SelectionVisuals;
25560
25561     }, {
25562         "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js"
25563     }],
25564     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\selection\\index.js": [function(require, module, exports) {
25565         module.exports = {
25566             __init__: ['selectionVisuals', 'selectionBehavior'],
25567             __depends__: [
25568                 require('../interaction-events'),
25569                 require('../outline')
25570             ],
25571             selection: ['type', require('./Selection')],
25572             selectionVisuals: ['type', require('./SelectionVisuals')],
25573             selectionBehavior: ['type', require('./SelectionBehavior')]
25574         };
25575
25576     }, {
25577         "../interaction-events": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\interaction-events\\index.js",
25578         "../outline": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\outline\\index.js",
25579         "./Selection": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\selection\\Selection.js",
25580         "./SelectionBehavior": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\selection\\SelectionBehavior.js",
25581         "./SelectionVisuals": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\selection\\SelectionVisuals.js"
25582     }],
25583     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\snapping\\SnapContext.js": [function(require, module, exports) {
25584         'use strict';
25585
25586         var forEach = require('lodash/collection/forEach');
25587
25588         var snapTo = require('./SnapUtil').snapTo;
25589
25590
25591         /**
25592          * A snap context, containing the (possibly incomplete) mappings of drop targets
25593          * (to identify the snapping) to computed snap points.
25594          */
25595         function SnapContext() {
25596
25597             /**
25598              * Map<String, SnapPoints> mapping drop targets to a list of possible
25599              * snappings.
25600              * 
25601              * @type {Object}
25602              */
25603             this._targets = {};
25604
25605             /**
25606              * Map<String, Point> initial positioning of element regarding various snap
25607              * directions.
25608              * 
25609              * @type {Object}
25610              */
25611             this._snapOrigins = {};
25612
25613             /**
25614              * List of snap locations
25615              * 
25616              * @type {Array<String>}
25617              */
25618             this._snapLocations = [];
25619
25620             /**
25621              * Map<String, Array<Point>> of default snapping locations
25622              * 
25623              * @type {Object}
25624              */
25625             this._defaultSnaps = {};
25626         }
25627
25628
25629         SnapContext.prototype.getSnapOrigin = function(snapLocation) {
25630             return this._snapOrigins[snapLocation];
25631         };
25632
25633
25634         SnapContext.prototype.setSnapOrigin = function(snapLocation, initialValue) {
25635             this._snapOrigins[snapLocation] = initialValue;
25636
25637             if (this._snapLocations.indexOf(snapLocation) === -1) {
25638                 this._snapLocations.push(snapLocation);
25639             }
25640         };
25641
25642
25643         SnapContext.prototype.addDefaultSnap = function(type, point) {
25644
25645             var snapValues = this._defaultSnaps[type];
25646
25647             if (!snapValues) {
25648                 snapValues = this._defaultSnaps[type] = [];
25649             }
25650
25651             snapValues.push(point);
25652         };
25653
25654         /**
25655          * Return a number of initialized snaps, i.e. snap locations such as top-left,
25656          * mid, bottom-right and so forth.
25657          * 
25658          * @return {Array<String>} snapLocations
25659          */
25660         SnapContext.prototype.getSnapLocations = function() {
25661             return this._snapLocations;
25662         };
25663
25664         /**
25665          * Set the snap locations for this context.
25666          * 
25667          * The order of locations determines precedence.
25668          * 
25669          * @param {Array
25670          *            <String>} snapLocations
25671          */
25672         SnapContext.prototype.setSnapLocations = function(snapLocations) {
25673             this._snapLocations = snapLocations;
25674         };
25675
25676         /**
25677          * Get snap points for a given target
25678          * 
25679          * @param {Element|String}
25680          *            target
25681          */
25682         SnapContext.prototype.pointsForTarget = function(target) {
25683
25684             var targetId = target.id || target;
25685
25686             var snapPoints = this._targets[targetId];
25687
25688             if (!snapPoints) {
25689                 snapPoints = this._targets[targetId] = new SnapPoints();
25690                 snapPoints.initDefaults(this._defaultSnaps);
25691             }
25692
25693             return snapPoints;
25694         };
25695
25696         module.exports = SnapContext;
25697
25698
25699         /**
25700          * Creates the snap points and initializes them with the given default values.
25701          * 
25702          * @param {Object
25703          *            <String, Array<Point>>} [defaultPoints]
25704          */
25705         function SnapPoints(defaultSnaps) {
25706
25707             /**
25708              * Map<String, Map<(x|y), Array<Number>>> mapping snap locations, i.e.
25709              * top-left, bottom-right, center to actual snap values.
25710              * 
25711              * @type {Object}
25712              */
25713             this._snapValues = {};
25714         }
25715
25716         SnapPoints.prototype.add = function(snapLocation, point) {
25717
25718             var snapValues = this._snapValues[snapLocation];
25719
25720             if (!snapValues) {
25721                 snapValues = this._snapValues[snapLocation] = {
25722                     x: [],
25723                     y: []
25724                 };
25725             }
25726
25727             if (snapValues.x.indexOf(point.x) === -1) {
25728                 snapValues.x.push(point.x);
25729             }
25730
25731             if (snapValues.y.indexOf(point.y) === -1) {
25732                 snapValues.y.push(point.y);
25733             }
25734         };
25735
25736
25737         SnapPoints.prototype.snap = function(point, snapLocation, axis, tolerance) {
25738             var snappingValues = this._snapValues[snapLocation];
25739
25740             return snappingValues && snapTo(point[axis], snappingValues[axis], tolerance);
25741         };
25742
25743         /**
25744          * Initialize a number of default snapping points.
25745          * 
25746          * @param {Object}
25747          *            defaultSnaps
25748          */
25749         SnapPoints.prototype.initDefaults = function(defaultSnaps) {
25750
25751             var self = this;
25752
25753             forEach(defaultSnaps || {}, function(snapPoints, snapLocation) {
25754                 forEach(snapPoints, function(point) {
25755                     self.add(snapLocation, point);
25756                 });
25757             });
25758         };
25759     }, {
25760         "./SnapUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\snapping\\SnapUtil.js",
25761         "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js"
25762     }],
25763     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\snapping\\SnapUtil.js": [function(require, module, exports) {
25764         'use strict';
25765
25766         var abs = Math.abs,
25767             round = Math.round;
25768
25769
25770         /**
25771          * Snap value to a collection of reference values.
25772          * 
25773          * @param {Number}
25774          *            value
25775          * @param {Array
25776          *            <Number>} values
25777          * @param {Number}
25778          *            [tolerance=10]
25779          * 
25780          * @return {Number} the value we snapped to or null, if none snapped
25781          */
25782         function snapTo(value, values, tolerance) {
25783             tolerance = tolerance === undefined ? 10 : tolerance;
25784
25785             var idx, snapValue;
25786
25787             for (idx = 0; idx < values.length; idx++) {
25788                 snapValue = values[idx];
25789
25790                 if (abs(snapValue - value) <= tolerance) {
25791                     return snapValue;
25792                 }
25793             }
25794         }
25795
25796
25797         module.exports.snapTo = snapTo;
25798
25799
25800         function topLeft(bounds) {
25801             return {
25802                 x: bounds.x,
25803                 y: bounds.y
25804             };
25805         }
25806
25807         module.exports.topLeft = topLeft;
25808
25809
25810         function mid(bounds, defaultValue) {
25811
25812             if (!bounds || isNaN(bounds.x) || isNaN(bounds.y)) {
25813                 return defaultValue;
25814             }
25815
25816             return {
25817                 x: round(bounds.x + bounds.width / 2),
25818                 y: round(bounds.y + bounds.height / 2)
25819             };
25820         }
25821
25822         module.exports.mid = mid;
25823
25824
25825         function bottomRight(bounds) {
25826             return {
25827                 x: bounds.x + bounds.width,
25828                 y: bounds.y + bounds.height
25829             };
25830         }
25831
25832         module.exports.bottomRight = bottomRight;
25833     }, {}],
25834     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\snapping\\Snapping.js": [function(require, module, exports) {
25835         'use strict';
25836
25837         var filter = require('lodash/collection/filter'),
25838             forEach = require('lodash/collection/forEach'),
25839             debounce = require('lodash/function/debounce');
25840
25841
25842         var mid = require('./SnapUtil').mid;
25843
25844         var SnapContext = require('./SnapContext');
25845
25846         /**
25847          * A general purpose snapping component for diagram elements.
25848          * 
25849          * @param {EventBus}
25850          *            eventBus
25851          * @param {Canvas}
25852          *            canvas
25853          */
25854         function Snapping(eventBus, canvas) {
25855
25856             this._canvas = canvas;
25857
25858             var self = this;
25859
25860             eventBus.on(['shape.move.start', 'create.start'], function(event) {
25861                 self.initSnap(event);
25862             });
25863
25864             eventBus.on(['shape.move.move', 'shape.move.end', 'create.move', 'create.end'], function(event) {
25865                 if (event.snapped) {
25866                     return;
25867                 }
25868
25869                 self.snap(event);
25870             });
25871
25872             eventBus.on(['shape.move.cleanup', 'create.cleanup'], function(event) {
25873                 self.hide();
25874             });
25875
25876             // delay hide by 1000 seconds since last match
25877             this._asyncHide = debounce(this.hide, 1000);
25878         }
25879
25880         Snapping.$inject = ['eventBus', 'canvas'];
25881
25882         module.exports = Snapping;
25883
25884
25885         Snapping.prototype.initSnap = function(event) {
25886
25887             var context = event.context,
25888                 shape = context.shape,
25889                 snapContext = context.snapContext;
25890
25891             if (!snapContext) {
25892                 snapContext = context.snapContext = new SnapContext();
25893             }
25894
25895             var snapMid = mid(shape, event);
25896
25897             snapContext.setSnapOrigin('mid', {
25898                 x: snapMid.x - event.x,
25899                 y: snapMid.y - event.y
25900             });
25901
25902             return snapContext;
25903         };
25904
25905
25906         Snapping.prototype.snap = function(event) {
25907
25908             var context = event.context,
25909                 snapContext = context.snapContext,
25910                 shape = context.shape,
25911                 target = context.target,
25912                 snapLocations = snapContext.getSnapLocations();
25913
25914             if (!target) {
25915                 return;
25916             }
25917
25918             var snapPoints = snapContext.pointsForTarget(target);
25919
25920             if (!snapPoints.initialized) {
25921                 this.addTargetSnaps(snapPoints, shape, target);
25922
25923                 snapPoints.initialized = true;
25924             }
25925
25926
25927             var snapping = {};
25928
25929             forEach(snapLocations, function(location) {
25930
25931                 var snapOrigin = snapContext.getSnapOrigin(location);
25932
25933                 var snapCurrent = {
25934                     x: event.x + snapOrigin.x,
25935                     y: event.y + snapOrigin.y
25936                 };
25937
25938                 // snap on both axis, if not snapped already
25939                 forEach(['x', 'y'], function(axis) {
25940                     var locationSnapping;
25941
25942                     if (!snapping[axis]) {
25943                         locationSnapping = snapPoints.snap(snapCurrent, location, axis, 7);
25944
25945                         if (locationSnapping !== undefined) {
25946                             snapping[axis] = {
25947                                 value: locationSnapping,
25948                                 originValue: locationSnapping - snapOrigin[axis]
25949                             };
25950                         }
25951                     }
25952                 });
25953
25954                 // no more need to snap, drop out of interation
25955                 if (snapping.x && snapping.y) {
25956                     return false;
25957                 }
25958             });
25959
25960
25961             // show snap visuals
25962
25963             this.showSnapLine('vertical', snapping.x && snapping.x.value);
25964             this.showSnapLine('horizontal', snapping.y && snapping.y.value);
25965
25966
25967             // adjust event { x, y, dx, dy } and mark as snapping
25968             var cx, cy;
25969
25970             if (snapping.x) {
25971
25972                 cx = event.x - snapping.x.originValue;
25973
25974                 event.x = snapping.x.originValue;
25975                 event.dx = event.dx - cx;
25976
25977                 event.snapped = true;
25978             }
25979
25980             if (snapping.y) {
25981                 cy = event.y - snapping.y.originValue;
25982
25983                 event.y = snapping.y.originValue;
25984                 event.dy = event.dy - cy;
25985
25986                 event.snapped = true;
25987             }
25988         };
25989
25990
25991         Snapping.prototype._createLine = function(orientation) {
25992
25993             var root = this._canvas.getLayer('snap');
25994
25995             var line = root.path('M0,0 L0,0').addClass('djs-snap-line');
25996
25997             return {
25998                 update: function(position) {
25999
26000                     if (position === undefined) {
26001                         line.attr({
26002                             display: 'none'
26003                         });
26004                     } else {
26005                         if (orientation === 'horizontal') {
26006                             line.attr({
26007                                 path: 'M-100000,' + position + ' L+100000,' + position,
26008                                 display: ''
26009                             });
26010                         } else {
26011                             line.attr({
26012                                 path: 'M ' + position + ',-100000 L ' + position + ', +100000',
26013                                 display: ''
26014                             });
26015                         }
26016                     }
26017                 }
26018             };
26019         };
26020
26021
26022         Snapping.prototype._createSnapLines = function() {
26023
26024             this._snapLines = {
26025                 horizontal: this._createLine('horizontal'),
26026                 vertical: this._createLine('vertical')
26027             };
26028         };
26029
26030         Snapping.prototype.showSnapLine = function(orientation, position) {
26031
26032             var line = this.getSnapLine(orientation);
26033
26034             if (line) {
26035                 line.update(position);
26036             }
26037
26038             this._asyncHide();
26039         };
26040
26041         Snapping.prototype.getSnapLine = function(orientation) {
26042             if (!this._snapLines) {
26043                 this._createSnapLines();
26044             }
26045
26046             return this._snapLines[orientation];
26047         };
26048
26049         Snapping.prototype.hide = function() {
26050             forEach(this._snapLines, function(l) {
26051                 l.update();
26052             });
26053         };
26054
26055         Snapping.prototype.addTargetSnaps = function(snapPoints, shape, target) {
26056
26057             var siblings = this.getSiblings(shape, target);
26058
26059             forEach(siblings, function(s) {
26060                 snapPoints.add('mid', mid(s));
26061             });
26062
26063         };
26064
26065         Snapping.prototype.getSiblings = function(element, target) {
26066
26067             // snap to all non connection siblings
26068             return target && filter(target.children, function(e) {
26069                 return !e.hidden && !e.labelTarget && !e.waypoints && e !== element;
26070             });
26071         };
26072     }, {
26073         "./SnapContext": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\snapping\\SnapContext.js",
26074         "./SnapUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\snapping\\SnapUtil.js",
26075         "lodash/collection/filter": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\filter.js",
26076         "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
26077         "lodash/function/debounce": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\function\\debounce.js"
26078     }],
26079     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\space-tool\\SpaceTool.js": [function(require, module, exports) {
26080         'use strict';
26081
26082         var SpaceUtil = require('./SpaceUtil');
26083
26084         var Cursor = require('../../util/Cursor');
26085
26086         var hasPrimaryModifier = require('../../util/Mouse').hasPrimaryModifier;
26087
26088         var abs = Math.abs,
26089             round = Math.round;
26090
26091         var HIGH_PRIORITY = 1500;
26092
26093         /**
26094          * A tool that allows users to create and remove space in a diagram.
26095          * 
26096          * The tool needs to be activated manually via
26097          * {@link SpaceTool#activate(MouseEvent)}.
26098          */
26099         function SpaceTool(eventBus, dragging, elementRegistry, modeling, rules) {
26100
26101             function canResize(shape) {
26102                 var ctx = {
26103                     shape: shape
26104                 };
26105                 return rules.allowed('shape.resize', ctx);
26106             }
26107
26108             function activateSelection(event, autoActivate) {
26109                 dragging.activate(event, 'spaceTool.selection', {
26110                     cursor: 'crosshair',
26111                     autoActivate: autoActivate,
26112                     data: {
26113                         context: {
26114                             crosshair: {}
26115                         }
26116                     }
26117                 });
26118             }
26119
26120             function activateMakeSpace(event) {
26121                 dragging.activate(event, 'spaceTool', {
26122                     autoActivate: true,
26123                     cursor: 'crosshair',
26124                     data: {
26125                         context: {}
26126                     }
26127                 });
26128             }
26129
26130
26131             eventBus.on('spaceTool.selection.end', function(event) {
26132                 setTimeout(function() {
26133                     activateMakeSpace(event.originalEvent);
26134                 });
26135             });
26136
26137
26138             var AXIS_TO_DIMENSION = {
26139                     x: 'width',
26140                     y: 'height'
26141                 },
26142                 AXIS_INVERTED = {
26143                     x: 'y',
26144                     y: 'x'
26145                 };
26146
26147
26148             function initializeMakeSpace(event, context) {
26149
26150                 var axis = abs(event.dx) > abs(event.dy) ? 'x' : 'y',
26151                     offset = event['d' + axis],
26152                     // start point of create space operation
26153                     spacePos = event[axis] - offset,
26154                     // list of moving shapes
26155                     movingShapes = [],
26156                     // list of resizing shapes
26157                     resizingShapes = [];
26158
26159                 if (abs(offset) < 5) {
26160                     return false;
26161                 }
26162
26163                 // inverts the offset to choose the shapes
26164                 // on the opposite side of the resizer if
26165                 // a key modifier is pressed
26166                 if (hasPrimaryModifier(event)) {
26167                     offset *= -1;
26168                 }
26169
26170                 // collect all elements that need to be moved _AND_
26171                 // resized given on the initial create space position
26172                 elementRegistry.forEach(function(shape) {
26173                     var shapeStart = shape[[axis]],
26174                         shapeEnd = shapeStart + shape[AXIS_TO_DIMENSION[axis]];
26175
26176                     // checking if it's root
26177                     if (!shape.parent) {
26178                         return;
26179                     }
26180
26181                     // checking if it's a shape
26182                     if (shape.waypoints) {
26183                         return;
26184                     }
26185
26186                     // shape after spacePos
26187                     if (offset > 0 && shapeStart > spacePos) {
26188                         return movingShapes.push(shape);
26189                     }
26190
26191                     // shape before spacePos
26192                     if (offset < 0 && shapeEnd < spacePos) {
26193                         return movingShapes.push(shape);
26194                     }
26195
26196                     // shape on top of spacePos, resize only if allowed
26197                     if (shapeStart < spacePos && shapeEnd > spacePos && canResize(shape)) {
26198                         return resizingShapes.push(shape);
26199                     }
26200                 });
26201
26202                 // store data in context
26203                 context.axis = axis;
26204                 context.direction = SpaceUtil.getDirection(axis, offset);
26205                 context.movingShapes = movingShapes;
26206                 context.resizingShapes = resizingShapes;
26207
26208                 Cursor.set('resize-' + (axis === 'x' ? 'ew' : 'ns'));
26209
26210                 return true;
26211             }
26212
26213
26214             eventBus.on('spaceTool.move', HIGH_PRIORITY, function(event) {
26215
26216                 var context = event.context;
26217
26218                 if (!context.initialized) {
26219                     context.initialized = initializeMakeSpace(event, context);
26220                 }
26221             });
26222
26223
26224             eventBus.on('spaceTool.end', function(event) {
26225
26226                 var context = event.context,
26227                     axis = context.axis,
26228                     direction = context.direction,
26229                     movingShapes = context.movingShapes,
26230                     resizingShapes = context.resizingShapes;
26231
26232                 // skip if create space has not been initialized yet
26233                 if (!context.initialized) {
26234                     return;
26235                 }
26236
26237                 var delta = {
26238                     x: round(event.dx),
26239                     y: round(event.dy)
26240                 };
26241                 delta[AXIS_INVERTED[axis]] = 0;
26242
26243                 return modeling.createSpace(movingShapes, resizingShapes, delta, direction);
26244             });
26245
26246             // API
26247             this.activateSelection = activateSelection;
26248             this.activateMakeSpace = activateMakeSpace;
26249         }
26250
26251         SpaceTool.$inject = ['eventBus', 'dragging', 'elementRegistry', 'modeling', 'rules'];
26252
26253         module.exports = SpaceTool;
26254
26255     }, {
26256         "../../util/Cursor": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Cursor.js",
26257         "../../util/Mouse": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Mouse.js",
26258         "./SpaceUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\space-tool\\SpaceUtil.js"
26259     }],
26260     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\space-tool\\SpaceToolVisuals.js": [function(require, module, exports) {
26261         'use strict';
26262
26263         var forEach = require('lodash/collection/forEach');
26264
26265
26266         var MARKER_DRAGGING = 'djs-dragging';
26267
26268
26269         /**
26270          * A plugin that makes shapes draggable / droppable.
26271          * 
26272          * @param {EventBus}
26273          *            eventBus
26274          * @param {ElementRegistry}
26275          *            elementRegistry
26276          * @param {Canvas}
26277          *            canvas
26278          * @param {Styles}
26279          *            styles
26280          */
26281
26282         function SpaceToolVisuals(eventBus, elementRegistry, canvas, styles) {
26283
26284             function getGfx(e) {
26285                 return elementRegistry.getGraphics(e);
26286             }
26287
26288             function addDragger(shape, dragGroup) {
26289                 var gfx = getGfx(shape);
26290                 var dragger = gfx.clone();
26291                 var bbox = gfx.getBBox();
26292
26293                 dragger.attr(styles.cls('djs-dragger', [], {
26294                     x: bbox.x,
26295                     y: bbox.y
26296                 }));
26297
26298                 dragGroup.add(dragger);
26299             }
26300
26301             eventBus.on('spaceTool.selection.start', function(event) {
26302                 var space = canvas.getLayer('space'),
26303                     context = event.context;
26304
26305                 var orientation = {
26306                     x: 'M 0,-10000 L 0,10000',
26307                     y: 'M -10000,0 L 10000,0'
26308                 };
26309
26310                 var crosshairGroup = space.group().attr(styles.cls('djs-crosshair-group', ['no-events']));
26311
26312                 crosshairGroup.path(orientation.x).addClass('djs-crosshair');
26313                 crosshairGroup.path(orientation.y).addClass('djs-crosshair');
26314
26315                 context.crosshairGroup = crosshairGroup;
26316             });
26317
26318             eventBus.on('spaceTool.selection.move', function(event) {
26319                 var crosshairGroup = event.context.crosshairGroup;
26320
26321                 crosshairGroup.translate(event.x, event.y);
26322             });
26323
26324             eventBus.on('spaceTool.selection.cleanup', function(event) {
26325                 var context = event.context,
26326                     crosshairGroup = context.crosshairGroup;
26327
26328                 if (crosshairGroup) {
26329                     crosshairGroup.remove();
26330                 }
26331             });
26332
26333
26334             // assign a low priority to this handler
26335             // to let others modify the move context before
26336             // we draw things
26337             eventBus.on('spaceTool.move', function(event) {
26338                 /*
26339                  * TODO (Ricardo): extend connections while adding space
26340                  */
26341
26342                 var context = event.context,
26343                     line = context.line,
26344                     axis = context.axis,
26345                     dragShapes = context.movingShapes;
26346
26347                 if (!context.initialized) {
26348                     return;
26349                 }
26350
26351                 if (!context.dragGroup) {
26352                     var spaceLayer = canvas.getLayer('space');
26353                     line = spaceLayer.path('M0,0 L0,0').addClass('djs-crosshair');
26354
26355                     context.line = line;
26356                     var dragGroup = canvas.getDefaultLayer().group().attr(styles.cls('djs-drag-group', ['no-events']));
26357
26358
26359                     forEach(dragShapes, function(shape) {
26360                         addDragger(shape, dragGroup);
26361                         canvas.addMarker(shape, MARKER_DRAGGING);
26362                     });
26363
26364                     context.dragGroup = dragGroup;
26365                 }
26366
26367                 var orientation = {
26368                     x: 'M' + event.x + ', -10000 L' + event.x + ', 10000',
26369                     y: 'M -10000, ' + event.y + ' L 10000, ' + event.y
26370                 };
26371
26372                 line.attr({
26373                     path: orientation[axis],
26374                     display: ''
26375                 });
26376
26377                 var opposite = {
26378                     x: 'y',
26379                     y: 'x'
26380                 };
26381                 var delta = {
26382                     x: event.dx,
26383                     y: event.dy
26384                 };
26385                 delta[opposite[context.axis]] = 0;
26386
26387                 context.dragGroup.translate(delta.x, delta.y);
26388             });
26389
26390             eventBus.on('spaceTool.cleanup', function(event) {
26391
26392                 var context = event.context,
26393                     shapes = context.movingShapes,
26394                     line = context.line,
26395                     dragGroup = context.dragGroup;
26396
26397                 // remove dragging marker
26398                 forEach(shapes, function(e) {
26399                     canvas.removeMarker(e, MARKER_DRAGGING);
26400                 });
26401
26402                 if (dragGroup) {
26403                     line.remove();
26404                     dragGroup.remove();
26405                 }
26406             });
26407         }
26408
26409         SpaceToolVisuals.$inject = ['eventBus', 'elementRegistry', 'canvas', 'styles'];
26410
26411         module.exports = SpaceToolVisuals;
26412
26413     }, {
26414         "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js"
26415     }],
26416     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\space-tool\\SpaceUtil.js": [function(require, module, exports) {
26417         'use strict';
26418
26419         /**
26420          * Get Resize direction given axis + offset
26421          * 
26422          * @param {String}
26423          *            axis (x|y)
26424          * @param {Number}
26425          *            offset
26426          * 
26427          * @return {String} (e|w|n|s)
26428          */
26429         function getDirection(axis, offset) {
26430
26431             if (axis === 'x') {
26432                 if (offset > 0) {
26433                     return 'e';
26434                 }
26435
26436                 if (offset < 0) {
26437                     return 'w';
26438                 }
26439             }
26440
26441             if (axis === 'y') {
26442                 if (offset > 0) {
26443                     return 's';
26444                 }
26445
26446                 if (offset < 0) {
26447                     return 'n';
26448                 }
26449             }
26450
26451             return null;
26452         }
26453
26454         module.exports.getDirection = getDirection;
26455
26456         /**
26457          * Resize the given bounds by the specified delta from a given anchor point.
26458          * 
26459          * @param {Bounds}
26460          *            bounds the bounding box that should be resized
26461          * @param {String}
26462          *            direction in which the element is resized (n, s, e, w)
26463          * @param {Point}
26464          *            delta of the resize operation
26465          * 
26466          * @return {Bounds} resized bounding box
26467          */
26468         module.exports.resizeBounds = function(bounds, direction, delta) {
26469
26470             var dx = delta.x,
26471                 dy = delta.y;
26472
26473             switch (direction) {
26474
26475                 case 'n':
26476                     return {
26477                         x: bounds.x,
26478                         y: bounds.y + dy,
26479                         width: bounds.width,
26480                         height: bounds.height - dy
26481                     };
26482
26483                 case 's':
26484                     return {
26485                         x: bounds.x,
26486                         y: bounds.y,
26487                         width: bounds.width,
26488                         height: bounds.height + dy
26489                     };
26490
26491                 case 'w':
26492                     return {
26493                         x: bounds.x + dx,
26494                         y: bounds.y,
26495                         width: bounds.width - dx,
26496                         height: bounds.height
26497                     };
26498
26499                 case 'e':
26500                     return {
26501                         x: bounds.x,
26502                         y: bounds.y,
26503                         width: bounds.width + dx,
26504                         height: bounds.height
26505                     };
26506
26507                 default:
26508                     throw new Error('unrecognized direction: ' + direction);
26509             }
26510         };
26511     }, {}],
26512     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\space-tool\\index.js": [function(require, module, exports) {
26513         module.exports = {
26514             __init__: ['spaceToolVisuals'],
26515             __depends__: [require('../dragging'), require('../modeling'), require('../rules')],
26516             spaceTool: ['type', require('./SpaceTool')],
26517             spaceToolVisuals: ['type', require('./SpaceToolVisuals')]
26518         };
26519
26520     }, {
26521         "../dragging": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\dragging\\index.js",
26522         "../modeling": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\modeling\\index.js",
26523         "../rules": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\rules\\index.js",
26524         "./SpaceTool": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\space-tool\\SpaceTool.js",
26525         "./SpaceToolVisuals": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\space-tool\\SpaceToolVisuals.js"
26526     }],
26527     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\tooltips\\Tooltips.js": [function(require, module, exports) {
26528         'use strict';
26529
26530         var isString = require('lodash/lang/isString'),
26531             assign = require('lodash/object/assign'),
26532             forEach = require('lodash/collection/forEach'),
26533             debounce = require('lodash/function/debounce');
26534
26535         var domify = require('min-dom/lib/domify'),
26536             domAttr = require('min-dom/lib/attr'),
26537             domClasses = require('min-dom/lib/classes'),
26538             domRemove = require('min-dom/lib/remove'),
26539             domDelegate = require('min-dom/lib/delegate');
26540
26541
26542         // document wide unique tooltip ids
26543         var ids = new(require('../../util/IdGenerator'))('tt');
26544
26545
26546         function createRoot(parent) {
26547             var root = domify('<div class="djs-tooltip-container" style="position: absolute; width: 0; height: 0;" />');
26548             parent.insertBefore(root, parent.firstChild);
26549
26550             return root;
26551         }
26552
26553
26554         function setPosition(el, x, y) {
26555             assign(el.style, {
26556                 left: x + 'px',
26557                 top: y + 'px'
26558             });
26559         }
26560
26561         function setVisible(el, visible) {
26562             el.style.display = visible === false ? 'none' : '';
26563         }
26564
26565
26566         var tooltipClass = 'djs-tooltip',
26567             tooltipSelector = '.' + tooltipClass;
26568
26569         /**
26570          * A service that allows users to render tool tips on the diagram.
26571          * 
26572          * The tooltip service will take care of updating the tooltip positioning during
26573          * navigation + zooming.
26574          * 
26575          * @example
26576          * 
26577          * ```javascript
26578          *  // add a pink badge on the top left of the shape tooltips.add({ position: {
26579          * x: 50, y: 100 }, html: '<div style="width: 10px; background: fuchsia; color:
26580          * white;">0</div>' });
26581          *  // or with optional life span tooltips.add({ position: { top: -5, left: -5 },
26582          * html: '<div style="width: 10px; background: fuchsia; color: white;">0</div>',
26583          * ttl: 2000 });
26584          *  // remove a tool tip var id = tooltips.add(...); tooltips.remove(id); ```
26585          * 
26586          * @param {Object}
26587          *            config
26588          * @param {EventBus}
26589          *            eventBus
26590          * @param {Canvas}
26591          *            canvas
26592          */
26593         function Tooltips(config, eventBus, canvas) {
26594
26595             this._eventBus = eventBus;
26596             this._canvas = canvas;
26597
26598             this._ids = ids;
26599
26600             this._tooltipDefaults = {
26601                 show: {
26602                     minZoom: 0.7,
26603                     maxZoom: 5.0
26604                 }
26605             };
26606
26607             /**
26608              * Mapping tooltipId -> tooltip
26609              */
26610             this._tooltips = {};
26611
26612             // root html element for all tooltips
26613             this._tooltipRoot = createRoot(canvas.getContainer());
26614
26615
26616             var self = this;
26617
26618             domDelegate.bind(this._tooltipRoot, tooltipSelector, 'mousedown', function(event) {
26619                 event.stopPropagation();
26620             });
26621
26622             domDelegate.bind(this._tooltipRoot, tooltipSelector, 'mouseover', function(event) {
26623                 self.trigger('mouseover', event);
26624             });
26625
26626             domDelegate.bind(this._tooltipRoot, tooltipSelector, 'mouseout', function(event) {
26627                 self.trigger('mouseout', event);
26628             });
26629
26630             this._init(config);
26631         }
26632
26633
26634         Tooltips.$inject = ['config.tooltips', 'eventBus', 'canvas'];
26635
26636         module.exports = Tooltips;
26637
26638
26639         /**
26640          * Adds a HTML tooltip to the diagram
26641          * 
26642          * @param {Object}
26643          *            tooltip the tooltip configuration
26644          * 
26645          * @param {String|DOMElement}
26646          *            tooltip.html html element to use as an tooltip
26647          * @param {Object}
26648          *            [tooltip.show] show configuration
26649          * @param {Number}
26650          *            [tooltip.show.minZoom] minimal zoom level to show the tooltip
26651          * @param {Number}
26652          *            [tooltip.show.maxZoom] maximum zoom level to show the tooltip
26653          * @param {Object}
26654          *            tooltip.position where to attach the tooltip
26655          * @param {Number}
26656          *            [tooltip.position.left] relative to element bbox left attachment
26657          * @param {Number}
26658          *            [tooltip.position.top] relative to element bbox top attachment
26659          * @param {Number}
26660          *            [tooltip.position.bottom] relative to element bbox bottom
26661          *            attachment
26662          * @param {Number}
26663          *            [tooltip.position.right] relative to element bbox right attachment
26664          * @param {Number}
26665          *            [tooltip.timeout=-1]
26666          * 
26667          * @return {String} id that may be used to reference the tooltip for update or
26668          *         removal
26669          */
26670         Tooltips.prototype.add = function(tooltip) {
26671
26672             if (!tooltip.position) {
26673                 throw new Error('must specifiy tooltip position');
26674             }
26675
26676             if (!tooltip.html) {
26677                 throw new Error('must specifiy tooltip html');
26678             }
26679
26680             var id = this._ids.next();
26681
26682             tooltip = assign({}, this._tooltipDefaults, tooltip, {
26683                 id: id
26684             });
26685
26686             this._addTooltip(tooltip);
26687
26688             if (tooltip.timeout) {
26689                 this.setTimeout(tooltip);
26690             }
26691
26692             return id;
26693         };
26694
26695         Tooltips.prototype.trigger = function(action, event) {
26696
26697             var node = event.delegateTarget || event.target;
26698
26699             var tooltip = this.get(domAttr(node, 'data-tooltip-id'));
26700
26701             if (!tooltip) {
26702                 return;
26703             }
26704
26705             if (action === 'mouseover' && tooltip.timeout) {
26706                 this.clearTimeout(tooltip);
26707             }
26708
26709             if (action === 'mouseout' && tooltip.timeout) {
26710                 // cut timeout after mouse out
26711                 tooltip.timeout = 1000;
26712
26713                 this.setTimeout(tooltip);
26714             }
26715
26716             console.log('mouse leave', event);
26717         };
26718
26719         /**
26720          * Get a tooltip with the given id
26721          * 
26722          * @param {String}
26723          *            id
26724          */
26725         Tooltips.prototype.get = function(id) {
26726
26727             if (typeof id !== 'string') {
26728                 id = id.id;
26729             }
26730
26731             return this._tooltips[id];
26732         };
26733
26734         Tooltips.prototype.clearTimeout = function(tooltip) {
26735
26736             tooltip = this.get(tooltip);
26737
26738             if (!tooltip) {
26739                 return;
26740             }
26741
26742             var removeTimer = tooltip.removeTimer;
26743
26744             if (removeTimer) {
26745                 clearTimeout(removeTimer);
26746                 tooltip.removeTimer = null;
26747             }
26748         };
26749
26750         Tooltips.prototype.setTimeout = function(tooltip) {
26751
26752             tooltip = this.get(tooltip);
26753
26754             if (!tooltip) {
26755                 return;
26756             }
26757
26758             this.clearTimeout(tooltip);
26759
26760             var self = this;
26761
26762             tooltip.removeTimer = setTimeout(function() {
26763                 self.remove(tooltip);
26764             }, tooltip.timeout);
26765         };
26766
26767         /**
26768          * Remove an tooltip with the given id
26769          * 
26770          * @param {String}
26771          *            id
26772          */
26773         Tooltips.prototype.remove = function(id) {
26774
26775             var tooltip = this.get(id);
26776
26777             if (tooltip) {
26778                 domRemove(tooltip.html);
26779                 domRemove(tooltip.htmlContainer);
26780
26781                 delete tooltip.htmlContainer;
26782
26783                 delete this._tooltips[tooltip.id];
26784             }
26785         };
26786
26787
26788         Tooltips.prototype.show = function() {
26789             setVisible(this._tooltipRoot);
26790         };
26791
26792
26793         Tooltips.prototype.hide = function() {
26794             setVisible(this._tooltipRoot, false);
26795         };
26796
26797
26798         Tooltips.prototype._updateRoot = function(viewbox) {
26799             var a = viewbox.scale || 1;
26800             var d = viewbox.scale || 1;
26801
26802             var matrix = 'matrix(' + a + ',0,0,' + d + ',' + (-1 * viewbox.x * a) + ',' + (-1 * viewbox.y * d) + ')';
26803
26804             this._tooltipRoot.style.transform = matrix;
26805             this._tooltipRoot.style['-ms-transform'] = matrix;
26806         };
26807
26808
26809         Tooltips.prototype._addTooltip = function(tooltip) {
26810
26811             var id = tooltip.id,
26812                 html = tooltip.html,
26813                 htmlContainer,
26814                 tooltipRoot = this._tooltipRoot;
26815
26816             // unwrap jquery (for those who need it)
26817             if (html.get) {
26818                 html = html.get(0);
26819             }
26820
26821             // create proper html elements from
26822             // tooltip HTML strings
26823             if (isString(html)) {
26824                 html = domify(html);
26825             }
26826
26827             htmlContainer = domify('<div data-tooltip-id="' + id + '" class="' + tooltipClass + '" style="position: absolute">');
26828
26829             htmlContainer.appendChild(html);
26830
26831             if (tooltip.type) {
26832                 domClasses(htmlContainer).add('djs-tooltip-' + tooltip.type);
26833             }
26834
26835             if (tooltip.className) {
26836                 domClasses(htmlContainer).add(tooltip.className);
26837             }
26838
26839             tooltip.htmlContainer = htmlContainer;
26840
26841             tooltipRoot.appendChild(htmlContainer);
26842
26843             this._tooltips[id] = tooltip;
26844
26845             this._updateTooltip(tooltip);
26846         };
26847
26848
26849         Tooltips.prototype._updateTooltip = function(tooltip) {
26850
26851             var position = tooltip.position,
26852                 htmlContainer = tooltip.htmlContainer;
26853
26854             // update overlay html based on tooltip x, y
26855
26856             setPosition(htmlContainer, position.x, position.y);
26857         };
26858
26859
26860         Tooltips.prototype._updateTooltipVisibilty = function(viewbox) {
26861
26862             forEach(this._tooltips, function(tooltip) {
26863                 var show = tooltip.show,
26864                     htmlContainer = tooltip.htmlContainer,
26865                     visible = true;
26866
26867                 if (show) {
26868                     if (show.minZoom > viewbox.scale ||
26869                         show.maxZoom < viewbox.scale) {
26870                         visible = false;
26871                     }
26872
26873                     setVisible(htmlContainer, visible);
26874                 }
26875             });
26876         };
26877
26878         Tooltips.prototype._init = function(config) {
26879
26880             var self = this;
26881
26882
26883             // scroll/zoom integration
26884
26885             var updateViewbox = function(viewbox) {
26886                 self._updateRoot(viewbox);
26887                 self._updateTooltipVisibilty(viewbox);
26888
26889                 self.show();
26890             };
26891
26892             if (!config || config.deferUpdate !== false) {
26893                 updateViewbox = debounce(updateViewbox, 300);
26894             }
26895
26896             this._eventBus.on('canvas.viewbox.changed', function(event) {
26897                 self.hide();
26898                 updateViewbox(event.viewbox);
26899             });
26900         };
26901
26902     }, {
26903         "../../util/IdGenerator": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\IdGenerator.js",
26904         "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
26905         "lodash/function/debounce": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\function\\debounce.js",
26906         "lodash/lang/isString": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isString.js",
26907         "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js",
26908         "min-dom/lib/attr": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\attr.js",
26909         "min-dom/lib/classes": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\classes.js",
26910         "min-dom/lib/delegate": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\delegate.js",
26911         "min-dom/lib/domify": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\domify.js",
26912         "min-dom/lib/remove": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\remove.js"
26913     }],
26914     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\tooltips\\index.js": [function(require, module, exports) {
26915         module.exports = {
26916             __init__: ['tooltips'],
26917             tooltips: ['type', require('./Tooltips')]
26918         };
26919     }, {
26920         "./Tooltips": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\tooltips\\Tooltips.js"
26921     }],
26922     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\touch\\TouchFix.js": [function(require, module, exports) {
26923         'use strict';
26924
26925         function TouchFix(canvas, eventBus) {
26926
26927             var self = this;
26928
26929             eventBus.on('canvas.init', function(e) {
26930                 self.addBBoxMarker(e.svg);
26931             });
26932         }
26933
26934         TouchFix.$inject = ['canvas', 'eventBus'];
26935
26936         module.exports = TouchFix;
26937
26938
26939         /**
26940          * Safari mobile (iOS 7) does not fire touchstart event in <SVG> element if
26941          * there is no shape between 0,0 and viewport elements origin.
26942          * 
26943          * So touchstart event is only fired when the <g class="viewport"> element was
26944          * hit. Putting an element over and below the 'viewport' fixes that behavior.
26945          */
26946         TouchFix.prototype.addBBoxMarker = function(paper) {
26947
26948             var markerStyle = {
26949                 fill: 'none',
26950                 class: 'outer-bound-marker'
26951             };
26952
26953             paper.rect(-10000, -10000, 10, 10).attr(markerStyle);
26954             paper.rect(10000, 10000, 10, 10).attr(markerStyle);
26955         };
26956
26957     }, {}],
26958     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\touch\\TouchInteractionEvents.js": [function(require, module, exports) {
26959         'use strict';
26960
26961         var forEach = require('lodash/collection/forEach'),
26962             domEvent = require('min-dom/lib/event'),
26963             domClosest = require('min-dom/lib/closest'),
26964             Hammer = require('hammerjs'),
26965             Snap = require('../../../vendor/snapsvg'),
26966             Event = require('../../util/Event');
26967
26968         var MIN_ZOOM = 0.2,
26969             MAX_ZOOM = 4;
26970
26971         var mouseEvents = [
26972             'mousedown',
26973             'mouseup',
26974             'mouseover',
26975             'mouseout',
26976             'click',
26977             'dblclick'
26978         ];
26979
26980         function log() {
26981             if (false) {
26982                 console.log.apply(console, arguments);
26983             }
26984         }
26985
26986         function get(service, injector) {
26987             try {
26988                 return injector.get(service);
26989             } catch (e) {
26990                 return null;
26991             }
26992         }
26993
26994         function createTouchRecognizer(node) {
26995
26996             function stopEvent(event) {
26997                 Event.stopEvent(event, true);
26998             }
26999
27000             function stopMouse(event) {
27001
27002                 forEach(mouseEvents, function(e) {
27003                     domEvent.bind(node, e, stopEvent, true);
27004                 });
27005             }
27006
27007             function allowMouse(event) {
27008                 setTimeout(function() {
27009                     forEach(mouseEvents, function(e) {
27010                         domEvent.unbind(node, e, stopEvent, true);
27011                     });
27012                 }, 500);
27013             }
27014
27015             domEvent.bind(node, 'touchstart', stopMouse, true);
27016             domEvent.bind(node, 'touchend', allowMouse, true);
27017             domEvent.bind(node, 'touchcancel', allowMouse, true);
27018
27019             // A touch event recognizer that handles
27020             // touch events only (we know, we can already handle
27021             // mouse events out of the box)
27022
27023             var recognizer = new Hammer.Manager(node, {
27024                 inputClass: Hammer.TouchInput,
27025                 recognizers: []
27026             });
27027
27028
27029             var tap = new Hammer.Tap();
27030             var pan = new Hammer.Pan({
27031                 threshold: 10
27032             });
27033             var press = new Hammer.Press();
27034             var pinch = new Hammer.Pinch();
27035
27036             var doubleTap = new Hammer.Tap({
27037                 event: 'doubletap',
27038                 taps: 2
27039             });
27040
27041             pinch.requireFailure(pan);
27042             pinch.requireFailure(press);
27043
27044             recognizer.add([pan, press, pinch, doubleTap, tap]);
27045
27046             recognizer.reset = function(force) {
27047                 var recognizers = this.recognizers,
27048                     session = this.session;
27049
27050                 if (session.stopped) {
27051                     return;
27052                 }
27053
27054                 log('recognizer', 'stop');
27055
27056                 recognizer.stop(force);
27057
27058                 setTimeout(function() {
27059                     var i, r;
27060
27061                     log('recognizer', 'reset');
27062                     for (i = 0; !!(r = recognizers[i]); i++) {
27063                         r.reset();
27064                         r.state = 8; // FAILED STATE
27065                     }
27066
27067                     session.curRecognizer = null;
27068                 }, 0);
27069             };
27070
27071             recognizer.on('hammer.input', function(event) {
27072                 if (event.srcEvent.defaultPrevented) {
27073                     recognizer.reset(true);
27074                 }
27075             });
27076
27077             return recognizer;
27078         }
27079
27080         /**
27081          * A plugin that provides touch events for elements.
27082          * 
27083          * @param {EventBus}
27084          *            eventBus
27085          * @param {InteractionEvents}
27086          *            interactionEvents
27087          */
27088         function TouchInteractionEvents(injector, canvas, eventBus, elementRegistry, interactionEvents, snap) {
27089
27090             // optional integrations
27091             var dragging = get('dragging', injector),
27092                 move = get('move', injector),
27093                 contextPad = get('contextPad', injector),
27094                 palette = get('palette', injector);
27095
27096             // the touch recognizer
27097             var recognizer;
27098
27099             function handler(type) {
27100
27101                 return function(event) {
27102                     log('element', type, event);
27103
27104                     interactionEvents.fire(type, event);
27105                 };
27106             }
27107
27108             function getGfx(target) {
27109                 var node = domClosest(target, 'svg, .djs-element', true);
27110                 return node && new Snap(node);
27111             }
27112
27113             function initEvents(svg) {
27114
27115                 // touch recognizer
27116                 recognizer = createTouchRecognizer(svg);
27117
27118                 recognizer.on('doubletap', handler('element.dblclick'));
27119
27120                 recognizer.on('tap', handler('element.click'));
27121
27122                 function startGrabCanvas(event) {
27123
27124                     log('canvas', 'grab start');
27125
27126                     var lx = 0,
27127                         ly = 0;
27128
27129                     function update(e) {
27130
27131                         var dx = e.deltaX - lx,
27132                             dy = e.deltaY - ly;
27133
27134                         canvas.scroll({
27135                             dx: dx,
27136                             dy: dy
27137                         });
27138
27139                         lx = e.deltaX;
27140                         ly = e.deltaY;
27141                     }
27142
27143                     function end(e) {
27144                         recognizer.off('panmove', update);
27145                         recognizer.off('panend', end);
27146                         recognizer.off('pancancel', end);
27147
27148                         log('canvas', 'grab end');
27149                     }
27150
27151                     recognizer.on('panmove', update);
27152                     recognizer.on('panend', end);
27153                     recognizer.on('pancancel', end);
27154                 }
27155
27156                 function startGrab(event) {
27157
27158                     var gfx = getGfx(event.target),
27159                         element = gfx && elementRegistry.get(gfx);
27160
27161                     // recognizer
27162                     if (move && canvas.getRootElement() !== element) {
27163                         log('element', 'move start', element, event, true);
27164                         return move.start(event, element, true);
27165                     } else {
27166                         startGrabCanvas(event);
27167                     }
27168                 }
27169
27170                 function startZoom(e) {
27171
27172                     log('canvas', 'zoom start');
27173
27174                     var zoom = canvas.zoom(),
27175                         mid = e.center;
27176
27177                     function update(e) {
27178
27179                         var ratio = 1 - (1 - e.scale) / 1.50,
27180                             newZoom = Math.max(MIN_ZOOM, Math.min(MAX_ZOOM, ratio * zoom));
27181
27182                         canvas.zoom(newZoom, mid);
27183
27184                         Event.stopEvent(e, true);
27185                     }
27186
27187                     function end(e) {
27188                         recognizer.off('pinchmove', update);
27189                         recognizer.off('pinchend', end);
27190                         recognizer.off('pinchcancel', end);
27191
27192                         recognizer.reset(true);
27193
27194                         log('canvas', 'zoom end');
27195                     }
27196
27197                     recognizer.on('pinchmove', update);
27198                     recognizer.on('pinchend', end);
27199                     recognizer.on('pinchcancel', end);
27200                 }
27201
27202                 recognizer.on('panstart', startGrab);
27203                 recognizer.on('press', startGrab);
27204
27205                 recognizer.on('pinchstart', startZoom);
27206             }
27207
27208             if (dragging) {
27209
27210                 // simulate hover during dragging
27211                 eventBus.on('drag.move', function(event) {
27212
27213                     var position = Event.toPoint(event.originalEvent);
27214
27215                     var node = document.elementFromPoint(position.x, position.y),
27216                         gfx = getGfx(node),
27217                         element = gfx && elementRegistry.get(gfx);
27218
27219                     if (element !== event.hover) {
27220                         if (event.hover) {
27221                             dragging.out(event);
27222                         }
27223
27224                         if (element) {
27225                             dragging.hover({
27226                                 element: element,
27227                                 gfx: gfx
27228                             });
27229
27230                             event.hover = element;
27231                             event.hoverGfx = gfx;
27232                         }
27233                     }
27234                 });
27235             }
27236
27237             if (contextPad) {
27238
27239                 eventBus.on('contextPad.create', function(event) {
27240                     var node = event.pad.html;
27241
27242                     // touch recognizer
27243                     var padRecognizer = createTouchRecognizer(node);
27244
27245                     padRecognizer.on('panstart', function(event) {
27246                         log('context-pad', 'panstart', event);
27247                         contextPad.trigger('dragstart', event, true);
27248                     });
27249
27250                     padRecognizer.on('press', function(event) {
27251                         log('context-pad', 'press', event);
27252                         contextPad.trigger('dragstart', event, true);
27253                     });
27254
27255                     padRecognizer.on('tap', function(event) {
27256                         log('context-pad', 'tap', event);
27257                         contextPad.trigger('click', event);
27258                     });
27259                 });
27260             }
27261
27262             if (palette) {
27263                 eventBus.on('palette.create', function(event) {
27264                     var node = event.html;
27265
27266                     // touch recognizer
27267                     var padRecognizer = createTouchRecognizer(node);
27268
27269                     padRecognizer.on('panstart', function(event) {
27270                         log('palette', 'panstart', event);
27271                         palette.trigger('dragstart', event, true);
27272                     });
27273
27274                     padRecognizer.on('press', function(event) {
27275                         log('palette', 'press', event);
27276                         palette.trigger('dragstart', event, true);
27277                     });
27278
27279                     padRecognizer.on('tap', function(event) {
27280                         log('palette', 'tap', event);
27281                         palette.trigger('click', event);
27282                     });
27283                 });
27284             }
27285
27286             eventBus.on('canvas.init', function(event) {
27287                 initEvents(event.svg.node);
27288             });
27289         }
27290
27291
27292         TouchInteractionEvents.$inject = [
27293             'injector',
27294             'canvas',
27295             'eventBus',
27296             'elementRegistry',
27297             'interactionEvents',
27298             'touchFix'
27299         ];
27300
27301         module.exports = TouchInteractionEvents;
27302     }, {
27303         "../../../vendor/snapsvg": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\vendor\\snapsvg.js",
27304         "../../util/Event": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Event.js",
27305         "hammerjs": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\hammerjs\\hammer.js",
27306         "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
27307         "min-dom/lib/closest": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\closest.js",
27308         "min-dom/lib/event": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\event.js"
27309     }],
27310     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\touch\\index.js": [function(require, module, exports) {
27311         module.exports = {
27312             __depends__: [require('../interaction-events')],
27313             __init__: ['touchInteractionEvents'],
27314             touchInteractionEvents: ['type', require('./TouchInteractionEvents')],
27315             touchFix: ['type', require('./TouchFix')]
27316         };
27317     }, {
27318         "../interaction-events": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\interaction-events\\index.js",
27319         "./TouchFix": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\touch\\TouchFix.js",
27320         "./TouchInteractionEvents": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\touch\\TouchInteractionEvents.js"
27321     }],
27322     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\layout\\BaseLayouter.js": [function(require, module, exports) {
27323         'use strict';
27324
27325         var LayoutUtil = require('./LayoutUtil');
27326
27327
27328         /**
27329          * A base connection layouter implementation that layouts the connection by
27330          * directly connecting mid(source) + mid(target).
27331          */
27332         function BaseLayouter() {}
27333
27334         module.exports = BaseLayouter;
27335
27336
27337         /**
27338          * Return the new layouted waypoints for the given connection.
27339          * 
27340          * @param {djs.model.Connection}
27341          *            connection
27342          * @param {Object}
27343          *            hints
27344          * @param {Boolean}
27345          *            [hints.movedStart=false]
27346          * @param {Boolean}
27347          *            [hints.movedEnd=false]
27348          * 
27349          * @return {Array<Point>} the layouted connection waypoints
27350          */
27351         BaseLayouter.prototype.layoutConnection = function(connection, hints) {
27352             return [
27353                 LayoutUtil.getMidPoint(connection.source),
27354                 LayoutUtil.getMidPoint(connection.target)
27355             ];
27356         };
27357
27358     }, {
27359         "./LayoutUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\layout\\LayoutUtil.js"
27360     }],
27361     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\layout\\CroppingConnectionDocking.js": [function(require, module, exports) {
27362         'use strict';
27363
27364         var assign = require('lodash/object/assign');
27365
27366         var LayoutUtil = require('./LayoutUtil');
27367
27368
27369         function dockingToPoint(docking) {
27370             // use the dockings actual point and
27371             // retain the original docking
27372             return assign({
27373                 original: docking.point.original || docking.point
27374             }, docking.actual);
27375         }
27376
27377
27378         /**
27379          * A {@link ConnectionDocking} that crops connection waypoints based on the
27380          * path(s) of the connection source and target.
27381          * 
27382          * @param {djs.core.ElementRegistry}
27383          *            elementRegistry
27384          */
27385         function CroppingConnectionDocking(elementRegistry, renderer) {
27386             this._elementRegistry = elementRegistry;
27387             this._renderer = renderer;
27388         }
27389
27390         CroppingConnectionDocking.$inject = ['elementRegistry', 'renderer'];
27391
27392         module.exports = CroppingConnectionDocking;
27393
27394
27395         /**
27396          * @inheritDoc ConnectionDocking#getCroppedWaypoints
27397          */
27398         CroppingConnectionDocking.prototype.getCroppedWaypoints = function(connection, source, target) {
27399
27400             source = source || connection.source;
27401             target = target || connection.target;
27402
27403             var sourceDocking = this.getDockingPoint(connection, source, true),
27404                 targetDocking = this.getDockingPoint(connection, target);
27405
27406             var croppedWaypoints = connection.waypoints.slice(sourceDocking.idx + 1, targetDocking.idx);
27407
27408             croppedWaypoints.unshift(dockingToPoint(sourceDocking));
27409             croppedWaypoints.push(dockingToPoint(targetDocking));
27410
27411             return croppedWaypoints;
27412         };
27413
27414         /**
27415          * Return the connection docking point on the specified shape
27416          * 
27417          * @inheritDoc ConnectionDocking#getDockingPoint
27418          */
27419         CroppingConnectionDocking.prototype.getDockingPoint = function(connection, shape, dockStart) {
27420
27421             var waypoints = connection.waypoints,
27422                 dockingIdx,
27423                 dockingPoint,
27424                 croppedPoint;
27425
27426             dockingIdx = dockStart ? 0 : waypoints.length - 1;
27427             dockingPoint = waypoints[dockingIdx];
27428
27429             croppedPoint = this._getIntersection(shape, connection, dockStart);
27430
27431             return {
27432                 point: dockingPoint,
27433                 actual: croppedPoint || dockingPoint,
27434                 idx: dockingIdx
27435             };
27436         };
27437
27438
27439         // //// helper methods ///////////////////////////////////////////////////
27440
27441         CroppingConnectionDocking.prototype._getIntersection = function(shape, connection, takeFirst) {
27442
27443             var shapePath = this._getShapePath(shape),
27444                 connectionPath = this._getConnectionPath(connection);
27445
27446             return LayoutUtil.getElementLineIntersection(shapePath, connectionPath, takeFirst);
27447         };
27448
27449         CroppingConnectionDocking.prototype._getConnectionPath = function(connection) {
27450             return this._renderer.getConnectionPath(connection);
27451         };
27452
27453         CroppingConnectionDocking.prototype._getShapePath = function(shape) {
27454             return this._renderer.getShapePath(shape);
27455         };
27456
27457         CroppingConnectionDocking.prototype._getGfx = function(element) {
27458             return this._elementRegistry.getGraphics(element);
27459         };
27460     }, {
27461         "./LayoutUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\layout\\LayoutUtil.js",
27462         "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js"
27463     }],
27464     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\layout\\LayoutUtil.js": [function(require, module, exports) {
27465         'use strict';
27466
27467         var isArray = require('lodash/lang/isArray'),
27468             sortBy = require('lodash/collection/sortBy');
27469
27470         var Snap = require('../../vendor/snapsvg');
27471
27472         /**
27473          * Returns whether two points are in a horizontal or vertical line.
27474          * 
27475          * @param {Point}
27476          *            a
27477          * @param {Point}
27478          *            b
27479          * 
27480          * @return {String|Boolean} returns false if the points are not aligned or 'h|v'
27481          *         if they are aligned horizontally / vertically.
27482          */
27483         function pointsAligned(a, b) {
27484             switch (true) {
27485                 case a.x === b.x:
27486                     return 'h';
27487                 case a.y === b.y:
27488                     return 'v';
27489             }
27490
27491             return false;
27492         }
27493
27494         module.exports.pointsAligned = pointsAligned;
27495
27496
27497         function roundPoint(point) {
27498
27499             return {
27500                 x: Math.round(point.x),
27501                 y: Math.round(point.y)
27502             };
27503         }
27504
27505         module.exports.roundPoint = roundPoint;
27506
27507
27508         function pointsEqual(a, b) {
27509             return a.x === b.x && a.y === b.y;
27510         }
27511
27512         module.exports.pointsEqual = pointsEqual;
27513
27514
27515         function pointDistance(a, b) {
27516             return Math.sqrt(Math.pow(a.x - b.x, 2) + Math.pow(a.y - b.y, 2));
27517         }
27518
27519         module.exports.pointDistance = pointDistance;
27520
27521
27522         function asTRBL(bounds) {
27523             return {
27524                 top: bounds.y,
27525                 right: bounds.x + (bounds.width || 0),
27526                 bottom: bounds.y + (bounds.height || 0),
27527                 left: bounds.x
27528             };
27529         }
27530
27531         module.exports.asTRBL = asTRBL;
27532
27533
27534         function getMidPoint(bounds) {
27535             return roundPoint({
27536                 x: bounds.x + bounds.width / 2,
27537                 y: bounds.y + bounds.height / 2
27538             });
27539         }
27540
27541         module.exports.getMidPoint = getMidPoint;
27542
27543
27544         // //// orientation utils //////////////////////////////
27545
27546         function getOrientation(rect, reference, pointDistance) {
27547
27548             pointDistance = pointDistance || 0;
27549
27550             var rectOrientation = asTRBL(rect),
27551                 referenceOrientation = asTRBL(reference);
27552
27553             var top = rectOrientation.bottom + pointDistance <= referenceOrientation.top,
27554                 right = rectOrientation.left - pointDistance >= referenceOrientation.right,
27555                 bottom = rectOrientation.top - pointDistance >= referenceOrientation.bottom,
27556                 left = rectOrientation.right + pointDistance <= referenceOrientation.left;
27557
27558             var vertical = top ? 'top' : (bottom ? 'bottom' : null),
27559                 horizontal = left ? 'left' : (right ? 'right' : null);
27560
27561             if (horizontal && vertical) {
27562                 return vertical + '-' + horizontal;
27563             } else
27564             if (horizontal || vertical) {
27565                 return horizontal || vertical;
27566             } else {
27567                 return 'intersect';
27568             }
27569         }
27570
27571         module.exports.getOrientation = getOrientation;
27572
27573
27574         function hasAnyOrientation(rect, reference, pointDistance, locations) {
27575
27576             if (isArray(pointDistance)) {
27577                 locations = pointDistance;
27578                 pointDistance = 0;
27579             }
27580
27581             var orientation = getOrientation(rect, reference, pointDistance);
27582
27583             return locations.indexOf(orientation) !== -1;
27584         }
27585
27586         module.exports.hasAnyOrientation = hasAnyOrientation;
27587
27588
27589         // //// intersection utils //////////////////////////////
27590
27591         function getElementLineIntersection(elementPath, linePath, cropStart) {
27592
27593             var intersections = getIntersections(elementPath, linePath);
27594
27595             // recognize intersections
27596             // only one -> choose
27597             // two close together -> choose first
27598             // two or more distinct -> pull out appropriate one
27599             // none -> ok (fallback to point itself)
27600             if (intersections.length === 1) {
27601                 return roundPoint(intersections[0]);
27602             } else if (intersections.length === 2 && pointDistance(intersections[0], intersections[1]) < 1) {
27603                 return roundPoint(intersections[0]);
27604             } else if (intersections.length > 1) {
27605
27606                 // sort by intersections based on connection segment +
27607                 // distance from start
27608                 intersections = sortBy(intersections, function(i) {
27609                     var distance = Math.floor(i.t2 * 100) || 1;
27610
27611                     distance = 100 - distance;
27612
27613                     distance = (distance < 10 ? '0' : '') + distance;
27614
27615                     // create a sort string that makes sure we sort
27616                     // line segment ASC + line segment position DESC (for cropStart)
27617                     // line segment ASC + line segment position ASC (for cropEnd)
27618                     return i.segment2 + '#' + distance;
27619                 });
27620
27621                 return roundPoint(intersections[cropStart ? 0 : intersections.length - 1]);
27622             }
27623
27624             return null;
27625         }
27626
27627         module.exports.getElementLineIntersection = getElementLineIntersection;
27628
27629
27630         function getIntersections(a, b) {
27631             return Snap.path.intersection(a, b);
27632         }
27633
27634         module.exports.getIntersections = getIntersections;
27635     }, {
27636         "../../vendor/snapsvg": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\vendor\\snapsvg.js",
27637         "lodash/collection/sortBy": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\sortBy.js",
27638         "lodash/lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js"
27639     }],
27640     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\layout\\ManhattanLayout.js": [function(require, module, exports) {
27641         'use strict';
27642
27643         var isArray = require('lodash/lang/isArray'),
27644             find = require('lodash/collection/find');
27645
27646         var LayoutUtil = require('./LayoutUtil'),
27647             Geometry = require('../util/Geometry');
27648
27649         var MIN_DISTANCE = 20;
27650
27651
27652         /**
27653          * Returns the mid points for a manhattan connection between two points.
27654          * 
27655          * @example
27656          * 
27657          * [a]----[x] | [x]--->[b]
27658          * 
27659          * @param {Point}
27660          *            a
27661          * @param {Point}
27662          *            b
27663          * @param {String}
27664          *            directions
27665          * 
27666          * @return {Array<Point>}
27667          */
27668         module.exports.getMidPoints = function(a, b, directions) {
27669
27670             directions = directions || 'h:h';
27671
27672             var xmid, ymid;
27673
27674             // one point, next to a
27675             if (directions === 'h:v') {
27676                 return [{
27677                     x: b.x,
27678                     y: a.y
27679                 }];
27680             } else
27681             // one point, above a
27682             if (directions === 'v:h') {
27683                 return [{
27684                     x: a.x,
27685                     y: b.y
27686                 }];
27687             } else
27688             // vertical edge xmid
27689             if (directions === 'h:h') {
27690                 xmid = Math.round((b.x - a.x) / 2 + a.x);
27691
27692                 return [{
27693                     x: xmid,
27694                     y: a.y
27695                 }, {
27696                     x: xmid,
27697                     y: b.y
27698                 }];
27699             } else
27700             // horizontal edge ymid
27701             if (directions === 'v:v') {
27702                 ymid = Math.round((b.y - a.y) / 2 + a.y);
27703
27704                 return [{
27705                     x: a.x,
27706                     y: ymid
27707                 }, {
27708                     x: b.x,
27709                     y: ymid
27710                 }];
27711             } else {
27712                 throw new Error(
27713                     'unknown directions: <' + directions + '>: ' +
27714                     'directions must be specified as {a direction}:{b direction} (direction in h|v)');
27715             }
27716         };
27717
27718
27719         /**
27720          * Create a connection between the two points according to the manhattan layout
27721          * (only horizontal and vertical) edges.
27722          * 
27723          * @param {Point}
27724          *            a
27725          * @param {Point}
27726          *            b
27727          * 
27728          * @param {String}
27729          *            [directions='h:h'] specifies manhattan directions for each point
27730          *            as {adirection}:{bdirection}. A directionfor a point is either `h`
27731          *            (horizontal) or `v` (vertical)
27732          * 
27733          * @return {Array<Point>}
27734          */
27735         module.exports.connectPoints = function(a, b, directions) {
27736
27737             var points = [];
27738
27739             if (!LayoutUtil.pointsAligned(a, b)) {
27740                 points = this.getMidPoints(a, b, directions);
27741             }
27742
27743             points.unshift(a);
27744             points.push(b);
27745
27746             return points;
27747         };
27748
27749
27750         /**
27751          * Connect two rectangles using a manhattan layouted connection.
27752          * 
27753          * @param {Bounds}
27754          *            source source rectangle
27755          * @param {Bounds}
27756          *            target target rectangle
27757          * @param {Point}
27758          *            [start] source docking
27759          * @param {Point}
27760          *            [end] target docking
27761          * 
27762          * @return {Array<Point>} connection points
27763          */
27764         module.exports.connectRectangles = function(source, target, start, end, options) {
27765
27766             options = options || {};
27767
27768             var orientation = LayoutUtil.getOrientation(source, target, MIN_DISTANCE);
27769
27770             var directions = this.getDirections(source, target, options.preferVertical);
27771
27772             start = start || LayoutUtil.getMidPoint(source);
27773             end = end || LayoutUtil.getMidPoint(target);
27774
27775             // overlapping elements
27776             if (!directions) {
27777                 return;
27778             }
27779
27780             if (directions === 'h:h') {
27781
27782                 switch (orientation) {
27783                     case 'top-right':
27784                     case 'right':
27785                     case 'bottom-right':
27786                         start = {
27787                             original: start,
27788                             x: source.x,
27789                             y: start.y
27790                         };
27791                         end = {
27792                             original: end,
27793                             x: target.x + target.width,
27794                             y: end.y
27795                         };
27796                         break;
27797                     case 'top-left':
27798                     case 'left':
27799                     case 'bottom-left':
27800                         start = {
27801                             original: start,
27802                             x: source.x + source.width,
27803                             y: start.y
27804                         };
27805                         end = {
27806                             original: end,
27807                             x: target.x,
27808                             y: end.y
27809                         };
27810                         break;
27811                 }
27812             }
27813
27814             if (directions === 'v:v') {
27815
27816                 switch (orientation) {
27817                     case 'top-left':
27818                     case 'top':
27819                     case 'top-right':
27820                         start = {
27821                             original: start,
27822                             x: start.x,
27823                             y: source.y + source.height
27824                         };
27825                         end = {
27826                             original: end,
27827                             x: end.x,
27828                             y: target.y
27829                         };
27830                         break;
27831                     case 'bottom-left':
27832                     case 'bottom':
27833                     case 'bottom-right':
27834                         start = {
27835                             original: start,
27836                             x: start.x,
27837                             y: source.y
27838                         };
27839                         end = {
27840                             original: end,
27841                             x: end.x,
27842                             y: target.y + target.height
27843                         };
27844                         break;
27845                 }
27846             }
27847
27848             return this.connectPoints(start, end, directions);
27849         };
27850
27851         /**
27852          * Repair the connection between two rectangles, of which one has been updated.
27853          * 
27854          * @param {Bounds}
27855          *            source
27856          * @param {Bounds}
27857          *            target
27858          * @param {Point}
27859          *            [start]
27860          * @param {Point}
27861          *            [end]
27862          * @param {Array
27863          *            <Point>} waypoints
27864          * @param {Object}
27865          *            [hints]
27866          * @param {Boolean}
27867          *            hints.preferStraight
27868          * @param {Boolean}
27869          *            hints.preferVertical
27870          * @param {Boolean}
27871          *            hints.startChanged
27872          * @param {Boolean}
27873          *            hints.endChanged
27874          * 
27875          * @return {Array<Point>} repaired waypoints
27876          */
27877         module.exports.repairConnection = function(source, target, start, end, waypoints, hints) {
27878
27879             if (isArray(start)) {
27880                 waypoints = start;
27881                 hints = end;
27882
27883                 start = LayoutUtil.getMidPoint(source);
27884                 end = LayoutUtil.getMidPoint(target);
27885             }
27886
27887             hints = hints || {};
27888
27889
27890             var repairedWaypoints;
27891
27892             // just layout non-existing or simple connections
27893             // attempt to render straight lines, if required
27894             if (!waypoints || waypoints.length < 3) {
27895
27896                 if (hints.preferStraight) {
27897                     // attempt to layout a straight line
27898                     repairedWaypoints = this.layoutStraight(source, target, start, end, hints);
27899                 }
27900             } else {
27901                 // check if we layout from start or end
27902                 if (hints.endChanged) {
27903                     repairedWaypoints = this._repairConnectionSide(target, source, end, waypoints.slice().reverse());
27904                     repairedWaypoints = repairedWaypoints && repairedWaypoints.reverse();
27905                 } else
27906                 if (hints.startChanged) {
27907                     repairedWaypoints = this._repairConnectionSide(source, target, start, waypoints);
27908                 }
27909                 // or whether nothing seems to have changed
27910                 else {
27911                     repairedWaypoints = waypoints;
27912                 }
27913             }
27914
27915             // simply reconnect if nothing else worked
27916             if (!repairedWaypoints) {
27917                 return this.connectRectangles(source, target, start, end, hints);
27918             }
27919
27920             return repairedWaypoints;
27921         };
27922
27923         function max(a, b) {
27924             return Math.max(a, b);
27925         }
27926
27927         function min(a, b) {
27928             return Math.min(a, b);
27929         }
27930
27931         function inRange(a, start, end) {
27932             return a >= start && a <= end;
27933         }
27934
27935         module.exports.layoutStraight = function(source, target, start, end, hints) {
27936
27937             var startX, endX, x,
27938                 startY, endY, y;
27939
27940             startX = max(source.x + 10, target.x + 10);
27941             endX = min(source.x + source.width - 10, target.x + target.width - 10);
27942
27943             if (startX < endX) {
27944
27945                 if (source.width === target.width) {
27946
27947                     if (hints.endChanged && inRange(end.x, startX, endX)) {
27948                         x = end.x;
27949                     } else
27950                     if (inRange(start.x, startX, endX)) {
27951                         x = start.x;
27952                     }
27953                 }
27954
27955                 if (x === undefined) {
27956                     if (source.width < target.width && inRange(start.x, startX, endX)) {
27957                         x = start.x;
27958                     } else
27959                     if (source.width > target.width && inRange(end.x, startX, endX)) {
27960                         x = end.x;
27961                     } else {
27962                         x = (startX + endX) / 2;
27963                     }
27964                 }
27965             }
27966
27967             startY = max(source.y + 10, target.y + 10);
27968             endY = min(source.y + source.height - 10, target.y + target.height - 10);
27969
27970             if (startY < endY) {
27971
27972                 if (source.height === target.height) {
27973                     if (hints.endChanged && inRange(end.y, startY, endY)) {
27974                         y = end.y;
27975                     } else
27976                     if (inRange(start.y, startY, endY)) {
27977                         y = start.y;
27978                     }
27979                 }
27980
27981                 if (y === undefined) {
27982                     if (source.height <= target.height && inRange(start.y, startY, endY)) {
27983                         y = start.y;
27984                     } else
27985                     if (target.height <= source.height && inRange(end.y, startY, endY)) {
27986                         y = end.y;
27987                     } else {
27988                         y = (startY + endY) / 2;
27989                     }
27990                 }
27991             }
27992
27993             // cannot layout straight
27994             if (x === undefined && y === undefined) {
27995                 return null;
27996             }
27997
27998             return [{
27999                 x: x !== undefined ? x : start.x,
28000                 y: y !== undefined ? y : start.y
28001             }, {
28002                 x: x !== undefined ? x : end.x,
28003                 y: y !== undefined ? y : end.y
28004             }];
28005         };
28006
28007
28008         /**
28009          * Repair a connection from one side that moved.
28010          * 
28011          * @param {Bounds}
28012          *            moved
28013          * @param {Bounds}
28014          *            other
28015          * @param {Point}
28016          *            newDocking
28017          * @param {Array
28018          *            <Point>} points originalPoints from moved to other
28019          * 
28020          * @return {Array<Point>} the repaired points between the two rectangles
28021          */
28022         module.exports._repairConnectionSide = function(moved, other, newDocking, points) {
28023
28024             function needsRelayout(moved, other, points) {
28025
28026                 if (points.length < 3) {
28027                     return true;
28028                 }
28029
28030                 if (points.length > 4) {
28031                     return false;
28032                 }
28033
28034                 // relayout if two points overlap
28035                 // this is most likely due to
28036                 return !!find(points, function(p, idx) {
28037                     var q = points[idx - 1];
28038
28039                     return q && Geometry.distance(p, q) < 3;
28040                 });
28041             }
28042
28043             function repairBendpoint(candidate, oldPeer, newPeer) {
28044
28045                 var alignment = LayoutUtil.pointsAligned(oldPeer, candidate);
28046
28047                 switch (alignment) {
28048                     case 'v':
28049                         // repair vertical alignment
28050                         return {
28051                             x: candidate.x,
28052                             y: newPeer.y
28053                         };
28054                     case 'h':
28055                         // repair horizontal alignment
28056                         return {
28057                             x: newPeer.x,
28058                             y: candidate.y
28059                         };
28060                 }
28061
28062                 return {
28063                     x: candidate.x,
28064                     y: candidate.y
28065                 };
28066             }
28067
28068             function removeOverlapping(points, a, b) {
28069                 var i;
28070
28071                 for (i = points.length - 2; i !== 0; i--) {
28072
28073                     // intersects (?) break, remove all bendpoints up to this one and
28074                     // relayout
28075                     if (Geometry.pointInRect(points[i], a, MIN_DISTANCE) ||
28076                         Geometry.pointInRect(points[i], b, MIN_DISTANCE)) {
28077
28078                         // return sliced old connection
28079                         return points.slice(i);
28080                     }
28081                 }
28082
28083                 return points;
28084             }
28085
28086
28087             // (0) only repair what has layoutable bendpoints
28088
28089             // (1) if only one bendpoint and on shape moved onto other shapes axis
28090             // (horizontally / vertically), relayout
28091
28092             if (needsRelayout(moved, other, points)) {
28093                 return null;
28094             }
28095
28096             var oldDocking = points[0],
28097                 newPoints = points.slice(),
28098                 slicedPoints;
28099
28100             // (2) repair only last line segment and only if it was layouted before
28101
28102             newPoints[0] = newDocking;
28103             newPoints[1] = repairBendpoint(newPoints[1], oldDocking, newDocking);
28104
28105
28106             // (3) if shape intersects with any bendpoint after repair,
28107             // remove all segments up to this bendpoint and repair from there
28108
28109             slicedPoints = removeOverlapping(newPoints, moved, other);
28110             if (slicedPoints !== newPoints) {
28111                 return this._repairConnectionSide(moved, other, newDocking, slicedPoints);
28112             }
28113
28114             return newPoints;
28115         };
28116
28117         /**
28118          * Returns the default manhattan directions connecting two rectangles.
28119          * 
28120          * @param {Bounds}
28121          *            source
28122          * @param {Bounds}
28123          *            target
28124          * @param {Boolean}
28125          *            preferVertical
28126          * 
28127          * @return {String}
28128          */
28129         module.exports.getDirections = function(source, target, preferVertical) {
28130             var orientation = LayoutUtil.getOrientation(source, target, MIN_DISTANCE);
28131
28132             switch (orientation) {
28133                 case 'intersect':
28134                     return null;
28135
28136                 case 'top':
28137                 case 'bottom':
28138                     return 'v:v';
28139
28140                 case 'left':
28141                 case 'right':
28142                     return 'h:h';
28143
28144                 default:
28145                     return preferVertical ? 'v:v' : 'h:h';
28146             }
28147         };
28148     }, {
28149         "../util/Geometry": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Geometry.js",
28150         "./LayoutUtil": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\layout\\LayoutUtil.js",
28151         "lodash/collection/find": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\find.js",
28152         "lodash/lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js"
28153     }],
28154     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\model\\index.js": [function(require, module, exports) {
28155         'use strict';
28156
28157         var assign = require('lodash/object/assign'),
28158             inherits = require('inherits');
28159
28160         var Refs = require('object-refs');
28161
28162         var parentRefs = new Refs({
28163                 name: 'children',
28164                 enumerable: true,
28165                 collection: true
28166             }, {
28167                 name: 'parent'
28168             }),
28169             labelRefs = new Refs({
28170                 name: 'label',
28171                 enumerable: true
28172             }, {
28173                 name: 'labelTarget'
28174             }),
28175             outgoingRefs = new Refs({
28176                 name: 'outgoing',
28177                 collection: true
28178             }, {
28179                 name: 'source'
28180             }),
28181             incomingRefs = new Refs({
28182                 name: 'incoming',
28183                 collection: true
28184             }, {
28185                 name: 'target'
28186             });
28187
28188         /**
28189          * @namespace djs.model
28190          */
28191
28192         /**
28193          * @memberOf djs.model
28194          */
28195
28196         /**
28197          * The basic graphical representation
28198          * 
28199          * @class
28200          * 
28201          * @abstract
28202          */
28203         function Base() {
28204
28205             /**
28206              * The object that backs up the shape
28207              * 
28208              * @name Base#businessObject
28209              * @type Object
28210              */
28211             Object.defineProperty(this, 'businessObject', {
28212                 writable: true
28213             });
28214
28215             /**
28216              * The parent shape
28217              * 
28218              * @name Base#parent
28219              * @type Shape
28220              */
28221             parentRefs.bind(this, 'parent');
28222
28223             /**
28224              * @name Base#label
28225              * @type Label
28226              */
28227             labelRefs.bind(this, 'label');
28228
28229             /**
28230              * The list of outgoing connections
28231              * 
28232              * @name Base#outgoing
28233              * @type Array<Connection>
28234              */
28235             outgoingRefs.bind(this, 'outgoing');
28236
28237             /**
28238              * The list of outgoing connections
28239              * 
28240              * @name Base#incoming
28241              * @type Array<Connection>
28242              */
28243             incomingRefs.bind(this, 'incoming');
28244         }
28245
28246
28247         /**
28248          * A graphical object
28249          * 
28250          * @class
28251          * @constructor
28252          * 
28253          * @extends Base
28254          */
28255         function Shape() {
28256             Base.call(this);
28257
28258             /**
28259              * The list of children
28260              * 
28261              * @name Shape#children
28262              * @type Array<Base>
28263              */
28264             parentRefs.bind(this, 'children');
28265         }
28266
28267         inherits(Shape, Base);
28268
28269
28270         /**
28271          * A root graphical object
28272          * 
28273          * @class
28274          * @constructor
28275          * 
28276          * @extends Shape
28277          */
28278         function Root() {
28279             Shape.call(this);
28280         }
28281
28282         inherits(Root, Shape);
28283
28284
28285         /**
28286          * A label for an element
28287          * 
28288          * @class
28289          * @constructor
28290          * 
28291          * @extends Shape
28292          */
28293         function Label() {
28294             Shape.call(this);
28295
28296             /**
28297              * The labeled element
28298              * 
28299              * @name Label#labelTarget
28300              * @type Base
28301              */
28302             labelRefs.bind(this, 'labelTarget');
28303         }
28304
28305         inherits(Label, Shape);
28306
28307
28308         /**
28309          * A connection between two elements
28310          * 
28311          * @class
28312          * @constructor
28313          * 
28314          * @extends Base
28315          */
28316         function Connection() {
28317             Base.call(this);
28318
28319             /**
28320              * The element this connection originates from
28321              * 
28322              * @name Connection#source
28323              * @type Base
28324              */
28325             outgoingRefs.bind(this, 'source');
28326
28327             /**
28328              * The element this connection points to
28329              * 
28330              * @name Connection#target
28331              * @type Base
28332              */
28333             incomingRefs.bind(this, 'target');
28334         }
28335
28336         inherits(Connection, Base);
28337
28338
28339         var types = {
28340             connection: Connection,
28341             shape: Shape,
28342             label: Label,
28343             root: Root
28344         };
28345
28346         /**
28347          * Creates a new model element of the specified type
28348          * 
28349          * @method create
28350          * 
28351          * @example
28352          * 
28353          * var shape1 = Model.create('shape', { x: 10, y: 10, width: 100, height: 100
28354          * }); var shape2 = Model.create('shape', { x: 210, y: 210, width: 100, height:
28355          * 100 });
28356          * 
28357          * var connection = Model.create('connection', { waypoints: [ { x: 110, y: 55 },
28358          * {x: 210, y: 55 } ] });
28359          * 
28360          * @param {String}
28361          *            type lower-cased model name
28362          * @param {Object}
28363          *            attrs attributes to initialize the new model instance with
28364          * 
28365          * @return {Base} the new model instance
28366          */
28367         module.exports.create = function(type, attrs) {
28368             var Type = types[type];
28369             if (!Type) {
28370                 throw new Error('unknown type: <' + type + '>');
28371             }
28372             return assign(new Type(), attrs);
28373         };
28374
28375
28376         module.exports.Base = Base;
28377         module.exports.Root = Root;
28378         module.exports.Shape = Shape;
28379         module.exports.Connection = Connection;
28380         module.exports.Label = Label;
28381     }, {
28382         "inherits": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\inherits\\inherits_browser.js",
28383         "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js",
28384         "object-refs": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\object-refs\\index.js"
28385     }],
28386     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\navigation\\movecanvas\\MoveCanvas.js": [function(require, module, exports) {
28387         'use strict';
28388
28389         var Cursor = require('../../util/Cursor'),
28390             ClickTrap = require('../../util/ClickTrap'),
28391             domEvent = require('min-dom/lib/event'),
28392             Event = require('../../util/Event');
28393
28394         function substract(p1, p2) {
28395             return {
28396                 x: p1.x - p2.x,
28397                 y: p1.y - p2.y
28398             };
28399         }
28400
28401         function length(point) {
28402             return Math.sqrt(Math.pow(point.x, 2) + Math.pow(point.y, 2));
28403         }
28404
28405
28406         var THRESHOLD = 15;
28407
28408
28409         function MoveCanvas(eventBus, canvas) {
28410
28411             var container = canvas._container,
28412                 context;
28413
28414
28415             function handleMove(event) {
28416
28417                 var start = context.start,
28418                     position = Event.toPoint(event),
28419                     delta = substract(position, start);
28420
28421                 if (!context.dragging && length(delta) > THRESHOLD) {
28422                     context.dragging = true;
28423
28424                     // prevent mouse click in this
28425                     // interaction sequence
28426                     ClickTrap.install();
28427
28428                     Cursor.set('move');
28429                 }
28430
28431                 if (context.dragging) {
28432
28433                     var lastPosition = context.last || context.start;
28434
28435                     delta = substract(position, lastPosition);
28436
28437                     canvas.scroll({
28438                         dx: delta.x,
28439                         dy: delta.y
28440                     });
28441
28442                     context.last = position;
28443                 }
28444
28445                 // prevent select
28446                 event.preventDefault();
28447             }
28448
28449
28450             function handleEnd(event) {
28451                 domEvent.unbind(document, 'mousemove', handleMove);
28452                 domEvent.unbind(document, 'mouseup', handleEnd);
28453
28454                 context = null;
28455
28456                 Cursor.unset();
28457
28458                 // prevent select
28459                 Event.stopEvent(event);
28460             }
28461
28462             function handleStart(event) {
28463
28464                 // reject non-left left mouse button or modifier key
28465                 if (event.button || event.ctrlKey || event.shiftKey || event.altKey) {
28466                     return;
28467                 }
28468
28469                 context = {
28470                     start: Event.toPoint(event)
28471                 };
28472
28473                 domEvent.bind(document, 'mousemove', handleMove);
28474                 domEvent.bind(document, 'mouseup', handleEnd);
28475
28476                 // prevent select
28477                 Event.stopEvent(event);
28478             }
28479
28480             domEvent.bind(container, 'mousedown', handleStart);
28481         }
28482
28483
28484         MoveCanvas.$inject = ['eventBus', 'canvas'];
28485
28486         module.exports = MoveCanvas;
28487
28488     }, {
28489         "../../util/ClickTrap": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\ClickTrap.js",
28490         "../../util/Cursor": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Cursor.js",
28491         "../../util/Event": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Event.js",
28492         "min-dom/lib/event": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\event.js"
28493     }],
28494     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\navigation\\movecanvas\\index.js": [function(require, module, exports) {
28495         module.exports = {
28496             __init__: ['moveCanvas'],
28497             moveCanvas: ['type', require('./MoveCanvas')]
28498         };
28499     }, {
28500         "./MoveCanvas": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\navigation\\movecanvas\\MoveCanvas.js"
28501     }],
28502     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\navigation\\touch\\index.js": [function(require, module, exports) {
28503         module.exports = {
28504             __depends__: [require('../../features/touch')]
28505         };
28506     }, {
28507         "../../features/touch": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\features\\touch\\index.js"
28508     }],
28509     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\navigation\\zoomscroll\\ZoomScroll.js": [function(require, module, exports) {
28510         'use strict';
28511
28512         var domEvent = require('min-dom/lib/event');
28513
28514         var hasPrimaryModifier = require('../../util/Mouse').hasPrimaryModifier,
28515             hasSecondaryModifier = require('../../util/Mouse').hasSecondaryModifier;
28516
28517         var isMac = require('../../util/Platform').isMac;
28518
28519
28520         function ZoomScroll(events, canvas) {
28521                 var $canvas = $( canvas.getContainer() ), //canvas.getContainer() 
28522             $controls = $( '<div></div>' ),
28523             $zoomOut = $( '<div><span class="glyphicon glyphicon-zoom-out"></span></div>' ),
28524             $zoomIn = $( '<div><span class="glyphicon glyphicon-zoom-in"></span></div>' ),
28525             $zoomFit= $( '<div><span class="glyphicon glyphicon-fullscreen"></span></div>' ),
28526             zlevel = 1,
28527             zstep = 0.2;
28528
28529         $canvas.append( $controls );
28530         $controls.append( $zoomIn );
28531         $controls.append( $zoomOut );
28532         $controls.append( $zoomFit );
28533
28534         $controls.addClass( 'zoom-controls' );
28535         $zoomOut.addClass( 'zoom zoom-out' );
28536         $zoomIn.addClass( 'zoom zoom-in' );
28537         $zoomFit.addClass( 'zoom zoom-fit' );
28538
28539         $zoomOut.attr( 'title', 'Zoom out' );
28540         $zoomIn.attr( 'title', 'Zoom in' );
28541         $zoomFit.attr( 'title', 'Fit to viewport' );
28542
28543         // set initial zoom level
28544         //canvas.zoom( zlevel, 'auto' );
28545
28546         // update our zoom level on viewbox change
28547         events.on( 'canvas.viewbox.changed', function( evt ) {
28548             zlevel = evt.viewbox.scale;
28549         });
28550
28551         // define click handlers for controls
28552         $zoomFit.on( 'click', function() {
28553             canvas.zoom( 'fit-viewport', 'auto' );
28554         });
28555
28556         $zoomOut.on( 'click', function() {
28557             zlevel = Math.max( zlevel - zstep, zstep );
28558             canvas.zoom( zlevel, 'auto' );
28559         });
28560         
28561         $zoomIn.on( 'click', function() {
28562             zlevel = Math.min( zlevel + zstep, 7 );
28563             canvas.zoom( zlevel, 'auto' );
28564         });
28565         
28566         $(".TCS").click(function() {
28567                 console.log($(this).data("stuff"));
28568                 var modelElements = $(this).data("stuff").modelElements;
28569                 var modelName = $(this).data("model").name;
28570                 var hElements = [];
28571                 modelElements.forEach(function(mElement){
28572                         if(hElements.indexOf(mElement.elementID)==-1){
28573                                 hElements.push(mElement.elementID);
28574                         }
28575                 });
28576                 highlightPath(hElements);
28577         });
28578         
28579         function highlightPath(hElements){
28580                 clear();
28581             var elementRegistry = canvas._elementRegistry;
28582             //console.log(elementRegistry);
28583             hElements.forEach(function(hElement){
28584                 try{
28585                 //console.log(hElement);
28586                 var activityShape = elementRegistry.get(hElement);
28587                 var outgoing = activityShape.incoming;
28588                 
28589                 if (canvas.hasMarker(hElement, 'highlight')) {
28590                         canvas.removeMarker(hElement, 'highlight');
28591                         outgoing.forEach(function(flow){
28592                         var outgoingGfx = elementRegistry.getGraphics(flow.id);
28593                         if(hElements.indexOf(flow.id)!=-1){
28594                                 outgoingGfx.select('path').attr({stroke: 'black'});
28595                         }
28596                     });
28597                 } else {
28598                         canvas.addMarker(hElement, 'highlight');
28599                         outgoing.forEach(function(flow){
28600                         var outgoingGfx = elementRegistry.getGraphics(flow.id);
28601                         if(hElements.indexOf(flow.id)!=-1){
28602                                 outgoingGfx.select('path').attr({stroke: 'blue'});
28603                         }
28604                     });
28605                 }
28606                 }catch(err){
28607                         //console.log(err);
28608                 }
28609                 
28610             });
28611         }
28612         
28613         function clear() {
28614                 var elementRegistry = canvas._elementRegistry;
28615                 elementRegistry.forEach(function(hElement){
28616                         try {
28617                                 canvas.removeMarker(hElement, 'highlight');
28618                                 var outgoing = hElement.incoming;
28619                                 outgoing.forEach(function(flow){
28620                             var outgoingGfx = elementRegistry.getGraphics(flow.id);
28621                             outgoingGfx.select('path').attr({stroke: 'black'});
28622                         });
28623                         }catch(err){
28624                                 
28625                         }
28626                 });
28627         }
28628         
28629         //console.log('endzoom');
28630                 
28631                 
28632             var RANGE = {
28633                 min: 0.2,
28634                 max: 4
28635             };
28636
28637             function cap(scale) {
28638                 return Math.max(RANGE.min, Math.min(RANGE.max, scale));
28639             }
28640
28641             function reset() {
28642                 canvas.zoom('fit-viewport');
28643             }
28644
28645             function zoom(direction, position) {
28646
28647                 var currentZoom = canvas.zoom();
28648                 var factor = Math.pow(1 + Math.abs(direction), direction > 0 ? 1 : -1);
28649
28650                 canvas.zoom(cap(currentZoom * factor), position);
28651             }
28652
28653             function scroll(delta) {
28654                 canvas.scroll(delta);
28655             }
28656
28657             function init(element) {
28658
28659                 domEvent.bind(element, 'wheel', function(event) {/*
28660
28661                     event.preventDefault();
28662
28663                     // mouse-event: SELECTION_KEY
28664                     // mouse-event: AND_KEY
28665                     var isVerticalScroll = hasPrimaryModifier(event),
28666                         isHorizontalScroll = hasSecondaryModifier(event);
28667
28668                     var factor;
28669
28670                     if (isVerticalScroll || isHorizontalScroll) {
28671
28672                         if (isMac) {
28673                             factor = event.deltaMode === 0 ? 1.25 : 50;
28674                         } else {
28675                             factor = event.deltaMode === 0 ? 1 / 40 : 1 / 2;
28676                         }
28677
28678                         var delta = {};
28679
28680                         if (isHorizontalScroll) {
28681                             delta.dx = (factor * (event.deltaX || event.deltaY));
28682                         } else {
28683                             delta.dy = (factor * event.deltaY);
28684                         }
28685
28686                         scroll(delta);
28687                     } else {
28688                         factor = (event.deltaMode === 0 ? 1 / 40 : 1 / 2);
28689
28690                         var elementRect = element.getBoundingClientRect();
28691
28692                         var offset = {
28693                             x: event.clientX - elementRect.left,
28694                             y: event.clientY - elementRect.top
28695                         };
28696
28697                         // zoom in relative to diagram {x,y} coordinates
28698                         zoom(event.deltaY * factor / (-5), offset);
28699                     }
28700                 */});
28701             }
28702
28703             events.on('canvas.init', function(e) {
28704                 init(canvas._container);
28705             });
28706
28707             // API
28708             this.zoom = zoom;
28709             this.reset = reset;
28710         }
28711
28712
28713         ZoomScroll.$inject = ['eventBus', 'canvas'];
28714
28715         module.exports = ZoomScroll;
28716
28717
28718     }, {
28719         "../../util/Mouse": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Mouse.js",
28720         "../../util/Platform": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Platform.js",
28721         "min-dom/lib/event": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\event.js"
28722     }],
28723     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\navigation\\zoomscroll\\index.js": [function(require, module, exports) {
28724         module.exports = {
28725             __init__: ['zoomScroll'],
28726             zoomScroll: ['type', require('./ZoomScroll')]
28727         };
28728     }, {
28729         "./ZoomScroll": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\navigation\\zoomscroll\\ZoomScroll.js"
28730     }],
28731     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\ClickTrap.js": [function(require, module, exports) {
28732         'use strict';
28733
28734         var domEvent = require('min-dom/lib/event'),
28735             stopEvent = require('./Event').stopEvent;
28736
28737         function trap(event) {
28738             stopEvent(event);
28739
28740             toggle(false);
28741         }
28742
28743         function toggle(active) {
28744             domEvent[active ? 'bind' : 'unbind'](document.body, 'click', trap, true);
28745         }
28746
28747         /**
28748          * Installs a click trap that prevents a ghost click following a dragging
28749          * operation.
28750          * 
28751          * @return {Function} a function to immediately remove the installed trap.
28752          */
28753         function install() {
28754
28755             toggle(true);
28756
28757             return function() {
28758                 toggle(false);
28759             };
28760         }
28761
28762         module.exports.install = install;
28763     }, {
28764         "./Event": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Event.js",
28765         "min-dom/lib/event": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\event.js"
28766     }],
28767     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Collections.js": [function(require, module, exports) {
28768         'use strict';
28769
28770         /**
28771          * Failsafe remove an element from a collection
28772          * 
28773          * @param {Array
28774          *            <Object>} [collection]
28775          * @param {Object}
28776          *            [element]
28777          * 
28778          * @return {Object} the element that got removed or undefined
28779          */
28780         module.exports.remove = function(collection, element) {
28781
28782             if (!collection || !element) {
28783                 return;
28784             }
28785
28786             var idx = collection.indexOf(element);
28787             if (idx === -1) {
28788                 return;
28789             }
28790
28791             collection.splice(idx, 1);
28792
28793             return element;
28794         };
28795
28796         /**
28797          * Fail save add an element to the given connection, ensuring it does not yet
28798          * exist.
28799          * 
28800          * @param {Array
28801          *            <Object>} collection
28802          * @param {Object}
28803          *            element
28804          * @param {Number}
28805          *            idx
28806          */
28807         module.exports.add = function(collection, element, idx) {
28808
28809             if (!collection || !element) {
28810                 return;
28811             }
28812
28813             if (isNaN(idx)) {
28814                 idx = -1;
28815             }
28816
28817             var currentIdx = collection.indexOf(element);
28818
28819             if (currentIdx !== -1) {
28820
28821                 if (currentIdx === idx) {
28822                     // nothing to do, position has not changed
28823                     return;
28824                 } else {
28825
28826                     if (idx !== -1) {
28827                         // remove from current position
28828                         collection.splice(currentIdx, 1);
28829                     } else {
28830                         // already exists in collection
28831                         return;
28832                     }
28833                 }
28834             }
28835
28836             if (idx !== -1) {
28837                 // insert at specified position
28838                 collection.splice(idx, 0, element);
28839             } else {
28840                 // push to end
28841                 collection.push(element);
28842             }
28843         };
28844
28845
28846         /**
28847          * Fail get the index of an element in a collection.
28848          * 
28849          * @param {Array
28850          *            <Object>} collection
28851          * @param {Object}
28852          *            element
28853          * 
28854          * @return {Number} the index or -1 if collection or element do not exist or the
28855          *         element is not contained.
28856          */
28857         module.exports.indexOf = function(collection, element) {
28858
28859             if (!collection || !element) {
28860                 return -1;
28861             }
28862
28863             return collection.indexOf(element);
28864         };
28865
28866     }, {}],
28867     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Cursor.js": [function(require, module, exports) {
28868         'use strict';
28869
28870         var domClasses = require('min-dom/lib/classes');
28871
28872         var CURSOR_CLS_PATTERN = /^djs-cursor-.*$/;
28873
28874
28875         module.exports.set = function(mode) {
28876             var classes = domClasses(document.body);
28877
28878             classes.removeMatching(CURSOR_CLS_PATTERN);
28879
28880             if (mode) {
28881                 classes.add('djs-cursor-' + mode);
28882             }
28883         };
28884
28885         module.exports.unset = function() {
28886             this.set(null);
28887         };
28888     }, {
28889         "min-dom/lib/classes": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\classes.js"
28890     }],
28891     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Elements.js": [function(require, module, exports) {
28892         'use strict';
28893
28894         var isArray = require('lodash/lang/isArray'),
28895             isNumber = require('lodash/lang/isNumber'),
28896             groupBy = require('lodash/collection/groupBy'),
28897             forEach = require('lodash/collection/forEach');
28898
28899         /**
28900          * Adds an element to a collection and returns true if the element was added.
28901          * 
28902          * @param {Array
28903          *            <Object>} elements
28904          * @param {Object}
28905          *            e
28906          * @param {Boolean}
28907          *            unique
28908          */
28909         function add(elements, e, unique) {
28910             var canAdd = !unique || elements.indexOf(e) === -1;
28911
28912             if (canAdd) {
28913                 elements.push(e);
28914             }
28915
28916             return canAdd;
28917         }
28918
28919         function eachElement(elements, fn, depth) {
28920
28921             depth = depth || 0;
28922
28923             forEach(elements, function(s, i) {
28924                 var filter = fn(s, i, depth);
28925
28926                 if (isArray(filter) && filter.length) {
28927                     eachElement(filter, fn, depth + 1);
28928                 }
28929             });
28930         }
28931
28932         /**
28933          * Collects self + child elements up to a given depth from a list of elements.
28934          * 
28935          * @param {Array
28936          *            <djs.model.Base>} elements the elements to select the children
28937          *            from
28938          * @param {Boolean}
28939          *            unique whether to return a unique result set (no duplicates)
28940          * @param {Number}
28941          *            maxDepth the depth to search through or -1 for infinite
28942          * 
28943          * @return {Array<djs.model.Base>} found elements
28944          */
28945         function selfAndChildren(elements, unique, maxDepth) {
28946             var result = [],
28947                 processedChildren = [];
28948
28949             eachElement(elements, function(element, i, depth) {
28950                 add(result, element, unique);
28951
28952                 var children = element.children;
28953
28954                 // max traversal depth not reached yet
28955                 if (maxDepth === -1 || depth < maxDepth) {
28956
28957                     // children exist && children not yet processed
28958                     if (children && add(processedChildren, children, unique)) {
28959                         return children;
28960                     }
28961                 }
28962             });
28963
28964             return result;
28965         }
28966
28967         /**
28968          * Return self + direct children for a number of elements
28969          * 
28970          * @param {Array
28971          *            <djs.model.Base>} elements to query
28972          * @param {Boolean}
28973          *            allowDuplicates to allow duplicates in the result set
28974          * 
28975          * @return {Array<djs.model.Base>} the collected elements
28976          */
28977         function selfAndDirectChildren(elements, allowDuplicates) {
28978             return selfAndChildren(elements, !allowDuplicates, 1);
28979         }
28980
28981         /**
28982          * Return self + ALL children for a number of elements
28983          * 
28984          * @param {Array
28985          *            <djs.model.Base>} elements to query
28986          * @param {Boolean}
28987          *            allowDuplicates to allow duplicates in the result set
28988          * 
28989          * @return {Array<djs.model.Base>} the collected elements
28990          */
28991         function selfAndAllChildren(elements, allowDuplicates) {
28992             return selfAndChildren(elements, !allowDuplicates, -1);
28993         }
28994
28995         /**
28996          * Gets the the closure fo all selected elements, their connections and
28997          * 
28998          * @param {Array
28999          *            <djs.model.Base>} elements
29000          * @return {Object} enclosure
29001          */
29002         function getClosure(elements) {
29003
29004             // original elements passed to this function
29005             var topLevel = groupBy(elements, function(e) {
29006                 return e.id;
29007             });
29008
29009             var allShapes = {},
29010                 allConnections = {},
29011                 enclosedElements = {},
29012                 enclosedConnections = {};
29013
29014             function handleConnection(c) {
29015                 if (topLevel[c.source.id] && topLevel[c.target.id]) {
29016                     topLevel[c.id] = c;
29017                 }
29018
29019                 // not enclosed as a child, but maybe logically
29020                 // (connecting two moved elements?)
29021                 if (allShapes[c.source.id] && allShapes[c.target.id]) {
29022                     enclosedConnections[c.id] = enclosedElements[c.id] = c;
29023                 }
29024
29025                 allConnections[c.id] = c;
29026             }
29027
29028             function handleElement(element) {
29029
29030                 enclosedElements[element.id] = element;
29031
29032                 if (element.waypoints) {
29033                     // remember connection
29034                     enclosedConnections[element.id] = allConnections[element.id] = element;
29035                 } else {
29036                     // remember shape
29037                     allShapes[element.id] = element;
29038
29039                     // remember all connections
29040                     forEach(element.incoming, handleConnection);
29041
29042                     forEach(element.outgoing, handleConnection);
29043
29044                     // recurse into children
29045                     return element.children;
29046                 }
29047             }
29048
29049             eachElement(elements, handleElement);
29050
29051             return {
29052                 allShapes: allShapes,
29053                 allConnections: allConnections,
29054                 topLevel: topLevel,
29055                 enclosedConnections: enclosedConnections,
29056                 enclosedElements: enclosedElements
29057             };
29058         }
29059
29060         /**
29061          * Returns the surrounding bbox for all elements in the array or the element
29062          * primitive.
29063          */
29064         function getBBox(elements, stopRecursion) {
29065
29066             stopRecursion = !!stopRecursion;
29067             if (!isArray(elements)) {
29068                 elements = [elements];
29069             }
29070
29071             var minX,
29072                 minY,
29073                 maxX,
29074                 maxY;
29075
29076             forEach(elements, function(element) {
29077
29078                 // If element is a connection the bbox must be computed first
29079                 var bbox = element;
29080                 if (element.waypoints && !stopRecursion) {
29081                     bbox = getBBox(element.waypoints, true);
29082                 }
29083
29084                 var x = bbox.x,
29085                     y = bbox.y,
29086                     height = bbox.height || 0,
29087                     width = bbox.width || 0;
29088
29089                 if (x < minX || minX === undefined) {
29090                     minX = x;
29091                 }
29092                 if (y < minY || minY === undefined) {
29093                     minY = y;
29094                 }
29095
29096                 if ((x + width) > maxX || maxX === undefined) {
29097                     maxX = x + width;
29098                 }
29099                 if ((y + height) > maxY || maxY === undefined) {
29100                     maxY = y + height;
29101                 }
29102             });
29103
29104             return {
29105                 x: minX,
29106                 y: minY,
29107                 height: maxY - minY,
29108                 width: maxX - minX
29109             };
29110         }
29111
29112
29113         /**
29114          * Returns all elements that are enclosed from the bounding box.
29115          * 
29116          * @param {Array
29117          *            <Object>} elements List of Elements to search through
29118          * @param {Object}
29119          *            bbox the enclosing bbox.
29120          *            <ul>
29121          *            <li>If bbox.(width|height) is not specified the method returns
29122          *            all elements with element.x/y &gt; bbox.x/y </li>
29123          *            <li>If only bbox.x or bbox.y is specified, method return all
29124          *            elements with e.x &gt; bbox.x or e.y &gt; bbox.y.</li>
29125          *            </ul>
29126          * 
29127          */
29128         function getEnclosedElements(elements, bbox) {
29129
29130             var filteredElements = {};
29131
29132             forEach(elements, function(element) {
29133
29134                 var e = element;
29135
29136                 if (e.waypoints) {
29137                     e = getBBox(e);
29138                 }
29139
29140                 if (!isNumber(bbox.y) && (e.x > bbox.x)) {
29141                     filteredElements[element.id] = element;
29142                 }
29143                 if (!isNumber(bbox.x) && (e.y > bbox.y)) {
29144                     filteredElements[element.id] = element;
29145                 }
29146                 if (e.x > bbox.x && e.y > bbox.y) {
29147                     if (isNumber(bbox.width) && isNumber(bbox.height) &&
29148                         e.width + e.x < bbox.width + bbox.x &&
29149                         e.height + e.y < bbox.height + bbox.y) {
29150
29151                         filteredElements[element.id] = element;
29152                     } else if (!isNumber(bbox.width) || !isNumber(bbox.height)) {
29153                         filteredElements[element.id] = element;
29154                     }
29155                 }
29156             });
29157
29158             return filteredElements;
29159         }
29160
29161
29162
29163         module.exports.eachElement = eachElement;
29164         module.exports.selfAndDirectChildren = selfAndDirectChildren;
29165         module.exports.selfAndAllChildren = selfAndAllChildren;
29166         module.exports.getBBox = getBBox;
29167         module.exports.getEnclosedElements = getEnclosedElements;
29168
29169         module.exports.getClosure = getClosure;
29170
29171     }, {
29172         "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
29173         "lodash/collection/groupBy": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\groupBy.js",
29174         "lodash/lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js",
29175         "lodash/lang/isNumber": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isNumber.js"
29176     }],
29177     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Event.js": [function(require, module, exports) {
29178         'use strict';
29179
29180         function __preventDefault(event) {
29181             return event && event.preventDefault();
29182         }
29183
29184         function __stopPropagation(event, immediate) {
29185             if (!event) {
29186                 return;
29187             }
29188
29189             if (event.stopPropagation) {
29190                 event.stopPropagation();
29191             }
29192
29193             if (immediate && event.stopImmediatePropagation) {
29194                 event.stopImmediatePropagation();
29195             }
29196         }
29197
29198
29199         function getOriginal(event) {
29200             return event.originalEvent || event.srcEvent;
29201         }
29202
29203         module.exports.getOriginal = getOriginal;
29204
29205
29206         function stopEvent(event, immediate) {
29207             stopPropagation(event, immediate);
29208             preventDefault(event);
29209         }
29210
29211         module.exports.stopEvent = stopEvent;
29212
29213
29214         function preventDefault(event) {
29215             __preventDefault(event);
29216             __preventDefault(getOriginal(event));
29217         }
29218
29219         module.exports.preventDefault = preventDefault;
29220
29221
29222         function stopPropagation(event, immediate) {
29223             __stopPropagation(event, immediate);
29224             __stopPropagation(getOriginal(event), immediate);
29225         }
29226
29227         module.exports.stopPropagation = stopPropagation;
29228
29229
29230         function toPoint(event) {
29231
29232             if (event.pointers && event.pointers.length) {
29233                 event = event.pointers[0];
29234             }
29235
29236             if (event.touches && event.touches.length) {
29237                 event = event.touches[0];
29238             }
29239
29240             return event ? {
29241                 x: event.clientX,
29242                 y: event.clientY
29243             } : null;
29244         }
29245
29246         module.exports.toPoint = toPoint;
29247
29248     }, {}],
29249     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Geometry.js": [function(require, module, exports) {
29250         'use strict';
29251
29252         /**
29253          * Computes the distance between two points
29254          * 
29255          * @param {Point}
29256          *            p
29257          * @param {Point}
29258          *            q
29259          * 
29260          * @return {Number} distance
29261          */
29262         var distance = module.exports.distance = function(p, q) {
29263             return Math.sqrt(Math.pow(q.x - p.x, 2) + Math.pow(q.y - p.y, 2));
29264         };
29265
29266         /**
29267          * Returns true if the point r is on the line between p and y
29268          * 
29269          * @param {Point}
29270          *            p
29271          * @param {Point}
29272          *            q
29273          * @param {Point}
29274          *            r
29275          * 
29276          * @return {Boolean}
29277          */
29278         module.exports.pointsOnLine = function(p, q, r) {
29279
29280             if (!p || !q || !r) {
29281                 return false;
29282             }
29283
29284             var val = (q.x - p.x) * (r.y - p.y) - (q.y - p.y) * (r.x - p.x),
29285                 dist = distance(p, q);
29286
29287             // @see http://stackoverflow.com/a/907491/412190
29288             return Math.abs(val / dist) < 5;
29289         };
29290
29291         module.exports.pointInRect = function(p, rect, tolerance) {
29292             tolerance = tolerance || 0;
29293
29294             return p.x > rect.x - tolerance &&
29295                 p.y > rect.y - tolerance &&
29296                 p.x < rect.x + rect.width + tolerance &&
29297                 p.y < rect.y + rect.height + tolerance;
29298         };
29299     }, {}],
29300     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\GraphicsUtil.js": [function(require, module, exports) {
29301         'use strict';
29302
29303         /**
29304          * SVGs for elements are generated by the {@link GraphicsFactory}.
29305          * 
29306          * This utility gives quick access to the important semantic parts of an
29307          * element.
29308          */
29309
29310         /**
29311          * Returns the visual part of a diagram element
29312          * 
29313          * @param {Snap
29314          *            <SVGElement>} gfx
29315          * 
29316          * @return {Snap<SVGElement>}
29317          */
29318         function getVisual(gfx) {
29319             return gfx.select('.djs-visual');
29320         }
29321
29322         /**
29323          * Returns the children for a given diagram element.
29324          * 
29325          * @param {Snap
29326          *            <SVGElement>} gfx
29327          * @return {Snap<SVGElement>}
29328          */
29329         function getChildren(gfx) {
29330             return gfx.parent().children()[1];
29331         }
29332
29333         /**
29334          * Returns the visual bbox of an element
29335          * 
29336          * @param {Snap
29337          *            <SVGElement>} gfx
29338          * 
29339          * @return {Bounds}
29340          */
29341         function getBBox(gfx) {
29342             return getVisual(gfx).select('*').getBBox();
29343         }
29344
29345
29346         module.exports.getVisual = getVisual;
29347         module.exports.getChildren = getChildren;
29348         module.exports.getBBox = getBBox;
29349     }, {}],
29350     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\IdGenerator.js": [function(require, module, exports) {
29351         'use strict';
29352
29353         /**
29354          * Util that provides unique IDs.
29355          * 
29356          * @class djs.util.IdGenerator
29357          * @constructor
29358          * @memberOf djs.util
29359          * 
29360          * The ids can be customized via a given prefix and contain a random value to
29361          * avoid collisions.
29362          * 
29363          * @param {String}
29364          *            prefix a prefix to prepend to generated ids (for better
29365          *            readability)
29366          */
29367         function IdGenerator(prefix) {
29368
29369             this._counter = 0;
29370             this._prefix = (prefix ? prefix + '-' : '') + Math.floor(Math.random() * 1000000000) + '-';
29371         }
29372
29373         module.exports = IdGenerator;
29374
29375         /**
29376          * Returns a next unique ID.
29377          * 
29378          * @method djs.util.IdGenerator#next
29379          * 
29380          * @returns {String} the id
29381          */
29382         IdGenerator.prototype.next = function() {
29383             return this._prefix + (++this._counter);
29384         };
29385
29386     }, {}],
29387     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Mouse.js": [function(require, module, exports) {
29388         'use strict';
29389
29390         var getOriginalEvent = require('./Event').getOriginal;
29391
29392         var isMac = require('./Platform').isMac;
29393
29394
29395         function isPrimaryButton(event) {
29396             // button === 0 -> left ÃƒÆ’ƒÂ¡ka primary mouse button
29397             return !(getOriginalEvent(event) || event).button;
29398         }
29399
29400         module.exports.isPrimaryButton = isPrimaryButton;
29401
29402         module.exports.isMac = isMac;
29403
29404         module.exports.hasPrimaryModifier = function(event) {
29405             var originalEvent = getOriginalEvent(event) || event;
29406
29407             if (!isPrimaryButton(event)) {
29408                 return false;
29409             }
29410
29411             // Use alt as primary modifier key for mac OS
29412             if (isMac()) {
29413                 return originalEvent.altKey;
29414             } else {
29415                 return originalEvent.ctrlKey;
29416             }
29417         };
29418
29419
29420         module.exports.hasSecondaryModifier = function(event) {
29421             var originalEvent = getOriginalEvent(event) || event;
29422
29423             return isPrimaryButton(event) && originalEvent.shiftKey;
29424         };
29425
29426     }, {
29427         "./Event": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Event.js",
29428         "./Platform": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Platform.js"
29429     }],
29430     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Platform.js": [function(require, module, exports) {
29431         'use strict';
29432
29433         module.exports.isMac = function isMac() {
29434             return (/mac/i).test(navigator.platform);
29435         };
29436     }, {}],
29437     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\lib\\util\\Text.js": [function(require, module, exports) {
29438         'use strict';
29439
29440         var isObject = require('lodash/lang/isObject'),
29441             assign = require('lodash/object/assign'),
29442             forEach = require('lodash/collection/forEach'),
29443             reduce = require('lodash/collection/reduce'),
29444             merge = require('lodash/object/merge');
29445
29446         var Snap = require('../../vendor/snapsvg');
29447
29448         var DEFAULT_BOX_PADDING = 0;
29449
29450         var DEFAULT_LABEL_SIZE = {
29451             width: 150,
29452             height: 50
29453         };
29454
29455
29456         function parseAlign(align) {
29457
29458             var parts = align.split('-');
29459
29460             return {
29461                 horizontal: parts[0] || 'center',
29462                 vertical: parts[1] || 'top'
29463             };
29464         }
29465
29466         function parsePadding(padding) {
29467
29468             if (isObject(padding)) {
29469                 return assign({
29470                     top: 0,
29471                     left: 0,
29472                     right: 0,
29473                     bottom: 0
29474                 }, padding);
29475             } else {
29476                 return {
29477                     top: padding,
29478                     left: padding,
29479                     right: padding,
29480                     bottom: padding
29481                 };
29482             }
29483         }
29484
29485         function getTextBBox(text, fakeText) {
29486             fakeText.textContent = text;
29487             return fakeText.getBBox();
29488         }
29489
29490
29491         /**
29492          * Layout the next line and return the layouted element.
29493          * 
29494          * Alters the lines passed.
29495          * 
29496          * @param {Array
29497          *            <String>} lines
29498          * @return {Object} the line descriptor, an object { width, height, text }
29499          */
29500         function layoutNext(lines, maxWidth, fakeText) {
29501
29502             var originalLine = lines.shift(),
29503                 fitLine = originalLine;
29504
29505             var textBBox;
29506
29507             while (true) {
29508                 textBBox = getTextBBox(fitLine, fakeText);
29509
29510                 textBBox.width = fitLine ? textBBox.width : 0;
29511
29512                 // try to fit
29513                 if (fitLine === ' ' || fitLine === '' || textBBox.width < Math.round(maxWidth) || fitLine.length < 4) {
29514                     return fit(lines, fitLine, originalLine, textBBox);
29515                 }
29516
29517
29518                 fitLine = shortenLine(fitLine, textBBox.width, maxWidth);
29519             }
29520         }
29521
29522         function fit(lines, fitLine, originalLine, textBBox) {
29523             if (fitLine.length < originalLine.length) {
29524                 var nextLine = lines[0] || '',
29525                     remainder = originalLine.slice(fitLine.length).trim();
29526
29527                 if (/-\s*$/.test(remainder)) {
29528                     nextLine = remainder.replace(/-\s*$/, '') + nextLine.replace(/^\s+/, '');
29529                 } else {
29530                     nextLine = remainder + ' ' + nextLine;
29531                 }
29532
29533                 lines[0] = nextLine;
29534             }
29535             return {
29536                 width: textBBox.width,
29537                 height: textBBox.height,
29538                 text: fitLine
29539             };
29540         }
29541
29542
29543         /**
29544          * Shortens a line based on spacing and hyphens. Returns the shortened result on
29545          * success.
29546          * 
29547          * @param {String}
29548          *            line
29549          * @param {Number}
29550          *            maxLength the maximum characters of the string
29551          * @return {String} the shortened string
29552          */
29553         function semanticShorten(line, maxLength) {
29554             var parts = line.split(/(\s|-)/g),
29555                 part,
29556                 shortenedParts = [],
29557                 length = 0;
29558
29559             // try to shorten via spaces + hyphens
29560             if (parts.length > 1) {
29561                 while ((part = parts.shift())) {
29562                     if (part.length + length < maxLength) {
29563                         shortenedParts.push(part);
29564                         length += part.length;
29565                     } else {
29566                         // remove previous part, too if hyphen does not fit anymore
29567                         if (part === '-') {
29568                             shortenedParts.pop();
29569                         }
29570
29571                         break;
29572                     }
29573                 }
29574             }
29575
29576             return shortenedParts.join('');
29577         }
29578
29579
29580         function shortenLine(line, width, maxWidth) {
29581             var length = Math.max(line.length * (maxWidth / width), 1);
29582
29583             // try to shorten semantically (i.e. based on spaces and hyphens)
29584             var shortenedLine = semanticShorten(line, length);
29585
29586             if (!shortenedLine) {
29587
29588                 // force shorten by cutting the long word
29589                 shortenedLine = line.slice(0, Math.max(Math.round(length - 1), 1));
29590             }
29591
29592             return shortenedLine;
29593         }
29594
29595
29596         /**
29597          * Creates a new label utility
29598          * 
29599          * @param {Object}
29600          *            config
29601          * @param {Dimensions}
29602          *            config.size
29603          * @param {Number}
29604          *            config.padding
29605          * @param {Object}
29606          *            config.style
29607          * @param {String}
29608          *            config.align
29609          */
29610         function Text(config) {
29611
29612             this._config = assign({}, {
29613                 size: DEFAULT_LABEL_SIZE,
29614                 padding: DEFAULT_BOX_PADDING,
29615                 style: {},
29616                 align: 'center-top'
29617             }, config || {});
29618         }
29619
29620
29621         /**
29622          * Create a label in the parent node.
29623          * 
29624          * @method Text#createText
29625          * 
29626          * @param {SVGElement}
29627          *            parent the parent to draw the label on
29628          * @param {String}
29629          *            text the text to render on the label
29630          * @param {Object}
29631          *            options
29632          * @param {String}
29633          *            options.align how to align in the bounding box. Any of {
29634          *            'center-middle', 'center-top' }, defaults to 'center-top'.
29635          * @param {String}
29636          *            options.style style to be applied to the text
29637          * 
29638          * @return {SVGText} the text element created
29639          */
29640         Text.prototype.createText = function(parent, text, options) {
29641
29642             var box = merge({}, this._config.size, options.box || {}),
29643                 style = merge({}, this._config.style, options.style || {}),
29644                 align = parseAlign(options.align || this._config.align),
29645                 padding = parsePadding(options.padding !== undefined ? options.padding : this._config.padding);
29646
29647             var lines = text.split(/\r?\n/g),
29648                 layouted = [];
29649
29650             var maxWidth = box.width - padding.left - padding.right;
29651
29652             // FF regression: ensure text is shown during rendering
29653             // by attaching it directly to the body
29654             var fakeText = parent.paper.text(0, 0, '').attr(style).node;
29655
29656             while (lines.length) {
29657                 layouted.push(layoutNext(lines, maxWidth, fakeText));
29658             }
29659
29660             var totalHeight = reduce(layouted, function(sum, line, idx) {
29661                 return sum + line.height;
29662             }, 0);
29663
29664             // the y position of the next line
29665             var y, x;
29666
29667             switch (align.vertical) {
29668                 case 'middle':
29669                     y = (box.height - totalHeight) / 2 - layouted[0].height / 4;
29670                     break;
29671
29672                 default:
29673                     y = padding.top;
29674             }
29675
29676             var textElement = parent.text().attr(style);
29677
29678             forEach(layouted, function(line) {
29679                 y += line.height;
29680
29681                 switch (align.horizontal) {
29682                     case 'left':
29683                         x = padding.left;
29684                         break;
29685
29686                     case 'right':
29687                         x = (maxWidth - padding.right - line.width);
29688                         break;
29689
29690                     default:
29691                         // aka center
29692                         x = Math.max(((maxWidth - line.width) / 2 + padding.left), 0);
29693                 }
29694
29695
29696                 var tspan = Snap.create('tspan', {
29697                     x: x,
29698                     y: y
29699                 }).node;
29700                 tspan.textContent = line.text;
29701
29702                 textElement.append(tspan);
29703             });
29704
29705             // remove fake text
29706             fakeText.parentNode.removeChild(fakeText);
29707
29708             return textElement;
29709         };
29710
29711
29712         module.exports = Text;
29713     }, {
29714         "../../vendor/snapsvg": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\vendor\\snapsvg.js",
29715         "lodash/collection/forEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js",
29716         "lodash/collection/reduce": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\reduce.js",
29717         "lodash/lang/isObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isObject.js",
29718         "lodash/object/assign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js",
29719         "lodash/object/merge": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\merge.js"
29720     }],
29721     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\didi\\lib\\annotation.js": [function(require, module, exports) {
29722
29723         var isArray = function(obj) {
29724             return Object.prototype.toString.call(obj) === '[object Array]';
29725         };
29726
29727         var annotate = function() {
29728             var args = Array.prototype.slice.call(arguments);
29729
29730             if (args.length === 1 && isArray(args[0])) {
29731                 args = args[0];
29732             }
29733
29734             var fn = args.pop();
29735
29736             fn.$inject = args;
29737
29738             return fn;
29739         };
29740
29741
29742         // Current limitations:
29743         // - can't put into "function arg" comments
29744         // function /* (no parenthesis like this) */ (){}
29745         // function abc( /* xx (no parenthesis like this) */ a, b) {}
29746         //
29747         // Just put the comment before function or inside:
29748         // /* (((this is fine))) */ function(a, b) {}
29749         // function abc(a) { /* (((this is fine))) */}
29750
29751         var FN_ARGS = /^function\s*[^\(]*\(\s*([^\)]*)\)/m;
29752         var FN_ARG = /\/\*([^\*]*)\*\//m;
29753
29754         var parse = function(fn) {
29755             if (typeof fn !== 'function') {
29756                 throw new Error('Cannot annotate "' + fn + '". Expected a function!');
29757             }
29758
29759             var match = fn.toString().match(FN_ARGS);
29760             return match[1] && match[1].split(',').map(function(arg) {
29761                 match = arg.match(FN_ARG);
29762                 return match ? match[1].trim() : arg.trim();
29763             }) || [];
29764         };
29765
29766
29767         exports.annotate = annotate;
29768         exports.parse = parse;
29769         exports.isArray = isArray;
29770
29771     }, {}],
29772     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\didi\\lib\\index.js": [function(require, module, exports) {
29773         module.exports = {
29774             annotate: require('./annotation').annotate,
29775             Module: require('./module'),
29776             Injector: require('./injector')
29777         };
29778
29779     }, {
29780         "./annotation": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\didi\\lib\\annotation.js",
29781         "./injector": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\didi\\lib\\injector.js",
29782         "./module": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\didi\\lib\\module.js"
29783     }],
29784     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\didi\\lib\\injector.js": [function(require, module, exports) {
29785         var Module = require('./module');
29786         var autoAnnotate = require('./annotation').parse;
29787         var annotate = require('./annotation').annotate;
29788         var isArray = require('./annotation').isArray;
29789
29790
29791         var Injector = function(modules, parent) {
29792             parent = parent || {
29793                 get: function(name) {
29794                     currentlyResolving.push(name);
29795                     throw error('No provider for "' + name + '"!');
29796                 }
29797             };
29798
29799             var currentlyResolving = [];
29800             var providers = this._providers = Object.create(parent._providers || null);
29801             var instances = this._instances = Object.create(null);
29802
29803             var self = instances.injector = this;
29804
29805             var error = function(msg) {
29806                 var stack = currentlyResolving.join(' -> ');
29807                 currentlyResolving.length = 0;
29808                 return new Error(stack ? msg + ' (Resolving: ' + stack + ')' : msg);
29809             };
29810
29811             var get = function(name) {
29812                 if (!providers[name] && name.indexOf('.') !== -1) {
29813                     var parts = name.split('.');
29814                     var pivot = get(parts.shift());
29815
29816                     while (parts.length) {
29817                         pivot = pivot[parts.shift()];
29818                     }
29819
29820                     return pivot;
29821                 }
29822
29823                 if (Object.hasOwnProperty.call(instances, name)) {
29824                     return instances[name];
29825                 }
29826
29827                 if (Object.hasOwnProperty.call(providers, name)) {
29828                     if (currentlyResolving.indexOf(name) !== -1) {
29829                         currentlyResolving.push(name);
29830                         throw error('Cannot resolve circular dependency!');
29831                     }
29832
29833                     currentlyResolving.push(name);
29834                     instances[name] = providers[name][0](providers[name][1]);
29835                     currentlyResolving.pop();
29836
29837                     return instances[name];
29838                 }
29839
29840                 return parent.get(name);
29841             };
29842
29843             var instantiate = function(Type) {
29844                 var instance = Object.create(Type.prototype);
29845                 var returned = invoke(Type, instance);
29846
29847                 return typeof returned === 'object' ? returned : instance;
29848             };
29849
29850             var invoke = function(fn, context) {
29851                 if (typeof fn !== 'function') {
29852                     if (isArray(fn)) {
29853                         fn = annotate(fn.slice());
29854                     } else {
29855                         throw new Error('Cannot invoke "' + fn + '". Expected a function!');
29856                     }
29857                 }
29858
29859                 var inject = fn.$inject && fn.$inject || autoAnnotate(fn);
29860                 var dependencies = inject.map(function(dep) {
29861                     return get(dep);
29862                 });
29863
29864                 // TODO(vojta): optimize without apply
29865                 return fn.apply(context, dependencies);
29866             };
29867
29868
29869             var createPrivateInjectorFactory = function(privateChildInjector) {
29870                 return annotate(function(key) {
29871                     return privateChildInjector.get(key);
29872                 });
29873             };
29874
29875             var createChild = function(modules, forceNewInstances) {
29876                 if (forceNewInstances && forceNewInstances.length) {
29877                     var fromParentModule = Object.create(null);
29878                     var matchedScopes = Object.create(null);
29879
29880                     var privateInjectorsCache = [];
29881                     var privateChildInjectors = [];
29882                     var privateChildFactories = [];
29883
29884                     var provider;
29885                     var cacheIdx;
29886                     var privateChildInjector;
29887                     var privateChildInjectorFactory;
29888                     for (var name in providers) {
29889                         provider = providers[name];
29890
29891                         if (forceNewInstances.indexOf(name) !== -1) {
29892                             if (provider[2] === 'private') {
29893                                 cacheIdx = privateInjectorsCache.indexOf(provider[3]);
29894                                 if (cacheIdx === -1) {
29895                                     privateChildInjector = provider[3].createChild([], forceNewInstances);
29896                                     privateChildInjectorFactory = createPrivateInjectorFactory(privateChildInjector);
29897                                     privateInjectorsCache.push(provider[3]);
29898                                     privateChildInjectors.push(privateChildInjector);
29899                                     privateChildFactories.push(privateChildInjectorFactory);
29900                                     fromParentModule[name] = [privateChildInjectorFactory, name, 'private', privateChildInjector];
29901                                 } else {
29902                                     fromParentModule[name] = [privateChildFactories[cacheIdx], name, 'private', privateChildInjectors[cacheIdx]];
29903                                 }
29904                             } else {
29905                                 fromParentModule[name] = [provider[2], provider[1]];
29906                             }
29907                             matchedScopes[name] = true;
29908                         }
29909
29910                         if ((provider[2] === 'factory' || provider[2] === 'type') && provider[1].$scope) {
29911                             forceNewInstances.forEach(function(scope) {
29912                                 if (provider[1].$scope.indexOf(scope) !== -1) {
29913                                     fromParentModule[name] = [provider[2], provider[1]];
29914                                     matchedScopes[scope] = true;
29915                                 }
29916                             });
29917                         }
29918                     }
29919
29920                     forceNewInstances.forEach(function(scope) {
29921                         if (!matchedScopes[scope]) {
29922                             throw new Error('No provider for "' + scope + '". Cannot use provider from the parent!');
29923                         }
29924                     });
29925
29926                     modules.unshift(fromParentModule);
29927                 }
29928
29929                 return new Injector(modules, self);
29930             };
29931
29932             var factoryMap = {
29933                 factory: invoke,
29934                 type: instantiate,
29935                 value: function(value) {
29936                     return value;
29937                 }
29938             };
29939
29940             modules.forEach(function(module) {
29941
29942                 function arrayUnwrap(type, value) {
29943                     if (type !== 'value' && isArray(value)) {
29944                         value = annotate(value.slice());
29945                     }
29946
29947                     return value;
29948                 }
29949
29950                 // TODO(vojta): handle wrong inputs (modules)
29951                 if (module instanceof Module) {
29952                     module.forEach(function(provider) {
29953                         var name = provider[0];
29954                         var type = provider[1];
29955                         var value = provider[2];
29956
29957                         providers[name] = [factoryMap[type], arrayUnwrap(type, value), type];
29958                     });
29959                 } else if (typeof module === 'object') {
29960                     if (module.__exports__) {
29961                         var clonedModule = Object.keys(module).reduce(function(m, key) {
29962                             if (key.substring(0, 2) !== '__') {
29963                                 m[key] = module[key];
29964                             }
29965                             return m;
29966                         }, Object.create(null));
29967
29968                         var privateInjector = new Injector((module.__modules__ || []).concat([clonedModule]), self);
29969                         var getFromPrivateInjector = annotate(function(key) {
29970                             return privateInjector.get(key);
29971                         });
29972                         module.__exports__.forEach(function(key) {
29973                             providers[key] = [getFromPrivateInjector, key, 'private', privateInjector];
29974                         });
29975                     } else {
29976                         Object.keys(module).forEach(function(name) {
29977                             if (module[name][2] === 'private') {
29978                                 providers[name] = module[name];
29979                                 return;
29980                             }
29981
29982                             var type = module[name][0];
29983                             var value = module[name][1];
29984
29985                             providers[name] = [factoryMap[type], arrayUnwrap(type, value), type];
29986                         });
29987                     }
29988                 }
29989             });
29990
29991             // public API
29992             this.get = get;
29993             this.invoke = invoke;
29994             this.instantiate = instantiate;
29995             this.createChild = createChild;
29996         };
29997
29998         module.exports = Injector;
29999
30000     }, {
30001         "./annotation": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\didi\\lib\\annotation.js",
30002         "./module": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\didi\\lib\\module.js"
30003     }],
30004     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\didi\\lib\\module.js": [function(require, module, exports) {
30005         var Module = function() {
30006             var providers = [];
30007
30008             this.factory = function(name, factory) {
30009                 providers.push([name, 'factory', factory]);
30010                 return this;
30011             };
30012
30013             this.value = function(name, value) {
30014                 providers.push([name, 'value', value]);
30015                 return this;
30016             };
30017
30018             this.type = function(name, type) {
30019                 providers.push([name, 'type', type]);
30020                 return this;
30021             };
30022
30023             this.forEach = function(iterator) {
30024                 providers.forEach(iterator);
30025             };
30026         };
30027
30028         module.exports = Module;
30029
30030     }, {}],
30031     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\eve\\eve.js": [function(require, module, exports) {
30032         // Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.
30033         // 
30034         // Licensed under the Apache License, Version 2.0 (the "License");
30035         // you may not use this file except in compliance with the License.
30036         // You may obtain a copy of the License at
30037         // 
30038         // http://www.apache.org/licenses/LICENSE-2.0
30039         // 
30040         // Unless required by applicable law or agreed to in writing, software
30041         // distributed under the License is distributed on an "AS IS" BASIS,
30042         // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
30043         // See the License for the specific language governing permissions and
30044         // limitations under the License.
30045         // ÃƒÆ’¢â€�Ήâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�Â�
30046         // \\
30047         // ÃƒÆ’¢â€�‚ Eve 0.4.2 - JavaScript Events Library ÃƒÆ’¢â€�‚ \\
30048         // ÃƒÆ’¢â€�ωâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�¤
30049         // \\
30050         // ÃƒÆ’¢â€�‚ Author Dmitry Baranovskiy (http://dmitry.baranovskiy.com/) ÃƒÆ’¢â€�‚
30051         // \\
30052         // ÃƒÆ’¢â€�â€�ââ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�ۉâ€�Ëœ
30053         // \\
30054
30055         (function(glob) {
30056             var version = "0.4.2",
30057                 has = "hasOwnProperty",
30058                 separator = /[\.\/]/,
30059                 comaseparator = /\s*,\s*/,
30060                 wildcard = "*",
30061                 fun = function() {},
30062                 numsort = function(a, b) {
30063                     return a - b;
30064                 },
30065                 current_event,
30066                 stop,
30067                 events = {
30068                     n: {}
30069                 },
30070                 firstDefined = function() {
30071                     for (var i = 0, ii = this.length; i < ii; i++) {
30072                         if (typeof this[i] != "undefined") {
30073                             return this[i];
30074                         }
30075                     }
30076                 },
30077                 lastDefined = function() {
30078                     var i = this.length;
30079                     while (--i) {
30080                         if (typeof this[i] != "undefined") {
30081                             return this[i];
30082                         }
30083                     }
30084                 },
30085                 /*
30086                  * \ eve [ method ]
30087                  * 
30088                  * Fires event with given `name`, given scope and other parameters.
30089                  *  > Arguments
30090                  *  - name (string) name of the *event*, dot (`.`) or slash (`/`) separated -
30091                  * scope (object) context for the event handlers - varargs (...) the rest of
30092                  * arguments will be sent to event handlers
30093                  *  = (object) array of returned values from the listeners. Array has two
30094                  * methods `.firstDefined()` and `.lastDefined()` to get first or last not
30095                  * `undefined` value. \
30096                  */
30097                 eve = function(name, scope) {
30098                     name = String(name);
30099                     var e = events,
30100                         oldstop = stop,
30101                         args = Array.prototype.slice.call(arguments, 2),
30102                         listeners = eve.listeners(name),
30103                         z = 0,
30104                         f = false,
30105                         l,
30106                         indexed = [],
30107                         queue = {},
30108                         out = [],
30109                         ce = current_event,
30110                         errors = [];
30111                     out.firstDefined = firstDefined;
30112                     out.lastDefined = lastDefined;
30113                     current_event = name;
30114                     stop = 0;
30115                     for (var i = 0, ii = listeners.length; i < ii; i++)
30116                         if ("zIndex" in listeners[i]) {
30117                             indexed.push(listeners[i].zIndex);
30118                             if (listeners[i].zIndex < 0) {
30119                                 queue[listeners[i].zIndex] = listeners[i];
30120                             }
30121                         }
30122                     indexed.sort(numsort);
30123                     while (indexed[z] < 0) {
30124                         l = queue[indexed[z++]];
30125                         out.push(l.apply(scope, args));
30126                         if (stop) {
30127                             stop = oldstop;
30128                             return out;
30129                         }
30130                     }
30131                     for (i = 0; i < ii; i++) {
30132                         l = listeners[i];
30133                         if ("zIndex" in l) {
30134                             if (l.zIndex == indexed[z]) {
30135                                 out.push(l.apply(scope, args));
30136                                 if (stop) {
30137                                     break;
30138                                 }
30139                                 do {
30140                                     z++;
30141                                     l = queue[indexed[z]];
30142                                     l && out.push(l.apply(scope, args));
30143                                     if (stop) {
30144                                         break;
30145                                     }
30146                                 } while (l)
30147                             } else {
30148                                 queue[l.zIndex] = l;
30149                             }
30150                         } else {
30151                             out.push(l.apply(scope, args));
30152                             if (stop) {
30153                                 break;
30154                             }
30155                         }
30156                     }
30157                     stop = oldstop;
30158                     current_event = ce;
30159                     return out;
30160                 };
30161             // Undocumented. Debug only.
30162             eve._events = events;
30163             /*
30164              * \ eve.listeners [ method ]
30165              * 
30166              * Internal method which gives you array of all event handlers that will be
30167              * triggered by the given `name`.
30168              *  > Arguments
30169              *  - name (string) name of the event, dot (`.`) or slash (`/`) separated
30170              *  = (array) array of event handlers \
30171              */
30172             eve.listeners = function(name) {
30173                 var names = name.split(separator),
30174                     e = events,
30175                     item,
30176                     items,
30177                     k,
30178                     i,
30179                     ii,
30180                     j,
30181                     jj,
30182                     nes,
30183                     es = [e],
30184                     out = [];
30185                 for (i = 0, ii = names.length; i < ii; i++) {
30186                     nes = [];
30187                     for (j = 0, jj = es.length; j < jj; j++) {
30188                         e = es[j].n;
30189                         items = [e[names[i]], e[wildcard]];
30190                         k = 2;
30191                         while (k--) {
30192                             item = items[k];
30193                             if (item) {
30194                                 nes.push(item);
30195                                 out = out.concat(item.f || []);
30196                             }
30197                         }
30198                     }
30199                     es = nes;
30200                 }
30201                 return out;
30202             };
30203
30204             /*
30205              * \ eve.on [ method ] * Binds given event handler with a given name. You
30206              * can use wildcards ÃƒÆ’¢â‚¬Å“`*`� for the names: | eve.on("*.under.*",
30207              * f); | eve("mouse.under.floor"); // triggers f Use @eve to trigger the
30208              * listener. * > Arguments * - name (string) name of the event, dot (`.`) or
30209              * slash (`/`) separated, with optional wildcards - f (function) event
30210              * handler function * = (function) returned function accepts a single
30211              * numeric parameter that represents z-index of the handler. It is an
30212              * optional feature and only used when you need to ensure that some subset
30213              * of handlers will be invoked in a given order, despite of the order of
30214              * assignment. > Example: | eve.on("mouse", eatIt)(2); | eve.on("mouse",
30215              * scream); | eve.on("mouse", catchIt)(1); This will ensure that `catchIt`
30216              * function will be called before `eatIt`.
30217              * 
30218              * If you want to put your handler before non-indexed handlers, specify a
30219              * negative value. Note: I assume most of the time you don’t need to
30220              * worry about z-index, but it’s nice to have this feature
30221              * ÃƒÆ’¢â‚¬Å“just in case�. \
30222              */
30223             eve.on = function(name, f) {
30224                 name = String(name);
30225                 if (typeof f != "function") {
30226                     return function() {};
30227                 }
30228                 var names = name.split(comaseparator);
30229                 for (var i = 0, ii = names.length; i < ii; i++) {
30230                     (function(name) {
30231                         var names = name.split(separator),
30232                             e = events,
30233                             exist;
30234                         for (var i = 0, ii = names.length; i < ii; i++) {
30235                             e = e.n;
30236                             e = e.hasOwnProperty(names[i]) && e[names[i]] || (e[names[i]] = {
30237                                 n: {}
30238                             });
30239                         }
30240                         e.f = e.f || [];
30241                         for (i = 0, ii = e.f.length; i < ii; i++)
30242                             if (e.f[i] == f) {
30243                                 exist = true;
30244                                 break;
30245                             }!exist && e.f.push(f);
30246                     }(names[i]));
30247                 }
30248                 return function(zIndex) {
30249                     if (+zIndex == +zIndex) {
30250                         f.zIndex = +zIndex;
30251                     }
30252                 };
30253             };
30254             /*
30255              * \ eve.f [ method ] * Returns function that will fire given event with
30256              * optional arguments. Arguments that will be passed to the result function
30257              * will be also concated to the list of final arguments. | el.onclick =
30258              * eve.f("click", 1, 2); | eve.on("click", function (a, b, c) { |
30259              * console.log(a, b, c); // 1, 2, [event object] | }); > Arguments - event
30260              * (string) event name - varargs (…) and any other arguments =
30261              * (function) possible event handler function \
30262              */
30263             eve.f = function(event) {
30264                 var attrs = [].slice.call(arguments, 1);
30265                 return function() {
30266                     eve.apply(null, [event, null].concat(attrs).concat([].slice.call(arguments, 0)));
30267                 };
30268             };
30269             /*
30270              * \ eve.stop [ method ] * Is used inside an event handler to stop the
30271              * event, preventing any subsequent listeners from firing. \
30272              */
30273             eve.stop = function() {
30274                 stop = 1;
30275             };
30276             /*
30277              * \ eve.nt [ method ] * Could be used inside event handler to figure out
30278              * actual name of the event. * > Arguments * - subname (string) #optional
30279              * subname of the event * = (string) name of the event, if `subname` is not
30280              * specified or = (boolean) `true`, if current event’s name contains
30281              * `subname` \
30282              */
30283             eve.nt = function(subname) {
30284                 if (subname) {
30285                     return new RegExp("(?:\\.|\\/|^)" + subname + "(?:\\.|\\/|$)").test(current_event);
30286                 }
30287                 return current_event;
30288             };
30289             /*
30290              * \ eve.nts [ method ] * Could be used inside event handler to figure out
30291              * actual name of the event. * * = (array) names of the event \
30292              */
30293             eve.nts = function() {
30294                 return current_event.split(separator);
30295             };
30296             /*
30297              * \ eve.off [ method ] * Removes given function from the list of event
30298              * listeners assigned to given name. If no arguments specified all the
30299              * events will be cleared. * > Arguments * - name (string) name of the
30300              * event, dot (`.`) or slash (`/`) separated, with optional wildcards - f
30301              * (function) event handler function \
30302              */
30303             /*
30304              * \ eve.unbind [ method ] * See @eve.off \
30305              */
30306             eve.off = eve.unbind = function(name, f) {
30307                 if (!name) {
30308                     eve._events = events = {
30309                         n: {}
30310                     };
30311                     return;
30312                 }
30313                 var names = name.split(comaseparator);
30314                 if (names.length > 1) {
30315                     for (var i = 0, ii = names.length; i < ii; i++) {
30316                         eve.off(names[i], f);
30317                     }
30318                     return;
30319                 }
30320                 names = name.split(separator);
30321                 var e,
30322                     key,
30323                     splice,
30324                     i, ii, j, jj,
30325                     cur = [events];
30326                 for (i = 0, ii = names.length; i < ii; i++) {
30327                     for (j = 0; j < cur.length; j += splice.length - 2) {
30328                         splice = [j, 1];
30329                         e = cur[j].n;
30330                         if (names[i] != wildcard) {
30331                             if (e[names[i]]) {
30332                                 splice.push(e[names[i]]);
30333                             }
30334                         } else {
30335                             for (key in e)
30336                                 if (e[has](key)) {
30337                                     splice.push(e[key]);
30338                                 }
30339                         }
30340                         cur.splice.apply(cur, splice);
30341                     }
30342                 }
30343                 for (i = 0, ii = cur.length; i < ii; i++) {
30344                     e = cur[i];
30345                     while (e.n) {
30346                         if (f) {
30347                             if (e.f) {
30348                                 for (j = 0, jj = e.f.length; j < jj; j++)
30349                                     if (e.f[j] == f) {
30350                                         e.f.splice(j, 1);
30351                                         break;
30352                                     }!e.f.length && delete e.f;
30353                             }
30354                             for (key in e.n)
30355                                 if (e.n[has](key) && e.n[key].f) {
30356                                     var funcs = e.n[key].f;
30357                                     for (j = 0, jj = funcs.length; j < jj; j++)
30358                                         if (funcs[j] == f) {
30359                                             funcs.splice(j, 1);
30360                                             break;
30361                                         }!funcs.length && delete e.n[key].f;
30362                                 }
30363                         } else {
30364                             delete e.f;
30365                             for (key in e.n)
30366                                 if (e.n[has](key) && e.n[key].f) {
30367                                     delete e.n[key].f;
30368                                 }
30369                         }
30370                         e = e.n;
30371                     }
30372                 }
30373             };
30374             /*
30375              * \ eve.once [ method ] * Binds given event handler with a given name to
30376              * only run once then unbind itself. | eve.once("login", f); | eve("login"); //
30377              * triggers f | eve("login"); // no listeners Use @eve to trigger the
30378              * listener. * > Arguments * - name (string) name of the event, dot (`.`) or
30379              * slash (`/`) separated, with optional wildcards - f (function) event
30380              * handler function * = (function) same return function as @eve.on \
30381              */
30382             eve.once = function(name, f) {
30383                 var f2 = function() {
30384                     eve.unbind(name, f2);
30385                     return f.apply(this, arguments);
30386                 };
30387                 return eve.on(name, f2);
30388             };
30389             /*
30390              * \ eve.version [ property (string) ] * Current version of the library. \
30391              */
30392             eve.version = version;
30393             eve.toString = function() {
30394                 return "You are running Eve " + version;
30395             };
30396             (typeof module != "undefined" && module.exports) ? (module.exports = eve) : (typeof define === "function" && define.amd ? (define("eve", [], function() {
30397                 return eve;
30398             })) : (glob.eve = eve));
30399         })(this);
30400
30401     }, {}],
30402     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\hammerjs\\hammer.js": [function(require, module, exports) {
30403         /*
30404          * ! Hammer.JS - v2.0.4 - 2014-09-28 http://hammerjs.github.io/
30405          * 
30406          * Copyright (c) 2014 Jorik Tangelder; Licensed under the MIT license
30407          */
30408         (function(window, document, exportName, undefined) {
30409             'use strict';
30410
30411             var VENDOR_PREFIXES = ['', 'webkit', 'moz', 'MS', 'ms', 'o'];
30412             var TEST_ELEMENT = document.createElement('div');
30413
30414             var TYPE_FUNCTION = 'function';
30415
30416             var round = Math.round;
30417             var abs = Math.abs;
30418             var now = Date.now;
30419
30420             /**
30421              * set a timeout with a given scope
30422              * 
30423              * @param {Function}
30424              *            fn
30425              * @param {Number}
30426              *            timeout
30427              * @param {Object}
30428              *            context
30429              * @returns {number}
30430              */
30431             function setTimeoutContext(fn, timeout, context) {
30432                 return setTimeout(bindFn(fn, context), timeout);
30433             }
30434
30435             /**
30436              * if the argument is an array, we want to execute the fn on each entry if it
30437              * aint an array we don't want to do a thing. this is used by all the methods
30438              * that accept a single and array argument.
30439              * 
30440              * @param {*|Array}
30441              *            arg
30442              * @param {String}
30443              *            fn
30444              * @param {Object}
30445              *            [context]
30446              * @returns {Boolean}
30447              */
30448             function invokeArrayArg(arg, fn, context) {
30449                 if (Array.isArray(arg)) {
30450                     each(arg, context[fn], context);
30451                     return true;
30452                 }
30453                 return false;
30454             }
30455
30456             /**
30457              * walk objects and arrays
30458              * 
30459              * @param {Object}
30460              *            obj
30461              * @param {Function}
30462              *            iterator
30463              * @param {Object}
30464              *            context
30465              */
30466             function each(obj, iterator, context) {
30467                 var i;
30468
30469                 if (!obj) {
30470                     return;
30471                 }
30472
30473                 if (obj.forEach) {
30474                     obj.forEach(iterator, context);
30475                 } else if (obj.length !== undefined) {
30476                     i = 0;
30477                     while (i < obj.length) {
30478                         iterator.call(context, obj[i], i, obj);
30479                         i++;
30480                     }
30481                 } else {
30482                     for (i in obj) {
30483                         obj.hasOwnProperty(i) && iterator.call(context, obj[i], i, obj);
30484                     }
30485                 }
30486             }
30487
30488             /**
30489              * extend object. means that properties in dest will be overwritten by the ones
30490              * in src.
30491              * 
30492              * @param {Object}
30493              *            dest
30494              * @param {Object}
30495              *            src
30496              * @param {Boolean}
30497              *            [merge]
30498              * @returns {Object} dest
30499              */
30500             function extend(dest, src, merge) {
30501                 var keys = Object.keys(src);
30502                 var i = 0;
30503                 while (i < keys.length) {
30504                     if (!merge || (merge && dest[keys[i]] === undefined)) {
30505                         dest[keys[i]] = src[keys[i]];
30506                     }
30507                     i++;
30508                 }
30509                 return dest;
30510             }
30511
30512             /**
30513              * merge the values from src in the dest. means that properties that exist in
30514              * dest will not be overwritten by src
30515              * 
30516              * @param {Object}
30517              *            dest
30518              * @param {Object}
30519              *            src
30520              * @returns {Object} dest
30521              */
30522             function merge(dest, src) {
30523                 return extend(dest, src, true);
30524             }
30525
30526             /**
30527              * simple class inheritance
30528              * 
30529              * @param {Function}
30530              *            child
30531              * @param {Function}
30532              *            base
30533              * @param {Object}
30534              *            [properties]
30535              */
30536             function inherit(child, base, properties) {
30537                 var baseP = base.prototype,
30538                     childP;
30539
30540                 childP = child.prototype = Object.create(baseP);
30541                 childP.constructor = child;
30542                 childP._super = baseP;
30543
30544                 if (properties) {
30545                     extend(childP, properties);
30546                 }
30547             }
30548
30549             /**
30550              * simple function bind
30551              * 
30552              * @param {Function}
30553              *            fn
30554              * @param {Object}
30555              *            context
30556              * @returns {Function}
30557              */
30558             function bindFn(fn, context) {
30559                 return function boundFn() {
30560                     return fn.apply(context, arguments);
30561                 };
30562             }
30563
30564             /**
30565              * let a boolean value also be a function that must return a boolean this first
30566              * item in args will be used as the context
30567              * 
30568              * @param {Boolean|Function}
30569              *            val
30570              * @param {Array}
30571              *            [args]
30572              * @returns {Boolean}
30573              */
30574             function boolOrFn(val, args) {
30575                 if (typeof val == TYPE_FUNCTION) {
30576                     return val.apply(args ? args[0] || undefined : undefined, args);
30577                 }
30578                 return val;
30579             }
30580
30581             /**
30582              * use the val2 when val1 is undefined
30583              * 
30584              * @param {*}
30585              *            val1
30586              * @param {*}
30587              *            val2
30588              * @returns {*}
30589              */
30590             function ifUndefined(val1, val2) {
30591                 return (val1 === undefined) ? val2 : val1;
30592             }
30593
30594             /**
30595              * addEventListener with multiple events at once
30596              * 
30597              * @param {EventTarget}
30598              *            target
30599              * @param {String}
30600              *            types
30601              * @param {Function}
30602              *            handler
30603              */
30604             function addEventListeners(target, types, handler) {
30605                 each(splitStr(types), function(type) {
30606                     target.addEventListener(type, handler, false);
30607                 });
30608             }
30609
30610             /**
30611              * removeEventListener with multiple events at once
30612              * 
30613              * @param {EventTarget}
30614              *            target
30615              * @param {String}
30616              *            types
30617              * @param {Function}
30618              *            handler
30619              */
30620             function removeEventListeners(target, types, handler) {
30621                 each(splitStr(types), function(type) {
30622                     target.removeEventListener(type, handler, false);
30623                 });
30624             }
30625
30626             /**
30627              * find if a node is in the given parent
30628              * 
30629              * @method hasParent
30630              * @param {HTMLElement}
30631              *            node
30632              * @param {HTMLElement}
30633              *            parent
30634              * @return {Boolean} found
30635              */
30636             function hasParent(node, parent) {
30637                 while (node) {
30638                     if (node == parent) {
30639                         return true;
30640                     }
30641                     node = node.parentNode;
30642                 }
30643                 return false;
30644             }
30645
30646             /**
30647              * small indexOf wrapper
30648              * 
30649              * @param {String}
30650              *            str
30651              * @param {String}
30652              *            find
30653              * @returns {Boolean} found
30654              */
30655             function inStr(str, find) {
30656                 return str.indexOf(find) > -1;
30657             }
30658
30659             /**
30660              * split string on whitespace
30661              * 
30662              * @param {String}
30663              *            str
30664              * @returns {Array} words
30665              */
30666             function splitStr(str) {
30667                 return str.trim().split(/\s+/g);
30668             }
30669
30670             /**
30671              * find if a array contains the object using indexOf or a simple polyFill
30672              * 
30673              * @param {Array}
30674              *            src
30675              * @param {String}
30676              *            find
30677              * @param {String}
30678              *            [findByKey]
30679              * @return {Boolean|Number} false when not found, or the index
30680              */
30681             function inArray(src, find, findByKey) {
30682                 if (src.indexOf && !findByKey) {
30683                     return src.indexOf(find);
30684                 } else {
30685                     var i = 0;
30686                     while (i < src.length) {
30687                         if ((findByKey && src[i][findByKey] == find) || (!findByKey && src[i] === find)) {
30688                             return i;
30689                         }
30690                         i++;
30691                     }
30692                     return -1;
30693                 }
30694             }
30695
30696             /**
30697              * convert array-like objects to real arrays
30698              * 
30699              * @param {Object}
30700              *            obj
30701              * @returns {Array}
30702              */
30703             function toArray(obj) {
30704                 return Array.prototype.slice.call(obj, 0);
30705             }
30706
30707             /**
30708              * unique array with objects based on a key (like 'id') or just by the array's
30709              * value
30710              * 
30711              * @param {Array}
30712              *            src [{id:1},{id:2},{id:1}]
30713              * @param {String}
30714              *            [key]
30715              * @param {Boolean}
30716              *            [sort=False]
30717              * @returns {Array} [{id:1},{id:2}]
30718              */
30719             function uniqueArray(src, key, sort) {
30720                 var results = [];
30721                 var values = [];
30722                 var i = 0;
30723
30724                 while (i < src.length) {
30725                     var val = key ? src[i][key] : src[i];
30726                     if (inArray(values, val) < 0) {
30727                         results.push(src[i]);
30728                     }
30729                     values[i] = val;
30730                     i++;
30731                 }
30732
30733                 if (sort) {
30734                     if (!key) {
30735                         results = results.sort();
30736                     } else {
30737                         results = results.sort(function sortUniqueArray(a, b) {
30738                             return a[key] > b[key];
30739                         });
30740                     }
30741                 }
30742
30743                 return results;
30744             }
30745
30746             /**
30747              * get the prefixed property
30748              * 
30749              * @param {Object}
30750              *            obj
30751              * @param {String}
30752              *            property
30753              * @returns {String|Undefined} prefixed
30754              */
30755             function prefixed(obj, property) {
30756                 var prefix, prop;
30757                 var camelProp = property[0].toUpperCase() + property.slice(1);
30758
30759                 var i = 0;
30760                 while (i < VENDOR_PREFIXES.length) {
30761                     prefix = VENDOR_PREFIXES[i];
30762                     prop = (prefix) ? prefix + camelProp : property;
30763
30764                     if (prop in obj) {
30765                         return prop;
30766                     }
30767                     i++;
30768                 }
30769                 return undefined;
30770             }
30771
30772             /**
30773              * get a unique id
30774              * 
30775              * @returns {number} uniqueId
30776              */
30777             var _uniqueId = 1;
30778
30779             function uniqueId() {
30780                 return _uniqueId++;
30781             }
30782
30783             /**
30784              * get the window object of an element
30785              * 
30786              * @param {HTMLElement}
30787              *            element
30788              * @returns {DocumentView|Window}
30789              */
30790             function getWindowForElement(element) {
30791                 var doc = element.ownerDocument;
30792                 return (doc.defaultView || doc.parentWindow);
30793             }
30794
30795             var MOBILE_REGEX = /mobile|tablet|ip(ad|hone|od)|android/i;
30796
30797             var SUPPORT_TOUCH = ('ontouchstart' in window);
30798             var SUPPORT_POINTER_EVENTS = prefixed(window, 'PointerEvent') !== undefined;
30799             var SUPPORT_ONLY_TOUCH = SUPPORT_TOUCH && MOBILE_REGEX.test(navigator.userAgent);
30800
30801             var INPUT_TYPE_TOUCH = 'touch';
30802             var INPUT_TYPE_PEN = 'pen';
30803             var INPUT_TYPE_MOUSE = 'mouse';
30804             var INPUT_TYPE_KINECT = 'kinect';
30805
30806             var COMPUTE_INTERVAL = 25;
30807
30808             var INPUT_START = 1;
30809             var INPUT_MOVE = 2;
30810             var INPUT_END = 4;
30811             var INPUT_CANCEL = 8;
30812
30813             var DIRECTION_NONE = 1;
30814             var DIRECTION_LEFT = 2;
30815             var DIRECTION_RIGHT = 4;
30816             var DIRECTION_UP = 8;
30817             var DIRECTION_DOWN = 16;
30818
30819             var DIRECTION_HORIZONTAL = DIRECTION_LEFT | DIRECTION_RIGHT;
30820             var DIRECTION_VERTICAL = DIRECTION_UP | DIRECTION_DOWN;
30821             var DIRECTION_ALL = DIRECTION_HORIZONTAL | DIRECTION_VERTICAL;
30822
30823             var PROPS_XY = ['x', 'y'];
30824             var PROPS_CLIENT_XY = ['clientX', 'clientY'];
30825
30826             /**
30827              * create new input type manager
30828              * 
30829              * @param {Manager}
30830              *            manager
30831              * @param {Function}
30832              *            callback
30833              * @returns {Input}
30834              * @constructor
30835              */
30836             function Input(manager, callback) {
30837                 var self = this;
30838                 this.manager = manager;
30839                 this.callback = callback;
30840                 this.element = manager.element;
30841                 this.target = manager.options.inputTarget;
30842
30843                 // smaller wrapper around the handler, for the scope and the enabled state
30844                 // of the manager,
30845                 // so when disabled the input events are completely bypassed.
30846                 this.domHandler = function(ev) {
30847                     if (boolOrFn(manager.options.enable, [manager])) {
30848                         self.handler(ev);
30849                     }
30850                 };
30851
30852                 this.init();
30853
30854             }
30855
30856             Input.prototype = {
30857                 /**
30858                  * should handle the inputEvent data and trigger the callback
30859                  * 
30860                  * @virtual
30861                  */
30862                 handler: function() {},
30863
30864                 /**
30865                  * bind the events
30866                  */
30867                 init: function() {
30868                     this.evEl && addEventListeners(this.element, this.evEl, this.domHandler);
30869                     this.evTarget && addEventListeners(this.target, this.evTarget, this.domHandler);
30870                     this.evWin && addEventListeners(getWindowForElement(this.element), this.evWin, this.domHandler);
30871                 },
30872
30873                 /**
30874                  * unbind the events
30875                  */
30876                 destroy: function() {
30877                     this.evEl && removeEventListeners(this.element, this.evEl, this.domHandler);
30878                     this.evTarget && removeEventListeners(this.target, this.evTarget, this.domHandler);
30879                     this.evWin && removeEventListeners(getWindowForElement(this.element), this.evWin, this.domHandler);
30880                 }
30881             };
30882
30883             /**
30884              * create new input type manager called by the Manager constructor
30885              * 
30886              * @param {Hammer}
30887              *            manager
30888              * @returns {Input}
30889              */
30890             function createInputInstance(manager) {
30891                 var Type;
30892                 var inputClass = manager.options.inputClass;
30893
30894                 if (inputClass) {
30895                     Type = inputClass;
30896                 } else if (SUPPORT_POINTER_EVENTS) {
30897                     Type = PointerEventInput;
30898                 } else if (SUPPORT_ONLY_TOUCH) {
30899                     Type = TouchInput;
30900                 } else if (!SUPPORT_TOUCH) {
30901                     Type = MouseInput;
30902                 } else {
30903                     Type = TouchMouseInput;
30904                 }
30905                 return new(Type)(manager, inputHandler);
30906             }
30907
30908             /**
30909              * handle input events
30910              * 
30911              * @param {Manager}
30912              *            manager
30913              * @param {String}
30914              *            eventType
30915              * @param {Object}
30916              *            input
30917              */
30918             function inputHandler(manager, eventType, input) {
30919                 var pointersLen = input.pointers.length;
30920                 var changedPointersLen = input.changedPointers.length;
30921                 var isFirst = (eventType & INPUT_START && (pointersLen - changedPointersLen === 0));
30922                 var isFinal = (eventType & (INPUT_END | INPUT_CANCEL) && (pointersLen - changedPointersLen === 0));
30923
30924                 input.isFirst = !!isFirst;
30925                 input.isFinal = !!isFinal;
30926
30927                 if (isFirst) {
30928                     manager.session = {};
30929                 }
30930
30931                 // source event is the normalized value of the domEvents
30932                 // like 'touchstart, mouseup, pointerdown'
30933                 input.eventType = eventType;
30934
30935                 // compute scale, rotation etc
30936                 computeInputData(manager, input);
30937
30938                 // emit secret event
30939                 manager.emit('hammer.input', input);
30940
30941                 manager.recognize(input);
30942                 manager.session.prevInput = input;
30943             }
30944
30945             /**
30946              * extend the data with some usable properties like scale, rotate, velocity etc
30947              * 
30948              * @param {Object}
30949              *            manager
30950              * @param {Object}
30951              *            input
30952              */
30953             function computeInputData(manager, input) {
30954                 var session = manager.session;
30955                 var pointers = input.pointers;
30956                 var pointersLength = pointers.length;
30957
30958                 // store the first input to calculate the distance and direction
30959                 if (!session.firstInput) {
30960                     session.firstInput = simpleCloneInputData(input);
30961                 }
30962
30963                 // to compute scale and rotation we need to store the multiple touches
30964                 if (pointersLength > 1 && !session.firstMultiple) {
30965                     session.firstMultiple = simpleCloneInputData(input);
30966                 } else if (pointersLength === 1) {
30967                     session.firstMultiple = false;
30968                 }
30969
30970                 var firstInput = session.firstInput;
30971                 var firstMultiple = session.firstMultiple;
30972                 var offsetCenter = firstMultiple ? firstMultiple.center : firstInput.center;
30973
30974                 var center = input.center = getCenter(pointers);
30975                 input.timeStamp = now();
30976                 input.deltaTime = input.timeStamp - firstInput.timeStamp;
30977
30978                 input.angle = getAngle(offsetCenter, center);
30979                 input.distance = getDistance(offsetCenter, center);
30980
30981                 computeDeltaXY(session, input);
30982                 input.offsetDirection = getDirection(input.deltaX, input.deltaY);
30983
30984                 input.scale = firstMultiple ? getScale(firstMultiple.pointers, pointers) : 1;
30985                 input.rotation = firstMultiple ? getRotation(firstMultiple.pointers, pointers) : 0;
30986
30987                 computeIntervalInputData(session, input);
30988
30989                 // find the correct target
30990                 var target = manager.element;
30991                 if (hasParent(input.srcEvent.target, target)) {
30992                     target = input.srcEvent.target;
30993                 }
30994                 input.target = target;
30995             }
30996
30997             function computeDeltaXY(session, input) {
30998                 var center = input.center;
30999                 var offset = session.offsetDelta || {};
31000                 var prevDelta = session.prevDelta || {};
31001                 var prevInput = session.prevInput || {};
31002
31003                 if (input.eventType === INPUT_START || prevInput.eventType === INPUT_END) {
31004                     prevDelta = session.prevDelta = {
31005                         x: prevInput.deltaX || 0,
31006                         y: prevInput.deltaY || 0
31007                     };
31008
31009                     offset = session.offsetDelta = {
31010                         x: center.x,
31011                         y: center.y
31012                     };
31013                 }
31014
31015                 input.deltaX = prevDelta.x + (center.x - offset.x);
31016                 input.deltaY = prevDelta.y + (center.y - offset.y);
31017             }
31018
31019             /**
31020              * velocity is calculated every x ms
31021              * 
31022              * @param {Object}
31023              *            session
31024              * @param {Object}
31025              *            input
31026              */
31027             function computeIntervalInputData(session, input) {
31028                 var last = session.lastInterval || input,
31029                     deltaTime = input.timeStamp - last.timeStamp,
31030                     velocity, velocityX, velocityY, direction;
31031
31032                 if (input.eventType != INPUT_CANCEL && (deltaTime > COMPUTE_INTERVAL || last.velocity === undefined)) {
31033                     var deltaX = last.deltaX - input.deltaX;
31034                     var deltaY = last.deltaY - input.deltaY;
31035
31036                     var v = getVelocity(deltaTime, deltaX, deltaY);
31037                     velocityX = v.x;
31038                     velocityY = v.y;
31039                     velocity = (abs(v.x) > abs(v.y)) ? v.x : v.y;
31040                     direction = getDirection(deltaX, deltaY);
31041
31042                     session.lastInterval = input;
31043                 } else {
31044                     // use latest velocity info if it doesn't overtake a minimum period
31045                     velocity = last.velocity;
31046                     velocityX = last.velocityX;
31047                     velocityY = last.velocityY;
31048                     direction = last.direction;
31049                 }
31050
31051                 input.velocity = velocity;
31052                 input.velocityX = velocityX;
31053                 input.velocityY = velocityY;
31054                 input.direction = direction;
31055             }
31056
31057             /**
31058              * create a simple clone from the input used for storage of firstInput and
31059              * firstMultiple
31060              * 
31061              * @param {Object}
31062              *            input
31063              * @returns {Object} clonedInputData
31064              */
31065             function simpleCloneInputData(input) {
31066                 // make a simple copy of the pointers because we will get a reference if we
31067                 // don't
31068                 // we only need clientXY for the calculations
31069                 var pointers = [];
31070                 var i = 0;
31071                 while (i < input.pointers.length) {
31072                     pointers[i] = {
31073                         clientX: round(input.pointers[i].clientX),
31074                         clientY: round(input.pointers[i].clientY)
31075                     };
31076                     i++;
31077                 }
31078
31079                 return {
31080                     timeStamp: now(),
31081                     pointers: pointers,
31082                     center: getCenter(pointers),
31083                     deltaX: input.deltaX,
31084                     deltaY: input.deltaY
31085                 };
31086             }
31087
31088             /**
31089              * get the center of all the pointers
31090              * 
31091              * @param {Array}
31092              *            pointers
31093              * @return {Object} center contains `x` and `y` properties
31094              */
31095             function getCenter(pointers) {
31096                 var pointersLength = pointers.length;
31097
31098                 // no need to loop when only one touch
31099                 if (pointersLength === 1) {
31100                     return {
31101                         x: round(pointers[0].clientX),
31102                         y: round(pointers[0].clientY)
31103                     };
31104                 }
31105
31106                 var x = 0,
31107                     y = 0,
31108                     i = 0;
31109                 while (i < pointersLength) {
31110                     x += pointers[i].clientX;
31111                     y += pointers[i].clientY;
31112                     i++;
31113                 }
31114
31115                 return {
31116                     x: round(x / pointersLength),
31117                     y: round(y / pointersLength)
31118                 };
31119             }
31120
31121             /**
31122              * calculate the velocity between two points. unit is in px per ms.
31123              * 
31124              * @param {Number}
31125              *            deltaTime
31126              * @param {Number}
31127              *            x
31128              * @param {Number}
31129              *            y
31130              * @return {Object} velocity `x` and `y`
31131              */
31132             function getVelocity(deltaTime, x, y) {
31133                 return {
31134                     x: x / deltaTime || 0,
31135                     y: y / deltaTime || 0
31136                 };
31137             }
31138
31139             /**
31140              * get the direction between two points
31141              * 
31142              * @param {Number}
31143              *            x
31144              * @param {Number}
31145              *            y
31146              * @return {Number} direction
31147              */
31148             function getDirection(x, y) {
31149                 if (x === y) {
31150                     return DIRECTION_NONE;
31151                 }
31152
31153                 if (abs(x) >= abs(y)) {
31154                     return x > 0 ? DIRECTION_LEFT : DIRECTION_RIGHT;
31155                 }
31156                 return y > 0 ? DIRECTION_UP : DIRECTION_DOWN;
31157             }
31158
31159             /**
31160              * calculate the absolute distance between two points
31161              * 
31162              * @param {Object}
31163              *            p1 {x, y}
31164              * @param {Object}
31165              *            p2 {x, y}
31166              * @param {Array}
31167              *            [props] containing x and y keys
31168              * @return {Number} distance
31169              */
31170             function getDistance(p1, p2, props) {
31171                 if (!props) {
31172                     props = PROPS_XY;
31173                 }
31174                 var x = p2[props[0]] - p1[props[0]],
31175                     y = p2[props[1]] - p1[props[1]];
31176
31177                 return Math.sqrt((x * x) + (y * y));
31178             }
31179
31180             /**
31181              * calculate the angle between two coordinates
31182              * 
31183              * @param {Object}
31184              *            p1
31185              * @param {Object}
31186              *            p2
31187              * @param {Array}
31188              *            [props] containing x and y keys
31189              * @return {Number} angle
31190              */
31191             function getAngle(p1, p2, props) {
31192                 if (!props) {
31193                     props = PROPS_XY;
31194                 }
31195                 var x = p2[props[0]] - p1[props[0]],
31196                     y = p2[props[1]] - p1[props[1]];
31197                 return Math.atan2(y, x) * 180 / Math.PI;
31198             }
31199
31200             /**
31201              * calculate the rotation degrees between two pointersets
31202              * 
31203              * @param {Array}
31204              *            start array of pointers
31205              * @param {Array}
31206              *            end array of pointers
31207              * @return {Number} rotation
31208              */
31209             function getRotation(start, end) {
31210                 return getAngle(end[1], end[0], PROPS_CLIENT_XY) - getAngle(start[1], start[0], PROPS_CLIENT_XY);
31211             }
31212
31213             /**
31214              * calculate the scale factor between two pointersets no scale is 1, and goes
31215              * down to 0 when pinched together, and bigger when pinched out
31216              * 
31217              * @param {Array}
31218              *            start array of pointers
31219              * @param {Array}
31220              *            end array of pointers
31221              * @return {Number} scale
31222              */
31223             function getScale(start, end) {
31224                 return getDistance(end[0], end[1], PROPS_CLIENT_XY) / getDistance(start[0], start[1], PROPS_CLIENT_XY);
31225             }
31226
31227             var MOUSE_INPUT_MAP = {
31228                 mousedown: INPUT_START,
31229                 mousemove: INPUT_MOVE,
31230                 mouseup: INPUT_END
31231             };
31232
31233             var MOUSE_ELEMENT_EVENTS = 'mousedown';
31234             var MOUSE_WINDOW_EVENTS = 'mousemove mouseup';
31235
31236             /**
31237              * Mouse events input
31238              * 
31239              * @constructor
31240              * @extends Input
31241              */
31242             function MouseInput() {
31243                 this.evEl = MOUSE_ELEMENT_EVENTS;
31244                 this.evWin = MOUSE_WINDOW_EVENTS;
31245
31246                 this.allow = true; // used by Input.TouchMouse to disable mouse events
31247                 this.pressed = false; // mousedown state
31248
31249                 Input.apply(this, arguments);
31250             }
31251
31252             inherit(MouseInput, Input, {
31253                 /**
31254                  * handle mouse events
31255                  * 
31256                  * @param {Object}
31257                  *            ev
31258                  */
31259                 handler: function MEhandler(ev) {
31260                     var eventType = MOUSE_INPUT_MAP[ev.type];
31261
31262                     // on start we want to have the left mouse button down
31263                     if (eventType & INPUT_START && ev.button === 0) {
31264                         this.pressed = true;
31265                     }
31266
31267                     if (eventType & INPUT_MOVE && ev.which !== 1) {
31268                         eventType = INPUT_END;
31269                     }
31270
31271                     // mouse must be down, and mouse events are allowed (see the TouchMouse
31272                     // input)
31273                     if (!this.pressed || !this.allow) {
31274                         return;
31275                     }
31276
31277                     if (eventType & INPUT_END) {
31278                         this.pressed = false;
31279                     }
31280
31281                     this.callback(this.manager, eventType, {
31282                         pointers: [ev],
31283                         changedPointers: [ev],
31284                         pointerType: INPUT_TYPE_MOUSE,
31285                         srcEvent: ev
31286                     });
31287                 }
31288             });
31289
31290             var POINTER_INPUT_MAP = {
31291                 pointerdown: INPUT_START,
31292                 pointermove: INPUT_MOVE,
31293                 pointerup: INPUT_END,
31294                 pointercancel: INPUT_CANCEL,
31295                 pointerout: INPUT_CANCEL
31296             };
31297
31298             // in IE10 the pointer types is defined as an enum
31299             var IE10_POINTER_TYPE_ENUM = {
31300                 2: INPUT_TYPE_TOUCH,
31301                 3: INPUT_TYPE_PEN,
31302                 4: INPUT_TYPE_MOUSE,
31303                 5: INPUT_TYPE_KINECT // see
31304                     // https://twitter.com/jacobrossi/status/480596438489890816
31305             };
31306
31307             var POINTER_ELEMENT_EVENTS = 'pointerdown';
31308             var POINTER_WINDOW_EVENTS = 'pointermove pointerup pointercancel';
31309
31310             // IE10 has prefixed support, and case-sensitive
31311             if (window.MSPointerEvent) {
31312                 POINTER_ELEMENT_EVENTS = 'MSPointerDown';
31313                 POINTER_WINDOW_EVENTS = 'MSPointerMove MSPointerUp MSPointerCancel';
31314             }
31315
31316             /**
31317              * Pointer events input
31318              * 
31319              * @constructor
31320              * @extends Input
31321              */
31322             function PointerEventInput() {
31323                 this.evEl = POINTER_ELEMENT_EVENTS;
31324                 this.evWin = POINTER_WINDOW_EVENTS;
31325
31326                 Input.apply(this, arguments);
31327
31328                 this.store = (this.manager.session.pointerEvents = []);
31329             }
31330
31331             inherit(PointerEventInput, Input, {
31332                 /**
31333                  * handle mouse events
31334                  * 
31335                  * @param {Object}
31336                  *            ev
31337                  */
31338                 handler: function PEhandler(ev) {
31339                     var store = this.store;
31340                     var removePointer = false;
31341
31342                     var eventTypeNormalized = ev.type.toLowerCase().replace('ms', '');
31343                     var eventType = POINTER_INPUT_MAP[eventTypeNormalized];
31344                     var pointerType = IE10_POINTER_TYPE_ENUM[ev.pointerType] || ev.pointerType;
31345
31346                     var isTouch = (pointerType == INPUT_TYPE_TOUCH);
31347
31348                     // get index of the event in the store
31349                     var storeIndex = inArray(store, ev.pointerId, 'pointerId');
31350
31351                     // start and mouse must be down
31352                     if (eventType & INPUT_START && (ev.button === 0 || isTouch)) {
31353                         if (storeIndex < 0) {
31354                             store.push(ev);
31355                             storeIndex = store.length - 1;
31356                         }
31357                     } else if (eventType & (INPUT_END | INPUT_CANCEL)) {
31358                         removePointer = true;
31359                     }
31360
31361                     // it not found, so the pointer hasn't been down (so it's probably a
31362                     // hover)
31363                     if (storeIndex < 0) {
31364                         return;
31365                     }
31366
31367                     // update the event in the store
31368                     store[storeIndex] = ev;
31369
31370                     this.callback(this.manager, eventType, {
31371                         pointers: store,
31372                         changedPointers: [ev],
31373                         pointerType: pointerType,
31374                         srcEvent: ev
31375                     });
31376
31377                     if (removePointer) {
31378                         // remove from the store
31379                         store.splice(storeIndex, 1);
31380                     }
31381                 }
31382             });
31383
31384             var SINGLE_TOUCH_INPUT_MAP = {
31385                 touchstart: INPUT_START,
31386                 touchmove: INPUT_MOVE,
31387                 touchend: INPUT_END,
31388                 touchcancel: INPUT_CANCEL
31389             };
31390
31391             var SINGLE_TOUCH_TARGET_EVENTS = 'touchstart';
31392             var SINGLE_TOUCH_WINDOW_EVENTS = 'touchstart touchmove touchend touchcancel';
31393
31394             /**
31395              * Touch events input
31396              * 
31397              * @constructor
31398              * @extends Input
31399              */
31400             function SingleTouchInput() {
31401                 this.evTarget = SINGLE_TOUCH_TARGET_EVENTS;
31402                 this.evWin = SINGLE_TOUCH_WINDOW_EVENTS;
31403                 this.started = false;
31404
31405                 Input.apply(this, arguments);
31406             }
31407
31408             inherit(SingleTouchInput, Input, {
31409                 handler: function TEhandler(ev) {
31410                     var type = SINGLE_TOUCH_INPUT_MAP[ev.type];
31411
31412                     // should we handle the touch events?
31413                     if (type === INPUT_START) {
31414                         this.started = true;
31415                     }
31416
31417                     if (!this.started) {
31418                         return;
31419                     }
31420
31421                     var touches = normalizeSingleTouches.call(this, ev, type);
31422
31423                     // when done, reset the started state
31424                     if (type & (INPUT_END | INPUT_CANCEL) && touches[0].length - touches[1].length === 0) {
31425                         this.started = false;
31426                     }
31427
31428                     this.callback(this.manager, type, {
31429                         pointers: touches[0],
31430                         changedPointers: touches[1],
31431                         pointerType: INPUT_TYPE_TOUCH,
31432                         srcEvent: ev
31433                     });
31434                 }
31435             });
31436
31437             /**
31438              * @this {TouchInput}
31439              * @param {Object}
31440              *            ev
31441              * @param {Number}
31442              *            type flag
31443              * @returns {undefined|Array} [all, changed]
31444              */
31445             function normalizeSingleTouches(ev, type) {
31446                 var all = toArray(ev.touches);
31447                 var changed = toArray(ev.changedTouches);
31448
31449                 if (type & (INPUT_END | INPUT_CANCEL)) {
31450                     all = uniqueArray(all.concat(changed), 'identifier', true);
31451                 }
31452
31453                 return [all, changed];
31454             }
31455
31456             var TOUCH_INPUT_MAP = {
31457                 touchstart: INPUT_START,
31458                 touchmove: INPUT_MOVE,
31459                 touchend: INPUT_END,
31460                 touchcancel: INPUT_CANCEL
31461             };
31462
31463             var TOUCH_TARGET_EVENTS = 'touchstart touchmove touchend touchcancel';
31464
31465             /**
31466              * Multi-user touch events input
31467              * 
31468              * @constructor
31469              * @extends Input
31470              */
31471             function TouchInput() {
31472                 this.evTarget = TOUCH_TARGET_EVENTS;
31473                 this.targetIds = {};
31474
31475                 Input.apply(this, arguments);
31476             }
31477
31478             inherit(TouchInput, Input, {
31479                 handler: function MTEhandler(ev) {
31480                     var type = TOUCH_INPUT_MAP[ev.type];
31481                     var touches = getTouches.call(this, ev, type);
31482                     if (!touches) {
31483                         return;
31484                     }
31485
31486                     this.callback(this.manager, type, {
31487                         pointers: touches[0],
31488                         changedPointers: touches[1],
31489                         pointerType: INPUT_TYPE_TOUCH,
31490                         srcEvent: ev
31491                     });
31492                 }
31493             });
31494
31495             /**
31496              * @this {TouchInput}
31497              * @param {Object}
31498              *            ev
31499              * @param {Number}
31500              *            type flag
31501              * @returns {undefined|Array} [all, changed]
31502              */
31503             function getTouches(ev, type) {
31504                 var allTouches = toArray(ev.touches);
31505                 var targetIds = this.targetIds;
31506
31507                 // when there is only one touch, the process can be simplified
31508                 if (type & (INPUT_START | INPUT_MOVE) && allTouches.length === 1) {
31509                     targetIds[allTouches[0].identifier] = true;
31510                     return [allTouches, allTouches];
31511                 }
31512
31513                 var i,
31514                     targetTouches,
31515                     changedTouches = toArray(ev.changedTouches),
31516                     changedTargetTouches = [],
31517                     target = this.target;
31518
31519                 // get target touches from touches
31520                 targetTouches = allTouches.filter(function(touch) {
31521                     return hasParent(touch.target, target);
31522                 });
31523
31524                 // collect touches
31525                 if (type === INPUT_START) {
31526                     i = 0;
31527                     while (i < targetTouches.length) {
31528                         targetIds[targetTouches[i].identifier] = true;
31529                         i++;
31530                     }
31531                 }
31532
31533                 // filter changed touches to only contain touches that exist in the
31534                 // collected target ids
31535                 i = 0;
31536                 while (i < changedTouches.length) {
31537                     if (targetIds[changedTouches[i].identifier]) {
31538                         changedTargetTouches.push(changedTouches[i]);
31539                     }
31540
31541                     // cleanup removed touches
31542                     if (type & (INPUT_END | INPUT_CANCEL)) {
31543                         delete targetIds[changedTouches[i].identifier];
31544                     }
31545                     i++;
31546                 }
31547
31548                 if (!changedTargetTouches.length) {
31549                     return;
31550                 }
31551
31552                 return [
31553                     // merge targetTouches with changedTargetTouches so it contains ALL
31554                     // touches, including 'end' and 'cancel'
31555                     uniqueArray(targetTouches.concat(changedTargetTouches), 'identifier', true),
31556                     changedTargetTouches
31557                 ];
31558             }
31559
31560             /**
31561              * Combined touch and mouse input
31562              * 
31563              * Touch has a higher priority then mouse, and while touching no mouse events
31564              * are allowed. This because touch devices also emit mouse events while doing a
31565              * touch.
31566              * 
31567              * @constructor
31568              * @extends Input
31569              */
31570             function TouchMouseInput() {
31571                 Input.apply(this, arguments);
31572
31573                 var handler = bindFn(this.handler, this);
31574                 this.touch = new TouchInput(this.manager, handler);
31575                 this.mouse = new MouseInput(this.manager, handler);
31576             }
31577
31578             inherit(TouchMouseInput, Input, {
31579                 /**
31580                  * handle mouse and touch events
31581                  * 
31582                  * @param {Hammer}
31583                  *            manager
31584                  * @param {String}
31585                  *            inputEvent
31586                  * @param {Object}
31587                  *            inputData
31588                  */
31589                 handler: function TMEhandler(manager, inputEvent, inputData) {
31590                     var isTouch = (inputData.pointerType == INPUT_TYPE_TOUCH),
31591                         isMouse = (inputData.pointerType == INPUT_TYPE_MOUSE);
31592
31593                     // when we're in a touch event, so block all upcoming mouse events
31594                     // most mobile browser also emit mouseevents, right after touchstart
31595                     if (isTouch) {
31596                         this.mouse.allow = false;
31597                     } else if (isMouse && !this.mouse.allow) {
31598                         return;
31599                     }
31600
31601                     // reset the allowMouse when we're done
31602                     if (inputEvent & (INPUT_END | INPUT_CANCEL)) {
31603                         this.mouse.allow = true;
31604                     }
31605
31606                     this.callback(manager, inputEvent, inputData);
31607                 },
31608
31609                 /**
31610                  * remove the event listeners
31611                  */
31612                 destroy: function destroy() {
31613                     this.touch.destroy();
31614                     this.mouse.destroy();
31615                 }
31616             });
31617
31618             var PREFIXED_TOUCH_ACTION = prefixed(TEST_ELEMENT.style, 'touchAction');
31619             var NATIVE_TOUCH_ACTION = PREFIXED_TOUCH_ACTION !== undefined;
31620
31621             // magical touchAction value
31622             var TOUCH_ACTION_COMPUTE = 'compute';
31623             var TOUCH_ACTION_AUTO = 'auto';
31624             var TOUCH_ACTION_MANIPULATION = 'manipulation'; // not implemented
31625             var TOUCH_ACTION_NONE = 'none';
31626             var TOUCH_ACTION_PAN_X = 'pan-x';
31627             var TOUCH_ACTION_PAN_Y = 'pan-y';
31628
31629             /**
31630              * Touch Action sets the touchAction property or uses the js alternative
31631              * 
31632              * @param {Manager}
31633              *            manager
31634              * @param {String}
31635              *            value
31636              * @constructor
31637              */
31638             function TouchAction(manager, value) {
31639                 this.manager = manager;
31640                 this.set(value);
31641             }
31642
31643             TouchAction.prototype = {
31644                 /**
31645                  * set the touchAction value on the element or enable the polyfill
31646                  * 
31647                  * @param {String}
31648                  *            value
31649                  */
31650                 set: function(value) {
31651                     // find out the touch-action by the event handlers
31652                     if (value == TOUCH_ACTION_COMPUTE) {
31653                         value = this.compute();
31654                     }
31655
31656                     if (NATIVE_TOUCH_ACTION) {
31657                         this.manager.element.style[PREFIXED_TOUCH_ACTION] = value;
31658                     }
31659                     this.actions = value.toLowerCase().trim();
31660                 },
31661
31662                 /**
31663                  * just re-set the touchAction value
31664                  */
31665                 update: function() {
31666                     this.set(this.manager.options.touchAction);
31667                 },
31668
31669                 /**
31670                  * compute the value for the touchAction property based on the recognizer's
31671                  * settings
31672                  * 
31673                  * @returns {String} value
31674                  */
31675                 compute: function() {
31676                     var actions = [];
31677                     each(this.manager.recognizers, function(recognizer) {
31678                         if (boolOrFn(recognizer.options.enable, [recognizer])) {
31679                             actions = actions.concat(recognizer.getTouchAction());
31680                         }
31681                     });
31682                     return cleanTouchActions(actions.join(' '));
31683                 },
31684
31685                 /**
31686                  * this method is called on each input cycle and provides the preventing of
31687                  * the browser behavior
31688                  * 
31689                  * @param {Object}
31690                  *            input
31691                  */
31692                 preventDefaults: function(input) {
31693                     // not needed with native support for the touchAction property
31694                     if (NATIVE_TOUCH_ACTION) {
31695                         return;
31696                     }
31697
31698                     var srcEvent = input.srcEvent;
31699                     var direction = input.offsetDirection;
31700
31701                     // if the touch action did prevented once this session
31702                     if (this.manager.session.prevented) {
31703                         srcEvent.preventDefault();
31704                         return;
31705                     }
31706
31707                     var actions = this.actions;
31708                     var hasNone = inStr(actions, TOUCH_ACTION_NONE);
31709                     var hasPanY = inStr(actions, TOUCH_ACTION_PAN_Y);
31710                     var hasPanX = inStr(actions, TOUCH_ACTION_PAN_X);
31711
31712                     if (hasNone ||
31713                         (hasPanY && direction & DIRECTION_HORIZONTAL) ||
31714                         (hasPanX && direction & DIRECTION_VERTICAL)) {
31715                         return this.preventSrc(srcEvent);
31716                     }
31717                 },
31718
31719                 /**
31720                  * call preventDefault to prevent the browser's default behavior (scrolling
31721                  * in most cases)
31722                  * 
31723                  * @param {Object}
31724                  *            srcEvent
31725                  */
31726                 preventSrc: function(srcEvent) {
31727                     this.manager.session.prevented = true;
31728                     srcEvent.preventDefault();
31729                 }
31730             };
31731
31732             /**
31733              * when the touchActions are collected they are not a valid value, so we need to
31734              * clean things up. *
31735              * 
31736              * @param {String}
31737              *            actions
31738              * @returns {*}
31739              */
31740             function cleanTouchActions(actions) {
31741                 // none
31742                 if (inStr(actions, TOUCH_ACTION_NONE)) {
31743                     return TOUCH_ACTION_NONE;
31744                 }
31745
31746                 var hasPanX = inStr(actions, TOUCH_ACTION_PAN_X);
31747                 var hasPanY = inStr(actions, TOUCH_ACTION_PAN_Y);
31748
31749                 // pan-x and pan-y can be combined
31750                 if (hasPanX && hasPanY) {
31751                     return TOUCH_ACTION_PAN_X + ' ' + TOUCH_ACTION_PAN_Y;
31752                 }
31753
31754                 // pan-x OR pan-y
31755                 if (hasPanX || hasPanY) {
31756                     return hasPanX ? TOUCH_ACTION_PAN_X : TOUCH_ACTION_PAN_Y;
31757                 }
31758
31759                 // manipulation
31760                 if (inStr(actions, TOUCH_ACTION_MANIPULATION)) {
31761                     return TOUCH_ACTION_MANIPULATION;
31762                 }
31763
31764                 return TOUCH_ACTION_AUTO;
31765             }
31766
31767             /**
31768              * Recognizer flow explained; * All recognizers have the initial state of
31769              * POSSIBLE when a input session starts. The definition of a input session is
31770              * from the first input until the last input, with all it's movement in it. *
31771              * Example session for mouse-input: mousedown -> mousemove -> mouseup
31772              * 
31773              * On each recognizing cycle (see Manager.recognize) the .recognize() method is
31774              * executed which determines with state it should be.
31775              * 
31776              * If the recognizer has the state FAILED, CANCELLED or RECOGNIZED (equals
31777              * ENDED), it is reset to POSSIBLE to give it another change on the next cycle.
31778              * 
31779              * Possible | +-----+---------------+ | | +-----+-----+ | | | | Failed Cancelled |
31780              * +-------+------+ | | Recognized Began | Changed | Ended/Recognized
31781              */
31782             var STATE_POSSIBLE = 1;
31783             var STATE_BEGAN = 2;
31784             var STATE_CHANGED = 4;
31785             var STATE_ENDED = 8;
31786             var STATE_RECOGNIZED = STATE_ENDED;
31787             var STATE_CANCELLED = 16;
31788             var STATE_FAILED = 32;
31789
31790             /**
31791              * Recognizer Every recognizer needs to extend from this class.
31792              * 
31793              * @constructor
31794              * @param {Object}
31795              *            options
31796              */
31797             function Recognizer(options) {
31798                 this.id = uniqueId();
31799
31800                 this.manager = null;
31801                 this.options = merge(options || {}, this.defaults);
31802
31803                 // default is enable true
31804                 this.options.enable = ifUndefined(this.options.enable, true);
31805
31806                 this.state = STATE_POSSIBLE;
31807
31808                 this.simultaneous = {};
31809                 this.requireFail = [];
31810             }
31811
31812             Recognizer.prototype = {
31813                 /**
31814                  * @virtual
31815                  * @type {Object}
31816                  */
31817                 defaults: {},
31818
31819                 /**
31820                  * set options
31821                  * 
31822                  * @param {Object}
31823                  *            options
31824                  * @return {Recognizer}
31825                  */
31826                 set: function(options) {
31827                     extend(this.options, options);
31828
31829                     // also update the touchAction, in case something changed about the
31830                     // directions/enabled state
31831                     this.manager && this.manager.touchAction.update();
31832                     return this;
31833                 },
31834
31835                 /**
31836                  * recognize simultaneous with an other recognizer.
31837                  * 
31838                  * @param {Recognizer}
31839                  *            otherRecognizer
31840                  * @returns {Recognizer} this
31841                  */
31842                 recognizeWith: function(otherRecognizer) {
31843                     if (invokeArrayArg(otherRecognizer, 'recognizeWith', this)) {
31844                         return this;
31845                     }
31846
31847                     var simultaneous = this.simultaneous;
31848                     otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);
31849                     if (!simultaneous[otherRecognizer.id]) {
31850                         simultaneous[otherRecognizer.id] = otherRecognizer;
31851                         otherRecognizer.recognizeWith(this);
31852                     }
31853                     return this;
31854                 },
31855
31856                 /**
31857                  * drop the simultaneous link. it doesnt remove the link on the other
31858                  * recognizer.
31859                  * 
31860                  * @param {Recognizer}
31861                  *            otherRecognizer
31862                  * @returns {Recognizer} this
31863                  */
31864                 dropRecognizeWith: function(otherRecognizer) {
31865                     if (invokeArrayArg(otherRecognizer, 'dropRecognizeWith', this)) {
31866                         return this;
31867                     }
31868
31869                     otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);
31870                     delete this.simultaneous[otherRecognizer.id];
31871                     return this;
31872                 },
31873
31874                 /**
31875                  * recognizer can only run when an other is failing
31876                  * 
31877                  * @param {Recognizer}
31878                  *            otherRecognizer
31879                  * @returns {Recognizer} this
31880                  */
31881                 requireFailure: function(otherRecognizer) {
31882                     if (invokeArrayArg(otherRecognizer, 'requireFailure', this)) {
31883                         return this;
31884                     }
31885
31886                     var requireFail = this.requireFail;
31887                     otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);
31888                     if (inArray(requireFail, otherRecognizer) === -1) {
31889                         requireFail.push(otherRecognizer);
31890                         otherRecognizer.requireFailure(this);
31891                     }
31892                     return this;
31893                 },
31894
31895                 /**
31896                  * drop the requireFailure link. it does not remove the link on the other
31897                  * recognizer.
31898                  * 
31899                  * @param {Recognizer}
31900                  *            otherRecognizer
31901                  * @returns {Recognizer} this
31902                  */
31903                 dropRequireFailure: function(otherRecognizer) {
31904                     if (invokeArrayArg(otherRecognizer, 'dropRequireFailure', this)) {
31905                         return this;
31906                     }
31907
31908                     otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);
31909                     var index = inArray(this.requireFail, otherRecognizer);
31910                     if (index > -1) {
31911                         this.requireFail.splice(index, 1);
31912                     }
31913                     return this;
31914                 },
31915
31916                 /**
31917                  * has require failures boolean
31918                  * 
31919                  * @returns {boolean}
31920                  */
31921                 hasRequireFailures: function() {
31922                     return this.requireFail.length > 0;
31923                 },
31924
31925                 /**
31926                  * if the recognizer can recognize simultaneous with an other recognizer
31927                  * 
31928                  * @param {Recognizer}
31929                  *            otherRecognizer
31930                  * @returns {Boolean}
31931                  */
31932                 canRecognizeWith: function(otherRecognizer) {
31933                     return !!this.simultaneous[otherRecognizer.id];
31934                 },
31935
31936                 /**
31937                  * You should use `tryEmit` instead of `emit` directly to check that all the
31938                  * needed recognizers has failed before emitting.
31939                  * 
31940                  * @param {Object}
31941                  *            input
31942                  */
31943                 emit: function(input) {
31944                     var self = this;
31945                     var state = this.state;
31946
31947                     function emit(withState) {
31948                         self.manager.emit(self.options.event + (withState ? stateStr(state) : ''), input);
31949                     }
31950
31951                     // 'panstart' and 'panmove'
31952                     if (state < STATE_ENDED) {
31953                         emit(true);
31954                     }
31955
31956                     emit(); // simple 'eventName' events
31957
31958                     // panend and pancancel
31959                     if (state >= STATE_ENDED) {
31960                         emit(true);
31961                     }
31962                 },
31963
31964                 /**
31965                  * Check that all the require failure recognizers has failed, if true, it
31966                  * emits a gesture event, otherwise, setup the state to FAILED.
31967                  * 
31968                  * @param {Object}
31969                  *            input
31970                  */
31971                 tryEmit: function(input) {
31972                     if (this.canEmit()) {
31973                         return this.emit(input);
31974                     }
31975                     // it's failing anyway
31976                     this.state = STATE_FAILED;
31977                 },
31978
31979                 /**
31980                  * can we emit?
31981                  * 
31982                  * @returns {boolean}
31983                  */
31984                 canEmit: function() {
31985                     var i = 0;
31986                     while (i < this.requireFail.length) {
31987                         if (!(this.requireFail[i].state & (STATE_FAILED | STATE_POSSIBLE))) {
31988                             return false;
31989                         }
31990                         i++;
31991                     }
31992                     return true;
31993                 },
31994
31995                 /**
31996                  * update the recognizer
31997                  * 
31998                  * @param {Object}
31999                  *            inputData
32000                  */
32001                 recognize: function(inputData) {
32002                     // make a new copy of the inputData
32003                     // so we can change the inputData without messing up the other
32004                     // recognizers
32005                     var inputDataClone = extend({}, inputData);
32006
32007                     // is is enabled and allow recognizing?
32008                     if (!boolOrFn(this.options.enable, [this, inputDataClone])) {
32009                         this.reset();
32010                         this.state = STATE_FAILED;
32011                         return;
32012                     }
32013
32014                     // reset when we've reached the end
32015                     if (this.state & (STATE_RECOGNIZED | STATE_CANCELLED | STATE_FAILED)) {
32016                         this.state = STATE_POSSIBLE;
32017                     }
32018
32019                     this.state = this.process(inputDataClone);
32020
32021                     // the recognizer has recognized a gesture
32022                     // so trigger an event
32023                     if (this.state & (STATE_BEGAN | STATE_CHANGED | STATE_ENDED | STATE_CANCELLED)) {
32024                         this.tryEmit(inputDataClone);
32025                     }
32026                 },
32027
32028                 /**
32029                  * return the state of the recognizer the actual recognizing happens in this
32030                  * method
32031                  * 
32032                  * @virtual
32033                  * @param {Object}
32034                  *            inputData
32035                  * @returns {Const} STATE
32036                  */
32037                 process: function(inputData) {}, // jshint ignore:line
32038
32039                 /**
32040                  * return the preferred touch-action
32041                  * 
32042                  * @virtual
32043                  * @returns {Array}
32044                  */
32045                 getTouchAction: function() {},
32046
32047                 /**
32048                  * called when the gesture isn't allowed to recognize like when another is
32049                  * being recognized or it is disabled
32050                  * 
32051                  * @virtual
32052                  */
32053                 reset: function() {}
32054             };
32055
32056             /**
32057              * get a usable string, used as event postfix
32058              * 
32059              * @param {Const}
32060              *            state
32061              * @returns {String} state
32062              */
32063             function stateStr(state) {
32064                 if (state & STATE_CANCELLED) {
32065                     return 'cancel';
32066                 } else if (state & STATE_ENDED) {
32067                     return 'end';
32068                 } else if (state & STATE_CHANGED) {
32069                     return 'move';
32070                 } else if (state & STATE_BEGAN) {
32071                     return 'start';
32072                 }
32073                 return '';
32074             }
32075
32076             /**
32077              * direction cons to string
32078              * 
32079              * @param {Const}
32080              *            direction
32081              * @returns {String}
32082              */
32083             function directionStr(direction) {
32084                 if (direction == DIRECTION_DOWN) {
32085                     return 'down';
32086                 } else if (direction == DIRECTION_UP) {
32087                     return 'up';
32088                 } else if (direction == DIRECTION_LEFT) {
32089                     return 'left';
32090                 } else if (direction == DIRECTION_RIGHT) {
32091                     return 'right';
32092                 }
32093                 return '';
32094             }
32095
32096             /**
32097              * get a recognizer by name if it is bound to a manager
32098              * 
32099              * @param {Recognizer|String}
32100              *            otherRecognizer
32101              * @param {Recognizer}
32102              *            recognizer
32103              * @returns {Recognizer}
32104              */
32105             function getRecognizerByNameIfManager(otherRecognizer, recognizer) {
32106                 var manager = recognizer.manager;
32107                 if (manager) {
32108                     return manager.get(otherRecognizer);
32109                 }
32110                 return otherRecognizer;
32111             }
32112
32113             /**
32114              * This recognizer is just used as a base for the simple attribute recognizers.
32115              * 
32116              * @constructor
32117              * @extends Recognizer
32118              */
32119             function AttrRecognizer() {
32120                 Recognizer.apply(this, arguments);
32121             }
32122
32123             inherit(AttrRecognizer, Recognizer, {
32124                 /**
32125                  * @namespace
32126                  * @memberof AttrRecognizer
32127                  */
32128                 defaults: {
32129                     /**
32130                      * @type {Number}
32131                      * @default 1
32132                      */
32133                     pointers: 1
32134                 },
32135
32136                 /**
32137                  * Used to check if it the recognizer receives valid input, like
32138                  * input.distance > 10.
32139                  * 
32140                  * @memberof AttrRecognizer
32141                  * @param {Object}
32142                  *            input
32143                  * @returns {Boolean} recognized
32144                  */
32145                 attrTest: function(input) {
32146                     var optionPointers = this.options.pointers;
32147                     return optionPointers === 0 || input.pointers.length === optionPointers;
32148                 },
32149
32150                 /**
32151                  * Process the input and return the state for the recognizer
32152                  * 
32153                  * @memberof AttrRecognizer
32154                  * @param {Object}
32155                  *            input
32156                  * @returns {*} State
32157                  */
32158                 process: function(input) {
32159                     var state = this.state;
32160                     var eventType = input.eventType;
32161
32162                     var isRecognized = state & (STATE_BEGAN | STATE_CHANGED);
32163                     var isValid = this.attrTest(input);
32164
32165                     // on cancel input and we've recognized before, return STATE_CANCELLED
32166                     if (isRecognized && (eventType & INPUT_CANCEL || !isValid)) {
32167                         return state | STATE_CANCELLED;
32168                     } else if (isRecognized || isValid) {
32169                         if (eventType & INPUT_END) {
32170                             return state | STATE_ENDED;
32171                         } else if (!(state & STATE_BEGAN)) {
32172                             return STATE_BEGAN;
32173                         }
32174                         return state | STATE_CHANGED;
32175                     }
32176                     return STATE_FAILED;
32177                 }
32178             });
32179
32180             /**
32181              * Pan Recognized when the pointer is down and moved in the allowed direction.
32182              * 
32183              * @constructor
32184              * @extends AttrRecognizer
32185              */
32186             function PanRecognizer() {
32187                 AttrRecognizer.apply(this, arguments);
32188
32189                 this.pX = null;
32190                 this.pY = null;
32191             }
32192
32193             inherit(PanRecognizer, AttrRecognizer, {
32194                 /**
32195                  * @namespace
32196                  * @memberof PanRecognizer
32197                  */
32198                 defaults: {
32199                     event: 'pan',
32200                     threshold: 10,
32201                     pointers: 1,
32202                     direction: DIRECTION_ALL
32203                 },
32204
32205                 getTouchAction: function() {
32206                     var direction = this.options.direction;
32207                     var actions = [];
32208                     if (direction & DIRECTION_HORIZONTAL) {
32209                         actions.push(TOUCH_ACTION_PAN_Y);
32210                     }
32211                     if (direction & DIRECTION_VERTICAL) {
32212                         actions.push(TOUCH_ACTION_PAN_X);
32213                     }
32214                     return actions;
32215                 },
32216
32217                 directionTest: function(input) {
32218                     var options = this.options;
32219                     var hasMoved = true;
32220                     var distance = input.distance;
32221                     var direction = input.direction;
32222                     var x = input.deltaX;
32223                     var y = input.deltaY;
32224
32225                     // lock to axis?
32226                     if (!(direction & options.direction)) {
32227                         if (options.direction & DIRECTION_HORIZONTAL) {
32228                             direction = (x === 0) ? DIRECTION_NONE : (x < 0) ? DIRECTION_LEFT : DIRECTION_RIGHT;
32229                             hasMoved = x != this.pX;
32230                             distance = Math.abs(input.deltaX);
32231                         } else {
32232                             direction = (y === 0) ? DIRECTION_NONE : (y < 0) ? DIRECTION_UP : DIRECTION_DOWN;
32233                             hasMoved = y != this.pY;
32234                             distance = Math.abs(input.deltaY);
32235                         }
32236                     }
32237                     input.direction = direction;
32238                     return hasMoved && distance > options.threshold && direction & options.direction;
32239                 },
32240
32241                 attrTest: function(input) {
32242                     return AttrRecognizer.prototype.attrTest.call(this, input) &&
32243                         (this.state & STATE_BEGAN || (!(this.state & STATE_BEGAN) && this.directionTest(input)));
32244                 },
32245
32246                 emit: function(input) {
32247                     this.pX = input.deltaX;
32248                     this.pY = input.deltaY;
32249
32250                     var direction = directionStr(input.direction);
32251                     if (direction) {
32252                         this.manager.emit(this.options.event + direction, input);
32253                     }
32254
32255                     this._super.emit.call(this, input);
32256                 }
32257             });
32258
32259             /**
32260              * Pinch Recognized when two or more pointers are moving toward (zoom-in) or
32261              * away from each other (zoom-out).
32262              * 
32263              * @constructor
32264              * @extends AttrRecognizer
32265              */
32266             function PinchRecognizer() {
32267                 AttrRecognizer.apply(this, arguments);
32268             }
32269
32270             inherit(PinchRecognizer, AttrRecognizer, {
32271                 /**
32272                  * @namespace
32273                  * @memberof PinchRecognizer
32274                  */
32275                 defaults: {
32276                     event: 'pinch',
32277                     threshold: 0,
32278                     pointers: 2
32279                 },
32280
32281                 getTouchAction: function() {
32282                     return [TOUCH_ACTION_NONE];
32283                 },
32284
32285                 attrTest: function(input) {
32286                     return this._super.attrTest.call(this, input) &&
32287                         (Math.abs(input.scale - 1) > this.options.threshold || this.state & STATE_BEGAN);
32288                 },
32289
32290                 emit: function(input) {
32291                     this._super.emit.call(this, input);
32292                     if (input.scale !== 1) {
32293                         var inOut = input.scale < 1 ? 'in' : 'out';
32294                         this.manager.emit(this.options.event + inOut, input);
32295                     }
32296                 }
32297             });
32298
32299             /**
32300              * Press Recognized when the pointer is down for x ms without any movement.
32301              * 
32302              * @constructor
32303              * @extends Recognizer
32304              */
32305             function PressRecognizer() {
32306                 Recognizer.apply(this, arguments);
32307
32308                 this._timer = null;
32309                 this._input = null;
32310             }
32311
32312             inherit(PressRecognizer, Recognizer, {
32313                 /**
32314                  * @namespace
32315                  * @memberof PressRecognizer
32316                  */
32317                 defaults: {
32318                     event: 'press',
32319                     pointers: 1,
32320                     time: 500, // minimal time of the pointer to be pressed
32321                     threshold: 5 // a minimal movement is ok, but keep it low
32322                 },
32323
32324                 getTouchAction: function() {
32325                     return [TOUCH_ACTION_AUTO];
32326                 },
32327
32328                 process: function(input) {
32329                     var options = this.options;
32330                     var validPointers = input.pointers.length === options.pointers;
32331                     var validMovement = input.distance < options.threshold;
32332                     var validTime = input.deltaTime > options.time;
32333
32334                     this._input = input;
32335
32336                     // we only allow little movement
32337                     // and we've reached an end event, so a tap is possible
32338                     if (!validMovement || !validPointers || (input.eventType & (INPUT_END | INPUT_CANCEL) && !validTime)) {
32339                         this.reset();
32340                     } else if (input.eventType & INPUT_START) {
32341                         this.reset();
32342                         this._timer = setTimeoutContext(function() {
32343                             this.state = STATE_RECOGNIZED;
32344                             this.tryEmit();
32345                         }, options.time, this);
32346                     } else if (input.eventType & INPUT_END) {
32347                         return STATE_RECOGNIZED;
32348                     }
32349                     return STATE_FAILED;
32350                 },
32351
32352                 reset: function() {
32353                     clearTimeout(this._timer);
32354                 },
32355
32356                 emit: function(input) {
32357                     if (this.state !== STATE_RECOGNIZED) {
32358                         return;
32359                     }
32360
32361                     if (input && (input.eventType & INPUT_END)) {
32362                         this.manager.emit(this.options.event + 'up', input);
32363                     } else {
32364                         this._input.timeStamp = now();
32365                         this.manager.emit(this.options.event, this._input);
32366                     }
32367                 }
32368             });
32369
32370             /**
32371              * Rotate Recognized when two or more pointer are moving in a circular motion.
32372              * 
32373              * @constructor
32374              * @extends AttrRecognizer
32375              */
32376             function RotateRecognizer() {
32377                 AttrRecognizer.apply(this, arguments);
32378             }
32379
32380             inherit(RotateRecognizer, AttrRecognizer, {
32381                 /**
32382                  * @namespace
32383                  * @memberof RotateRecognizer
32384                  */
32385                 defaults: {
32386                     event: 'rotate',
32387                     threshold: 0,
32388                     pointers: 2
32389                 },
32390
32391                 getTouchAction: function() {
32392                     return [TOUCH_ACTION_NONE];
32393                 },
32394
32395                 attrTest: function(input) {
32396                     return this._super.attrTest.call(this, input) &&
32397                         (Math.abs(input.rotation) > this.options.threshold || this.state & STATE_BEGAN);
32398                 }
32399             });
32400
32401             /**
32402              * Swipe Recognized when the pointer is moving fast (velocity), with enough
32403              * distance in the allowed direction.
32404              * 
32405              * @constructor
32406              * @extends AttrRecognizer
32407              */
32408             function SwipeRecognizer() {
32409                 AttrRecognizer.apply(this, arguments);
32410             }
32411
32412             inherit(SwipeRecognizer, AttrRecognizer, {
32413                 /**
32414                  * @namespace
32415                  * @memberof SwipeRecognizer
32416                  */
32417                 defaults: {
32418                     event: 'swipe',
32419                     threshold: 10,
32420                     velocity: 0.65,
32421                     direction: DIRECTION_HORIZONTAL | DIRECTION_VERTICAL,
32422                     pointers: 1
32423                 },
32424
32425                 getTouchAction: function() {
32426                     return PanRecognizer.prototype.getTouchAction.call(this);
32427                 },
32428
32429                 attrTest: function(input) {
32430                     var direction = this.options.direction;
32431                     var velocity;
32432
32433                     if (direction & (DIRECTION_HORIZONTAL | DIRECTION_VERTICAL)) {
32434                         velocity = input.velocity;
32435                     } else if (direction & DIRECTION_HORIZONTAL) {
32436                         velocity = input.velocityX;
32437                     } else if (direction & DIRECTION_VERTICAL) {
32438                         velocity = input.velocityY;
32439                     }
32440
32441                     return this._super.attrTest.call(this, input) &&
32442                         direction & input.direction &&
32443                         input.distance > this.options.threshold &&
32444                         abs(velocity) > this.options.velocity && input.eventType & INPUT_END;
32445                 },
32446
32447                 emit: function(input) {
32448                     var direction = directionStr(input.direction);
32449                     if (direction) {
32450                         this.manager.emit(this.options.event + direction, input);
32451                     }
32452
32453                     this.manager.emit(this.options.event, input);
32454                 }
32455             });
32456
32457             /**
32458              * A tap is ecognized when the pointer is doing a small tap/click. Multiple taps
32459              * are recognized if they occur between the given interval and position. The
32460              * delay option can be used to recognize multi-taps without firing a single tap.
32461              * 
32462              * The eventData from the emitted event contains the property `tapCount`, which
32463              * contains the amount of multi-taps being recognized.
32464              * 
32465              * @constructor
32466              * @extends Recognizer
32467              */
32468             function TapRecognizer() {
32469                 Recognizer.apply(this, arguments);
32470
32471                 // previous time and center,
32472                 // used for tap counting
32473                 this.pTime = false;
32474                 this.pCenter = false;
32475
32476                 this._timer = null;
32477                 this._input = null;
32478                 this.count = 0;
32479             }
32480
32481             inherit(TapRecognizer, Recognizer, {
32482                 /**
32483                  * @namespace
32484                  * @memberof PinchRecognizer
32485                  */
32486                 defaults: {
32487                     event: 'tap',
32488                     pointers: 1,
32489                     taps: 1,
32490                     interval: 300, // max time between the multi-tap taps
32491                     time: 250, // max time of the pointer to be down (like finger on the
32492                     // screen)
32493                     threshold: 2, // a minimal movement is ok, but keep it low
32494                     posThreshold: 10 // a multi-tap can be a bit off the initial position
32495                 },
32496
32497                 getTouchAction: function() {
32498                     return [TOUCH_ACTION_MANIPULATION];
32499                 },
32500
32501                 process: function(input) {
32502                     var options = this.options;
32503
32504                     var validPointers = input.pointers.length === options.pointers;
32505                     var validMovement = input.distance < options.threshold;
32506                     var validTouchTime = input.deltaTime < options.time;
32507
32508                     this.reset();
32509
32510                     if ((input.eventType & INPUT_START) && (this.count === 0)) {
32511                         return this.failTimeout();
32512                     }
32513
32514                     // we only allow little movement
32515                     // and we've reached an end event, so a tap is possible
32516                     if (validMovement && validTouchTime && validPointers) {
32517                         if (input.eventType != INPUT_END) {
32518                             return this.failTimeout();
32519                         }
32520
32521                         var validInterval = this.pTime ? (input.timeStamp - this.pTime < options.interval) : true;
32522                         var validMultiTap = !this.pCenter || getDistance(this.pCenter, input.center) < options.posThreshold;
32523
32524                         this.pTime = input.timeStamp;
32525                         this.pCenter = input.center;
32526
32527                         if (!validMultiTap || !validInterval) {
32528                             this.count = 1;
32529                         } else {
32530                             this.count += 1;
32531                         }
32532
32533                         this._input = input;
32534
32535                         // if tap count matches we have recognized it,
32536                         // else it has began recognizing...
32537                         var tapCount = this.count % options.taps;
32538                         if (tapCount === 0) {
32539                             // no failing requirements, immediately trigger the tap event
32540                             // or wait as long as the multitap interval to trigger
32541                             if (!this.hasRequireFailures()) {
32542                                 return STATE_RECOGNIZED;
32543                             } else {
32544                                 this._timer = setTimeoutContext(function() {
32545                                     this.state = STATE_RECOGNIZED;
32546                                     this.tryEmit();
32547                                 }, options.interval, this);
32548                                 return STATE_BEGAN;
32549                             }
32550                         }
32551                     }
32552                     return STATE_FAILED;
32553                 },
32554
32555                 failTimeout: function() {
32556                     this._timer = setTimeoutContext(function() {
32557                         this.state = STATE_FAILED;
32558                     }, this.options.interval, this);
32559                     return STATE_FAILED;
32560                 },
32561
32562                 reset: function() {
32563                     clearTimeout(this._timer);
32564                 },
32565
32566                 emit: function() {
32567                     if (this.state == STATE_RECOGNIZED) {
32568                         this._input.tapCount = this.count;
32569                         this.manager.emit(this.options.event, this._input);
32570                     }
32571                 }
32572             });
32573
32574             /**
32575              * Simple way to create an manager with a default set of recognizers.
32576              * 
32577              * @param {HTMLElement}
32578              *            element
32579              * @param {Object}
32580              *            [options]
32581              * @constructor
32582              */
32583             function Hammer(element, options) {
32584                 options = options || {};
32585                 options.recognizers = ifUndefined(options.recognizers, Hammer.defaults.preset);
32586                 return new Manager(element, options);
32587             }
32588
32589             /**
32590              * @const {string}
32591              */
32592             Hammer.VERSION = '2.0.4';
32593
32594             /**
32595              * default settings
32596              * 
32597              * @namespace
32598              */
32599             Hammer.defaults = {
32600                 /**
32601                  * set if DOM events are being triggered. But this is slower and unused by
32602                  * simple implementations, so disabled by default.
32603                  * 
32604                  * @type {Boolean}
32605                  * @default false
32606                  */
32607                 domEvents: false,
32608
32609                 /**
32610                  * The value for the touchAction property/fallback. When set to `compute` it
32611                  * will magically set the correct value based on the added recognizers.
32612                  * 
32613                  * @type {String}
32614                  * @default compute
32615                  */
32616                 touchAction: TOUCH_ACTION_COMPUTE,
32617
32618                 /**
32619                  * @type {Boolean}
32620                  * @default true
32621                  */
32622                 enable: true,
32623
32624                 /**
32625                  * EXPERIMENTAL FEATURE -- can be removed/changed Change the parent input
32626                  * target element. If Null, then it is being set the to main element.
32627                  * 
32628                  * @type {Null|EventTarget}
32629                  * @default null
32630                  */
32631                 inputTarget: null,
32632
32633                 /**
32634                  * force an input class
32635                  * 
32636                  * @type {Null|Function}
32637                  * @default null
32638                  */
32639                 inputClass: null,
32640
32641                 /**
32642                  * Default recognizer setup when calling `Hammer()` When creating a new
32643                  * Manager these will be skipped.
32644                  * 
32645                  * @type {Array}
32646                  */
32647                 preset: [
32648                     // RecognizerClass, options, [recognizeWith, ...], [requireFailure, ...]
32649                     [RotateRecognizer, {
32650                         enable: false
32651                     }],
32652                     [PinchRecognizer, {
32653                             enable: false
32654                         },
32655                         ['rotate']
32656                     ],
32657                     [SwipeRecognizer, {
32658                         direction: DIRECTION_HORIZONTAL
32659                     }],
32660                     [PanRecognizer, {
32661                             direction: DIRECTION_HORIZONTAL
32662                         },
32663                         ['swipe']
32664                     ],
32665                     [TapRecognizer],
32666                     [TapRecognizer, {
32667                             event: 'doubletap',
32668                             taps: 2
32669                         },
32670                         ['tap']
32671                     ],
32672                     [PressRecognizer]
32673                 ],
32674
32675                 /**
32676                  * Some CSS properties can be used to improve the working of Hammer. Add
32677                  * them to this method and they will be set when creating a new Manager.
32678                  * 
32679                  * @namespace
32680                  */
32681                 cssProps: {
32682                     /**
32683                      * Disables text selection to improve the dragging gesture. Mainly for
32684                      * desktop browsers.
32685                      * 
32686                      * @type {String}
32687                      * @default 'none'
32688                      */
32689                     userSelect: 'none',
32690
32691                     /**
32692                      * Disable the Windows Phone grippers when pressing an element.
32693                      * 
32694                      * @type {String}
32695                      * @default 'none'
32696                      */
32697                     touchSelect: 'none',
32698
32699                     /**
32700                      * Disables the default callout shown when you touch and hold a touch
32701                      * target. On iOS, when you touch and hold a touch target such as a
32702                      * link, Safari displays a callout containing information about the
32703                      * link. This property allows you to disable that callout.
32704                      * 
32705                      * @type {String}
32706                      * @default 'none'
32707                      */
32708                     touchCallout: 'none',
32709
32710                     /**
32711                      * Specifies whether zooming is enabled. Used by IE10>
32712                      * 
32713                      * @type {String}
32714                      * @default 'none'
32715                      */
32716                     contentZooming: 'none',
32717
32718                     /**
32719                      * Specifies that an entire element should be draggable instead of its
32720                      * contents. Mainly for desktop browsers.
32721                      * 
32722                      * @type {String}
32723                      * @default 'none'
32724                      */
32725                     userDrag: 'none',
32726
32727                     /**
32728                      * Overrides the highlight color shown when the user taps a link or a
32729                      * JavaScript clickable element in iOS. This property obeys the alpha
32730                      * value, if specified.
32731                      * 
32732                      * @type {String}
32733                      * @default 'rgba(0,0,0,0)'
32734                      */
32735                     tapHighlightColor: 'rgba(0,0,0,0)'
32736                 }
32737             };
32738
32739             var STOP = 1;
32740             var FORCED_STOP = 2;
32741
32742             /**
32743              * Manager
32744              * 
32745              * @param {HTMLElement}
32746              *            element
32747              * @param {Object}
32748              *            [options]
32749              * @constructor
32750              */
32751             function Manager(element, options) {
32752                 options = options || {};
32753
32754                 this.options = merge(options, Hammer.defaults);
32755                 this.options.inputTarget = this.options.inputTarget || element;
32756
32757                 this.handlers = {};
32758                 this.session = {};
32759                 this.recognizers = [];
32760
32761                 this.element = element;
32762                 this.input = createInputInstance(this);
32763                 this.touchAction = new TouchAction(this, this.options.touchAction);
32764
32765                 toggleCssProps(this, true);
32766
32767                 each(options.recognizers, function(item) {
32768                     var recognizer = this.add(new(item[0])(item[1]));
32769                     item[2] && recognizer.recognizeWith(item[2]);
32770                     item[3] && recognizer.requireFailure(item[3]);
32771                 }, this);
32772             }
32773
32774             Manager.prototype = {
32775                 /**
32776                  * set options
32777                  * 
32778                  * @param {Object}
32779                  *            options
32780                  * @returns {Manager}
32781                  */
32782                 set: function(options) {
32783                     extend(this.options, options);
32784
32785                     // Options that need a little more setup
32786                     if (options.touchAction) {
32787                         this.touchAction.update();
32788                     }
32789                     if (options.inputTarget) {
32790                         // Clean up existing event listeners and reinitialize
32791                         this.input.destroy();
32792                         this.input.target = options.inputTarget;
32793                         this.input.init();
32794                     }
32795                     return this;
32796                 },
32797
32798                 /**
32799                  * stop recognizing for this session. This session will be discarded, when a
32800                  * new [input]start event is fired. When forced, the recognizer cycle is
32801                  * stopped immediately.
32802                  * 
32803                  * @param {Boolean}
32804                  *            [force]
32805                  */
32806                 stop: function(force) {
32807                     this.session.stopped = force ? FORCED_STOP : STOP;
32808                 },
32809
32810                 /**
32811                  * run the recognizers! called by the inputHandler function on every
32812                  * movement of the pointers (touches) it walks through all the recognizers
32813                  * and tries to detect the gesture that is being made
32814                  * 
32815                  * @param {Object}
32816                  *            inputData
32817                  */
32818                 recognize: function(inputData) {
32819                     var session = this.session;
32820                     if (session.stopped) {
32821                         return;
32822                     }
32823
32824                     // run the touch-action polyfill
32825                     this.touchAction.preventDefaults(inputData);
32826
32827                     var recognizer;
32828                     var recognizers = this.recognizers;
32829
32830                     // this holds the recognizer that is being recognized.
32831                     // so the recognizer's state needs to be BEGAN, CHANGED, ENDED or
32832                     // RECOGNIZED
32833                     // if no recognizer is detecting a thing, it is set to `null`
32834                     var curRecognizer = session.curRecognizer;
32835
32836                     // reset when the last recognizer is recognized
32837                     // or when we're in a new session
32838                     if (!curRecognizer || (curRecognizer && curRecognizer.state & STATE_RECOGNIZED)) {
32839                         curRecognizer = session.curRecognizer = null;
32840                     }
32841
32842                     var i = 0;
32843                     while (i < recognizers.length) {
32844                         recognizer = recognizers[i];
32845
32846                         // find out if we are allowed try to recognize the input for this
32847                         // one.
32848                         // 1. allow if the session is NOT forced stopped (see the .stop()
32849                         // method)
32850                         // 2. allow if we still haven't recognized a gesture in this
32851                         // session, or the this recognizer is the one
32852                         // that is being recognized.
32853                         // 3. allow if the recognizer is allowed to run simultaneous with
32854                         // the current recognized recognizer.
32855                         // this can be setup with the `recognizeWith()` method on the
32856                         // recognizer.
32857                         if (session.stopped !== FORCED_STOP && ( // 1
32858                                 !curRecognizer || recognizer == curRecognizer || // 2
32859                                 recognizer.canRecognizeWith(curRecognizer))) { // 3
32860                             recognizer.recognize(inputData);
32861                         } else {
32862                             recognizer.reset();
32863                         }
32864
32865                         // if the recognizer has been recognizing the input as a valid
32866                         // gesture, we want to store this one as the
32867                         // current active recognizer. but only if we don't already have an
32868                         // active recognizer
32869                         if (!curRecognizer && recognizer.state & (STATE_BEGAN | STATE_CHANGED | STATE_ENDED)) {
32870                             curRecognizer = session.curRecognizer = recognizer;
32871                         }
32872                         i++;
32873                     }
32874                 },
32875
32876                 /**
32877                  * get a recognizer by its event name.
32878                  * 
32879                  * @param {Recognizer|String}
32880                  *            recognizer
32881                  * @returns {Recognizer|Null}
32882                  */
32883                 get: function(recognizer) {
32884                     if (recognizer instanceof Recognizer) {
32885                         return recognizer;
32886                     }
32887
32888                     var recognizers = this.recognizers;
32889                     for (var i = 0; i < recognizers.length; i++) {
32890                         if (recognizers[i].options.event == recognizer) {
32891                             return recognizers[i];
32892                         }
32893                     }
32894                     return null;
32895                 },
32896
32897                 /**
32898                  * add a recognizer to the manager existing recognizers with the same event
32899                  * name will be removed
32900                  * 
32901                  * @param {Recognizer}
32902                  *            recognizer
32903                  * @returns {Recognizer|Manager}
32904                  */
32905                 add: function(recognizer) {
32906                     if (invokeArrayArg(recognizer, 'add', this)) {
32907                         return this;
32908                     }
32909
32910                     // remove existing
32911                     var existing = this.get(recognizer.options.event);
32912                     if (existing) {
32913                         this.remove(existing);
32914                     }
32915
32916                     this.recognizers.push(recognizer);
32917                     recognizer.manager = this;
32918
32919                     this.touchAction.update();
32920                     return recognizer;
32921                 },
32922
32923                 /**
32924                  * remove a recognizer by name or instance
32925                  * 
32926                  * @param {Recognizer|String}
32927                  *            recognizer
32928                  * @returns {Manager}
32929                  */
32930                 remove: function(recognizer) {
32931                     if (invokeArrayArg(recognizer, 'remove', this)) {
32932                         return this;
32933                     }
32934
32935                     var recognizers = this.recognizers;
32936                     recognizer = this.get(recognizer);
32937                     recognizers.splice(inArray(recognizers, recognizer), 1);
32938
32939                     this.touchAction.update();
32940                     return this;
32941                 },
32942
32943                 /**
32944                  * bind event
32945                  * 
32946                  * @param {String}
32947                  *            events
32948                  * @param {Function}
32949                  *            handler
32950                  * @returns {EventEmitter} this
32951                  */
32952                 on: function(events, handler) {
32953                     var handlers = this.handlers;
32954                     each(splitStr(events), function(event) {
32955                         handlers[event] = handlers[event] || [];
32956                         handlers[event].push(handler);
32957                     });
32958                     return this;
32959                 },
32960
32961                 /**
32962                  * unbind event, leave emit blank to remove all handlers
32963                  * 
32964                  * @param {String}
32965                  *            events
32966                  * @param {Function}
32967                  *            [handler]
32968                  * @returns {EventEmitter} this
32969                  */
32970                 off: function(events, handler) {
32971                     var handlers = this.handlers;
32972                     each(splitStr(events), function(event) {
32973                         if (!handler) {
32974                             delete handlers[event];
32975                         } else {
32976                             handlers[event].splice(inArray(handlers[event], handler), 1);
32977                         }
32978                     });
32979                     return this;
32980                 },
32981
32982                 /**
32983                  * emit event to the listeners
32984                  * 
32985                  * @param {String}
32986                  *            event
32987                  * @param {Object}
32988                  *            data
32989                  */
32990                 emit: function(event, data) {
32991                     // we also want to trigger dom events
32992                     if (this.options.domEvents) {
32993                         triggerDomEvent(event, data);
32994                     }
32995
32996                     // no handlers, so skip it all
32997                     var handlers = this.handlers[event] && this.handlers[event].slice();
32998                     if (!handlers || !handlers.length) {
32999                         return;
33000                     }
33001
33002                     data.type = event;
33003                     data.preventDefault = function() {
33004                         data.srcEvent.preventDefault();
33005                     };
33006
33007                     var i = 0;
33008                     while (i < handlers.length) {
33009                         handlers[i](data);
33010                         i++;
33011                     }
33012                 },
33013
33014                 /**
33015                  * destroy the manager and unbinds all events it doesn't unbind dom events,
33016                  * that is the user own responsibility
33017                  */
33018                 destroy: function() {
33019                     this.element && toggleCssProps(this, false);
33020
33021                     this.handlers = {};
33022                     this.session = {};
33023                     this.input.destroy();
33024                     this.element = null;
33025                 }
33026             };
33027
33028             /**
33029              * add/remove the css properties as defined in manager.options.cssProps
33030              * 
33031              * @param {Manager}
33032              *            manager
33033              * @param {Boolean}
33034              *            add
33035              */
33036             function toggleCssProps(manager, add) {
33037                 var element = manager.element;
33038                 each(manager.options.cssProps, function(value, name) {
33039                     element.style[prefixed(element.style, name)] = add ? value : '';
33040                 });
33041             }
33042
33043             /**
33044              * trigger dom event
33045              * 
33046              * @param {String}
33047              *            event
33048              * @param {Object}
33049              *            data
33050              */
33051             function triggerDomEvent(event, data) {
33052                 var gestureEvent = document.createEvent('Event');
33053                 gestureEvent.initEvent(event, true, true);
33054                 gestureEvent.gesture = data;
33055                 data.target.dispatchEvent(gestureEvent);
33056             }
33057
33058             extend(Hammer, {
33059                 INPUT_START: INPUT_START,
33060                 INPUT_MOVE: INPUT_MOVE,
33061                 INPUT_END: INPUT_END,
33062                 INPUT_CANCEL: INPUT_CANCEL,
33063
33064                 STATE_POSSIBLE: STATE_POSSIBLE,
33065                 STATE_BEGAN: STATE_BEGAN,
33066                 STATE_CHANGED: STATE_CHANGED,
33067                 STATE_ENDED: STATE_ENDED,
33068                 STATE_RECOGNIZED: STATE_RECOGNIZED,
33069                 STATE_CANCELLED: STATE_CANCELLED,
33070                 STATE_FAILED: STATE_FAILED,
33071
33072                 DIRECTION_NONE: DIRECTION_NONE,
33073                 DIRECTION_LEFT: DIRECTION_LEFT,
33074                 DIRECTION_RIGHT: DIRECTION_RIGHT,
33075                 DIRECTION_UP: DIRECTION_UP,
33076                 DIRECTION_DOWN: DIRECTION_DOWN,
33077                 DIRECTION_HORIZONTAL: DIRECTION_HORIZONTAL,
33078                 DIRECTION_VERTICAL: DIRECTION_VERTICAL,
33079                 DIRECTION_ALL: DIRECTION_ALL,
33080
33081                 Manager: Manager,
33082                 Input: Input,
33083                 TouchAction: TouchAction,
33084
33085                 TouchInput: TouchInput,
33086                 MouseInput: MouseInput,
33087                 PointerEventInput: PointerEventInput,
33088                 TouchMouseInput: TouchMouseInput,
33089                 SingleTouchInput: SingleTouchInput,
33090
33091                 Recognizer: Recognizer,
33092                 AttrRecognizer: AttrRecognizer,
33093                 Tap: TapRecognizer,
33094                 Pan: PanRecognizer,
33095                 Swipe: SwipeRecognizer,
33096                 Pinch: PinchRecognizer,
33097                 Rotate: RotateRecognizer,
33098                 Press: PressRecognizer,
33099
33100                 on: addEventListeners,
33101                 off: removeEventListeners,
33102                 each: each,
33103                 merge: merge,
33104                 extend: extend,
33105                 inherit: inherit,
33106                 bindFn: bindFn,
33107                 prefixed: prefixed
33108             });
33109
33110             if (typeof define == TYPE_FUNCTION && define.amd) {
33111                 define(function() {
33112                     return Hammer;
33113                 });
33114             } else if (typeof module != 'undefined' && module.exports) {
33115                 module.exports = Hammer;
33116             } else {
33117                 window[exportName] = Hammer;
33118             }
33119
33120         })(window, document, 'Hammer');
33121
33122     }, {}],
33123     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\inherits\\inherits_browser.js": [function(require, module, exports) {
33124         arguments[4]["\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\inherits\\inherits_browser.js"][0].apply(exports, arguments)
33125     }, {}],
33126     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\attr.js": [function(require, module, exports) {
33127         /**
33128          * Set attribute `name` to `val`, or get attr `name`.
33129          * 
33130          * @param {Element}
33131          *            el
33132          * @param {String}
33133          *            name
33134          * @param {String}
33135          *            [val]
33136          * @api public
33137          */
33138
33139         module.exports = function(el, name, val) {
33140             // get
33141             if (arguments.length == 2) {
33142                 return el.getAttribute(name);
33143             }
33144
33145             // remove
33146             if (val === null) {
33147                 return el.removeAttribute(name);
33148             }
33149
33150             // set
33151             el.setAttribute(name, val);
33152
33153             return el;
33154         };
33155     }, {}],
33156     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\classes.js": [function(require, module, exports) {
33157         module.exports = require('component-classes');
33158     }, {
33159         "component-classes": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\node_modules\\component-classes\\index.js"
33160     }],
33161     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\clear.js": [function(require, module, exports) {
33162         module.exports = function(el) {
33163
33164             var c;
33165
33166             while (el.childNodes.length) {
33167                 c = el.childNodes[0];
33168                 el.removeChild(c);
33169             }
33170
33171             return el;
33172         };
33173     }, {}],
33174     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\closest.js": [function(require, module, exports) {
33175         module.exports = require('component-closest');
33176     }, {
33177         "component-closest": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\node_modules\\component-closest\\index.js"
33178     }],
33179     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\delegate.js": [function(require, module, exports) {
33180         module.exports = require('component-delegate');
33181     }, {
33182         "component-delegate": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\node_modules\\component-delegate\\index.js"
33183     }],
33184     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\domify.js": [function(require, module, exports) {
33185         arguments[4]["\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\min-dom\\lib\\domify.js"][0].apply(exports, arguments)
33186     }, {
33187         "domify": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\node_modules\\domify\\index.js"
33188     }],
33189     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\event.js": [function(require, module, exports) {
33190         arguments[4]["\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\min-dom\\lib\\event.js"][0].apply(exports, arguments)
33191     }, {
33192         "component-event": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\node_modules\\component-event\\index.js"
33193     }],
33194     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\matches.js": [function(require, module, exports) {
33195         module.exports = require('component-matches-selector');
33196     }, {
33197         "component-matches-selector": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\node_modules\\component-matches-selector\\index.js"
33198     }],
33199     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\query.js": [function(require, module, exports) {
33200         arguments[4]["\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\min-dom\\lib\\query.js"][0].apply(exports, arguments)
33201     }, {
33202         "component-query": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\node_modules\\component-query\\index.js"
33203     }],
33204     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\lib\\remove.js": [function(require, module, exports) {
33205         arguments[4]["\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\min-dom\\lib\\remove.js"][0].apply(exports, arguments)
33206     }, {}],
33207     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\node_modules\\component-classes\\index.js": [function(require, module, exports) {
33208         /**
33209          * Module dependencies.
33210          */
33211
33212         var index = require('indexof');
33213
33214         /**
33215          * Whitespace regexp.
33216          */
33217
33218         var re = /\s+/;
33219
33220         /**
33221          * toString reference.
33222          */
33223
33224         var toString = Object.prototype.toString;
33225
33226         /**
33227          * Wrap `el` in a `ClassList`.
33228          * 
33229          * @param {Element}
33230          *            el
33231          * @return {ClassList}
33232          * @api public
33233          */
33234
33235         module.exports = function(el) {
33236             return new ClassList(el);
33237         };
33238
33239         /**
33240          * Initialize a new ClassList for `el`.
33241          * 
33242          * @param {Element}
33243          *            el
33244          * @api private
33245          */
33246
33247         function ClassList(el) {
33248             if (!el || !el.nodeType) {
33249                 throw new Error('A DOM element reference is required');
33250             }
33251             this.el = el;
33252             this.list = el.classList;
33253         }
33254
33255         /**
33256          * Add class `name` if not already present.
33257          * 
33258          * @param {String}
33259          *            name
33260          * @return {ClassList}
33261          * @api public
33262          */
33263
33264         ClassList.prototype.add = function(name) {
33265             // classList
33266             if (this.list) {
33267                 this.list.add(name);
33268                 return this;
33269             }
33270
33271             // fallback
33272             var arr = this.array();
33273             var i = index(arr, name);
33274             if (!~i) arr.push(name);
33275             this.el.className = arr.join(' ');
33276             return this;
33277         };
33278
33279         /**
33280          * Remove class `name` when present, or pass a regular expression to remove any
33281          * which match.
33282          * 
33283          * @param {String|RegExp}
33284          *            name
33285          * @return {ClassList}
33286          * @api public
33287          */
33288
33289         ClassList.prototype.remove = function(name) {
33290             if ('[object RegExp]' == toString.call(name)) {
33291                 return this.removeMatching(name);
33292             }
33293
33294             // classList
33295             if (this.list) {
33296                 this.list.remove(name);
33297                 return this;
33298             }
33299
33300             // fallback
33301             var arr = this.array();
33302             var i = index(arr, name);
33303             if (~i) arr.splice(i, 1);
33304             this.el.className = arr.join(' ');
33305             return this;
33306         };
33307
33308         /**
33309          * Remove all classes matching `re`.
33310          * 
33311          * @param {RegExp}
33312          *            re
33313          * @return {ClassList}
33314          * @api private
33315          */
33316
33317         ClassList.prototype.removeMatching = function(re) {
33318             var arr = this.array();
33319             for (var i = 0; i < arr.length; i++) {
33320                 if (re.test(arr[i])) {
33321                     this.remove(arr[i]);
33322                 }
33323             }
33324             return this;
33325         };
33326
33327         /**
33328          * Toggle class `name`, can force state via `force`.
33329          * 
33330          * For browsers that support classList, but do not support `force` yet, the
33331          * mistake will be detected and corrected.
33332          * 
33333          * @param {String}
33334          *            name
33335          * @param {Boolean}
33336          *            force
33337          * @return {ClassList}
33338          * @api public
33339          */
33340
33341         ClassList.prototype.toggle = function(name, force) {
33342             // classList
33343             if (this.list) {
33344                 if ("undefined" !== typeof force) {
33345                     if (force !== this.list.toggle(name, force)) {
33346                         this.list.toggle(name); // toggle again to correct
33347                     }
33348                 } else {
33349                     this.list.toggle(name);
33350                 }
33351                 return this;
33352             }
33353
33354             // fallback
33355             if ("undefined" !== typeof force) {
33356                 if (!force) {
33357                     this.remove(name);
33358                 } else {
33359                     this.add(name);
33360                 }
33361             } else {
33362                 if (this.has(name)) {
33363                     this.remove(name);
33364                 } else {
33365                     this.add(name);
33366                 }
33367             }
33368
33369             return this;
33370         };
33371
33372         /**
33373          * Return an array of classes.
33374          * 
33375          * @return {Array}
33376          * @api public
33377          */
33378
33379         ClassList.prototype.array = function() {
33380             var className = this.el.getAttribute('class') || '';
33381             var str = className.replace(/^\s+|\s+$/g, '');
33382             var arr = str.split(re);
33383             if ('' === arr[0]) arr.shift();
33384             return arr;
33385         };
33386
33387         /**
33388          * Check if class `name` is present.
33389          * 
33390          * @param {String}
33391          *            name
33392          * @return {ClassList}
33393          * @api public
33394          */
33395
33396         ClassList.prototype.has =
33397             ClassList.prototype.contains = function(name) {
33398                 return this.list ? this.list.contains(name) : !!~index(this.array(), name);
33399             };
33400
33401     }, {
33402         "indexof": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\node_modules\\component-classes\\node_modules\\component-indexof\\index.js"
33403     }],
33404     "\\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) {
33405         module.exports = function(arr, obj) {
33406             if (arr.indexOf) return arr.indexOf(obj);
33407             for (var i = 0; i < arr.length; ++i) {
33408                 if (arr[i] === obj) return i;
33409             }
33410             return -1;
33411         };
33412     }, {}],
33413     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\node_modules\\component-closest\\index.js": [function(require, module, exports) {
33414         var matches = require('matches-selector')
33415
33416         module.exports = function(element, selector, checkYoSelf, root) {
33417             element = checkYoSelf ? {
33418                 parentNode: element
33419             } : element
33420
33421             root = root || document
33422
33423             // Make sure `element !== document` and `element != null`
33424             // otherwise we get an illegal invocation
33425             while ((element = element.parentNode) && element !== document) {
33426                 if (matches(element, selector))
33427                     return element
33428                         // After `matches` on the edge case that
33429                         // the selector matches the root
33430                         // (when the root is not the document)
33431                 if (element === root)
33432                     return
33433             }
33434         }
33435
33436     }, {
33437         "matches-selector": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\node_modules\\component-matches-selector\\index.js"
33438     }],
33439     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\node_modules\\component-delegate\\index.js": [function(require, module, exports) {
33440         /**
33441          * Module dependencies.
33442          */
33443
33444         var closest = require('closest'),
33445             event = require('event');
33446
33447         /**
33448          * Delegate event `type` to `selector` and invoke `fn(e)`. A callback function
33449          * is returned which may be passed to `.unbind()`.
33450          * 
33451          * @param {Element}
33452          *            el
33453          * @param {String}
33454          *            selector
33455          * @param {String}
33456          *            type
33457          * @param {Function}
33458          *            fn
33459          * @param {Boolean}
33460          *            capture
33461          * @return {Function}
33462          * @api public
33463          */
33464
33465         exports.bind = function(el, selector, type, fn, capture) {
33466             return event.bind(el, type, function(e) {
33467                 var target = e.target || e.srcElement;
33468                 e.delegateTarget = closest(target, selector, true, el);
33469                 if (e.delegateTarget) fn.call(el, e);
33470             }, capture);
33471         };
33472
33473         /**
33474          * Unbind event `type`'s callback `fn`.
33475          * 
33476          * @param {Element}
33477          *            el
33478          * @param {String}
33479          *            type
33480          * @param {Function}
33481          *            fn
33482          * @param {Boolean}
33483          *            capture
33484          * @api public
33485          */
33486
33487         exports.unbind = function(el, type, fn, capture) {
33488             event.unbind(el, type, fn, capture);
33489         };
33490
33491     }, {
33492         "closest": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\node_modules\\component-closest\\index.js",
33493         "event": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\node_modules\\component-event\\index.js"
33494     }],
33495     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\node_modules\\component-event\\index.js": [function(require, module, exports) {
33496         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)
33497     }, {}],
33498     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\node_modules\\component-matches-selector\\index.js": [function(require, module, exports) {
33499         /**
33500          * Module dependencies.
33501          */
33502
33503         var query = require('query');
33504
33505         /**
33506          * Element prototype.
33507          */
33508
33509         var proto = Element.prototype;
33510
33511         /**
33512          * Vendor function.
33513          */
33514
33515         var vendor = proto.matches || proto.webkitMatchesSelector || proto.mozMatchesSelector || proto.msMatchesSelector || proto.oMatchesSelector;
33516
33517         /**
33518          * Expose `match()`.
33519          */
33520
33521         module.exports = match;
33522
33523         /**
33524          * Match `el` to `selector`.
33525          * 
33526          * @param {Element}
33527          *            el
33528          * @param {String}
33529          *            selector
33530          * @return {Boolean}
33531          * @api public
33532          */
33533
33534         function match(el, selector) {
33535             if (!el || el.nodeType !== 1) return false;
33536             if (vendor) return vendor.call(el, selector);
33537             var nodes = query.all(selector, el.parentNode);
33538             for (var i = 0; i < nodes.length; ++i) {
33539                 if (nodes[i] == el) return true;
33540             }
33541             return false;
33542         }
33543
33544     }, {
33545         "query": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\node_modules\\component-query\\index.js"
33546     }],
33547     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\node_modules\\component-query\\index.js": [function(require, module, exports) {
33548         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)
33549     }, {}],
33550     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\min-dom\\node_modules\\domify\\index.js": [function(require, module, exports) {
33551         arguments[4]["\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\min-dom\\node_modules\\domify\\index.js"][0].apply(exports, arguments)
33552     }, {}],
33553     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\object-refs\\index.js": [function(require, module, exports) {
33554         arguments[4]["\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\object-refs\\index.js"][0].apply(exports, arguments)
33555     }, {
33556         "./lib/collection": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\object-refs\\lib\\collection.js",
33557         "./lib/refs": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\object-refs\\lib\\refs.js"
33558     }],
33559     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\object-refs\\lib\\collection.js": [function(require, module, exports) {
33560         arguments[4]["\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\object-refs\\lib\\collection.js"][0].apply(exports, arguments)
33561     }, {}],
33562     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\object-refs\\lib\\refs.js": [function(require, module, exports) {
33563         arguments[4]["\\bpmn-js-examples-master\\modeler\\node_modules\\bpmn-js\\node_modules\\object-refs\\lib\\refs.js"][0].apply(exports, arguments)
33564     }, {
33565         "./collection": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\object-refs\\lib\\collection.js"
33566     }],
33567     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\snapsvg\\dist\\snap.svg.js": [function(require, module, exports) {
33568         // Snap.svg 0.3.0
33569         // 
33570         // Copyright (c) 2013 ÃƒÆ’¢â‚¬â€œ 2014 Adobe Systems Incorporated. All rights
33571         // reserved.
33572         // 
33573         // Licensed under the Apache License, Version 2.0 (the "License");
33574         // you may not use this file except in compliance with the License.
33575         // You may obtain a copy of the License at
33576         // 
33577         // http://www.apache.org/licenses/LICENSE-2.0
33578         // 
33579         // Unless required by applicable law or agreed to in writing, software
33580         // distributed under the License is distributed on an "AS IS" BASIS,
33581         // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
33582         // See the License for the specific language governing permissions and
33583         // limitations under the License.
33584         // 
33585         // build: 2014-09-08
33586
33587         (function(glob, factory) {
33588             // AMD support
33589             if (typeof define === "function" && define.amd) {
33590                 // Define as an anonymous module
33591                 define(["eve"], function(eve) {
33592                     return factory(glob, eve);
33593                 });
33594             } else if (typeof exports !== 'undefined') {
33595                 // Next for Node.js or CommonJS
33596                 var eve = require('eve');
33597                 module.exports = factory(glob, eve);
33598             } else {
33599                 // Browser globals (glob is window)
33600                 // Snap adds itself to window
33601                 factory(glob, glob.eve);
33602             }
33603         }(window || this, function(window, eve) {
33604
33605             // Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.
33606             // 
33607             // Licensed under the Apache License, Version 2.0 (the "License");
33608             // you may not use this file except in compliance with the License.
33609             // You may obtain a copy of the License at
33610             // 
33611             // http://www.apache.org/licenses/LICENSE-2.0
33612             // 
33613             // Unless required by applicable law or agreed to in writing, software
33614             // distributed under the License is distributed on an "AS IS" BASIS,
33615             // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
33616             // See the License for the specific language governing permissions and
33617             // limitations under the License.
33618             var mina = (function(eve) {
33619                 var animations = {},
33620                     requestAnimFrame = window.requestAnimationFrame ||
33621                     window.webkitRequestAnimationFrame ||
33622                     window.mozRequestAnimationFrame ||
33623                     window.oRequestAnimationFrame ||
33624                     window.msRequestAnimationFrame ||
33625                     function(callback) {
33626                         setTimeout(callback, 16);
33627                     },
33628                     isArray = Array.isArray || function(a) {
33629                         return a instanceof Array ||
33630                             Object.prototype.toString.call(a) == "[object Array]";
33631                     },
33632                     idgen = 0,
33633                     idprefix = "M" + (+new Date).toString(36),
33634                     ID = function() {
33635                         return idprefix + (idgen++).toString(36);
33636                     },
33637                     diff = function(a, b, A, B) {
33638                         if (isArray(a)) {
33639                             res = [];
33640                             for (var i = 0, ii = a.length; i < ii; i++) {
33641                                 res[i] = diff(a[i], b, A[i], B);
33642                             }
33643                             return res;
33644                         }
33645                         var dif = (A - a) / (B - b);
33646                         return function(bb) {
33647                             return a + dif * (bb - b);
33648                         };
33649                     },
33650                     timer = Date.now || function() {
33651                         return +new Date;
33652                     },
33653                     sta = function(val) {
33654                         var a = this;
33655                         if (val == null) {
33656                             return a.s;
33657                         }
33658                         var ds = a.s - val;
33659                         a.b += a.dur * ds;
33660                         a.B += a.dur * ds;
33661                         a.s = val;
33662                     },
33663                     speed = function(val) {
33664                         var a = this;
33665                         if (val == null) {
33666                             return a.spd;
33667                         }
33668                         a.spd = val;
33669                     },
33670                     duration = function(val) {
33671                         var a = this;
33672                         if (val == null) {
33673                             return a.dur;
33674                         }
33675                         a.s = a.s * val / a.dur;
33676                         a.dur = val;
33677                     },
33678                     stopit = function() {
33679                         var a = this;
33680                         delete animations[a.id];
33681                         a.update();
33682                         eve("mina.stop." + a.id, a);
33683                     },
33684                     pause = function() {
33685                         var a = this;
33686                         if (a.pdif) {
33687                             return;
33688                         }
33689                         delete animations[a.id];
33690                         a.update();
33691                         a.pdif = a.get() - a.b;
33692                     },
33693                     resume = function() {
33694                         var a = this;
33695                         if (!a.pdif) {
33696                             return;
33697                         }
33698                         a.b = a.get() - a.pdif;
33699                         delete a.pdif;
33700                         animations[a.id] = a;
33701                     },
33702                     update = function() {
33703                         var a = this,
33704                             res;
33705                         if (isArray(a.start)) {
33706                             res = [];
33707                             for (var j = 0, jj = a.start.length; j < jj; j++) {
33708                                 res[j] = +a.start[j] +
33709                                     (a.end[j] - a.start[j]) * a.easing(a.s);
33710                             }
33711                         } else {
33712                             res = +a.start + (a.end - a.start) * a.easing(a.s);
33713                         }
33714                         a.set(res);
33715                     },
33716                     frame = function() {
33717                         var len = 0;
33718                         for (var i in animations)
33719                             if (animations.hasOwnProperty(i)) {
33720                                 var a = animations[i],
33721                                     b = a.get(),
33722                                     res;
33723                                 len++;
33724                                 a.s = (b - a.b) / (a.dur / a.spd);
33725                                 if (a.s >= 1) {
33726                                     delete animations[i];
33727                                     a.s = 1;
33728                                     len--;
33729                                     (function(a) {
33730                                         setTimeout(function() {
33731                                             eve("mina.finish." + a.id, a);
33732                                         });
33733                                     }(a));
33734                                 }
33735                                 a.update();
33736                             }
33737                         len && requestAnimFrame(frame);
33738                     },
33739                     /*
33740                      * \ mina [ method ] * Generic animation of numbers * - a (number) start
33741                      * _slave_ number - A (number) end _slave_ number - b (number) start
33742                      * _master_ number (start time in general case) - B (number) end _master_
33743                      * number (end time in gereal case) - get (function) getter of _master_
33744                      * number (see @mina.time) - set (function) setter of _slave_ number -
33745                      * easing (function) #optional easing function, default is @mina.linear =
33746                      * (object) animation descriptor o { o id (string) animation id, o start
33747                      * (number) start _slave_ number, o end (number) end _slave_ number, o b
33748                      * (number) start _master_ number, o s (number) animation status (0..1), o
33749                      * dur (number) animation duration, o spd (number) animation speed, o get
33750                      * (function) getter of _master_ number (see @mina.time), o set (function)
33751                      * setter of _slave_ number, o easing (function) easing function, default is
33752                      * @mina.linear, o status (function) status getter/setter, o speed
33753                      * (function) speed getter/setter, o duration (function) duration
33754                      * getter/setter, o stop (function) animation stopper o pause (function)
33755                      * pauses the animation o resume (function) resumes the animation o update
33756                      * (function) calles setter with the right value of the animation o } \
33757                      */
33758                     mina = function(a, A, b, B, get, set, easing) {
33759                         var anim = {
33760                             id: ID(),
33761                             start: a,
33762                             end: A,
33763                             b: b,
33764                             s: 0,
33765                             dur: B - b,
33766                             spd: 1,
33767                             get: get,
33768                             set: set,
33769                             easing: easing || mina.linear,
33770                             status: sta,
33771                             speed: speed,
33772                             duration: duration,
33773                             stop: stopit,
33774                             pause: pause,
33775                             resume: resume,
33776                             update: update
33777                         };
33778                         animations[anim.id] = anim;
33779                         var len = 0,
33780                             i;
33781                         for (i in animations)
33782                             if (animations.hasOwnProperty(i)) {
33783                                 len++;
33784                                 if (len == 2) {
33785                                     break;
33786                                 }
33787                             }
33788                         len == 1 && requestAnimFrame(frame);
33789                         return anim;
33790                     };
33791                 /*
33792                  * \ mina.time [ method ] * Returns the current time. Equivalent to: |
33793                  * function () { | return (new Date).getTime(); | } \
33794                  */
33795                 mina.time = timer;
33796                 /*
33797                  * \ mina.getById [ method ] * Returns an animation by its id - id (string)
33798                  * animation's id = (object) See @mina \
33799                  */
33800                 mina.getById = function(id) {
33801                     return animations[id] || null;
33802                 };
33803
33804                 /*
33805                  * \ mina.linear [ method ] * Default linear easing - n (number) input 0..1 =
33806                  * (number) output 0..1 \
33807                  */
33808                 mina.linear = function(n) {
33809                     return n;
33810                 };
33811                 /*
33812                  * \ mina.easeout [ method ] * Easeout easing - n (number) input 0..1 =
33813                  * (number) output 0..1 \
33814                  */
33815                 mina.easeout = function(n) {
33816                     return Math.pow(n, 1.7);
33817                 };
33818                 /*
33819                  * \ mina.easein [ method ] * Easein easing - n (number) input 0..1 =
33820                  * (number) output 0..1 \
33821                  */
33822                 mina.easein = function(n) {
33823                     return Math.pow(n, .48);
33824                 };
33825                 /*
33826                  * \ mina.easeinout [ method ] * Easeinout easing - n (number) input 0..1 =
33827                  * (number) output 0..1 \
33828                  */
33829                 mina.easeinout = function(n) {
33830                     if (n == 1) {
33831                         return 1;
33832                     }
33833                     if (n == 0) {
33834                         return 0;
33835                     }
33836                     var q = .48 - n / 1.04,
33837                         Q = Math.sqrt(.1734 + q * q),
33838                         x = Q - q,
33839                         X = Math.pow(Math.abs(x), 1 / 3) * (x < 0 ? -1 : 1),
33840                         y = -Q - q,
33841                         Y = Math.pow(Math.abs(y), 1 / 3) * (y < 0 ? -1 : 1),
33842                         t = X + Y + .5;
33843                     return (1 - t) * 3 * t * t + t * t * t;
33844                 };
33845                 /*
33846                  * \ mina.backin [ method ] * Backin easing - n (number) input 0..1 =
33847                  * (number) output 0..1 \
33848                  */
33849                 mina.backin = function(n) {
33850                     if (n == 1) {
33851                         return 1;
33852                     }
33853                     var s = 1.70158;
33854                     return n * n * ((s + 1) * n - s);
33855                 };
33856                 /*
33857                  * \ mina.backout [ method ] * Backout easing - n (number) input 0..1 =
33858                  * (number) output 0..1 \
33859                  */
33860                 mina.backout = function(n) {
33861                     if (n == 0) {
33862                         return 0;
33863                     }
33864                     n = n - 1;
33865                     var s = 1.70158;
33866                     return n * n * ((s + 1) * n + s) + 1;
33867                 };
33868                 /*
33869                  * \ mina.elastic [ method ] * Elastic easing - n (number) input 0..1 =
33870                  * (number) output 0..1 \
33871                  */
33872                 mina.elastic = function(n) {
33873                     if (n == !!n) {
33874                         return n;
33875                     }
33876                     return Math.pow(2, -10 * n) * Math.sin((n - .075) *
33877                         (2 * Math.PI) / .3) + 1;
33878                 };
33879                 /*
33880                  * \ mina.bounce [ method ] * Bounce easing - n (number) input 0..1 =
33881                  * (number) output 0..1 \
33882                  */
33883                 mina.bounce = function(n) {
33884                     var s = 7.5625,
33885                         p = 2.75,
33886                         l;
33887                     if (n < (1 / p)) {
33888                         l = s * n * n;
33889                     } else {
33890                         if (n < (2 / p)) {
33891                             n -= (1.5 / p);
33892                             l = s * n * n + .75;
33893                         } else {
33894                             if (n < (2.5 / p)) {
33895                                 n -= (2.25 / p);
33896                                 l = s * n * n + .9375;
33897                             } else {
33898                                 n -= (2.625 / p);
33899                                 l = s * n * n + .984375;
33900                             }
33901                         }
33902                     }
33903                     return l;
33904                 };
33905                 window.mina = mina;
33906                 return mina;
33907             })(typeof eve == "undefined" ? function() {} : eve);
33908             // Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.
33909             //
33910             // Licensed under the Apache License, Version 2.0 (the "License");
33911             // you may not use this file except in compliance with the License.
33912             // You may obtain a copy of the License at
33913             //
33914             // http://www.apache.org/licenses/LICENSE-2.0
33915             //
33916             // Unless required by applicable law or agreed to in writing, software
33917             // distributed under the License is distributed on an "AS IS" BASIS,
33918             // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
33919             // See the License for the specific language governing permissions and
33920             // limitations under the License.
33921
33922             var Snap = (function(root) {
33923                 Snap.version = "0.3.0";
33924                 /*
33925                  * \ Snap [ method ] * Creates a drawing surface or wraps existing SVG element. * -
33926                  * width (number|string) width of surface - height (number|string) height of
33927                  * surface or - DOM (SVGElement) element to be wrapped into Snap structure or -
33928                  * array (array) array of elements (will return set of elements) or - query
33929                  * (string) CSS query selector = (object) @Element \
33930                  */
33931                 function Snap(w, h) {
33932                     if (w) {
33933                         if (w.tagName) {
33934                             return wrap(w);
33935                         }
33936                         if (is(w, "array") && Snap.set) {
33937                             return Snap.set.apply(Snap, w);
33938                         }
33939                         if (w instanceof Element) {
33940                             return w;
33941                         }
33942                         if (h == null) {
33943                             w = glob.doc.querySelector(w);
33944                             return wrap(w);
33945                         }
33946                     }
33947                     w = w == null ? "100%" : w;
33948                     h = h == null ? "100%" : h;
33949                     return new Paper(w, h);
33950                 }
33951                 Snap.toString = function() {
33952                     return "Snap v" + this.version;
33953                 };
33954                 Snap._ = {};
33955                 var glob = {
33956                     win: root.window,
33957                     doc: root.window.document
33958                 };
33959                 Snap._.glob = glob;
33960                 var has = "hasOwnProperty",
33961                     Str = String,
33962                     toFloat = parseFloat,
33963                     toInt = parseInt,
33964                     math = Math,
33965                     mmax = math.max,
33966                     mmin = math.min,
33967                     abs = math.abs,
33968                     pow = math.pow,
33969                     PI = math.PI,
33970                     round = math.round,
33971                     E = "",
33972                     S = " ",
33973                     objectToString = Object.prototype.toString,
33974                     ISURL = /^url\(['"]?([^\)]+?)['"]?\)$/i,
33975                     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,
33976                     bezierrg = /^(?:cubic-)?bezier\(([^,]+),([^,]+),([^,]+),([^\)]+)\)/,
33977                     reURLValue = /^url\(#?([^)]+)\)$/,
33978                     separator = Snap._.separator = /[,\s]+/,
33979                     whitespace = /[\s]/g,
33980                     commaSpaces = /[\s]*,[\s]*/,
33981                     hsrg = {
33982                         hs: 1,
33983                         rg: 1
33984                     },
33985                     pathCommand = /([a-z])[\s,]*((-?\d*\.?\d*(?:e[\-+]?\d+)?[\s]*,?[\s]*)+)/ig,
33986                     tCommand = /([rstm])[\s,]*((-?\d*\.?\d*(?:e[\-+]?\d+)?[\s]*,?[\s]*)+)/ig,
33987                     pathValues = /(-?\d*\.?\d*(?:e[\-+]?\\d+)?)[\s]*,?[\s]*/ig,
33988                     idgen = 0,
33989                     idprefix = "S" + (+new Date).toString(36),
33990                     ID = function(el) {
33991                         return (el && el.type ? el.type : E) + idprefix + (idgen++).toString(36);
33992                     },
33993                     xlink = "http://www.w3.org/1999/xlink",
33994                     xmlns = "http://www.w3.org/2000/svg",
33995                     hub = {},
33996                     URL = Snap.url = function(url) {
33997                         return "url('#" + url + "')";
33998                     };
33999
34000                 function $(el, attr) {
34001                     if (attr) {
34002                         if (el == "#text") {
34003                             el = glob.doc.createTextNode(attr.text || "");
34004                         }
34005                         if (typeof el == "string") {
34006                             el = $(el);
34007                         }
34008                         if (typeof attr == "string") {
34009                             if (attr.substring(0, 6) == "xlink:") {
34010                                 return el.getAttributeNS(xlink, attr.substring(6));
34011                             }
34012                             if (attr.substring(0, 4) == "xml:") {
34013                                 return el.getAttributeNS(xmlns, attr.substring(4));
34014                             }
34015                             return el.getAttribute(attr);
34016                         }
34017                         for (var key in attr)
34018                             if (attr[has](key)) {
34019                                 var val = Str(attr[key]);
34020                                 if (val) {
34021                                     if (key.substring(0, 6) == "xlink:") {
34022                                         el.setAttributeNS(xlink, key.substring(6), val);
34023                                     } else if (key.substring(0, 4) == "xml:") {
34024                                         el.setAttributeNS(xmlns, key.substring(4), val);
34025                                     } else {
34026                                         el.setAttribute(key, val);
34027                                     }
34028                                 } else {
34029                                     el.removeAttribute(key);
34030                                 }
34031                             }
34032                     } else {
34033                         el = glob.doc.createElementNS(xmlns, el);
34034                     }
34035                     return el;
34036                 }
34037                 Snap._.$ = $;
34038                 Snap._.id = ID;
34039
34040                 function getAttrs(el) {
34041                     var attrs = el.attributes,
34042                         name,
34043                         out = {};
34044                     for (var i = 0; i < attrs.length; i++) {
34045                         if (attrs[i].namespaceURI == xlink) {
34046                             name = "xlink:";
34047                         } else {
34048                             name = "";
34049                         }
34050                         name += attrs[i].name;
34051                         out[name] = attrs[i].textContent;
34052                     }
34053                     return out;
34054                 }
34055
34056                 function is(o, type) {
34057                     type = Str.prototype.toLowerCase.call(type);
34058                     if (type == "finite") {
34059                         return isFinite(o);
34060                     }
34061                     if (type == "array" &&
34062                         (o instanceof Array || Array.isArray && Array.isArray(o))) {
34063                         return true;
34064                     }
34065                     return (type == "null" && o === null) ||
34066                         (type == typeof o && o !== null) ||
34067                         (type == "object" && o === Object(o)) ||
34068                         objectToString.call(o).slice(8, -1).toLowerCase() == type;
34069                 }
34070                 /*
34071                  * \ Snap.format [ method ] * Replaces construction of type `{<name>}` to the
34072                  * corresponding argument * - token (string) string to format - json (object)
34073                  * object which properties are used as a replacement = (string) formatted string >
34074                  * Usage | // this draws a rectangular shape equivalent to "M10,20h40v50h-40z" |
34075                  * paper.path(Snap.format("M{x},{y}h{dim.width}v{dim.height}h{dim['negative
34076                  * width']}z", { | x: 10, | y: 20, | dim: { | width: 40, | height: 50, |
34077                  * "negative width": -40 | } | })); \
34078                  */
34079                 Snap.format = (function() {
34080                     var tokenRegex = /\{([^\}]+)\}/g,
34081                         objNotationRegex = /(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g, // matches
34082                         // .xxxxx
34083                         // or
34084                         // ["xxxxx"]
34085                         // to
34086                         // run
34087                         // over
34088                         // object
34089                         // properties
34090                         replacer = function(all, key, obj) {
34091                             var res = obj;
34092                             key.replace(objNotationRegex, function(all, name, quote, quotedName, isFunc) {
34093                                 name = name || quotedName;
34094                                 if (res) {
34095                                     if (name in res) {
34096                                         res = res[name];
34097                                     }
34098                                     typeof res == "function" && isFunc && (res = res());
34099                                 }
34100                             });
34101                             res = (res == null || res == obj ? all : res) + "";
34102                             return res;
34103                         };
34104                     return function(str, obj) {
34105                         return Str(str).replace(tokenRegex, function(all, key) {
34106                             return replacer(all, key, obj);
34107                         });
34108                     };
34109                 })();
34110
34111                 function clone(obj) {
34112                     if (typeof obj == "function" || Object(obj) !== obj) {
34113                         return obj;
34114                     }
34115                     var res = new obj.constructor;
34116                     for (var key in obj)
34117                         if (obj[has](key)) {
34118                             res[key] = clone(obj[key]);
34119                         }
34120                     return res;
34121                 }
34122                 Snap._.clone = clone;
34123
34124                 function repush(array, item) {
34125                     for (var i = 0, ii = array.length; i < ii; i++)
34126                         if (array[i] === item) {
34127                             return array.push(array.splice(i, 1)[0]);
34128                         }
34129                 }
34130
34131                 function cacher(f, scope, postprocessor) {
34132                     function newf() {
34133                         var arg = Array.prototype.slice.call(arguments, 0),
34134                             args = arg.join("\u2400"),
34135                             cache = newf.cache = newf.cache || {},
34136                             count = newf.count = newf.count || [];
34137                         if (cache[has](args)) {
34138                             repush(count, args);
34139                             return postprocessor ? postprocessor(cache[args]) : cache[args];
34140                         }
34141                         count.length >= 1e3 && delete cache[count.shift()];
34142                         count.push(args);
34143                         cache[args] = f.apply(scope, arg);
34144                         return postprocessor ? postprocessor(cache[args]) : cache[args];
34145                     }
34146                     return newf;
34147                 }
34148                 Snap._.cacher = cacher;
34149
34150                 function angle(x1, y1, x2, y2, x3, y3) {
34151                     if (x3 == null) {
34152                         var x = x1 - x2,
34153                             y = y1 - y2;
34154                         if (!x && !y) {
34155                             return 0;
34156                         }
34157                         return (180 + math.atan2(-y, -x) * 180 / PI + 360) % 360;
34158                     } else {
34159                         return angle(x1, y1, x3, y3) - angle(x2, y2, x3, y3);
34160                     }
34161                 }
34162
34163                 function rad(deg) {
34164                     return deg % 360 * PI / 180;
34165                 }
34166
34167                 function deg(rad) {
34168                     return rad * 180 / PI % 360;
34169                 }
34170
34171                 function x_y() {
34172                     return this.x + S + this.y;
34173                 }
34174
34175                 function x_y_w_h() {
34176                     return this.x + S + this.y + S + this.width + " \xd7 " + this.height;
34177                 }
34178
34179                 /*
34180                  * \ Snap.rad [ method ] * Transform angle to radians - deg (number) angle in
34181                  * degrees = (number) angle in radians \
34182                  */
34183                 Snap.rad = rad;
34184                 /*
34185                  * \ Snap.deg [ method ] * Transform angle to degrees - rad (number) angle in
34186                  * radians = (number) angle in degrees \
34187                  */
34188                 Snap.deg = deg;
34189                 /*
34190                  * \ Snap.angle [ method ] * Returns an angle between two or three points >
34191                  * Parameters - x1 (number) x coord of first point - y1 (number) y coord of
34192                  * first point - x2 (number) x coord of second point - y2 (number) y coord of
34193                  * second point - x3 (number) #optional x coord of third point - y3 (number)
34194                  * #optional y coord of third point = (number) angle in degrees \
34195                  */
34196                 Snap.angle = angle;
34197                 /*
34198                  * \ Snap.is [ method ] * Handy replacement for the `typeof` operator - o
34199                  * (…) any object or primitive - type (string) name of the type, e.g.,
34200                  * `string`, `function`, `number`, etc. = (boolean) `true` if given value is of
34201                  * given type \
34202                  */
34203                 Snap.is = is;
34204                 /*
34205                  * \ Snap.snapTo [ method ] * Snaps given value to given grid - values
34206                  * (array|number) given array of values or step of the grid - value (number)
34207                  * value to adjust - tolerance (number) #optional maximum distance to the target
34208                  * value that would trigger the snap. Default is `10`. = (number) adjusted value \
34209                  */
34210                 Snap.snapTo = function(values, value, tolerance) {
34211                     tolerance = is(tolerance, "finite") ? tolerance : 10;
34212                     if (is(values, "array")) {
34213                         var i = values.length;
34214                         while (i--)
34215                             if (abs(values[i] - value) <= tolerance) {
34216                                 return values[i];
34217                             }
34218                     } else {
34219                         values = +values;
34220                         var rem = value % values;
34221                         if (rem < tolerance) {
34222                             return value - rem;
34223                         }
34224                         if (rem > values - tolerance) {
34225                             return value - rem + values;
34226                         }
34227                     }
34228                     return value;
34229                 };
34230                 // Colour
34231                 /*
34232                  * \ Snap.getRGB [ method ] * Parses color string as RGB object - color (string)
34233                  * color string in one of the following formats: # <ul> # <li>Color name (<code>red</code>,
34234                  * <code>green</code>, <code>cornflowerblue</code>, etc)</li> # <li>#•••
34235                  * ÃƒÆ’¢â‚¬â€� shortened HTML color: (<code>#000</code>, <code>#fc0</code>,
34236                  * etc.)</li> # <li>#•••••• ÃƒÆ’¢â‚¬â€� full
34237                  * length HTML color: (<code>#000000</code>, <code>#bd2300</code>)</li> #
34238                  * <li>rgb(•••, ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢, ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢)
34239                  * ÃƒÆ’¢â‚¬â€� red, green and blue channels values: (<code>rgb(200,&nbsp;100,&nbsp;0)</code>)</li> #
34240                  * <li>rgba(•••, ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢,
34241                  * ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢, ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢) ÃƒÆ’¢â‚¬â€� also with opacity</li> #
34242                  * <li>rgb(•••%, ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢%,
34243                  * ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢%) ÃƒÆ’¢â‚¬â€� same as above, but in %: (<code>rgb(100%,&nbsp;175%,&nbsp;0%)</code>)</li> #
34244                  * <li>rgba(•••%, ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢%,
34245                  * ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢%, ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢%) ÃƒÆ’¢â‚¬â€� also with opacity</li> #
34246                  * <li>hsb(•••, ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢, ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢)
34247                  * ÃƒÆ’¢â‚¬â€� hue, saturation and brightness values: (<code>hsb(0.5,&nbsp;0.25,&nbsp;1)</code>)</li> #
34248                  * <li>hsba(•••, ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢,
34249                  * ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢, ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢) ÃƒÆ’¢â‚¬â€� also with opacity</li> #
34250                  * <li>hsb(•••%, ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢%,
34251                  * ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢%) ÃƒÆ’¢â‚¬â€� same as above, but in %</li> # <li>hsba(•••%,
34252                  * ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢%, ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢%, ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢%)
34253                  * ÃƒÆ’¢â‚¬â€� also with opacity</li> # <li>hsl(•••,
34254                  * ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢, ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢) ÃƒÆ’¢â‚¬â€� hue, saturation and
34255                  * luminosity values: (<code>hsb(0.5,&nbsp;0.25,&nbsp;0.5)</code>)</li> #
34256                  * <li>hsla(•••, ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢,
34257                  * ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢, ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢) ÃƒÆ’¢â‚¬â€� also with opacity</li> #
34258                  * <li>hsl(•••%, ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢%,
34259                  * ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢%) ÃƒÆ’¢â‚¬â€� same as above, but in %</li> # <li>hsla(•••%,
34260                  * ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢%, ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢%, ÃƒÆ’¢â‚¬Â¢Ã¢â‚¬Â¢Ã¢â‚¬Â¢%)
34261                  * ÃƒÆ’¢â‚¬â€� also with opacity</li> # </ul> Note that `%` can be used any time:
34262                  * `rgb(20%, 255, 50%)`. = (object) RGB object in the following format: o { o r
34263                  * (number) red, o g (number) green, o b (number) blue, o hex (string) color in
34264                  * HTML/CSS format: #••••••, o error
34265                  * (boolean) true if string can't be parsed o } \
34266                  */
34267                 Snap.getRGB = cacher(function(colour) {
34268                     if (!colour || !!((colour = Str(colour)).indexOf("-") + 1)) {
34269                         return {
34270                             r: -1,
34271                             g: -1,
34272                             b: -1,
34273                             hex: "none",
34274                             error: 1,
34275                             toString: rgbtoString
34276                         };
34277                     }
34278                     if (colour == "none") {
34279                         return {
34280                             r: -1,
34281                             g: -1,
34282                             b: -1,
34283                             hex: "none",
34284                             toString: rgbtoString
34285                         };
34286                     }!(hsrg[has](colour.toLowerCase().substring(0, 2)) || colour.charAt() == "#") && (colour = toHex(colour));
34287                     if (!colour) {
34288                         return {
34289                             r: -1,
34290                             g: -1,
34291                             b: -1,
34292                             hex: "none",
34293                             error: 1,
34294                             toString: rgbtoString
34295                         };
34296                     }
34297                     var res,
34298                         red,
34299                         green,
34300                         blue,
34301                         opacity,
34302                         t,
34303                         values,
34304                         rgb = colour.match(colourRegExp);
34305                     if (rgb) {
34306                         if (rgb[2]) {
34307                             blue = toInt(rgb[2].substring(5), 16);
34308                             green = toInt(rgb[2].substring(3, 5), 16);
34309                             red = toInt(rgb[2].substring(1, 3), 16);
34310                         }
34311                         if (rgb[3]) {
34312                             blue = toInt((t = rgb[3].charAt(3)) + t, 16);
34313                             green = toInt((t = rgb[3].charAt(2)) + t, 16);
34314                             red = toInt((t = rgb[3].charAt(1)) + t, 16);
34315                         }
34316                         if (rgb[4]) {
34317                             values = rgb[4].split(commaSpaces);
34318                             red = toFloat(values[0]);
34319                             values[0].slice(-1) == "%" && (red *= 2.55);
34320                             green = toFloat(values[1]);
34321                             values[1].slice(-1) == "%" && (green *= 2.55);
34322                             blue = toFloat(values[2]);
34323                             values[2].slice(-1) == "%" && (blue *= 2.55);
34324                             rgb[1].toLowerCase().slice(0, 4) == "rgba" && (opacity = toFloat(values[3]));
34325                             values[3] && values[3].slice(-1) == "%" && (opacity /= 100);
34326                         }
34327                         if (rgb[5]) {
34328                             values = rgb[5].split(commaSpaces);
34329                             red = toFloat(values[0]);
34330                             values[0].slice(-1) == "%" && (red /= 100);
34331                             green = toFloat(values[1]);
34332                             values[1].slice(-1) == "%" && (green /= 100);
34333                             blue = toFloat(values[2]);
34334                             values[2].slice(-1) == "%" && (blue /= 100);
34335                             (values[0].slice(-3) == "deg" || values[0].slice(-1) == "\xb0") && (red /= 360);
34336                             rgb[1].toLowerCase().slice(0, 4) == "hsba" && (opacity = toFloat(values[3]));
34337                             values[3] && values[3].slice(-1) == "%" && (opacity /= 100);
34338                             return Snap.hsb2rgb(red, green, blue, opacity);
34339                         }
34340                         if (rgb[6]) {
34341                             values = rgb[6].split(commaSpaces);
34342                             red = toFloat(values[0]);
34343                             values[0].slice(-1) == "%" && (red /= 100);
34344                             green = toFloat(values[1]);
34345                             values[1].slice(-1) == "%" && (green /= 100);
34346                             blue = toFloat(values[2]);
34347                             values[2].slice(-1) == "%" && (blue /= 100);
34348                             (values[0].slice(-3) == "deg" || values[0].slice(-1) == "\xb0") && (red /= 360);
34349                             rgb[1].toLowerCase().slice(0, 4) == "hsla" && (opacity = toFloat(values[3]));
34350                             values[3] && values[3].slice(-1) == "%" && (opacity /= 100);
34351                             return Snap.hsl2rgb(red, green, blue, opacity);
34352                         }
34353                         red = mmin(math.round(red), 255);
34354                         green = mmin(math.round(green), 255);
34355                         blue = mmin(math.round(blue), 255);
34356                         opacity = mmin(mmax(opacity, 0), 1);
34357                         rgb = {
34358                             r: red,
34359                             g: green,
34360                             b: blue,
34361                             toString: rgbtoString
34362                         };
34363                         rgb.hex = "#" + (16777216 | blue | (green << 8) | (red << 16)).toString(16).slice(1);
34364                         rgb.opacity = is(opacity, "finite") ? opacity : 1;
34365                         return rgb;
34366                     }
34367                     return {
34368                         r: -1,
34369                         g: -1,
34370                         b: -1,
34371                         hex: "none",
34372                         error: 1,
34373                         toString: rgbtoString
34374                     };
34375                 }, Snap);
34376                 // SIERRA It seems odd that the following 3 conversion methods are not expressed
34377                 // as .this2that(), like the others.
34378                 /*
34379                  * \ Snap.hsb [ method ] * Converts HSB values to a hex representation of the
34380                  * color - h (number) hue - s (number) saturation - b (number) value or
34381                  * brightness = (string) hex representation of the color \
34382                  */
34383                 Snap.hsb = cacher(function(h, s, b) {
34384                     return Snap.hsb2rgb(h, s, b).hex;
34385                 });
34386                 /*
34387                  * \ Snap.hsl [ method ] * Converts HSL values to a hex representation of the
34388                  * color - h (number) hue - s (number) saturation - l (number) luminosity =
34389                  * (string) hex representation of the color \
34390                  */
34391                 Snap.hsl = cacher(function(h, s, l) {
34392                     return Snap.hsl2rgb(h, s, l).hex;
34393                 });
34394                 /*
34395                  * \ Snap.rgb [ method ] * Converts RGB values to a hex representation of the
34396                  * color - r (number) red - g (number) green - b (number) blue = (string) hex
34397                  * representation of the color \
34398                  */
34399                 Snap.rgb = cacher(function(r, g, b, o) {
34400                     if (is(o, "finite")) {
34401                         var round = math.round;
34402                         return "rgba(" + [round(r), round(g), round(b), +o.toFixed(2)] + ")";
34403                     }
34404                     return "#" + (16777216 | b | (g << 8) | (r << 16)).toString(16).slice(1);
34405                 });
34406                 var toHex = function(color) {
34407                         var i = glob.doc.getElementsByTagName("head")[0] || glob.doc.getElementsByTagName("svg")[0],
34408                             red = "rgb(255, 0, 0)";
34409                         toHex = cacher(function(color) {
34410                             if (color.toLowerCase() == "red") {
34411                                 return red;
34412                             }
34413                             i.style.color = red;
34414                             i.style.color = color;
34415                             var out = glob.doc.defaultView.getComputedStyle(i, E).getPropertyValue("color");
34416                             return out == red ? null : out;
34417                         });
34418                         return toHex(color);
34419                     },
34420                     hsbtoString = function() {
34421                         return "hsb(" + [this.h, this.s, this.b] + ")";
34422                     },
34423                     hsltoString = function() {
34424                         return "hsl(" + [this.h, this.s, this.l] + ")";
34425                     },
34426                     rgbtoString = function() {
34427                         return this.opacity == 1 || this.opacity == null ?
34428                             this.hex :
34429                             "rgba(" + [this.r, this.g, this.b, this.opacity] + ")";
34430                     },
34431                     prepareRGB = function(r, g, b) {
34432                         if (g == null && is(r, "object") && "r" in r && "g" in r && "b" in r) {
34433                             b = r.b;
34434                             g = r.g;
34435                             r = r.r;
34436                         }
34437                         if (g == null && is(r, string)) {
34438                             var clr = Snap.getRGB(r);
34439                             r = clr.r;
34440                             g = clr.g;
34441                             b = clr.b;
34442                         }
34443                         if (r > 1 || g > 1 || b > 1) {
34444                             r /= 255;
34445                             g /= 255;
34446                             b /= 255;
34447                         }
34448
34449                         return [r, g, b];
34450                     },
34451                     packageRGB = function(r, g, b, o) {
34452                         r = math.round(r * 255);
34453                         g = math.round(g * 255);
34454                         b = math.round(b * 255);
34455                         var rgb = {
34456                             r: r,
34457                             g: g,
34458                             b: b,
34459                             opacity: is(o, "finite") ? o : 1,
34460                             hex: Snap.rgb(r, g, b),
34461                             toString: rgbtoString
34462                         };
34463                         is(o, "finite") && (rgb.opacity = o);
34464                         return rgb;
34465                     };
34466                 // SIERRA Clarify if Snap does not support consolidated HSLA/RGBA colors. E.g.,
34467                 // can you specify a semi-transparent value for Snap.filter.shadow()?
34468                 /*
34469                  * \ Snap.color [ method ] * Parses the color string and returns an object
34470                  * featuring the color's component values - clr (string) color string in one of
34471                  * the supported formats (see @Snap.getRGB) = (object) Combined RGB/HSB object
34472                  * in the following format: o { o r (number) red, o g (number) green, o b
34473                  * (number) blue, o hex (string) color in HTML/CSS format:
34474                  * #••••••, o error (boolean) `true` if
34475                  * string can't be parsed, o h (number) hue, o s (number) saturation, o v
34476                  * (number) value (brightness), o l (number) lightness o } \
34477                  */
34478                 Snap.color = function(clr) {
34479                     var rgb;
34480                     if (is(clr, "object") && "h" in clr && "s" in clr && "b" in clr) {
34481                         rgb = Snap.hsb2rgb(clr);
34482                         clr.r = rgb.r;
34483                         clr.g = rgb.g;
34484                         clr.b = rgb.b;
34485                         clr.opacity = 1;
34486                         clr.hex = rgb.hex;
34487                     } else if (is(clr, "object") && "h" in clr && "s" in clr && "l" in clr) {
34488                         rgb = Snap.hsl2rgb(clr);
34489                         clr.r = rgb.r;
34490                         clr.g = rgb.g;
34491                         clr.b = rgb.b;
34492                         clr.opacity = 1;
34493                         clr.hex = rgb.hex;
34494                     } else {
34495                         if (is(clr, "string")) {
34496                             clr = Snap.getRGB(clr);
34497                         }
34498                         if (is(clr, "object") && "r" in clr && "g" in clr && "b" in clr && !("error" in clr)) {
34499                             rgb = Snap.rgb2hsl(clr);
34500                             clr.h = rgb.h;
34501                             clr.s = rgb.s;
34502                             clr.l = rgb.l;
34503                             rgb = Snap.rgb2hsb(clr);
34504                             clr.v = rgb.b;
34505                         } else {
34506                             clr = {
34507                                 hex: "none"
34508                             };
34509                             clr.r = clr.g = clr.b = clr.h = clr.s = clr.v = clr.l = -1;
34510                             clr.error = 1;
34511                         }
34512                     }
34513                     clr.toString = rgbtoString;
34514                     return clr;
34515                 };
34516                 /*
34517                  * \ Snap.hsb2rgb [ method ] * Converts HSB values to an RGB object - h (number)
34518                  * hue - s (number) saturation - v (number) value or brightness = (object) RGB
34519                  * object in the following format: o { o r (number) red, o g (number) green, o b
34520                  * (number) blue, o hex (string) color in HTML/CSS format:
34521                  * #•••••• o } \
34522                  */
34523                 Snap.hsb2rgb = function(h, s, v, o) {
34524                     if (is(h, "object") && "h" in h && "s" in h && "b" in h) {
34525                         v = h.b;
34526                         s = h.s;
34527                         h = h.h;
34528                         o = h.o;
34529                     }
34530                     h *= 360;
34531                     var R, G, B, X, C;
34532                     h = (h % 360) / 60;
34533                     C = v * s;
34534                     X = C * (1 - abs(h % 2 - 1));
34535                     R = G = B = v - C;
34536
34537                     h = ~~h;
34538                     R += [C, X, 0, 0, X, C][h];
34539                     G += [X, C, C, X, 0, 0][h];
34540                     B += [0, 0, X, C, C, X][h];
34541                     return packageRGB(R, G, B, o);
34542                 };
34543                 /*
34544                  * \ Snap.hsl2rgb [ method ] * Converts HSL values to an RGB object - h (number)
34545                  * hue - s (number) saturation - l (number) luminosity = (object) RGB object in
34546                  * the following format: o { o r (number) red, o g (number) green, o b (number)
34547                  * blue, o hex (string) color in HTML/CSS format:
34548                  * #•••••• o } \
34549                  */
34550                 Snap.hsl2rgb = function(h, s, l, o) {
34551                     if (is(h, "object") && "h" in h && "s" in h && "l" in h) {
34552                         l = h.l;
34553                         s = h.s;
34554                         h = h.h;
34555                     }
34556                     if (h > 1 || s > 1 || l > 1) {
34557                         h /= 360;
34558                         s /= 100;
34559                         l /= 100;
34560                     }
34561                     h *= 360;
34562                     var R, G, B, X, C;
34563                     h = (h % 360) / 60;
34564                     C = 2 * s * (l < .5 ? l : 1 - l);
34565                     X = C * (1 - abs(h % 2 - 1));
34566                     R = G = B = l - C / 2;
34567
34568                     h = ~~h;
34569                     R += [C, X, 0, 0, X, C][h];
34570                     G += [X, C, C, X, 0, 0][h];
34571                     B += [0, 0, X, C, C, X][h];
34572                     return packageRGB(R, G, B, o);
34573                 };
34574                 /*
34575                  * \ Snap.rgb2hsb [ method ] * Converts RGB values to an HSB object - r (number)
34576                  * red - g (number) green - b (number) blue = (object) HSB object in the
34577                  * following format: o { o h (number) hue, o s (number) saturation, o b (number)
34578                  * brightness o } \
34579                  */
34580                 Snap.rgb2hsb = function(r, g, b) {
34581                     b = prepareRGB(r, g, b);
34582                     r = b[0];
34583                     g = b[1];
34584                     b = b[2];
34585
34586                     var H, S, V, C;
34587                     V = mmax(r, g, b);
34588                     C = V - mmin(r, g, b);
34589                     H = (C == 0 ? null :
34590                         V == r ? (g - b) / C :
34591                         V == g ? (b - r) / C + 2 :
34592                         (r - g) / C + 4
34593                     );
34594                     H = ((H + 360) % 6) * 60 / 360;
34595                     S = C == 0 ? 0 : C / V;
34596                     return {
34597                         h: H,
34598                         s: S,
34599                         b: V,
34600                         toString: hsbtoString
34601                     };
34602                 };
34603                 /*
34604                  * \ Snap.rgb2hsl [ method ] * Converts RGB values to an HSL object - r (number)
34605                  * red - g (number) green - b (number) blue = (object) HSL object in the
34606                  * following format: o { o h (number) hue, o s (number) saturation, o l (number)
34607                  * luminosity o } \
34608                  */
34609                 Snap.rgb2hsl = function(r, g, b) {
34610                     b = prepareRGB(r, g, b);
34611                     r = b[0];
34612                     g = b[1];
34613                     b = b[2];
34614
34615                     var H, S, L, M, m, C;
34616                     M = mmax(r, g, b);
34617                     m = mmin(r, g, b);
34618                     C = M - m;
34619                     H = (C == 0 ? null :
34620                         M == r ? (g - b) / C :
34621                         M == g ? (b - r) / C + 2 :
34622                         (r - g) / C + 4);
34623                     H = ((H + 360) % 6) * 60 / 360;
34624                     L = (M + m) / 2;
34625                     S = (C == 0 ? 0 :
34626                         L < .5 ? C / (2 * L) :
34627                         C / (2 - 2 * L));
34628                     return {
34629                         h: H,
34630                         s: S,
34631                         l: L,
34632                         toString: hsltoString
34633                     };
34634                 };
34635
34636                 // Transformations
34637                 // SIERRA Snap.parsePathString(): By _array of arrays,_ I assume you mean a
34638                 // format like this for two separate segments? [ ["M10,10","L90,90"],
34639                 // ["M90,10","L10,90"] ] Otherwise how is each command structured?
34640                 /*
34641                  * \ Snap.parsePathString [ method ] * Utility method * Parses given path string
34642                  * into an array of arrays of path segments - pathString (string|array) path
34643                  * string or array of segments (in the last case it is returned straight away) =
34644                  * (array) array of segments \
34645                  */
34646                 Snap.parsePathString = function(pathString) {
34647                     if (!pathString) {
34648                         return null;
34649                     }
34650                     var pth = Snap.path(pathString);
34651                     if (pth.arr) {
34652                         return Snap.path.clone(pth.arr);
34653                     }
34654
34655                     var paramCounts = {
34656                             a: 7,
34657                             c: 6,
34658                             o: 2,
34659                             h: 1,
34660                             l: 2,
34661                             m: 2,
34662                             r: 4,
34663                             q: 4,
34664                             s: 4,
34665                             t: 2,
34666                             v: 1,
34667                             u: 3,
34668                             z: 0
34669                         },
34670                         data = [];
34671                     if (is(pathString, "array") && is(pathString[0], "array")) { // rough
34672                         // assumption
34673                         data = Snap.path.clone(pathString);
34674                     }
34675                     if (!data.length) {
34676                         Str(pathString).replace(pathCommand, function(a, b, c) {
34677                             var params = [],
34678                                 name = b.toLowerCase();
34679                             c.replace(pathValues, function(a, b) {
34680                                 b && params.push(+b);
34681                             });
34682                             if (name == "m" && params.length > 2) {
34683                                 data.push([b].concat(params.splice(0, 2)));
34684                                 name = "l";
34685                                 b = b == "m" ? "l" : "L";
34686                             }
34687                             if (name == "o" && params.length == 1) {
34688                                 data.push([b, params[0]]);
34689                             }
34690                             if (name == "r") {
34691                                 data.push([b].concat(params));
34692                             } else
34693                                 while (params.length >= paramCounts[name]) {
34694                                     data.push([b].concat(params.splice(0, paramCounts[name])));
34695                                     if (!paramCounts[name]) {
34696                                         break;
34697                                     }
34698                                 }
34699                         });
34700                     }
34701                     data.toString = Snap.path.toString;
34702                     pth.arr = Snap.path.clone(data);
34703                     return data;
34704                 };
34705                 /*
34706                  * \ Snap.parseTransformString [ method ] * Utility method * Parses given
34707                  * transform string into an array of transformations - TString (string|array)
34708                  * transform string or array of transformations (in the last case it is returned
34709                  * straight away) = (array) array of transformations \
34710                  */
34711                 var parseTransformString = Snap.parseTransformString = function(TString) {
34712                     if (!TString) {
34713                         return null;
34714                     }
34715                     var paramCounts = {
34716                             r: 3,
34717                             s: 4,
34718                             t: 2,
34719                             m: 6
34720                         },
34721                         data = [];
34722                     if (is(TString, "array") && is(TString[0], "array")) { // rough assumption
34723                         data = Snap.path.clone(TString);
34724                     }
34725                     if (!data.length) {
34726                         Str(TString).replace(tCommand, function(a, b, c) {
34727                             var params = [],
34728                                 name = b.toLowerCase();
34729                             c.replace(pathValues, function(a, b) {
34730                                 b && params.push(+b);
34731                             });
34732                             data.push([b].concat(params));
34733                         });
34734                     }
34735                     data.toString = Snap.path.toString;
34736                     return data;
34737                 };
34738
34739                 function svgTransform2string(tstr) {
34740                     var res = [];
34741                     tstr = tstr.replace(/(?:^|\s)(\w+)\(([^)]+)\)/g, function(all, name, params) {
34742                         params = params.split(/\s*,\s*|\s+/);
34743                         if (name == "rotate" && params.length == 1) {
34744                             params.push(0, 0);
34745                         }
34746                         if (name == "scale") {
34747                             if (params.length > 2) {
34748                                 params = params.slice(0, 2);
34749                             } else if (params.length == 2) {
34750                                 params.push(0, 0);
34751                             }
34752                             if (params.length == 1) {
34753                                 params.push(params[0], 0, 0);
34754                             }
34755                         }
34756                         if (name == "skewX") {
34757                             res.push(["m", 1, 0, math.tan(rad(params[0])), 1, 0, 0]);
34758                         } else if (name == "skewY") {
34759                             res.push(["m", 1, math.tan(rad(params[0])), 0, 1, 0, 0]);
34760                         } else {
34761                             res.push([name.charAt(0)].concat(params));
34762                         }
34763                         return all;
34764                     });
34765                     return res;
34766                 }
34767                 Snap._.svgTransform2string = svgTransform2string;
34768                 Snap._.rgTransform = /^[a-z][\s]*-?\.?\d/i;
34769
34770                 function transform2matrix(tstr, bbox) {
34771                     var tdata = parseTransformString(tstr),
34772                         m = new Snap.Matrix;
34773                     if (tdata) {
34774                         for (var i = 0, ii = tdata.length; i < ii; i++) {
34775                             var t = tdata[i],
34776                                 tlen = t.length,
34777                                 command = Str(t[0]).toLowerCase(),
34778                                 absolute = t[0] != command,
34779                                 inver = absolute ? m.invert() : 0,
34780                                 x1,
34781                                 y1,
34782                                 x2,
34783                                 y2,
34784                                 bb;
34785                             if (command == "t" && tlen == 2) {
34786                                 m.translate(t[1], 0);
34787                             } else if (command == "t" && tlen == 3) {
34788                                 if (absolute) {
34789                                     x1 = inver.x(0, 0);
34790                                     y1 = inver.y(0, 0);
34791                                     x2 = inver.x(t[1], t[2]);
34792                                     y2 = inver.y(t[1], t[2]);
34793                                     m.translate(x2 - x1, y2 - y1);
34794                                 } else {
34795                                     m.translate(t[1], t[2]);
34796                                 }
34797                             } else if (command == "r") {
34798                                 if (tlen == 2) {
34799                                     bb = bb || bbox;
34800                                     m.rotate(t[1], bb.x + bb.width / 2, bb.y + bb.height / 2);
34801                                 } else if (tlen == 4) {
34802                                     if (absolute) {
34803                                         x2 = inver.x(t[2], t[3]);
34804                                         y2 = inver.y(t[2], t[3]);
34805                                         m.rotate(t[1], x2, y2);
34806                                     } else {
34807                                         m.rotate(t[1], t[2], t[3]);
34808                                     }
34809                                 }
34810                             } else if (command == "s") {
34811                                 if (tlen == 2 || tlen == 3) {
34812                                     bb = bb || bbox;
34813                                     m.scale(t[1], t[tlen - 1], bb.x + bb.width / 2, bb.y + bb.height / 2);
34814                                 } else if (tlen == 4) {
34815                                     if (absolute) {
34816                                         x2 = inver.x(t[2], t[3]);
34817                                         y2 = inver.y(t[2], t[3]);
34818                                         m.scale(t[1], t[1], x2, y2);
34819                                     } else {
34820                                         m.scale(t[1], t[1], t[2], t[3]);
34821                                     }
34822                                 } else if (tlen == 5) {
34823                                     if (absolute) {
34824                                         x2 = inver.x(t[3], t[4]);
34825                                         y2 = inver.y(t[3], t[4]);
34826                                         m.scale(t[1], t[2], x2, y2);
34827                                     } else {
34828                                         m.scale(t[1], t[2], t[3], t[4]);
34829                                     }
34830                                 }
34831                             } else if (command == "m" && tlen == 7) {
34832                                 m.add(t[1], t[2], t[3], t[4], t[5], t[6]);
34833                             }
34834                         }
34835                     }
34836                     return m;
34837                 }
34838                 Snap._.transform2matrix = transform2matrix;
34839                 Snap._unit2px = unit2px;
34840                 var contains = glob.doc.contains || glob.doc.compareDocumentPosition ?
34841                     function(a, b) {
34842                         var adown = a.nodeType == 9 ? a.documentElement : a,
34843                             bup = b && b.parentNode;
34844                         return a == bup || !!(bup && bup.nodeType == 1 && (
34845                             adown.contains ?
34846                             adown.contains(bup) :
34847                             a.compareDocumentPosition && a.compareDocumentPosition(bup) & 16
34848                         ));
34849                     } :
34850                     function(a, b) {
34851                         if (b) {
34852                             while (b) {
34853                                 b = b.parentNode;
34854                                 if (b == a) {
34855                                     return true;
34856                                 }
34857                             }
34858                         }
34859                         return false;
34860                     };
34861
34862                 function getSomeDefs(el) {
34863                     var p = (el.node.ownerSVGElement && wrap(el.node.ownerSVGElement)) ||
34864                         (el.node.parentNode && wrap(el.node.parentNode)) ||
34865                         Snap.select("svg") ||
34866                         Snap(0, 0),
34867                         pdefs = p.select("defs"),
34868                         defs = pdefs == null ? false : pdefs.node;
34869                     if (!defs) {
34870                         defs = make("defs", p.node).node;
34871                     }
34872                     return defs;
34873                 }
34874
34875                 function getSomeSVG(el) {
34876                     return el.node.ownerSVGElement && wrap(el.node.ownerSVGElement) || Snap.select("svg");
34877                 }
34878                 Snap._.getSomeDefs = getSomeDefs;
34879                 Snap._.getSomeSVG = getSomeSVG;
34880
34881                 function unit2px(el, name, value) {
34882                     var svg = getSomeSVG(el).node,
34883                         out = {},
34884                         mgr = svg.querySelector(".svg---mgr");
34885                     if (!mgr) {
34886                         mgr = $("rect");
34887                         $(mgr, {
34888                             x: -9e9,
34889                             y: -9e9,
34890                             width: 10,
34891                             height: 10,
34892                             "class": "svg---mgr",
34893                             fill: "none"
34894                         });
34895                         svg.appendChild(mgr);
34896                     }
34897
34898                     function getW(val) {
34899                         if (val == null) {
34900                             return E;
34901                         }
34902                         if (val == +val) {
34903                             return val;
34904                         }
34905                         $(mgr, {
34906                             width: val
34907                         });
34908                         try {
34909                             return mgr.getBBox().width;
34910                         } catch (e) {
34911                             return 0;
34912                         }
34913                     }
34914
34915                     function getH(val) {
34916                         if (val == null) {
34917                             return E;
34918                         }
34919                         if (val == +val) {
34920                             return val;
34921                         }
34922                         $(mgr, {
34923                             height: val
34924                         });
34925                         try {
34926                             return mgr.getBBox().height;
34927                         } catch (e) {
34928                             return 0;
34929                         }
34930                     }
34931
34932                     function set(nam, f) {
34933                         if (name == null) {
34934                             out[nam] = f(el.attr(nam) || 0);
34935                         } else if (nam == name) {
34936                             out = f(value == null ? el.attr(nam) || 0 : value);
34937                         }
34938                     }
34939                     switch (el.type) {
34940                         case "rect":
34941                             set("rx", getW);
34942                             set("ry", getH);
34943                         case "image":
34944                             set("width", getW);
34945                             set("height", getH);
34946                         case "text":
34947                             set("x", getW);
34948                             set("y", getH);
34949                             break;
34950                         case "circle":
34951                             set("cx", getW);
34952                             set("cy", getH);
34953                             set("r", getW);
34954                             break;
34955                         case "ellipse":
34956                             set("cx", getW);
34957                             set("cy", getH);
34958                             set("rx", getW);
34959                             set("ry", getH);
34960                             break;
34961                         case "line":
34962                             set("x1", getW);
34963                             set("x2", getW);
34964                             set("y1", getH);
34965                             set("y2", getH);
34966                             break;
34967                         case "marker":
34968                             set("refX", getW);
34969                             set("markerWidth", getW);
34970                             set("refY", getH);
34971                             set("markerHeight", getH);
34972                             break;
34973                         case "radialGradient":
34974                             set("fx", getW);
34975                             set("fy", getH);
34976                             break;
34977                         case "tspan":
34978                             set("dx", getW);
34979                             set("dy", getH);
34980                             break;
34981                         default:
34982                             set(name, getW);
34983                     }
34984                     svg.removeChild(mgr);
34985                     return out;
34986                 }
34987                 /*
34988                  * \ Snap.select [ method ] * Wraps a DOM element specified by CSS selector as
34989                  * @Element - query (string) CSS selector of the element = (Element) the current
34990                  * element \
34991                  */
34992                 Snap.select = function(query) {
34993                     query = Str(query).replace(/([^\\]):/g, "$1\\:");
34994                     return wrap(glob.doc.querySelector(query));
34995                 };
34996                 /*
34997                  * \ Snap.selectAll [ method ] * Wraps DOM elements specified by CSS selector as
34998                  * set or array of @Element - query (string) CSS selector of the element =
34999                  * (Element) the current element \
35000                  */
35001                 Snap.selectAll = function(query) {
35002                     var nodelist = glob.doc.querySelectorAll(query),
35003                         set = (Snap.set || Array)();
35004                     for (var i = 0; i < nodelist.length; i++) {
35005                         set.push(wrap(nodelist[i]));
35006                     }
35007                     return set;
35008                 };
35009
35010                 function add2group(list) {
35011                     if (!is(list, "array")) {
35012                         list = Array.prototype.slice.call(arguments, 0);
35013                     }
35014                     var i = 0,
35015                         j = 0,
35016                         node = this.node;
35017                     while (this[i]) delete this[i++];
35018                     for (i = 0; i < list.length; i++) {
35019                         if (list[i].type == "set") {
35020                             list[i].forEach(function(el) {
35021                                 node.appendChild(el.node);
35022                             });
35023                         } else {
35024                             node.appendChild(list[i].node);
35025                         }
35026                     }
35027                     var children = node.childNodes;
35028                     for (i = 0; i < children.length; i++) {
35029                         this[j++] = wrap(children[i]);
35030                     }
35031                     return this;
35032                 }
35033                 // Hub garbage collector every 10s
35034                 setInterval(function() {
35035                     for (var key in hub)
35036                         if (hub[has](key)) {
35037                             var el = hub[key],
35038                                 node = el.node;
35039                             if (el.type != "svg" && !node.ownerSVGElement || el.type == "svg" && (!node.parentNode || "ownerSVGElement" in node.parentNode && !node.ownerSVGElement)) {
35040                                 delete hub[key];
35041                             }
35042                         }
35043                 }, 1e4);
35044
35045                 function Element(el) {
35046                     if (el.snap in hub) {
35047                         return hub[el.snap];
35048                     }
35049                     var svg;
35050                     try {
35051                         svg = el.ownerSVGElement;
35052                     } catch (e) {}
35053                     /*
35054                      * \ Element.node [ property (object) ] * Gives you a reference to the DOM
35055                      * object, so you can assign event handlers or just mess around. > Usage | //
35056                      * draw a circle at coordinate 10,10 with radius of 10 | var c =
35057                      * paper.circle(10, 10, 10); | c.node.onclick = function () { |
35058                      * c.attr("fill", "red"); | }; \
35059                      */
35060                     this.node = el;
35061                     if (svg) {
35062                         this.paper = new Paper(svg);
35063                     }
35064                     /*
35065                      * \ Element.type [ property (string) ] * SVG tag name of the given element. \
35066                      */
35067                     this.type = el.tagName;
35068                     var id = this.id = ID(this);
35069                     this.anims = {};
35070                     this._ = {
35071                         transform: []
35072                     };
35073                     el.snap = id;
35074                     hub[id] = this;
35075                     if (this.type == "g") {
35076                         this.add = add2group;
35077                     }
35078                     if (this.type in {
35079                             g: 1,
35080                             mask: 1,
35081                             pattern: 1,
35082                             symbol: 1
35083                         }) {
35084                         for (var method in Paper.prototype)
35085                             if (Paper.prototype[has](method)) {
35086                                 this[method] = Paper.prototype[method];
35087                             }
35088                     }
35089                 }
35090                 /*
35091                  * \ Element.attr [ method ] * Gets or sets given attributes of the element. * -
35092                  * params (object) contains key-value pairs of attributes you want to set or -
35093                  * param (string) name of the attribute = (Element) the current element or =
35094                  * (string) value of attribute > Usage | el.attr({ | fill: "#fc0", | stroke:
35095                  * "#000", | strokeWidth: 2, // CamelCase... | "fill-opacity": 0.5, // or
35096                  * dash-separated names | width: "*=2" // prefixed values | }); |
35097                  * console.log(el.attr("fill")); // #fc0 Prefixed values in format `"+=10"`
35098                  * supported. All four operations (`+`, `-`, `*` and `/`) could be used.
35099                  * Optionally you can use units for `+` and `-`: `"+=2em"`. \
35100                  */
35101                 Element.prototype.attr = function(params, value) {
35102                     var el = this,
35103                         node = el.node;
35104                     if (!params) {
35105                         return el;
35106                     }
35107                     if (is(params, "string")) {
35108                         if (arguments.length > 1) {
35109                             var json = {};
35110                             json[params] = value;
35111                             params = json;
35112                         } else {
35113                             return eve("snap.util.getattr." + params, el).firstDefined();
35114                         }
35115                     }
35116                     for (var att in params) {
35117                         if (params[has](att)) {
35118                             eve("snap.util.attr." + att, el, params[att]);
35119                         }
35120                     }
35121                     return el;
35122                 };
35123                 /*
35124                  * \ Snap.parse [ method ] * Parses SVG fragment and converts it into a
35125                  * @Fragment * - svg (string) SVG string = (Fragment) the @Fragment \
35126                  */
35127                 Snap.parse = function(svg) {
35128                     var f = glob.doc.createDocumentFragment(),
35129                         full = true,
35130                         div = glob.doc.createElement("div");
35131                     svg = Str(svg);
35132                     if (!svg.match(/^\s*<\s*svg(?:\s|>)/)) {
35133                         svg = "<svg>" + svg + "</svg>";
35134                         full = false;
35135                     }
35136                     div.innerHTML = svg;
35137                     svg = div.getElementsByTagName("svg")[0];
35138                     if (svg) {
35139                         if (full) {
35140                             f = svg;
35141                         } else {
35142                             while (svg.firstChild) {
35143                                 f.appendChild(svg.firstChild);
35144                             }
35145                             div.innerHTML = E;
35146                         }
35147                     }
35148                     return new Fragment(f);
35149                 };
35150
35151                 function Fragment(frag) {
35152                     this.node = frag;
35153                 }
35154                 // SIERRA Snap.fragment() could especially use a code example
35155                 /*
35156                  * \ Snap.fragment [ method ] * Creates a DOM fragment from a given list of
35157                  * elements or strings * - varargs (…) SVG string = (Fragment) the
35158                  * @Fragment \
35159                  */
35160                 Snap.fragment = function() {
35161                     var args = Array.prototype.slice.call(arguments, 0),
35162                         f = glob.doc.createDocumentFragment();
35163                     for (var i = 0, ii = args.length; i < ii; i++) {
35164                         var item = args[i];
35165                         if (item.node && item.node.nodeType) {
35166                             f.appendChild(item.node);
35167                         }
35168                         if (item.nodeType) {
35169                             f.appendChild(item);
35170                         }
35171                         if (typeof item == "string") {
35172                             f.appendChild(Snap.parse(item).node);
35173                         }
35174                     }
35175                     return new Fragment(f);
35176                 };
35177
35178                 function make(name, parent) {
35179                     var res = $(name);
35180                     parent.appendChild(res);
35181                     var el = wrap(res);
35182                     return el;
35183                 }
35184
35185                 function Paper(w, h) {
35186                     var res,
35187                         desc,
35188                         defs,
35189                         proto = Paper.prototype;
35190                     if (w && w.tagName == "svg") {
35191                         if (w.snap in hub) {
35192                             return hub[w.snap];
35193                         }
35194                         var doc = w.ownerDocument;
35195                         res = new Element(w);
35196                         desc = w.getElementsByTagName("desc")[0];
35197                         defs = w.getElementsByTagName("defs")[0];
35198                         if (!desc) {
35199                             desc = $("desc");
35200                             desc.appendChild(doc.createTextNode("Created with Snap"));
35201                             res.node.appendChild(desc);
35202                         }
35203                         if (!defs) {
35204                             defs = $("defs");
35205                             res.node.appendChild(defs);
35206                         }
35207                         res.defs = defs;
35208                         for (var key in proto)
35209                             if (proto[has](key)) {
35210                                 res[key] = proto[key];
35211                             }
35212                         res.paper = res.root = res;
35213                     } else {
35214                         res = make("svg", glob.doc.body);
35215                         $(res.node, {
35216                             height: h,
35217                             version: 1.1,
35218                             width: w,
35219                             xmlns: xmlns
35220                         });
35221                     }
35222                     return res;
35223                 }
35224
35225                 function wrap(dom) {
35226                     if (!dom) {
35227                         return dom;
35228                     }
35229                     if (dom instanceof Element || dom instanceof Fragment) {
35230                         return dom;
35231                     }
35232                     if (dom.tagName && dom.tagName.toLowerCase() == "svg") {
35233                         return new Paper(dom);
35234                     }
35235                     if (dom.tagName && dom.tagName.toLowerCase() == "object" && dom.type == "image/svg+xml") {
35236                         return new Paper(dom.contentDocument.getElementsByTagName("svg")[0]);
35237                     }
35238                     return new Element(dom);
35239                 }
35240
35241                 Snap._.make = make;
35242                 Snap._.wrap = wrap;
35243                 /*
35244                  * \ Paper.el [ method ] * Creates an element on paper with a given name and no
35245                  * attributes * - name (string) tag name - attr (object) attributes = (Element)
35246                  * the current element > Usage | var c = paper.circle(10, 10, 10); // is the
35247                  * same as... | var c = paper.el("circle").attr({ | cx: 10, | cy: 10, | r: 10 |
35248                  * }); | // and the same as | var c = paper.el("circle", { | cx: 10, | cy: 10, |
35249                  * r: 10 | }); \
35250                  */
35251                 Paper.prototype.el = function(name, attr) {
35252                     var el = make(name, this.node);
35253                     attr && el.attr(attr);
35254                     return el;
35255                 };
35256                 // default
35257                 eve.on("snap.util.getattr", function() {
35258                     var att = eve.nt();
35259                     att = att.substring(att.lastIndexOf(".") + 1);
35260                     var css = att.replace(/[A-Z]/g, function(letter) {
35261                         return "-" + letter.toLowerCase();
35262                     });
35263                     if (cssAttr[has](css)) {
35264                         return this.node.ownerDocument.defaultView.getComputedStyle(this.node, null).getPropertyValue(css);
35265                     } else {
35266                         return $(this.node, att);
35267                     }
35268                 });
35269                 var cssAttr = {
35270                     "alignment-baseline": 0,
35271                     "baseline-shift": 0,
35272                     "clip": 0,
35273                     "clip-path": 0,
35274                     "clip-rule": 0,
35275                     "color": 0,
35276                     "color-interpolation": 0,
35277                     "color-interpolation-filters": 0,
35278                     "color-profile": 0,
35279                     "color-rendering": 0,
35280                     "cursor": 0,
35281                     "direction": 0,
35282                     "display": 0,
35283                     "dominant-baseline": 0,
35284                     "enable-background": 0,
35285                     "fill": 0,
35286                     "fill-opacity": 0,
35287                     "fill-rule": 0,
35288                     "filter": 0,
35289                     "flood-color": 0,
35290                     "flood-opacity": 0,
35291                     "font": 0,
35292                     "font-family": 0,
35293                     "font-size": 0,
35294                     "font-size-adjust": 0,
35295                     "font-stretch": 0,
35296                     "font-style": 0,
35297                     "font-variant": 0,
35298                     "font-weight": 0,
35299                     "glyph-orientation-horizontal": 0,
35300                     "glyph-orientation-vertical": 0,
35301                     "image-rendering": 0,
35302                     "kerning": 0,
35303                     "letter-spacing": 0,
35304                     "lighting-color": 0,
35305                     "marker": 0,
35306                     "marker-end": 0,
35307                     "marker-mid": 0,
35308                     "marker-start": 0,
35309                     "mask": 0,
35310                     "opacity": 0,
35311                     "overflow": 0,
35312                     "pointer-events": 0,
35313                     "shape-rendering": 0,
35314                     "stop-color": 0,
35315                     "stop-opacity": 0,
35316                     "stroke": 0,
35317                     "stroke-dasharray": 0,
35318                     "stroke-dashoffset": 0,
35319                     "stroke-linecap": 0,
35320                     "stroke-linejoin": 0,
35321                     "stroke-miterlimit": 0,
35322                     "stroke-opacity": 0,
35323                     "stroke-width": 0,
35324                     "text-anchor": 0,
35325                     "text-decoration": 0,
35326                     "text-rendering": 0,
35327                     "unicode-bidi": 0,
35328                     "visibility": 0,
35329                     "word-spacing": 0,
35330                     "writing-mode": 0
35331                 };
35332
35333                 eve.on("snap.util.attr", function(value) {
35334                     var att = eve.nt(),
35335                         attr = {};
35336                     att = att.substring(att.lastIndexOf(".") + 1);
35337                     attr[att] = value;
35338                     var style = att.replace(/-(\w)/gi, function(all, letter) {
35339                             return letter.toUpperCase();
35340                         }),
35341                         css = att.replace(/[A-Z]/g, function(letter) {
35342                             return "-" + letter.toLowerCase();
35343                         });
35344                     if (cssAttr[has](css)) {
35345                         this.node.style[style] = value == null ? E : value;
35346                     } else {
35347                         $(this.node, attr);
35348                     }
35349                 });
35350                 (function(proto) {}(Paper.prototype));
35351
35352                 // simple ajax
35353                 /*
35354                  * \ Snap.ajax [ method ] * Simple implementation of Ajax * - url (string) URL -
35355                  * postData (object|string) data for post request - callback (function) callback -
35356                  * scope (object) #optional scope of callback or - url (string) URL - callback
35357                  * (function) callback - scope (object) #optional scope of callback =
35358                  * (XMLHttpRequest) the XMLHttpRequest object, just in case \
35359                  */
35360                 Snap.ajax = function(url, postData, callback, scope) {
35361                     var req = new XMLHttpRequest,
35362                         id = ID();
35363                     if (req) {
35364                         if (is(postData, "function")) {
35365                             scope = callback;
35366                             callback = postData;
35367                             postData = null;
35368                         } else if (is(postData, "object")) {
35369                             var pd = [];
35370                             for (var key in postData)
35371                                 if (postData.hasOwnProperty(key)) {
35372                                     pd.push(encodeURIComponent(key) + "=" + encodeURIComponent(postData[key]));
35373                                 }
35374                             postData = pd.join("&");
35375                         }
35376                         req.open((postData ? "POST" : "GET"), url, true);
35377                         if (postData) {
35378                             req.setRequestHeader("X-Requested-With", "XMLHttpRequest");
35379                             req.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
35380                         }
35381                         if (callback) {
35382                             eve.once("snap.ajax." + id + ".0", callback);
35383                             eve.once("snap.ajax." + id + ".200", callback);
35384                             eve.once("snap.ajax." + id + ".304", callback);
35385                         }
35386                         req.onreadystatechange = function() {
35387                             if (req.readyState != 4) return;
35388                             eve("snap.ajax." + id + "." + req.status, scope, req);
35389                         };
35390                         if (req.readyState == 4) {
35391                             return req;
35392                         }
35393                         req.send(postData);
35394                         return req;
35395                     }
35396                 };
35397                 /*
35398                  * \ Snap.load [ method ] * Loads external SVG file as a @Fragment (see
35399                  * @Snap.ajax for more advanced AJAX) * - url (string) URL - callback (function)
35400                  * callback - scope (object) #optional scope of callback \
35401                  */
35402                 Snap.load = function(url, callback, scope) {
35403                     Snap.ajax(url, function(req) {
35404                         var f = Snap.parse(req.responseText);
35405                         scope ? callback.call(scope, f) : callback(f);
35406                     });
35407                 };
35408                 var getOffset = function(elem) {
35409                     var box = elem.getBoundingClientRect(),
35410                         doc = elem.ownerDocument,
35411                         body = doc.body,
35412                         docElem = doc.documentElement,
35413                         clientTop = docElem.clientTop || body.clientTop || 0,
35414                         clientLeft = docElem.clientLeft || body.clientLeft || 0,
35415                         top = box.top + (g.win.pageYOffset || docElem.scrollTop || body.scrollTop) - clientTop,
35416                         left = box.left + (g.win.pageXOffset || docElem.scrollLeft || body.scrollLeft) - clientLeft;
35417                     return {
35418                         y: top,
35419                         x: left
35420                     };
35421                 };
35422                 /*
35423                  * \ Snap.getElementByPoint [ method ] * Returns you topmost element under given
35424                  * point. * = (object) Snap element object - x (number) x coordinate from the
35425                  * top left corner of the window - y (number) y coordinate from the top left
35426                  * corner of the window > Usage | Snap.getElementByPoint(mouseX,
35427                  * mouseY).attr({stroke: "#f00"}); \
35428                  */
35429                 Snap.getElementByPoint = function(x, y) {
35430                     var paper = this,
35431                         svg = paper.canvas,
35432                         target = glob.doc.elementFromPoint(x, y);
35433                     if (glob.win.opera && target.tagName == "svg") {
35434                         var so = getOffset(target),
35435                             sr = target.createSVGRect();
35436                         sr.x = x - so.x;
35437                         sr.y = y - so.y;
35438                         sr.width = sr.height = 1;
35439                         var hits = target.getIntersectionList(sr, null);
35440                         if (hits.length) {
35441                             target = hits[hits.length - 1];
35442                         }
35443                     }
35444                     if (!target) {
35445                         return null;
35446                     }
35447                     return wrap(target);
35448                 };
35449                 /*
35450                  * \ Snap.plugin [ method ] * Let you write plugins. You pass in a function with
35451                  * four arguments, like this: | Snap.plugin(function (Snap, Element, Paper,
35452                  * global, Fragment) { | Snap.newmethod = function () {}; |
35453                  * Element.prototype.newmethod = function () {}; | Paper.prototype.newmethod =
35454                  * function () {}; | }); Inside the function you have access to all main objects
35455                  * (and their prototypes). This allow you to extend anything you want. * - f
35456                  * (function) your plugin body \
35457                  */
35458                 Snap.plugin = function(f) {
35459                     f(Snap, Element, Paper, glob, Fragment);
35460                 };
35461                 glob.win.Snap = Snap;
35462                 return Snap;
35463             }(window || this));
35464             // Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.
35465             //
35466             // Licensed under the Apache License, Version 2.0 (the "License");
35467             // you may not use this file except in compliance with the License.
35468             // You may obtain a copy of the License at
35469             //
35470             // http://www.apache.org/licenses/LICENSE-2.0
35471             //
35472             // Unless required by applicable law or agreed to in writing, software
35473             // distributed under the License is distributed on an "AS IS" BASIS,
35474             // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
35475             // See the License for the specific language governing permissions and
35476             // limitations under the License.
35477             Snap.plugin(function(Snap, Element, Paper, glob, Fragment) {
35478                 var elproto = Element.prototype,
35479                     is = Snap.is,
35480                     Str = String,
35481                     unit2px = Snap._unit2px,
35482                     $ = Snap._.$,
35483                     make = Snap._.make,
35484                     getSomeDefs = Snap._.getSomeDefs,
35485                     has = "hasOwnProperty",
35486                     wrap = Snap._.wrap;
35487                 /*
35488                  * \ Element.getBBox [ method ] * Returns the bounding box descriptor for
35489                  * the given element * = (object) bounding box descriptor: o { o cx:
35490                  * (number) x of the center, o cy: (number) x of the center, o h: (number)
35491                  * height, o height: (number) height, o path: (string) path command for the
35492                  * box, o r0: (number) radius of a circle that fully encloses the box, o r1:
35493                  * (number) radius of the smallest circle that can be enclosed, o r2:
35494                  * (number) radius of the largest circle that can be enclosed, o vb:
35495                  * (string) box as a viewbox command, o w: (number) width, o width: (number)
35496                  * width, o x2: (number) x of the right side, o x: (number) x of the left
35497                  * side, o y2: (number) y of the bottom edge, o y: (number) y of the top
35498                  * edge o } \
35499                  */
35500                 elproto.getBBox = function(isWithoutTransform) {
35501                     if (!Snap.Matrix || !Snap.path) {
35502                         return this.node.getBBox();
35503                     }
35504                     var el = this,
35505                         m = new Snap.Matrix;
35506                     if (el.removed) {
35507                         return Snap._.box();
35508                     }
35509                     while (el.type == "use") {
35510                         if (!isWithoutTransform) {
35511                             m = m.add(el.transform().localMatrix.translate(el.attr("x") || 0, el.attr("y") || 0));
35512                         }
35513                         if (el.original) {
35514                             el = el.original;
35515                         } else {
35516                             var href = el.attr("xlink:href");
35517                             el = el.original = el.node.ownerDocument.getElementById(href.substring(href.indexOf("#") + 1));
35518                         }
35519                     }
35520                     var _ = el._,
35521                         pathfinder = Snap.path.get[el.type] || Snap.path.get.deflt;
35522                     try {
35523                         if (isWithoutTransform) {
35524                             _.bboxwt = pathfinder ? Snap.path.getBBox(el.realPath = pathfinder(el)) : Snap._.box(el.node.getBBox());
35525                             return Snap._.box(_.bboxwt);
35526                         } else {
35527                             el.realPath = pathfinder(el);
35528                             el.matrix = el.transform().localMatrix;
35529                             _.bbox = Snap.path.getBBox(Snap.path.map(el.realPath, m.add(el.matrix)));
35530                             return Snap._.box(_.bbox);
35531                         }
35532                     } catch (e) {
35533                         // Firefox doesn’t give you bbox of hidden element
35534                         return Snap._.box();
35535                     }
35536                 };
35537                 var propString = function() {
35538                     return this.string;
35539                 };
35540
35541                 function extractTransform(el, tstr) {
35542                     if (tstr == null) {
35543                         var doReturn = true;
35544                         if (el.type == "linearGradient" || el.type == "radialGradient") {
35545                             tstr = el.node.getAttribute("gradientTransform");
35546                         } else if (el.type == "pattern") {
35547                             tstr = el.node.getAttribute("patternTransform");
35548                         } else {
35549                             tstr = el.node.getAttribute("transform");
35550                         }
35551                         if (!tstr) {
35552                             return new Snap.Matrix;
35553                         }
35554                         tstr = Snap._.svgTransform2string(tstr);
35555                     } else {
35556                         if (!Snap._.rgTransform.test(tstr)) {
35557                             tstr = Snap._.svgTransform2string(tstr);
35558                         } else {
35559                             tstr = Str(tstr).replace(/\.{3}|\u2026/g, el._.transform || E);
35560                         }
35561                         if (is(tstr, "array")) {
35562                             tstr = Snap.path ? Snap.path.toString.call(tstr) : Str(tstr);
35563                         }
35564                         el._.transform = tstr;
35565                     }
35566                     var m = Snap._.transform2matrix(tstr, el.getBBox(1));
35567                     if (doReturn) {
35568                         return m;
35569                     } else {
35570                         el.matrix = m;
35571                     }
35572                 }
35573                 /*
35574                  * \ Element.transform [ method ] * Gets or sets transformation of the
35575                  * element * - tstr (string) transform string in Snap or SVG format =
35576                  * (Element) the current element or = (object) transformation descriptor: o {
35577                  * o string (string) transform string, o globalMatrix (Matrix) matrix of all
35578                  * transformations applied to element or its parents, o localMatrix (Matrix)
35579                  * matrix of transformations applied only to the element, o diffMatrix
35580                  * (Matrix) matrix of difference between global and local transformations, o
35581                  * global (string) global transformation as string, o local (string) local
35582                  * transformation as string, o toString (function) returns `string` property
35583                  * o } \
35584                  */
35585                 elproto.transform = function(tstr) {
35586                     var _ = this._;
35587                     if (tstr == null) {
35588                         var papa = this,
35589                             global = new Snap.Matrix(this.node.getCTM()),
35590                             local = extractTransform(this),
35591                             ms = [local],
35592                             m = new Snap.Matrix,
35593                             i,
35594                             localString = local.toTransformString(),
35595                             string = Str(local) == Str(this.matrix) ?
35596                             Str(_.transform) : localString;
35597                         while (papa.type != "svg" && (papa = papa.parent())) {
35598                             ms.push(extractTransform(papa));
35599                         }
35600                         i = ms.length;
35601                         while (i--) {
35602                             m.add(ms[i]);
35603                         }
35604                         return {
35605                             string: string,
35606                             globalMatrix: global,
35607                             totalMatrix: m,
35608                             localMatrix: local,
35609                             diffMatrix: global.clone().add(local.invert()),
35610                             global: global.toTransformString(),
35611                             total: m.toTransformString(),
35612                             local: localString,
35613                             toString: propString
35614                         };
35615                     }
35616                     if (tstr instanceof Snap.Matrix) {
35617                         this.matrix = tstr;
35618                         this._.transform = tstr.toTransformString();
35619                     } else {
35620                         extractTransform(this, tstr);
35621                     }
35622
35623                     if (this.node) {
35624                         if (this.type == "linearGradient" || this.type == "radialGradient") {
35625                             $(this.node, {
35626                                 gradientTransform: this.matrix
35627                             });
35628                         } else if (this.type == "pattern") {
35629                             $(this.node, {
35630                                 patternTransform: this.matrix
35631                             });
35632                         } else {
35633                             $(this.node, {
35634                                 transform: this.matrix
35635                             });
35636                         }
35637                     }
35638
35639                     return this;
35640                 };
35641                 /*
35642                  * \ Element.parent [ method ] * Returns the element's parent * = (Element)
35643                  * the parent element \
35644                  */
35645                 elproto.parent = function() {
35646                     return wrap(this.node.parentNode);
35647                 };
35648                 /*
35649                  * \ Element.append [ method ] * Appends the given element to current one * -
35650                  * el (Element|Set) element to append = (Element) the parent element \
35651                  */
35652                 /*
35653                  * \ Element.add [ method ] * See @Element.append \
35654                  */
35655                 elproto.append = elproto.add = function(el) {
35656                     if (el) {
35657                         if (el.type == "set") {
35658                             var it = this;
35659                             el.forEach(function(el) {
35660                                 it.add(el);
35661                             });
35662                             return this;
35663                         }
35664                         el = wrap(el);
35665                         this.node.appendChild(el.node);
35666                         el.paper = this.paper;
35667                     }
35668                     return this;
35669                 };
35670                 /*
35671                  * \ Element.appendTo [ method ] * Appends the current element to the given
35672                  * one * - el (Element) parent element to append to = (Element) the child
35673                  * element \
35674                  */
35675                 elproto.appendTo = function(el) {
35676                     if (el) {
35677                         el = wrap(el);
35678                         el.append(this);
35679                     }
35680                     return this;
35681                 };
35682                 /*
35683                  * \ Element.prepend [ method ] * Prepends the given element to the current
35684                  * one * - el (Element) element to prepend = (Element) the parent element \
35685                  */
35686                 elproto.prepend = function(el) {
35687                     if (el) {
35688                         if (el.type == "set") {
35689                             var it = this,
35690                                 first;
35691                             el.forEach(function(el) {
35692                                 if (first) {
35693                                     first.after(el);
35694                                 } else {
35695                                     it.prepend(el);
35696                                 }
35697                                 first = el;
35698                             });
35699                             return this;
35700                         }
35701                         el = wrap(el);
35702                         var parent = el.parent();
35703                         this.node.insertBefore(el.node, this.node.firstChild);
35704                         this.add && this.add();
35705                         el.paper = this.paper;
35706                         this.parent() && this.parent().add();
35707                         parent && parent.add();
35708                     }
35709                     return this;
35710                 };
35711                 /*
35712                  * \ Element.prependTo [ method ] * Prepends the current element to the
35713                  * given one * - el (Element) parent element to prepend to = (Element) the
35714                  * child element \
35715                  */
35716                 elproto.prependTo = function(el) {
35717                     el = wrap(el);
35718                     el.prepend(this);
35719                     return this;
35720                 };
35721                 /*
35722                  * \ Element.before [ method ] * Inserts given element before the current
35723                  * one * - el (Element) element to insert = (Element) the parent element \
35724                  */
35725                 elproto.before = function(el) {
35726                     if (el.type == "set") {
35727                         var it = this;
35728                         el.forEach(function(el) {
35729                             var parent = el.parent();
35730                             it.node.parentNode.insertBefore(el.node, it.node);
35731                             parent && parent.add();
35732                         });
35733                         this.parent().add();
35734                         return this;
35735                     }
35736                     el = wrap(el);
35737                     var parent = el.parent();
35738                     this.node.parentNode.insertBefore(el.node, this.node);
35739                     this.parent() && this.parent().add();
35740                     parent && parent.add();
35741                     el.paper = this.paper;
35742                     return this;
35743                 };
35744                 /*
35745                  * \ Element.after [ method ] * Inserts given element after the current one * -
35746                  * el (Element) element to insert = (Element) the parent element \
35747                  */
35748                 elproto.after = function(el) {
35749                     el = wrap(el);
35750                     var parent = el.parent();
35751                     if (this.node.nextSibling) {
35752                         this.node.parentNode.insertBefore(el.node, this.node.nextSibling);
35753                     } else {
35754                         this.node.parentNode.appendChild(el.node);
35755                     }
35756                     this.parent() && this.parent().add();
35757                     parent && parent.add();
35758                     el.paper = this.paper;
35759                     return this;
35760                 };
35761                 /*
35762                  * \ Element.insertBefore [ method ] * Inserts the element after the given
35763                  * one * - el (Element) element next to whom insert to = (Element) the
35764                  * parent element \
35765                  */
35766                 elproto.insertBefore = function(el) {
35767                     el = wrap(el);
35768                     var parent = this.parent();
35769                     el.node.parentNode.insertBefore(this.node, el.node);
35770                     this.paper = el.paper;
35771                     parent && parent.add();
35772                     el.parent() && el.parent().add();
35773                     return this;
35774                 };
35775                 /*
35776                  * \ Element.insertAfter [ method ] * Inserts the element after the given
35777                  * one * - el (Element) element next to whom insert to = (Element) the
35778                  * parent element \
35779                  */
35780                 elproto.insertAfter = function(el) {
35781                     el = wrap(el);
35782                     var parent = this.parent();
35783                     el.node.parentNode.insertBefore(this.node, el.node.nextSibling);
35784                     this.paper = el.paper;
35785                     parent && parent.add();
35786                     el.parent() && el.parent().add();
35787                     return this;
35788                 };
35789                 /*
35790                  * \ Element.remove [ method ] * Removes element from the DOM = (Element)
35791                  * the detached element \
35792                  */
35793                 elproto.remove = function() {
35794                     var parent = this.parent();
35795                     this.node.parentNode && this.node.parentNode.removeChild(this.node);
35796                     delete this.paper;
35797                     this.removed = true;
35798                     parent && parent.add();
35799                     return this;
35800                 };
35801                 /*
35802                  * \ Element.select [ method ] * Gathers the nested @Element matching the
35803                  * given set of CSS selectors * - query (string) CSS selector = (Element)
35804                  * result of query selection \
35805                  */
35806                 elproto.select = function(query) {
35807                     query = Str(query).replace(/([^\\]):/g, "$1\\:");
35808                     return wrap(this.node.querySelector(query));
35809                 };
35810                 /*
35811                  * \ Element.selectAll [ method ] * Gathers nested @Element objects matching
35812                  * the given set of CSS selectors * - query (string) CSS selector =
35813                  * (Set|array) result of query selection \
35814                  */
35815                 elproto.selectAll = function(query) {
35816                     var nodelist = this.node.querySelectorAll(query),
35817                         set = (Snap.set || Array)();
35818                     for (var i = 0; i < nodelist.length; i++) {
35819                         set.push(wrap(nodelist[i]));
35820                     }
35821                     return set;
35822                 };
35823                 /*
35824                  * \ Element.asPX [ method ] * Returns given attribute of the element as a
35825                  * `px` value (not %, em, etc.) * - attr (string) attribute name - value
35826                  * (string) #optional attribute value = (Element) result of query selection \
35827                  */
35828                 elproto.asPX = function(attr, value) {
35829                     if (value == null) {
35830                         value = this.attr(attr);
35831                     }
35832                     return +unit2px(this, attr, value);
35833                 };
35834                 // SIERRA Element.use(): I suggest adding a note about how to access the
35835                 // original element the returned <use> instantiates. It's a part of SVG with
35836                 // which ordinary web developers may be least familiar.
35837                 /*
35838                  * \ Element.use [ method ] * Creates a `<use>` element linked to the
35839                  * current element * = (Element) the `<use>` element \
35840                  */
35841                 elproto.use = function() {
35842                     var use,
35843                         id = this.node.id;
35844                     if (!id) {
35845                         id = this.id;
35846                         $(this.node, {
35847                             id: id
35848                         });
35849                     }
35850                     if (this.type == "linearGradient" || this.type == "radialGradient" ||
35851                         this.type == "pattern") {
35852                         use = make(this.type, this.node.parentNode);
35853                     } else {
35854                         use = make("use", this.node.parentNode);
35855                     }
35856                     $(use.node, {
35857                         "xlink:href": "#" + id
35858                     });
35859                     use.original = this;
35860                     return use;
35861                 };
35862
35863                 function fixids(el) {
35864                     var els = el.selectAll("*"),
35865                         it,
35866                         url = /^\s*url\(("|'|)(.*)\1\)\s*$/,
35867                         ids = [],
35868                         uses = {};
35869
35870                     function urltest(it, name) {
35871                         var val = $(it.node, name);
35872                         val = val && val.match(url);
35873                         val = val && val[2];
35874                         if (val && val.charAt() == "#") {
35875                             val = val.substring(1);
35876                         } else {
35877                             return;
35878                         }
35879                         if (val) {
35880                             uses[val] = (uses[val] || []).concat(function(id) {
35881                                 var attr = {};
35882                                 attr[name] = URL(id);
35883                                 $(it.node, attr);
35884                             });
35885                         }
35886                     }
35887
35888                     function linktest(it) {
35889                         var val = $(it.node, "xlink:href");
35890                         if (val && val.charAt() == "#") {
35891                             val = val.substring(1);
35892                         } else {
35893                             return;
35894                         }
35895                         if (val) {
35896                             uses[val] = (uses[val] || []).concat(function(id) {
35897                                 it.attr("xlink:href", "#" + id);
35898                             });
35899                         }
35900                     }
35901                     for (var i = 0, ii = els.length; i < ii; i++) {
35902                         it = els[i];
35903                         urltest(it, "fill");
35904                         urltest(it, "stroke");
35905                         urltest(it, "filter");
35906                         urltest(it, "mask");
35907                         urltest(it, "clip-path");
35908                         linktest(it);
35909                         var oldid = $(it.node, "id");
35910                         if (oldid) {
35911                             $(it.node, {
35912                                 id: it.id
35913                             });
35914                             ids.push({
35915                                 old: oldid,
35916                                 id: it.id
35917                             });
35918                         }
35919                     }
35920                     for (i = 0, ii = ids.length; i < ii; i++) {
35921                         var fs = uses[ids[i].old];
35922                         if (fs) {
35923                             for (var j = 0, jj = fs.length; j < jj; j++) {
35924                                 fs[j](ids[i].id);
35925                             }
35926                         }
35927                     }
35928                 }
35929                 /*
35930                  * \ Element.clone [ method ] * Creates a clone of the element and inserts
35931                  * it after the element * = (Element) the clone \
35932                  */
35933                 elproto.clone = function() {
35934                     var clone = wrap(this.node.cloneNode(true));
35935                     if ($(clone.node, "id")) {
35936                         $(clone.node, {
35937                             id: clone.id
35938                         });
35939                     }
35940                     fixids(clone);
35941                     clone.insertAfter(this);
35942                     return clone;
35943                 };
35944                 /*
35945                  * \ Element.toDefs [ method ] * Moves element to the shared `<defs>` area * =
35946                  * (Element) the element \
35947                  */
35948                 elproto.toDefs = function() {
35949                     var defs = getSomeDefs(this);
35950                     defs.appendChild(this.node);
35951                     return this;
35952                 };
35953                 /*
35954                  * \ Element.toPattern [ method ] * Creates a `<pattern>` element from the
35955                  * current element * To create a pattern you have to specify the pattern
35956                  * rect: - x (string|number) - y (string|number) - width (string|number) -
35957                  * height (string|number) = (Element) the `<pattern>` element You can use
35958                  * pattern later on as an argument for `fill` attribute: | var p =
35959                  * paper.path("M10-5-10,15M15,0,0,15M0-5-20,15").attr({ | fill: "none", |
35960                  * stroke: "#bada55", | strokeWidth: 5 | }).pattern(0, 0, 10, 10), | c =
35961                  * paper.circle(200, 200, 100); | c.attr({ | fill: p | }); \
35962                  */
35963                 elproto.pattern = elproto.toPattern = function(x, y, width, height) {
35964                     var p = make("pattern", getSomeDefs(this));
35965                     if (x == null) {
35966                         x = this.getBBox();
35967                     }
35968                     if (is(x, "object") && "x" in x) {
35969                         y = x.y;
35970                         width = x.width;
35971                         height = x.height;
35972                         x = x.x;
35973                     }
35974                     $(p.node, {
35975                         x: x,
35976                         y: y,
35977                         width: width,
35978                         height: height,
35979                         patternUnits: "userSpaceOnUse",
35980                         id: p.id,
35981                         viewBox: [x, y, width, height].join(" ")
35982                     });
35983                     p.node.appendChild(this.node);
35984                     return p;
35985                 };
35986                 // SIERRA Element.marker(): clarify what a reference point is. E.g., helps you
35987                 // offset the object from its edge such as when centering it over a path.
35988                 // SIERRA Element.marker(): I suggest the method should accept default reference
35989                 // point values. Perhaps centered with (refX = width/2) and (refY = height/2)?
35990                 // Also, couldn't it assume the element's current _width_ and _height_? And
35991                 // please specify what _x_ and _y_ mean: offsets? If so, from where? Couldn't
35992                 // they also be assigned default values?
35993                 /*
35994                  * \ Element.marker [ method ] * Creates a `<marker>` element from the
35995                  * current element * To create a marker you have to specify the bounding
35996                  * rect and reference point: - x (number) - y (number) - width (number) -
35997                  * height (number) - refX (number) - refY (number) = (Element) the `<marker>`
35998                  * element You can specify the marker later as an argument for
35999                  * `marker-start`, `marker-end`, `marker-mid`, and `marker` attributes. The
36000                  * `marker` attribute places the marker at every point along the path, and
36001                  * `marker-mid` places them at every point except the start and end. \
36002                  */
36003                 // TODO add usage for markers
36004                 elproto.marker = function(x, y, width, height, refX, refY) {
36005                     var p = make("marker", getSomeDefs(this));
36006                     if (x == null) {
36007                         x = this.getBBox();
36008                     }
36009                     if (is(x, "object") && "x" in x) {
36010                         y = x.y;
36011                         width = x.width;
36012                         height = x.height;
36013                         refX = x.refX || x.cx;
36014                         refY = x.refY || x.cy;
36015                         x = x.x;
36016                     }
36017                     $(p.node, {
36018                         viewBox: [x, y, width, height].join(" "),
36019                         markerWidth: width,
36020                         markerHeight: height,
36021                         orient: "auto",
36022                         refX: refX || 0,
36023                         refY: refY || 0,
36024                         id: p.id
36025                     });
36026                     p.node.appendChild(this.node);
36027                     return p;
36028                 };
36029                 // animation
36030                 function slice(from, to, f) {
36031                     return function(arr) {
36032                         var res = arr.slice(from, to);
36033                         if (res.length == 1) {
36034                             res = res[0];
36035                         }
36036                         return f ? f(res) : res;
36037                     };
36038                 }
36039                 var Animation = function(attr, ms, easing, callback) {
36040                     if (typeof easing == "function" && !easing.length) {
36041                         callback = easing;
36042                         easing = mina.linear;
36043                     }
36044                     this.attr = attr;
36045                     this.dur = ms;
36046                     easing && (this.easing = easing);
36047                     callback && (this.callback = callback);
36048                 };
36049                 Snap._.Animation = Animation;
36050                 /*
36051                  * \ Snap.animation [ method ] * Creates an animation object * - attr
36052                  * (object) attributes of final destination - duration (number) duration of
36053                  * the animation, in milliseconds - easing (function) #optional one of
36054                  * easing functions of @mina or custom one - callback (function) #optional
36055                  * callback function that fires when animation ends = (object) animation
36056                  * object \
36057                  */
36058                 Snap.animation = function(attr, ms, easing, callback) {
36059                     return new Animation(attr, ms, easing, callback);
36060                 };
36061                 /*
36062                  * \ Element.inAnim [ method ] * Returns a set of animations that may be
36063                  * able to manipulate the current element * = (object) in format: o { o anim
36064                  * (object) animation object, o mina (object) @mina object, o curStatus
36065                  * (number) 0..1 ÃƒÆ’¢â‚¬â€� status of the animation: 0 ÃƒÆ’¢â‚¬â€� just started,
36066                  * 1 ÃƒÆ’¢â‚¬â€� just finished, o status (function) gets or sets the status of
36067                  * the animation, o stop (function) stops the animation o } \
36068                  */
36069                 elproto.inAnim = function() {
36070                     var el = this,
36071                         res = [];
36072                     for (var id in el.anims)
36073                         if (el.anims[has](id)) {
36074                             (function(a) {
36075                                 res.push({
36076                                     anim: new Animation(a._attrs, a.dur, a.easing, a._callback),
36077                                     mina: a,
36078                                     curStatus: a.status(),
36079                                     status: function(val) {
36080                                         return a.status(val);
36081                                     },
36082                                     stop: function() {
36083                                         a.stop();
36084                                     }
36085                                 });
36086                             }(el.anims[id]));
36087                         }
36088                     return res;
36089                 };
36090                 /*
36091                  * \ Snap.animate [ method ] * Runs generic animation of one number into
36092                  * another with a caring function * - from (number|array) number or array of
36093                  * numbers - to (number|array) number or array of numbers - setter
36094                  * (function) caring function that accepts one number argument - duration
36095                  * (number) duration, in milliseconds - easing (function) #optional easing
36096                  * function from @mina or custom - callback (function) #optional callback
36097                  * function to execute when animation ends = (object) animation object in
36098                  * @mina format o { o id (string) animation id, consider it read-only, o
36099                  * duration (function) gets or sets the duration of the animation, o easing
36100                  * (function) easing, o speed (function) gets or sets the speed of the
36101                  * animation, o status (function) gets or sets the status of the animation,
36102                  * o stop (function) stops the animation o } | var rect = Snap().rect(0, 0,
36103                  * 10, 10); | Snap.animate(0, 10, function (val) { | rect.attr({ | x: val |
36104                  * }); | }, 1000); | // in given context is equivalent to | rect.animate({x:
36105                  * 10}, 1000); \
36106                  */
36107                 Snap.animate = function(from, to, setter, ms, easing, callback) {
36108                     if (typeof easing == "function" && !easing.length) {
36109                         callback = easing;
36110                         easing = mina.linear;
36111                     }
36112                     var now = mina.time(),
36113                         anim = mina(from, to, now, now + ms, mina.time, setter, easing);
36114                     callback && eve.once("mina.finish." + anim.id, callback);
36115                     return anim;
36116                 };
36117                 /*
36118                  * \ Element.stop [ method ] * Stops all the animations for the current
36119                  * element * = (Element) the current element \
36120                  */
36121                 elproto.stop = function() {
36122                     var anims = this.inAnim();
36123                     for (var i = 0, ii = anims.length; i < ii; i++) {
36124                         anims[i].stop();
36125                     }
36126                     return this;
36127                 };
36128                 /*
36129                  * \ Element.animate [ method ] * Animates the given attributes of the
36130                  * element * - attrs (object) key-value pairs of destination attributes -
36131                  * duration (number) duration of the animation in milliseconds - easing
36132                  * (function) #optional easing function from @mina or custom - callback
36133                  * (function) #optional callback function that executes when the animation
36134                  * ends = (Element) the current element \
36135                  */
36136                 elproto.animate = function(attrs, ms, easing, callback) {
36137                     if (typeof easing == "function" && !easing.length) {
36138                         callback = easing;
36139                         easing = mina.linear;
36140                     }
36141                     if (attrs instanceof Animation) {
36142                         callback = attrs.callback;
36143                         easing = attrs.easing;
36144                         ms = easing.dur;
36145                         attrs = attrs.attr;
36146                     }
36147                     var fkeys = [],
36148                         tkeys = [],
36149                         keys = {},
36150                         from, to, f, eq,
36151                         el = this;
36152                     for (var key in attrs)
36153                         if (attrs[has](key)) {
36154                             if (el.equal) {
36155                                 eq = el.equal(key, Str(attrs[key]));
36156                                 from = eq.from;
36157                                 to = eq.to;
36158                                 f = eq.f;
36159                             } else {
36160                                 from = +el.attr(key);
36161                                 to = +attrs[key];
36162                             }
36163                             var len = is(from, "array") ? from.length : 1;
36164                             keys[key] = slice(fkeys.length, fkeys.length + len, f);
36165                             fkeys = fkeys.concat(from);
36166                             tkeys = tkeys.concat(to);
36167                         }
36168                     var now = mina.time(),
36169                         anim = mina(fkeys, tkeys, now, now + ms, mina.time, function(val) {
36170                             var attr = {};
36171                             for (var key in keys)
36172                                 if (keys[has](key)) {
36173                                     attr[key] = keys[key](val);
36174                                 }
36175                             el.attr(attr);
36176                         }, easing);
36177                     el.anims[anim.id] = anim;
36178                     anim._attrs = attrs;
36179                     anim._callback = callback;
36180                     eve("snap.animcreated." + el.id, anim);
36181                     eve.once("mina.finish." + anim.id, function() {
36182                         delete el.anims[anim.id];
36183                         callback && callback.call(el);
36184                     });
36185                     eve.once("mina.stop." + anim.id, function() {
36186                         delete el.anims[anim.id];
36187                     });
36188                     return el;
36189                 };
36190                 var eldata = {};
36191                 /*
36192                  * \ Element.data [ method ] * Adds or retrieves given value associated with
36193                  * given key. (Don’t confuse with `data-` attributes)
36194                  * 
36195                  * See also @Element.removeData - key (string) key to store data - value
36196                  * (any) #optional value to store = (object) @Element or, if value is not
36197                  * specified: = (any) value > Usage | for (var i = 0, i < 5, i++) { |
36198                  * paper.circle(10 + 15 * i, 10, 10) | .attr({fill: "#000"}) | .data("i", i) |
36199                  * .click(function () { | alert(this.data("i")); | }); | } \
36200                  */
36201                 elproto.data = function(key, value) {
36202                     var data = eldata[this.id] = eldata[this.id] || {};
36203                     if (arguments.length == 0) {
36204                         eve("snap.data.get." + this.id, this, data, null);
36205                         return data;
36206                     }
36207                     if (arguments.length == 1) {
36208                         if (Snap.is(key, "object")) {
36209                             for (var i in key)
36210                                 if (key[has](i)) {
36211                                     this.data(i, key[i]);
36212                                 }
36213                             return this;
36214                         }
36215                         eve("snap.data.get." + this.id, this, data[key], key);
36216                         return data[key];
36217                     }
36218                     data[key] = value;
36219                     eve("snap.data.set." + this.id, this, value, key);
36220                     return this;
36221                 };
36222                 /*
36223                  * \ Element.removeData [ method ] * Removes value associated with an
36224                  * element by given key. If key is not provided, removes all the data of the
36225                  * element. - key (string) #optional key = (object) @Element \
36226                  */
36227                 elproto.removeData = function(key) {
36228                     if (key == null) {
36229                         eldata[this.id] = {};
36230                     } else {
36231                         eldata[this.id] && delete eldata[this.id][key];
36232                     }
36233                     return this;
36234                 };
36235                 /*
36236                  * \ Element.outerSVG [ method ] * Returns SVG code for the element,
36237                  * equivalent to HTML's `outerHTML`.
36238                  * 
36239                  * See also @Element.innerSVG = (string) SVG code for the element \
36240                  */
36241                 /*
36242                  * \ Element.toString [ method ] * See @Element.outerSVG \
36243                  */
36244                 elproto.outerSVG = elproto.toString = toString(1);
36245                 /*
36246                  * \ Element.innerSVG [ method ] * Returns SVG code for the element's
36247                  * contents, equivalent to HTML's `innerHTML` = (string) SVG code for the
36248                  * element \
36249                  */
36250                 elproto.innerSVG = toString();
36251
36252                 function toString(type) {
36253                     return function() {
36254                         var res = type ? "<" + this.type : "",
36255                             attr = this.node.attributes,
36256                             chld = this.node.childNodes;
36257                         if (type) {
36258                             for (var i = 0, ii = attr.length; i < ii; i++) {
36259                                 res += " " + attr[i].name + '="' +
36260                                     attr[i].value.replace(/"/g, '\\"') + '"';
36261                             }
36262                         }
36263                         if (chld.length) {
36264                             type && (res += ">");
36265                             for (i = 0, ii = chld.length; i < ii; i++) {
36266                                 if (chld[i].nodeType == 3) {
36267                                     res += chld[i].nodeValue;
36268                                 } else if (chld[i].nodeType == 1) {
36269                                     res += wrap(chld[i]).toString();
36270                                 }
36271                             }
36272                             type && (res += "</" + this.type + ">");
36273                         } else {
36274                             type && (res += "/>");
36275                         }
36276                         return res;
36277                     };
36278                 }
36279                 elproto.toDataURL = function() {
36280                     if (window && window.btoa) {
36281                         var bb = this.getBBox(),
36282                             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>', {
36283                                 x: +bb.x.toFixed(3),
36284                                 y: +bb.y.toFixed(3),
36285                                 width: +bb.width.toFixed(3),
36286                                 height: +bb.height.toFixed(3),
36287                                 contents: this.outerSVG()
36288                             });
36289                         return "data:image/svg+xml;base64," + btoa(unescape(encodeURIComponent(svg)));
36290                     }
36291                 };
36292                 /*
36293                  * \ Fragment.select [ method ] * See @Element.select \
36294                  */
36295                 Fragment.prototype.select = elproto.select;
36296                 /*
36297                  * \ Fragment.selectAll [ method ] * See @Element.selectAll \
36298                  */
36299                 Fragment.prototype.selectAll = elproto.selectAll;
36300             });
36301
36302             // Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.
36303             // 
36304             // Licensed under the Apache License, Version 2.0 (the "License");
36305             // you may not use this file except in compliance with the License.
36306             // You may obtain a copy of the License at
36307             // 
36308             // http://www.apache.org/licenses/LICENSE-2.0
36309             // 
36310             // Unless required by applicable law or agreed to in writing, software
36311             // distributed under the License is distributed on an "AS IS" BASIS,
36312             // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
36313             // See the License for the specific language governing permissions and
36314             // limitations under the License.
36315             Snap.plugin(function(Snap, Element, Paper, glob, Fragment) {
36316                 var objectToString = Object.prototype.toString,
36317                     Str = String,
36318                     math = Math,
36319                     E = "";
36320
36321                 function Matrix(a, b, c, d, e, f) {
36322                     if (b == null && objectToString.call(a) == "[object SVGMatrix]") {
36323                         this.a = a.a;
36324                         this.b = a.b;
36325                         this.c = a.c;
36326                         this.d = a.d;
36327                         this.e = a.e;
36328                         this.f = a.f;
36329                         return;
36330                     }
36331                     if (a != null) {
36332                         this.a = +a;
36333                         this.b = +b;
36334                         this.c = +c;
36335                         this.d = +d;
36336                         this.e = +e;
36337                         this.f = +f;
36338                     } else {
36339                         this.a = 1;
36340                         this.b = 0;
36341                         this.c = 0;
36342                         this.d = 1;
36343                         this.e = 0;
36344                         this.f = 0;
36345                     }
36346                 }
36347                 (function(matrixproto) {
36348                     /*
36349                      * \ Matrix.add [ method ] * Adds the given matrix to existing one - a
36350                      * (number) - b (number) - c (number) - d (number) - e (number) - f
36351                      * (number) or - matrix (object) @Matrix \
36352                      */
36353                     matrixproto.add = function(a, b, c, d, e, f) {
36354                         var out = [
36355                                 [],
36356                                 [],
36357                                 []
36358                             ],
36359                             m = [
36360                                 [this.a, this.c, this.e],
36361                                 [this.b, this.d, this.f],
36362                                 [0, 0, 1]
36363                             ],
36364                             matrix = [
36365                                 [a, c, e],
36366                                 [b, d, f],
36367                                 [0, 0, 1]
36368                             ],
36369                             x, y, z, res;
36370
36371                         if (a && a instanceof Matrix) {
36372                             matrix = [
36373                                 [a.a, a.c, a.e],
36374                                 [a.b, a.d, a.f],
36375                                 [0, 0, 1]
36376                             ];
36377                         }
36378
36379                         for (x = 0; x < 3; x++) {
36380                             for (y = 0; y < 3; y++) {
36381                                 res = 0;
36382                                 for (z = 0; z < 3; z++) {
36383                                     res += m[x][z] * matrix[z][y];
36384                                 }
36385                                 out[x][y] = res;
36386                             }
36387                         }
36388                         this.a = out[0][0];
36389                         this.b = out[1][0];
36390                         this.c = out[0][1];
36391                         this.d = out[1][1];
36392                         this.e = out[0][2];
36393                         this.f = out[1][2];
36394                         return this;
36395                     };
36396                     /*
36397                      * \ Matrix.invert [ method ] * Returns an inverted version of the
36398                      * matrix = (object) @Matrix \
36399                      */
36400                     matrixproto.invert = function() {
36401                         var me = this,
36402                             x = me.a * me.d - me.b * me.c;
36403                         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);
36404                     };
36405                     /*
36406                      * \ Matrix.clone [ method ] * Returns a copy of the matrix = (object)
36407                      * @Matrix \
36408                      */
36409                     matrixproto.clone = function() {
36410                         return new Matrix(this.a, this.b, this.c, this.d, this.e, this.f);
36411                     };
36412                     /*
36413                      * \ Matrix.translate [ method ] * Translate the matrix - x (number)
36414                      * horizontal offset distance - y (number) vertical offset distance \
36415                      */
36416                     matrixproto.translate = function(x, y) {
36417                         return this.add(1, 0, 0, 1, x, y);
36418                     };
36419                     /*
36420                      * \ Matrix.scale [ method ] * Scales the matrix - x (number) amount to
36421                      * be scaled, with `1` resulting in no change - y (number) #optional
36422                      * amount to scale along the vertical axis. (Otherwise `x` applies to
36423                      * both axes.) - cx (number) #optional horizontal origin point from
36424                      * which to scale - cy (number) #optional vertical origin point from
36425                      * which to scale Default cx, cy is the middle point of the element. \
36426                      */
36427                     matrixproto.scale = function(x, y, cx, cy) {
36428                         y == null && (y = x);
36429                         (cx || cy) && this.add(1, 0, 0, 1, cx, cy);
36430                         this.add(x, 0, 0, y, 0, 0);
36431                         (cx || cy) && this.add(1, 0, 0, 1, -cx, -cy);
36432                         return this;
36433                     };
36434                     /*
36435                      * \ Matrix.rotate [ method ] * Rotates the matrix - a (number) angle of
36436                      * rotation, in degrees - x (number) horizontal origin point from which
36437                      * to rotate - y (number) vertical origin point from which to rotate \
36438                      */
36439                     matrixproto.rotate = function(a, x, y) {
36440                         a = Snap.rad(a);
36441                         x = x || 0;
36442                         y = y || 0;
36443                         var cos = +math.cos(a).toFixed(9),
36444                             sin = +math.sin(a).toFixed(9);
36445                         this.add(cos, sin, -sin, cos, x, y);
36446                         return this.add(1, 0, 0, 1, -x, -y);
36447                     };
36448                     /*
36449                      * \ Matrix.x [ method ] * Returns x coordinate for given point after
36450                      * transformation described by the matrix. See also @Matrix.y - x
36451                      * (number) - y (number) = (number) x \
36452                      */
36453                     matrixproto.x = function(x, y) {
36454                         return x * this.a + y * this.c + this.e;
36455                     };
36456                     /*
36457                      * \ Matrix.y [ method ] * Returns y coordinate for given point after
36458                      * transformation described by the matrix. See also @Matrix.x - x
36459                      * (number) - y (number) = (number) y \
36460                      */
36461                     matrixproto.y = function(x, y) {
36462                         return x * this.b + y * this.d + this.f;
36463                     };
36464                     matrixproto.get = function(i) {
36465                         return +this[Str.fromCharCode(97 + i)].toFixed(4);
36466                     };
36467                     matrixproto.toString = function() {
36468                         return "matrix(" + [this.get(0), this.get(1), this.get(2), this.get(3), this.get(4), this.get(5)].join() + ")";
36469                     };
36470                     matrixproto.offset = function() {
36471                         return [this.e.toFixed(4), this.f.toFixed(4)];
36472                     };
36473
36474                     function norm(a) {
36475                         return a[0] * a[0] + a[1] * a[1];
36476                     }
36477
36478                     function normalize(a) {
36479                         var mag = math.sqrt(norm(a));
36480                         a[0] && (a[0] /= mag);
36481                         a[1] && (a[1] /= mag);
36482                     }
36483                     /*
36484                      * \ Matrix.determinant [ method ] * Finds determinant of the given
36485                      * matrix. = (number) determinant \
36486                      */
36487                     matrixproto.determinant = function() {
36488                         return this.a * this.d - this.b * this.c;
36489                     };
36490                     /*
36491                      * \ Matrix.split [ method ] * Splits matrix into primitive
36492                      * transformations = (object) in format: o dx (number) translation by x
36493                      * o dy (number) translation by y o scalex (number) scale by x o scaley
36494                      * (number) scale by y o shear (number) shear o rotate (number) rotation
36495                      * in deg o isSimple (boolean) could it be represented via simple
36496                      * transformations \
36497                      */
36498                     matrixproto.split = function() {
36499                         var out = {};
36500                         // translation
36501                         out.dx = this.e;
36502                         out.dy = this.f;
36503
36504                         // scale and shear
36505                         var row = [
36506                             [this.a, this.c],
36507                             [this.b, this.d]
36508                         ];
36509                         out.scalex = math.sqrt(norm(row[0]));
36510                         normalize(row[0]);
36511
36512                         out.shear = row[0][0] * row[1][0] + row[0][1] * row[1][1];
36513                         row[1] = [row[1][0] - row[0][0] * out.shear, row[1][1] - row[0][1] * out.shear];
36514
36515                         out.scaley = math.sqrt(norm(row[1]));
36516                         normalize(row[1]);
36517                         out.shear /= out.scaley;
36518
36519                         if (this.determinant() < 0) {
36520                             out.scalex = -out.scalex;
36521                         }
36522
36523                         // rotation
36524                         var sin = -row[0][1],
36525                             cos = row[1][1];
36526                         if (cos < 0) {
36527                             out.rotate = Snap.deg(math.acos(cos));
36528                             if (sin < 0) {
36529                                 out.rotate = 360 - out.rotate;
36530                             }
36531                         } else {
36532                             out.rotate = Snap.deg(math.asin(sin));
36533                         }
36534
36535                         out.isSimple = !+out.shear.toFixed(9) && (out.scalex.toFixed(9) == out.scaley.toFixed(9) || !out.rotate);
36536                         out.isSuperSimple = !+out.shear.toFixed(9) && out.scalex.toFixed(9) == out.scaley.toFixed(9) && !out.rotate;
36537                         out.noRotation = !+out.shear.toFixed(9) && !out.rotate;
36538                         return out;
36539                     };
36540                     /*
36541                      * \ Matrix.toTransformString [ method ] * Returns transform string that
36542                      * represents given matrix = (string) transform string \
36543                      */
36544                     matrixproto.toTransformString = function(shorter) {
36545                         var s = shorter || this.split();
36546                         if (!+s.shear.toFixed(9)) {
36547                             s.scalex = +s.scalex.toFixed(4);
36548                             s.scaley = +s.scaley.toFixed(4);
36549                             s.rotate = +s.rotate.toFixed(4);
36550                             return (s.dx || s.dy ? "t" + [+s.dx.toFixed(4), +s.dy.toFixed(4)] : E) +
36551                                 (s.scalex != 1 || s.scaley != 1 ? "s" + [s.scalex, s.scaley, 0, 0] : E) +
36552                                 (s.rotate ? "r" + [+s.rotate.toFixed(4), 0, 0] : E);
36553                         } else {
36554                             return "m" + [this.get(0), this.get(1), this.get(2), this.get(3), this.get(4), this.get(5)];
36555                         }
36556                     };
36557                 })(Matrix.prototype);
36558                 /*
36559                  * \ Snap.Matrix [ method ] * Matrix constructor, extend on your own risk.
36560                  * To create matrices use @Snap.matrix. \
36561                  */
36562                 Snap.Matrix = Matrix;
36563                 /*
36564                  * \ Snap.matrix [ method ] * Utility method * Returns a matrix based on the
36565                  * given parameters - a (number) - b (number) - c (number) - d (number) - e
36566                  * (number) - f (number) or - svgMatrix (SVGMatrix) = (object) @Matrix \
36567                  */
36568                 Snap.matrix = function(a, b, c, d, e, f) {
36569                     return new Matrix(a, b, c, d, e, f);
36570                 };
36571             });
36572             // Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.
36573             // 
36574             // Licensed under the Apache License, Version 2.0 (the "License");
36575             // you may not use this file except in compliance with the License.
36576             // You may obtain a copy of the License at
36577             // 
36578             // http://www.apache.org/licenses/LICENSE-2.0
36579             // 
36580             // Unless required by applicable law or agreed to in writing, software
36581             // distributed under the License is distributed on an "AS IS" BASIS,
36582             // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
36583             // See the License for the specific language governing permissions and
36584             // limitations under the License.
36585             Snap.plugin(function(Snap, Element, Paper, glob, Fragment) {
36586                 var has = "hasOwnProperty",
36587                     make = Snap._.make,
36588                     wrap = Snap._.wrap,
36589                     is = Snap.is,
36590                     getSomeDefs = Snap._.getSomeDefs,
36591                     reURLValue = /^url\(#?([^)]+)\)$/,
36592                     $ = Snap._.$,
36593                     URL = Snap.url,
36594                     Str = String,
36595                     separator = Snap._.separator,
36596                     E = "";
36597                 // Attributes event handlers
36598                 eve.on("snap.util.attr.mask", function(value) {
36599                     if (value instanceof Element || value instanceof Fragment) {
36600                         eve.stop();
36601                         if (value instanceof Fragment && value.node.childNodes.length == 1) {
36602                             value = value.node.firstChild;
36603                             getSomeDefs(this).appendChild(value);
36604                             value = wrap(value);
36605                         }
36606                         if (value.type == "mask") {
36607                             var mask = value;
36608                         } else {
36609                             mask = make("mask", getSomeDefs(this));
36610                             mask.node.appendChild(value.node);
36611                         }!mask.node.id && $(mask.node, {
36612                             id: mask.id
36613                         });
36614                         $(this.node, {
36615                             mask: URL(mask.id)
36616                         });
36617                     }
36618                 });
36619                 (function(clipIt) {
36620                     eve.on("snap.util.attr.clip", clipIt);
36621                     eve.on("snap.util.attr.clip-path", clipIt);
36622                     eve.on("snap.util.attr.clipPath", clipIt);
36623                 }(function(value) {
36624                     if (value instanceof Element || value instanceof Fragment) {
36625                         eve.stop();
36626                         if (value.type == "clipPath") {
36627                             var clip = value;
36628                         } else {
36629                             clip = make("clipPath", getSomeDefs(this));
36630                             clip.node.appendChild(value.node);
36631                             !clip.node.id && $(clip.node, {
36632                                 id: clip.id
36633                             });
36634                         }
36635                         $(this.node, {
36636                             "clip-path": URL(clip.node.id || clip.id)
36637                         });
36638                     }
36639                 }));
36640
36641                 function fillStroke(name) {
36642                     return function(value) {
36643                         eve.stop();
36644                         if (value instanceof Fragment && value.node.childNodes.length == 1 &&
36645                             (value.node.firstChild.tagName == "radialGradient" ||
36646                                 value.node.firstChild.tagName == "linearGradient" ||
36647                                 value.node.firstChild.tagName == "pattern")) {
36648                             value = value.node.firstChild;
36649                             getSomeDefs(this).appendChild(value);
36650                             value = wrap(value);
36651                         }
36652                         if (value instanceof Element) {
36653                             if (value.type == "radialGradient" || value.type == "linearGradient" || value.type == "pattern") {
36654                                 if (!value.node.id) {
36655                                     $(value.node, {
36656                                         id: value.id
36657                                     });
36658                                 }
36659                                 var fill = URL(value.node.id);
36660                             } else {
36661                                 fill = value.attr(name);
36662                             }
36663                         } else {
36664                             fill = Snap.color(value);
36665                             if (fill.error) {
36666                                 var grad = Snap(getSomeDefs(this).ownerSVGElement).gradient(value);
36667                                 if (grad) {
36668                                     if (!grad.node.id) {
36669                                         $(grad.node, {
36670                                             id: grad.id
36671                                         });
36672                                     }
36673                                     fill = URL(grad.node.id);
36674                                 } else {
36675                                     fill = value;
36676                                 }
36677                             } else {
36678                                 fill = Str(fill);
36679                             }
36680                         }
36681                         var attrs = {};
36682                         attrs[name] = fill;
36683                         $(this.node, attrs);
36684                         this.node.style[name] = E;
36685                     };
36686                 }
36687                 eve.on("snap.util.attr.fill", fillStroke("fill"));
36688                 eve.on("snap.util.attr.stroke", fillStroke("stroke"));
36689                 var gradrg = /^([lr])(?:\(([^)]*)\))?(.*)$/i;
36690                 eve.on("snap.util.grad.parse", function parseGrad(string) {
36691                     string = Str(string);
36692                     var tokens = string.match(gradrg);
36693                     if (!tokens) {
36694                         return null;
36695                     }
36696                     var type = tokens[1],
36697                         params = tokens[2],
36698                         stops = tokens[3];
36699                     params = params.split(/\s*,\s*/).map(function(el) {
36700                         return +el == el ? +el : el;
36701                     });
36702                     if (params.length == 1 && params[0] == 0) {
36703                         params = [];
36704                     }
36705                     stops = stops.split("-");
36706                     stops = stops.map(function(el) {
36707                         el = el.split(":");
36708                         var out = {
36709                             color: el[0]
36710                         };
36711                         if (el[1]) {
36712                             out.offset = parseFloat(el[1]);
36713                         }
36714                         return out;
36715                     });
36716                     return {
36717                         type: type,
36718                         params: params,
36719                         stops: stops
36720                     };
36721                 });
36722
36723                 eve.on("snap.util.attr.d", function(value) {
36724                     eve.stop();
36725                     if (is(value, "array") && is(value[0], "array")) {
36726                         value = Snap.path.toString.call(value);
36727                     }
36728                     value = Str(value);
36729                     if (value.match(/[ruo]/i)) {
36730                         value = Snap.path.toAbsolute(value);
36731                     }
36732                     $(this.node, {
36733                         d: value
36734                     });
36735                 })(-1);
36736                 eve.on("snap.util.attr.#text", function(value) {
36737                     eve.stop();
36738                     value = Str(value);
36739                     var txt = glob.doc.createTextNode(value);
36740                     while (this.node.firstChild) {
36741                         this.node.removeChild(this.node.firstChild);
36742                     }
36743                     this.node.appendChild(txt);
36744                 })(-1);
36745                 eve.on("snap.util.attr.path", function(value) {
36746                     eve.stop();
36747                     this.attr({
36748                         d: value
36749                     });
36750                 })(-1);
36751                 eve.on("snap.util.attr.class", function(value) {
36752                     eve.stop();
36753                     this.node.className.baseVal = value;
36754                 })(-1);
36755                 eve.on("snap.util.attr.viewBox", function(value) {
36756                     var vb;
36757                     if (is(value, "object") && "x" in value) {
36758                         vb = [value.x, value.y, value.width, value.height].join(" ");
36759                     } else if (is(value, "array")) {
36760                         vb = value.join(" ");
36761                     } else {
36762                         vb = value;
36763                     }
36764                     $(this.node, {
36765                         viewBox: vb
36766                     });
36767                     eve.stop();
36768                 })(-1);
36769                 eve.on("snap.util.attr.transform", function(value) {
36770                     this.transform(value);
36771                     eve.stop();
36772                 })(-1);
36773                 eve.on("snap.util.attr.r", function(value) {
36774                     if (this.type == "rect") {
36775                         eve.stop();
36776                         $(this.node, {
36777                             rx: value,
36778                             ry: value
36779                         });
36780                     }
36781                 })(-1);
36782                 eve.on("snap.util.attr.textpath", function(value) {
36783                     eve.stop();
36784                     if (this.type == "text") {
36785                         var id, tp, node;
36786                         if (!value && this.textPath) {
36787                             tp = this.textPath;
36788                             while (tp.node.firstChild) {
36789                                 this.node.appendChild(tp.node.firstChild);
36790                             }
36791                             tp.remove();
36792                             delete this.textPath;
36793                             return;
36794                         }
36795                         if (is(value, "string")) {
36796                             var defs = getSomeDefs(this),
36797                                 path = wrap(defs.parentNode).path(value);
36798                             defs.appendChild(path.node);
36799                             id = path.id;
36800                             path.attr({
36801                                 id: id
36802                             });
36803                         } else {
36804                             value = wrap(value);
36805                             if (value instanceof Element) {
36806                                 id = value.attr("id");
36807                                 if (!id) {
36808                                     id = value.id;
36809                                     value.attr({
36810                                         id: id
36811                                     });
36812                                 }
36813                             }
36814                         }
36815                         if (id) {
36816                             tp = this.textPath;
36817                             node = this.node;
36818                             if (tp) {
36819                                 tp.attr({
36820                                     "xlink:href": "#" + id
36821                                 });
36822                             } else {
36823                                 tp = $("textPath", {
36824                                     "xlink:href": "#" + id
36825                                 });
36826                                 while (node.firstChild) {
36827                                     tp.appendChild(node.firstChild);
36828                                 }
36829                                 node.appendChild(tp);
36830                                 this.textPath = wrap(tp);
36831                             }
36832                         }
36833                     }
36834                 })(-1);
36835                 eve.on("snap.util.attr.text", function(value) {
36836                     if (this.type == "text") {
36837                         var i = 0,
36838                             node = this.node,
36839                             tuner = function(chunk) {
36840                                 var out = $("tspan");
36841                                 if (is(chunk, "array")) {
36842                                     for (var i = 0; i < chunk.length; i++) {
36843                                         out.appendChild(tuner(chunk[i]));
36844                                     }
36845                                 } else {
36846                                     out.appendChild(glob.doc.createTextNode(chunk));
36847                                 }
36848                                 out.normalize && out.normalize();
36849                                 return out;
36850                             };
36851                         while (node.firstChild) {
36852                             node.removeChild(node.firstChild);
36853                         }
36854                         var tuned = tuner(value);
36855                         while (tuned.firstChild) {
36856                             node.appendChild(tuned.firstChild);
36857                         }
36858                     }
36859                     eve.stop();
36860                 })(-1);
36861
36862                 function setFontSize(value) {
36863                     eve.stop();
36864                     if (value == +value) {
36865                         value += "px";
36866                     }
36867                     this.node.style.fontSize = value;
36868                 }
36869                 eve.on("snap.util.attr.fontSize", setFontSize)(-1);
36870                 eve.on("snap.util.attr.font-size", setFontSize)(-1);
36871
36872
36873                 eve.on("snap.util.getattr.transform", function() {
36874                     eve.stop();
36875                     return this.transform();
36876                 })(-1);
36877                 eve.on("snap.util.getattr.textpath", function() {
36878                     eve.stop();
36879                     return this.textPath;
36880                 })(-1);
36881                 // Markers
36882                 (function() {
36883                     function getter(end) {
36884                         return function() {
36885                             eve.stop();
36886                             var style = glob.doc.defaultView.getComputedStyle(this.node, null).getPropertyValue("marker-" + end);
36887                             if (style == "none") {
36888                                 return style;
36889                             } else {
36890                                 return Snap(glob.doc.getElementById(style.match(reURLValue)[1]));
36891                             }
36892                         };
36893                     }
36894
36895                     function setter(end) {
36896                         return function(value) {
36897                             eve.stop();
36898                             var name = "marker" + end.charAt(0).toUpperCase() + end.substring(1);
36899                             if (value == "" || !value) {
36900                                 this.node.style[name] = "none";
36901                                 return;
36902                             }
36903                             if (value.type == "marker") {
36904                                 var id = value.node.id;
36905                                 if (!id) {
36906                                     $(value.node, {
36907                                         id: value.id
36908                                     });
36909                                 }
36910                                 this.node.style[name] = URL(id);
36911                                 return;
36912                             }
36913                         };
36914                     }
36915                     eve.on("snap.util.getattr.marker-end", getter("end"))(-1);
36916                     eve.on("snap.util.getattr.markerEnd", getter("end"))(-1);
36917                     eve.on("snap.util.getattr.marker-start", getter("start"))(-1);
36918                     eve.on("snap.util.getattr.markerStart", getter("start"))(-1);
36919                     eve.on("snap.util.getattr.marker-mid", getter("mid"))(-1);
36920                     eve.on("snap.util.getattr.markerMid", getter("mid"))(-1);
36921                     eve.on("snap.util.attr.marker-end", setter("end"))(-1);
36922                     eve.on("snap.util.attr.markerEnd", setter("end"))(-1);
36923                     eve.on("snap.util.attr.marker-start", setter("start"))(-1);
36924                     eve.on("snap.util.attr.markerStart", setter("start"))(-1);
36925                     eve.on("snap.util.attr.marker-mid", setter("mid"))(-1);
36926                     eve.on("snap.util.attr.markerMid", setter("mid"))(-1);
36927                 }());
36928                 eve.on("snap.util.getattr.r", function() {
36929                     if (this.type == "rect" && $(this.node, "rx") == $(this.node, "ry")) {
36930                         eve.stop();
36931                         return $(this.node, "rx");
36932                     }
36933                 })(-1);
36934
36935                 function textExtract(node) {
36936                     var out = [];
36937                     var children = node.childNodes;
36938                     for (var i = 0, ii = children.length; i < ii; i++) {
36939                         var chi = children[i];
36940                         if (chi.nodeType == 3) {
36941                             out.push(chi.nodeValue);
36942                         }
36943                         if (chi.tagName == "tspan") {
36944                             if (chi.childNodes.length == 1 && chi.firstChild.nodeType == 3) {
36945                                 out.push(chi.firstChild.nodeValue);
36946                             } else {
36947                                 out.push(textExtract(chi));
36948                             }
36949                         }
36950                     }
36951                     return out;
36952                 }
36953                 eve.on("snap.util.getattr.text", function() {
36954                     if (this.type == "text" || this.type == "tspan") {
36955                         eve.stop();
36956                         var out = textExtract(this.node);
36957                         return out.length == 1 ? out[0] : out;
36958                     }
36959                 })(-1);
36960                 eve.on("snap.util.getattr.#text", function() {
36961                     return this.node.textContent;
36962                 })(-1);
36963                 eve.on("snap.util.getattr.viewBox", function() {
36964                     eve.stop();
36965                     var vb = $(this.node, "viewBox");
36966                     if (vb) {
36967                         vb = vb.split(separator);
36968                         return Snap._.box(+vb[0], +vb[1], +vb[2], +vb[3]);
36969                     } else {
36970                         return;
36971                     }
36972                 })(-1);
36973                 eve.on("snap.util.getattr.points", function() {
36974                     var p = $(this.node, "points");
36975                     eve.stop();
36976                     if (p) {
36977                         return p.split(separator);
36978                     } else {
36979                         return;
36980                     }
36981                 })(-1);
36982                 eve.on("snap.util.getattr.path", function() {
36983                     var p = $(this.node, "d");
36984                     eve.stop();
36985                     return p;
36986                 })(-1);
36987                 eve.on("snap.util.getattr.class", function() {
36988                     return this.node.className.baseVal;
36989                 })(-1);
36990
36991                 function getFontSize() {
36992                     eve.stop();
36993                     return this.node.style.fontSize;
36994                 }
36995                 eve.on("snap.util.getattr.fontSize", getFontSize)(-1);
36996                 eve.on("snap.util.getattr.font-size", getFontSize)(-1);
36997             });
36998
36999             // Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.
37000             // 
37001             // Licensed under the Apache License, Version 2.0 (the "License");
37002             // you may not use this file except in compliance with the License.
37003             // You may obtain a copy of the License at
37004             // 
37005             // http://www.apache.org/licenses/LICENSE-2.0
37006             // 
37007             // Unless required by applicable law or agreed to in writing, software
37008             // distributed under the License is distributed on an "AS IS" BASIS,
37009             // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
37010             // See the License for the specific language governing permissions and
37011             // limitations under the License.
37012             Snap.plugin(function(Snap, Element, Paper, glob, Fragment) {
37013                 var proto = Paper.prototype,
37014                     is = Snap.is;
37015                 /*
37016                  * \ Paper.rect [ method ]
37017                  * 
37018                  * Draws a rectangle * - x (number) x coordinate of the top left corner - y
37019                  * (number) y coordinate of the top left corner - width (number) width -
37020                  * height (number) height - rx (number) #optional horizontal radius for
37021                  * rounded corners, default is 0 - ry (number) #optional vertical radius for
37022                  * rounded corners, default is rx or 0 = (object) the `rect` element * >
37023                  * Usage | // regular rectangle | var c = paper.rect(10, 10, 50, 50); | //
37024                  * rectangle with rounded corners | var c = paper.rect(40, 40, 50, 50, 10); \
37025                  */
37026                 proto.rect = function(x, y, w, h, rx, ry) {
37027                     var attr;
37028                     if (ry == null) {
37029                         ry = rx;
37030                     }
37031                     if (is(x, "object") && x == "[object Object]") {
37032                         attr = x;
37033                     } else if (x != null) {
37034                         attr = {
37035                             x: x,
37036                             y: y,
37037                             width: w,
37038                             height: h
37039                         };
37040                         if (rx != null) {
37041                             attr.rx = rx;
37042                             attr.ry = ry;
37043                         }
37044                     }
37045                     return this.el("rect", attr);
37046                 };
37047                 /*
37048                  * \ Paper.circle [ method ] * Draws a circle * - x (number) x coordinate of
37049                  * the centre - y (number) y coordinate of the centre - r (number) radius =
37050                  * (object) the `circle` element * > Usage | var c = paper.circle(50, 50,
37051                  * 40); \
37052                  */
37053                 proto.circle = function(cx, cy, r) {
37054                     var attr;
37055                     if (is(cx, "object") && cx == "[object Object]") {
37056                         attr = cx;
37057                     } else if (cx != null) {
37058                         attr = {
37059                             cx: cx,
37060                             cy: cy,
37061                             r: r
37062                         };
37063                     }
37064                     return this.el("circle", attr);
37065                 };
37066
37067                 var preload = (function() {
37068                     function onerror() {
37069                         this.parentNode.removeChild(this);
37070                     }
37071                     return function(src, f) {
37072                         var img = glob.doc.createElement("img"),
37073                             body = glob.doc.body;
37074                         img.style.cssText = "position:absolute;left:-9999em;top:-9999em";
37075                         img.onload = function() {
37076                             f.call(img);
37077                             img.onload = img.onerror = null;
37078                             body.removeChild(img);
37079                         };
37080                         img.onerror = onerror;
37081                         body.appendChild(img);
37082                         img.src = src;
37083                     };
37084                 }());
37085
37086                 /*
37087                  * \ Paper.image [ method ] * Places an image on the surface * - src
37088                  * (string) URI of the source image - x (number) x offset position - y
37089                  * (number) y offset position - width (number) width of the image - height
37090                  * (number) height of the image = (object) the `image` element or = (object)
37091                  * Snap element object with type `image` * > Usage | var c =
37092                  * paper.image("apple.png", 10, 10, 80, 80); \
37093                  */
37094                 proto.image = function(src, x, y, width, height) {
37095                     var el = this.el("image");
37096                     if (is(src, "object") && "src" in src) {
37097                         el.attr(src);
37098                     } else if (src != null) {
37099                         var set = {
37100                             "xlink:href": src,
37101                             preserveAspectRatio: "none"
37102                         };
37103                         if (x != null && y != null) {
37104                             set.x = x;
37105                             set.y = y;
37106                         }
37107                         if (width != null && height != null) {
37108                             set.width = width;
37109                             set.height = height;
37110                         } else {
37111                             preload(src, function() {
37112                                 Snap._.$(el.node, {
37113                                     width: this.offsetWidth,
37114                                     height: this.offsetHeight
37115                                 });
37116                             });
37117                         }
37118                         Snap._.$(el.node, set);
37119                     }
37120                     return el;
37121                 };
37122                 /*
37123                  * \ Paper.ellipse [ method ] * Draws an ellipse * - x (number) x coordinate
37124                  * of the centre - y (number) y coordinate of the centre - rx (number)
37125                  * horizontal radius - ry (number) vertical radius = (object) the `ellipse`
37126                  * element * > Usage | var c = paper.ellipse(50, 50, 40, 20); \
37127                  */
37128                 proto.ellipse = function(cx, cy, rx, ry) {
37129                     var attr;
37130                     if (is(cx, "object") && cx == "[object Object]") {
37131                         attr = cx;
37132                     } else if (cx != null) {
37133                         attr = {
37134                             cx: cx,
37135                             cy: cy,
37136                             rx: rx,
37137                             ry: ry
37138                         };
37139                     }
37140                     return this.el("ellipse", attr);
37141                 };
37142                 // SIERRA Paper.path(): Unclear from the link what a Catmull-Rom curveto is,
37143                 // and why it would make life any easier.
37144                 /*
37145                  * \ Paper.path [ method ] * Creates a `<path>` element using the given
37146                  * string as the path's definition - pathString (string) #optional path
37147                  * string in SVG format Path string consists of one-letter commands,
37148                  * followed by comma seprarated arguments in numerical form. Example: |
37149                  * "M10,20L30,40" This example features two commands: `M`, with arguments
37150                  * `(10, 20)` and `L` with arguments `(30, 40)`. Uppercase letter commands
37151                  * express coordinates in absolute terms, while lowercase commands express
37152                  * them in relative terms from the most recently declared coordinates.
37153                  *  # <p>Here is short list of commands available, for more details see <a
37154                  * href="http://www.w3.org/TR/SVG/paths.html#PathData" title="Details of a
37155                  * path's data attribute's format are described in the SVG
37156                  * specification.">SVG path string format</a> or <a
37157                  * href="https://developer.mozilla.org/en/SVG/Tutorial/Paths">article about
37158                  * path strings at MDN</a>.</p> # <table><thead><tr><th>Command</th><th>Name</th><th>Parameters</th></tr></thead><tbody> #
37159                  * <tr><td>M</td><td>moveto</td><td>(x y)+</td></tr> # <tr><td>Z</td><td>closepath</td><td>(none)</td></tr> #
37160                  * <tr><td>L</td><td>lineto</td><td>(x y)+</td></tr> # <tr><td>H</td><td>horizontal
37161                  * lineto</td><td>x+</td></tr> # <tr><td>V</td><td>vertical lineto</td><td>y+</td></tr> #
37162                  * <tr><td>C</td><td>curveto</td><td>(x1 y1 x2 y2 x y)+</td></tr> #
37163                  * <tr><td>S</td><td>smooth curveto</td><td>(x2 y2 x y)+</td></tr> #
37164                  * <tr><td>Q</td><td>quadratic Bézier curveto</td><td>(x1 y1 x
37165                  * y)+</td></tr> # <tr><td>T</td><td>smooth quadratic Bézier
37166                  * curveto</td><td>(x y)+</td></tr> # <tr><td>A</td><td>elliptical
37167                  * arc</td><td>(rx ry x-axis-rotation large-arc-flag sweep-flag x y)+</td></tr> #
37168                  * <tr><td>R</td><td><a
37169                  * href="http://en.wikipedia.org/wiki/Catmull–Rom_spline#Catmull.E2.80.93Rom_spline">Catmull-Rom
37170                  * curveto</a>*</td><td>x1 y1 (x y)+</td></tr></tbody></table> *
37171                  * _Catmull-Rom curveto_ is a not standard SVG command and added to make
37172                  * life easier. Note: there is a special case when a path consists of only
37173                  * three commands: `M10,10R…z`. In this case the path connects back to
37174                  * its starting point. > Usage | var c = paper.path("M10 10L90 90"); | //
37175                  * draw a diagonal line: | // move to 10,10, line to 90,90 \
37176                  */
37177                 proto.path = function(d) {
37178                     var attr;
37179                     if (is(d, "object") && !is(d, "array")) {
37180                         attr = d;
37181                     } else if (d) {
37182                         attr = {
37183                             d: d
37184                         };
37185                     }
37186                     return this.el("path", attr);
37187                 };
37188                 /*
37189                  * \ Paper.g [ method ] * Creates a group element * - varargs (…)
37190                  * #optional elements to nest within the group = (object) the `g` element * >
37191                  * Usage | var c1 = paper.circle(), | c2 = paper.rect(), | g = paper.g(c2,
37192                  * c1); // note that the order of elements is different or | var c1 =
37193                  * paper.circle(), | c2 = paper.rect(), | g = paper.g(); | g.add(c2, c1); \
37194                  */
37195                 /*
37196                  * \ Paper.group [ method ] * See @Paper.g \
37197                  */
37198                 proto.group = proto.g = function(first) {
37199                     var attr,
37200                         el = this.el("g");
37201                     if (arguments.length == 1 && first && !first.type) {
37202                         el.attr(first);
37203                     } else if (arguments.length) {
37204                         el.add(Array.prototype.slice.call(arguments, 0));
37205                     }
37206                     return el;
37207                 };
37208                 /*
37209                  * \ Paper.svg [ method ] * Creates a nested SVG element. - x (number)
37210                  * @optional X of the element - y (number) @optional Y of the element -
37211                  * width (number) @optional width of the element - height (number) @optional
37212                  * height of the element - vbx (number) @optional viewbox X - vby (number)
37213                  * @optional viewbox Y - vbw (number) @optional viewbox width - vbh (number)
37214                  * @optional viewbox height * = (object) the `svg` element * \
37215                  */
37216                 proto.svg = function(x, y, width, height, vbx, vby, vbw, vbh) {
37217                     var attrs = {};
37218                     if (is(x, "object") && y == null) {
37219                         attrs = x;
37220                     } else {
37221                         if (x != null) {
37222                             attrs.x = x;
37223                         }
37224                         if (y != null) {
37225                             attrs.y = y;
37226                         }
37227                         if (width != null) {
37228                             attrs.width = width;
37229                         }
37230                         if (height != null) {
37231                             attrs.height = height;
37232                         }
37233                         if (vbx != null && vby != null && vbw != null && vbh != null) {
37234                             attrs.viewBox = [vbx, vby, vbw, vbh];
37235                         }
37236                     }
37237                     return this.el("svg", attrs);
37238                 };
37239                 /*
37240                  * \ Paper.mask [ method ] * Equivalent in behaviour to @Paper.g, except
37241                  * it’s a mask. * = (object) the `mask` element * \
37242                  */
37243                 proto.mask = function(first) {
37244                     var attr,
37245                         el = this.el("mask");
37246                     if (arguments.length == 1 && first && !first.type) {
37247                         el.attr(first);
37248                     } else if (arguments.length) {
37249                         el.add(Array.prototype.slice.call(arguments, 0));
37250                     }
37251                     return el;
37252                 };
37253                 /*
37254                  * \ Paper.ptrn [ method ] * Equivalent in behaviour to @Paper.g, except
37255                  * it’s a pattern. - x (number) @optional X of the element - y
37256                  * (number) @optional Y of the element - width (number) @optional width of
37257                  * the element - height (number) @optional height of the element - vbx
37258                  * (number) @optional viewbox X - vby (number) @optional viewbox Y - vbw
37259                  * (number) @optional viewbox width - vbh (number) @optional viewbox height * =
37260                  * (object) the `pattern` element * \
37261                  */
37262                 proto.ptrn = function(x, y, width, height, vx, vy, vw, vh) {
37263                     if (is(x, "object")) {
37264                         var attr = x;
37265                     } else {
37266                         attr = {
37267                             patternUnits: "userSpaceOnUse"
37268                         };
37269                         if (x) {
37270                             attr.x = x;
37271                         }
37272                         if (y) {
37273                             attr.y = y;
37274                         }
37275                         if (width != null) {
37276                             attr.width = width;
37277                         }
37278                         if (height != null) {
37279                             attr.height = height;
37280                         }
37281                         if (vx != null && vy != null && vw != null && vh != null) {
37282                             attr.viewBox = [vx, vy, vw, vh];
37283                         }
37284                     }
37285                     return this.el("pattern", attr);
37286                 };
37287                 /*
37288                  * \ Paper.use [ method ] * Creates a <use> element. - id (string) @optional
37289                  * id of element to link or - id (Element) @optional element to link * =
37290                  * (object) the `use` element * \
37291                  */
37292                 proto.use = function(id) {
37293                     if (id != null) {
37294                         if (id instanceof Element) {
37295                             if (!id.attr("id")) {
37296                                 id.attr({
37297                                     id: Snap._.id(id)
37298                                 });
37299                             }
37300                             id = id.attr("id");
37301                         }
37302                         if (String(id).charAt() == "#") {
37303                             id = id.substring(1);
37304                         }
37305                         return this.el("use", {
37306                             "xlink:href": "#" + id
37307                         });
37308                     } else {
37309                         return Element.prototype.use.call(this);
37310                     }
37311                 };
37312                 /*
37313                  * \ Paper.symbol [ method ] * Creates a <symbol> element. - vbx (number)
37314                  * @optional viewbox X - vby (number) @optional viewbox Y - vbw (number)
37315                  * @optional viewbox width - vbh (number) @optional viewbox height =
37316                  * (object) the `symbol` element * \
37317                  */
37318                 proto.symbol = function(vx, vy, vw, vh) {
37319                     var attr = {};
37320                     if (vx != null && vy != null && vw != null && vh != null) {
37321                         attr.viewBox = [vx, vy, vw, vh];
37322                     }
37323
37324                     return this.el("symbol", attr);
37325                 };
37326                 /*
37327                  * \ Paper.text [ method ] * Draws a text string * - x (number) x coordinate
37328                  * position - y (number) y coordinate position - text (string|array) The
37329                  * text string to draw or array of strings to nest within separate `<tspan>`
37330                  * elements = (object) the `text` element * > Usage | var t1 =
37331                  * paper.text(50, 50, "Snap"); | var t2 = paper.text(50, 50,
37332                  * ["S","n","a","p"]); | // Text path usage | t1.attr({textpath:
37333                  * "M10,10L100,100"}); | // or | var pth = paper.path("M10,10L100,100"); |
37334                  * t1.attr({textpath: pth}); \
37335                  */
37336                 proto.text = function(x, y, text) {
37337                     var attr = {};
37338                     if (is(x, "object")) {
37339                         attr = x;
37340                     } else if (x != null) {
37341                         attr = {
37342                             x: x,
37343                             y: y,
37344                             text: text || ""
37345                         };
37346                     }
37347                     return this.el("text", attr);
37348                 };
37349                 /*
37350                  * \ Paper.line [ method ] * Draws a line * - x1 (number) x coordinate
37351                  * position of the start - y1 (number) y coordinate position of the start -
37352                  * x2 (number) x coordinate position of the end - y2 (number) y coordinate
37353                  * position of the end = (object) the `line` element * > Usage | var t1 =
37354                  * paper.line(50, 50, 100, 100); \
37355                  */
37356                 proto.line = function(x1, y1, x2, y2) {
37357                     var attr = {};
37358                     if (is(x1, "object")) {
37359                         attr = x1;
37360                     } else if (x1 != null) {
37361                         attr = {
37362                             x1: x1,
37363                             x2: x2,
37364                             y1: y1,
37365                             y2: y2
37366                         };
37367                     }
37368                     return this.el("line", attr);
37369                 };
37370                 /*
37371                  * \ Paper.polyline [ method ] * Draws a polyline * - points (array) array
37372                  * of points or - varargs (…) points = (object) the `polyline` element * >
37373                  * Usage | var p1 = paper.polyline([10, 10, 100, 100]); | var p2 =
37374                  * paper.polyline(10, 10, 100, 100); \
37375                  */
37376                 proto.polyline = function(points) {
37377                     if (arguments.length > 1) {
37378                         points = Array.prototype.slice.call(arguments, 0);
37379                     }
37380                     var attr = {};
37381                     if (is(points, "object") && !is(points, "array")) {
37382                         attr = points;
37383                     } else if (points != null) {
37384                         attr = {
37385                             points: points
37386                         };
37387                     }
37388                     return this.el("polyline", attr);
37389                 };
37390                 /*
37391                  * \ Paper.polygon [ method ] * Draws a polygon. See @Paper.polyline \
37392                  */
37393                 proto.polygon = function(points) {
37394                     if (arguments.length > 1) {
37395                         points = Array.prototype.slice.call(arguments, 0);
37396                     }
37397                     var attr = {};
37398                     if (is(points, "object") && !is(points, "array")) {
37399                         attr = points;
37400                     } else if (points != null) {
37401                         attr = {
37402                             points: points
37403                         };
37404                     }
37405                     return this.el("polygon", attr);
37406                 };
37407                 // gradients
37408                 (function() {
37409                     var $ = Snap._.$;
37410                     // gradients' helpers
37411                     function Gstops() {
37412                         return this.selectAll("stop");
37413                     }
37414
37415                     function GaddStop(color, offset) {
37416                         var stop = $("stop"),
37417                             attr = {
37418                                 offset: +offset + "%"
37419                             };
37420                         color = Snap.color(color);
37421                         attr["stop-color"] = color.hex;
37422                         if (color.opacity < 1) {
37423                             attr["stop-opacity"] = color.opacity;
37424                         }
37425                         $(stop, attr);
37426                         this.node.appendChild(stop);
37427                         return this;
37428                     }
37429
37430                     function GgetBBox() {
37431                         if (this.type == "linearGradient") {
37432                             var x1 = $(this.node, "x1") || 0,
37433                                 x2 = $(this.node, "x2") || 1,
37434                                 y1 = $(this.node, "y1") || 0,
37435                                 y2 = $(this.node, "y2") || 0;
37436                             return Snap._.box(x1, y1, math.abs(x2 - x1), math.abs(y2 - y1));
37437                         } else {
37438                             var cx = this.node.cx || .5,
37439                                 cy = this.node.cy || .5,
37440                                 r = this.node.r || 0;
37441                             return Snap._.box(cx - r, cy - r, r * 2, r * 2);
37442                         }
37443                     }
37444
37445                     function gradient(defs, str) {
37446                         var grad = eve("snap.util.grad.parse", null, str).firstDefined(),
37447                             el;
37448                         if (!grad) {
37449                             return null;
37450                         }
37451                         grad.params.unshift(defs);
37452                         if (grad.type.toLowerCase() == "l") {
37453                             el = gradientLinear.apply(0, grad.params);
37454                         } else {
37455                             el = gradientRadial.apply(0, grad.params);
37456                         }
37457                         if (grad.type != grad.type.toLowerCase()) {
37458                             $(el.node, {
37459                                 gradientUnits: "userSpaceOnUse"
37460                             });
37461                         }
37462                         var stops = grad.stops,
37463                             len = stops.length,
37464                             start = 0,
37465                             j = 0;
37466
37467                         function seed(i, end) {
37468                             var step = (end - start) / (i - j);
37469                             for (var k = j; k < i; k++) {
37470                                 stops[k].offset = +(+start + step * (k - j)).toFixed(2);
37471                             }
37472                             j = i;
37473                             start = end;
37474                         }
37475                         len--;
37476                         for (var i = 0; i < len; i++)
37477                             if ("offset" in stops[i]) {
37478                                 seed(i, stops[i].offset);
37479                             }
37480                         stops[len].offset = stops[len].offset || 100;
37481                         seed(len, stops[len].offset);
37482                         for (i = 0; i <= len; i++) {
37483                             var stop = stops[i];
37484                             el.addStop(stop.color, stop.offset);
37485                         }
37486                         return el;
37487                     }
37488
37489                     function gradientLinear(defs, x1, y1, x2, y2) {
37490                         var el = Snap._.make("linearGradient", defs);
37491                         el.stops = Gstops;
37492                         el.addStop = GaddStop;
37493                         el.getBBox = GgetBBox;
37494                         if (x1 != null) {
37495                             $(el.node, {
37496                                 x1: x1,
37497                                 y1: y1,
37498                                 x2: x2,
37499                                 y2: y2
37500                             });
37501                         }
37502                         return el;
37503                     }
37504
37505                     function gradientRadial(defs, cx, cy, r, fx, fy) {
37506                         var el = Snap._.make("radialGradient", defs);
37507                         el.stops = Gstops;
37508                         el.addStop = GaddStop;
37509                         el.getBBox = GgetBBox;
37510                         if (cx != null) {
37511                             $(el.node, {
37512                                 cx: cx,
37513                                 cy: cy,
37514                                 r: r
37515                             });
37516                         }
37517                         if (fx != null && fy != null) {
37518                             $(el.node, {
37519                                 fx: fx,
37520                                 fy: fy
37521                             });
37522                         }
37523                         return el;
37524                     }
37525                     /*
37526                      * \ Paper.gradient [ method ] * Creates a gradient element * - gradient
37527                      * (string) gradient descriptor > Gradient Descriptor The gradient
37528                      * descriptor is an expression formatted as follows: `<type>(<coords>)<colors>`.
37529                      * The `<type>` can be either linear or radial. The uppercase `L` or
37530                      * `R` letters indicate absolute coordinates offset from the SVG
37531                      * surface. Lowercase `l` or `r` letters indicate coordinates calculated
37532                      * relative to the element to which the gradient is applied. Coordinates
37533                      * specify a linear gradient vector as `x1`, `y1`, `x2`, `y2`, or a
37534                      * radial gradient as `cx`, `cy`, `r` and optional `fx`, `fy` specifying
37535                      * a focal point away from the center of the circle. Specify `<colors>`
37536                      * as a list of dash-separated CSS color values. Each color may be
37537                      * followed by a custom offset value, separated with a colon character. >
37538                      * Examples Linear gradient, relative from top-left corner to
37539                      * bottom-right corner, from black through red to white: | var g =
37540                      * paper.gradient("l(0, 0, 1, 1)#000-#f00-#fff"); Linear gradient,
37541                      * absolute from (0, 0) to (100, 100), from black through red at 25% to
37542                      * white: | var g = paper.gradient("L(0, 0, 100,
37543                      * 100)#000-#f00:25-#fff"); Radial gradient, relative from the center of
37544                      * the element with radius half the width, from black to white: | var g =
37545                      * paper.gradient("r(0.5, 0.5, 0.5)#000-#fff"); To apply the gradient: |
37546                      * paper.circle(50, 50, 40).attr({ | fill: g | }); = (object) the
37547                      * `gradient` element \
37548                      */
37549                     proto.gradient = function(str) {
37550                         return gradient(this.defs, str);
37551                     };
37552                     proto.gradientLinear = function(x1, y1, x2, y2) {
37553                         return gradientLinear(this.defs, x1, y1, x2, y2);
37554                     };
37555                     proto.gradientRadial = function(cx, cy, r, fx, fy) {
37556                         return gradientRadial(this.defs, cx, cy, r, fx, fy);
37557                     };
37558                     /*
37559                      * \ Paper.toString [ method ] * Returns SVG code for the @Paper =
37560                      * (string) SVG code for the @Paper \
37561                      */
37562                     proto.toString = function() {
37563                         var doc = this.node.ownerDocument,
37564                             f = doc.createDocumentFragment(),
37565                             d = doc.createElement("div"),
37566                             svg = this.node.cloneNode(true),
37567                             res;
37568                         f.appendChild(d);
37569                         d.appendChild(svg);
37570                         Snap._.$(svg, {
37571                             xmlns: "http://www.w3.org/2000/svg"
37572                         });
37573                         res = d.innerHTML;
37574                         f.removeChild(f.firstChild);
37575                         return res;
37576                     };
37577                     /*
37578                      * \ Paper.toDataURL [ method ] * Returns SVG code for the @Paper as
37579                      * Data URI string. = (string) Data URI string \
37580                      */
37581                     proto.toDataURL = function() {
37582                         if (window && window.btoa) {
37583                             return "data:image/svg+xml;base64," + btoa(unescape(encodeURIComponent(this)));
37584                         }
37585                     };
37586                     /*
37587                      * \ Paper.clear [ method ] * Removes all child nodes of the paper,
37588                      * except <defs>. \
37589                      */
37590                     proto.clear = function() {
37591                         var node = this.node.firstChild,
37592                             next;
37593                         while (node) {
37594                             next = node.nextSibling;
37595                             if (node.tagName != "defs") {
37596                                 node.parentNode.removeChild(node);
37597                             } else {
37598                                 proto.clear.call({
37599                                     node: node
37600                                 });
37601                             }
37602                             node = next;
37603                         }
37604                     };
37605                 }());
37606             });
37607
37608             // Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.
37609             // 
37610             // Licensed under the Apache License, Version 2.0 (the "License");
37611             // you may not use this file except in compliance with the License.
37612             // You may obtain a copy of the License at
37613             // 
37614             // http://www.apache.org/licenses/LICENSE-2.0
37615             // 
37616             // Unless required by applicable law or agreed to in writing, software
37617             // distributed under the License is distributed on an "AS IS" BASIS,
37618             // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
37619             // See the License for the specific language governing permissions and
37620             // limitations under the License.
37621             Snap.plugin(function(Snap, Element, Paper, glob) {
37622                 var elproto = Element.prototype,
37623                     is = Snap.is,
37624                     clone = Snap._.clone,
37625                     has = "hasOwnProperty",
37626                     p2s = /,?([a-z]),?/gi,
37627                     toFloat = parseFloat,
37628                     math = Math,
37629                     PI = math.PI,
37630                     mmin = math.min,
37631                     mmax = math.max,
37632                     pow = math.pow,
37633                     abs = math.abs;
37634
37635                 function paths(ps) {
37636                     var p = paths.ps = paths.ps || {};
37637                     if (p[ps]) {
37638                         p[ps].sleep = 100;
37639                     } else {
37640                         p[ps] = {
37641                             sleep: 100
37642                         };
37643                     }
37644                     setTimeout(function() {
37645                         for (var key in p)
37646                             if (p[has](key) && key != ps) {
37647                                 p[key].sleep--;
37648                                 !p[key].sleep && delete p[key];
37649                             }
37650                     });
37651                     return p[ps];
37652                 }
37653
37654                 function box(x, y, width, height) {
37655                     if (x == null) {
37656                         x = y = width = height = 0;
37657                     }
37658                     if (y == null) {
37659                         y = x.y;
37660                         width = x.width;
37661                         height = x.height;
37662                         x = x.x;
37663                     }
37664                     return {
37665                         x: x,
37666                         y: y,
37667                         width: width,
37668                         w: width,
37669                         height: height,
37670                         h: height,
37671                         x2: x + width,
37672                         y2: y + height,
37673                         cx: x + width / 2,
37674                         cy: y + height / 2,
37675                         r1: math.min(width, height) / 2,
37676                         r2: math.max(width, height) / 2,
37677                         r0: math.sqrt(width * width + height * height) / 2,
37678                         path: rectPath(x, y, width, height),
37679                         vb: [x, y, width, height].join(" ")
37680                     };
37681                 }
37682
37683                 function toString() {
37684                     return this.join(",").replace(p2s, "$1");
37685                 }
37686
37687                 function pathClone(pathArray) {
37688                     var res = clone(pathArray);
37689                     res.toString = toString;
37690                     return res;
37691                 }
37692
37693                 function getPointAtSegmentLength(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y, length) {
37694                     if (length == null) {
37695                         return bezlen(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y);
37696                     } else {
37697                         return findDotsAtSegment(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y,
37698                             getTotLen(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y, length));
37699                     }
37700                 }
37701
37702                 function getLengthFactory(istotal, subpath) {
37703                     function O(val) {
37704                         return +(+val).toFixed(3);
37705                     }
37706                     return Snap._.cacher(function(path, length, onlystart) {
37707                         if (path instanceof Element) {
37708                             path = path.attr("d");
37709                         }
37710                         path = path2curve(path);
37711                         var x, y, p, l, sp = "",
37712                             subpaths = {},
37713                             point,
37714                             len = 0;
37715                         for (var i = 0, ii = path.length; i < ii; i++) {
37716                             p = path[i];
37717                             if (p[0] == "M") {
37718                                 x = +p[1];
37719                                 y = +p[2];
37720                             } else {
37721                                 l = getPointAtSegmentLength(x, y, p[1], p[2], p[3], p[4], p[5], p[6]);
37722                                 if (len + l > length) {
37723                                     if (subpath && !subpaths.start) {
37724                                         point = getPointAtSegmentLength(x, y, p[1], p[2], p[3], p[4], p[5], p[6], length - len);
37725                                         sp += [
37726                                             "C" + O(point.start.x),
37727                                             O(point.start.y),
37728                                             O(point.m.x),
37729                                             O(point.m.y),
37730                                             O(point.x),
37731                                             O(point.y)
37732                                         ];
37733                                         if (onlystart) {
37734                                             return sp;
37735                                         }
37736                                         subpaths.start = sp;
37737                                         sp = [
37738                                             "M" + O(point.x),
37739                                             O(point.y) + "C" + O(point.n.x),
37740                                             O(point.n.y),
37741                                             O(point.end.x),
37742                                             O(point.end.y),
37743                                             O(p[5]),
37744                                             O(p[6])
37745                                         ].join();
37746                                         len += l;
37747                                         x = +p[5];
37748                                         y = +p[6];
37749                                         continue;
37750                                     }
37751                                     if (!istotal && !subpath) {
37752                                         point = getPointAtSegmentLength(x, y, p[1], p[2], p[3], p[4], p[5], p[6], length - len);
37753                                         return point;
37754                                     }
37755                                 }
37756                                 len += l;
37757                                 x = +p[5];
37758                                 y = +p[6];
37759                             }
37760                             sp += p.shift() + p;
37761                         }
37762                         subpaths.end = sp;
37763                         point = istotal ? len : subpath ? subpaths : findDotsAtSegment(x, y, p[0], p[1], p[2], p[3], p[4], p[5], 1);
37764                         return point;
37765                     }, null, Snap._.clone);
37766                 }
37767                 var getTotalLength = getLengthFactory(1),
37768                     getPointAtLength = getLengthFactory(),
37769                     getSubpathsAtLength = getLengthFactory(0, 1);
37770
37771                 function findDotsAtSegment(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y, t) {
37772                     var t1 = 1 - t,
37773                         t13 = pow(t1, 3),
37774                         t12 = pow(t1, 2),
37775                         t2 = t * t,
37776                         t3 = t2 * t,
37777                         x = t13 * p1x + t12 * 3 * t * c1x + t1 * 3 * t * t * c2x + t3 * p2x,
37778                         y = t13 * p1y + t12 * 3 * t * c1y + t1 * 3 * t * t * c2y + t3 * p2y,
37779                         mx = p1x + 2 * t * (c1x - p1x) + t2 * (c2x - 2 * c1x + p1x),
37780                         my = p1y + 2 * t * (c1y - p1y) + t2 * (c2y - 2 * c1y + p1y),
37781                         nx = c1x + 2 * t * (c2x - c1x) + t2 * (p2x - 2 * c2x + c1x),
37782                         ny = c1y + 2 * t * (c2y - c1y) + t2 * (p2y - 2 * c2y + c1y),
37783                         ax = t1 * p1x + t * c1x,
37784                         ay = t1 * p1y + t * c1y,
37785                         cx = t1 * c2x + t * p2x,
37786                         cy = t1 * c2y + t * p2y,
37787                         alpha = (90 - math.atan2(mx - nx, my - ny) * 180 / PI);
37788                     // (mx > nx || my < ny) && (alpha += 180);
37789                     return {
37790                         x: x,
37791                         y: y,
37792                         m: {
37793                             x: mx,
37794                             y: my
37795                         },
37796                         n: {
37797                             x: nx,
37798                             y: ny
37799                         },
37800                         start: {
37801                             x: ax,
37802                             y: ay
37803                         },
37804                         end: {
37805                             x: cx,
37806                             y: cy
37807                         },
37808                         alpha: alpha
37809                     };
37810                 }
37811
37812                 function bezierBBox(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y) {
37813                     if (!Snap.is(p1x, "array")) {
37814                         p1x = [p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y];
37815                     }
37816                     var bbox = curveDim.apply(null, p1x);
37817                     return box(
37818                         bbox.min.x,
37819                         bbox.min.y,
37820                         bbox.max.x - bbox.min.x,
37821                         bbox.max.y - bbox.min.y
37822                     );
37823                 }
37824
37825                 function isPointInsideBBox(bbox, x, y) {
37826                     return x >= bbox.x &&
37827                         x <= bbox.x + bbox.width &&
37828                         y >= bbox.y &&
37829                         y <= bbox.y + bbox.height;
37830                 }
37831
37832                 function isBBoxIntersect(bbox1, bbox2) {
37833                     bbox1 = box(bbox1);
37834                     bbox2 = box(bbox2);
37835                     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);
37836                 }
37837
37838                 function base3(t, p1, p2, p3, p4) {
37839                     var t1 = -3 * p1 + 9 * p2 - 9 * p3 + 3 * p4,
37840                         t2 = t * t1 + 6 * p1 - 12 * p2 + 6 * p3;
37841                     return t * t2 - 3 * p1 + 3 * p2;
37842                 }
37843
37844                 function bezlen(x1, y1, x2, y2, x3, y3, x4, y4, z) {
37845                     if (z == null) {
37846                         z = 1;
37847                     }
37848                     z = z > 1 ? 1 : z < 0 ? 0 : z;
37849                     var z2 = z / 2,
37850                         n = 12,
37851                         Tvalues = [-.1252, .1252, -.3678, .3678, -.5873, .5873, -.7699, .7699, -.9041, .9041, -.9816, .9816],
37852                         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],
37853                         sum = 0;
37854                     for (var i = 0; i < n; i++) {
37855                         var ct = z2 * Tvalues[i] + z2,
37856                             xbase = base3(ct, x1, x2, x3, x4),
37857                             ybase = base3(ct, y1, y2, y3, y4),
37858                             comb = xbase * xbase + ybase * ybase;
37859                         sum += Cvalues[i] * math.sqrt(comb);
37860                     }
37861                     return z2 * sum;
37862                 }
37863
37864                 function getTotLen(x1, y1, x2, y2, x3, y3, x4, y4, ll) {
37865                     if (ll < 0 || bezlen(x1, y1, x2, y2, x3, y3, x4, y4) < ll) {
37866                         return;
37867                     }
37868                     var t = 1,
37869                         step = t / 2,
37870                         t2 = t - step,
37871                         l,
37872                         e = .01;
37873                     l = bezlen(x1, y1, x2, y2, x3, y3, x4, y4, t2);
37874                     while (abs(l - ll) > e) {
37875                         step /= 2;
37876                         t2 += (l < ll ? 1 : -1) * step;
37877                         l = bezlen(x1, y1, x2, y2, x3, y3, x4, y4, t2);
37878                     }
37879                     return t2;
37880                 }
37881
37882                 function intersect(x1, y1, x2, y2, x3, y3, x4, y4) {
37883                     if (
37884                         mmax(x1, x2) < mmin(x3, x4) ||
37885                         mmin(x1, x2) > mmax(x3, x4) ||
37886                         mmax(y1, y2) < mmin(y3, y4) ||
37887                         mmin(y1, y2) > mmax(y3, y4)
37888                     ) {
37889                         return;
37890                     }
37891                     var nx = (x1 * y2 - y1 * x2) * (x3 - x4) - (x1 - x2) * (x3 * y4 - y3 * x4),
37892                         ny = (x1 * y2 - y1 * x2) * (y3 - y4) - (y1 - y2) * (x3 * y4 - y3 * x4),
37893                         denominator = (x1 - x2) * (y3 - y4) - (y1 - y2) * (x3 - x4);
37894
37895                     if (!denominator) {
37896                         return;
37897                     }
37898                     var px = nx / denominator,
37899                         py = ny / denominator,
37900                         px2 = +px.toFixed(2),
37901                         py2 = +py.toFixed(2);
37902                     if (
37903                         px2 < +mmin(x1, x2).toFixed(2) ||
37904                         px2 > +mmax(x1, x2).toFixed(2) ||
37905                         px2 < +mmin(x3, x4).toFixed(2) ||
37906                         px2 > +mmax(x3, x4).toFixed(2) ||
37907                         py2 < +mmin(y1, y2).toFixed(2) ||
37908                         py2 > +mmax(y1, y2).toFixed(2) ||
37909                         py2 < +mmin(y3, y4).toFixed(2) ||
37910                         py2 > +mmax(y3, y4).toFixed(2)
37911                     ) {
37912                         return;
37913                     }
37914                     return {
37915                         x: px,
37916                         y: py
37917                     };
37918                 }
37919
37920                 function inter(bez1, bez2) {
37921                     return interHelper(bez1, bez2);
37922                 }
37923
37924                 function interCount(bez1, bez2) {
37925                     return interHelper(bez1, bez2, 1);
37926                 }
37927
37928                 function interHelper(bez1, bez2, justCount) {
37929                     var bbox1 = bezierBBox(bez1),
37930                         bbox2 = bezierBBox(bez2);
37931                     if (!isBBoxIntersect(bbox1, bbox2)) {
37932                         return justCount ? 0 : [];
37933                     }
37934                     var l1 = bezlen.apply(0, bez1),
37935                         l2 = bezlen.apply(0, bez2),
37936                         n1 = ~~(l1 / 8),
37937                         n2 = ~~(l2 / 8),
37938                         dots1 = [],
37939                         dots2 = [],
37940                         xy = {},
37941                         res = justCount ? 0 : [];
37942                     for (var i = 0; i < n1 + 1; i++) {
37943                         var p = findDotsAtSegment.apply(0, bez1.concat(i / n1));
37944                         dots1.push({
37945                             x: p.x,
37946                             y: p.y,
37947                             t: i / n1
37948                         });
37949                     }
37950                     for (i = 0; i < n2 + 1; i++) {
37951                         p = findDotsAtSegment.apply(0, bez2.concat(i / n2));
37952                         dots2.push({
37953                             x: p.x,
37954                             y: p.y,
37955                             t: i / n2
37956                         });
37957                     }
37958                     for (i = 0; i < n1; i++) {
37959                         for (var j = 0; j < n2; j++) {
37960                             var di = dots1[i],
37961                                 di1 = dots1[i + 1],
37962                                 dj = dots2[j],
37963                                 dj1 = dots2[j + 1],
37964                                 ci = abs(di1.x - di.x) < .001 ? "y" : "x",
37965                                 cj = abs(dj1.x - dj.x) < .001 ? "y" : "x",
37966                                 is = intersect(di.x, di.y, di1.x, di1.y, dj.x, dj.y, dj1.x, dj1.y);
37967                             if (is) {
37968                                 if (xy[is.x.toFixed(4)] == is.y.toFixed(4)) {
37969                                     continue;
37970                                 }
37971                                 xy[is.x.toFixed(4)] = is.y.toFixed(4);
37972                                 var t1 = di.t + abs((is[ci] - di[ci]) / (di1[ci] - di[ci])) * (di1.t - di.t),
37973                                     t2 = dj.t + abs((is[cj] - dj[cj]) / (dj1[cj] - dj[cj])) * (dj1.t - dj.t);
37974                                 if (t1 >= 0 && t1 <= 1 && t2 >= 0 && t2 <= 1) {
37975                                     if (justCount) {
37976                                         res++;
37977                                     } else {
37978                                         res.push({
37979                                             x: is.x,
37980                                             y: is.y,
37981                                             t1: t1,
37982                                             t2: t2
37983                                         });
37984                                     }
37985                                 }
37986                             }
37987                         }
37988                     }
37989                     return res;
37990                 }
37991
37992                 function pathIntersection(path1, path2) {
37993                     return interPathHelper(path1, path2);
37994                 }
37995
37996                 function pathIntersectionNumber(path1, path2) {
37997                     return interPathHelper(path1, path2, 1);
37998                 }
37999
38000                 function interPathHelper(path1, path2, justCount) {
38001                     path1 = path2curve(path1);
38002                     path2 = path2curve(path2);
38003                     var x1, y1, x2, y2, x1m, y1m, x2m, y2m, bez1, bez2,
38004                         res = justCount ? 0 : [];
38005                     for (var i = 0, ii = path1.length; i < ii; i++) {
38006                         var pi = path1[i];
38007                         if (pi[0] == "M") {
38008                             x1 = x1m = pi[1];
38009                             y1 = y1m = pi[2];
38010                         } else {
38011                             if (pi[0] == "C") {
38012                                 bez1 = [x1, y1].concat(pi.slice(1));
38013                                 x1 = bez1[6];
38014                                 y1 = bez1[7];
38015                             } else {
38016                                 bez1 = [x1, y1, x1, y1, x1m, y1m, x1m, y1m];
38017                                 x1 = x1m;
38018                                 y1 = y1m;
38019                             }
38020                             for (var j = 0, jj = path2.length; j < jj; j++) {
38021                                 var pj = path2[j];
38022                                 if (pj[0] == "M") {
38023                                     x2 = x2m = pj[1];
38024                                     y2 = y2m = pj[2];
38025                                 } else {
38026                                     if (pj[0] == "C") {
38027                                         bez2 = [x2, y2].concat(pj.slice(1));
38028                                         x2 = bez2[6];
38029                                         y2 = bez2[7];
38030                                     } else {
38031                                         bez2 = [x2, y2, x2, y2, x2m, y2m, x2m, y2m];
38032                                         x2 = x2m;
38033                                         y2 = y2m;
38034                                     }
38035                                     var intr = interHelper(bez1, bez2, justCount);
38036                                     if (justCount) {
38037                                         res += intr;
38038                                     } else {
38039                                         for (var k = 0, kk = intr.length; k < kk; k++) {
38040                                             intr[k].segment1 = i;
38041                                             intr[k].segment2 = j;
38042                                             intr[k].bez1 = bez1;
38043                                             intr[k].bez2 = bez2;
38044                                         }
38045                                         res = res.concat(intr);
38046                                     }
38047                                 }
38048                             }
38049                         }
38050                     }
38051                     return res;
38052                 }
38053
38054                 function isPointInsidePath(path, x, y) {
38055                     var bbox = pathBBox(path);
38056                     return isPointInsideBBox(bbox, x, y) &&
38057                         interPathHelper(path, [
38058                             ["M", x, y],
38059                             ["H", bbox.x2 + 10]
38060                         ], 1) % 2 == 1;
38061                 }
38062
38063                 function pathBBox(path) {
38064                     var pth = paths(path);
38065                     if (pth.bbox) {
38066                         return clone(pth.bbox);
38067                     }
38068                     if (!path) {
38069                         return box();
38070                     }
38071                     path = path2curve(path);
38072                     var x = 0,
38073                         y = 0,
38074                         X = [],
38075                         Y = [],
38076                         p;
38077                     for (var i = 0, ii = path.length; i < ii; i++) {
38078                         p = path[i];
38079                         if (p[0] == "M") {
38080                             x = p[1];
38081                             y = p[2];
38082                             X.push(x);
38083                             Y.push(y);
38084                         } else {
38085                             var dim = curveDim(x, y, p[1], p[2], p[3], p[4], p[5], p[6]);
38086                             X = X.concat(dim.min.x, dim.max.x);
38087                             Y = Y.concat(dim.min.y, dim.max.y);
38088                             x = p[5];
38089                             y = p[6];
38090                         }
38091                     }
38092                     var xmin = mmin.apply(0, X),
38093                         ymin = mmin.apply(0, Y),
38094                         xmax = mmax.apply(0, X),
38095                         ymax = mmax.apply(0, Y),
38096                         bb = box(xmin, ymin, xmax - xmin, ymax - ymin);
38097                     pth.bbox = clone(bb);
38098                     return bb;
38099                 }
38100
38101                 function rectPath(x, y, w, h, r) {
38102                     if (r) {
38103                         return [
38104                             ["M", +x + (+r), y],
38105                             ["l", w - r * 2, 0],
38106                             ["a", r, r, 0, 0, 1, r, r],
38107                             ["l", 0, h - r * 2],
38108                             ["a", r, r, 0, 0, 1, -r, r],
38109                             ["l", r * 2 - w, 0],
38110                             ["a", r, r, 0, 0, 1, -r, -r],
38111                             ["l", 0, r * 2 - h],
38112                             ["a", r, r, 0, 0, 1, r, -r],
38113                             ["z"]
38114                         ];
38115                     }
38116                     var res = [
38117                         ["M", x, y],
38118                         ["l", w, 0],
38119                         ["l", 0, h],
38120                         ["l", -w, 0],
38121                         ["z"]
38122                     ];
38123                     res.toString = toString;
38124                     return res;
38125                 }
38126
38127                 function ellipsePath(x, y, rx, ry, a) {
38128                     if (a == null && ry == null) {
38129                         ry = rx;
38130                     }
38131                     x = +x;
38132                     y = +y;
38133                     rx = +rx;
38134                     ry = +ry;
38135                     if (a != null) {
38136                         var rad = Math.PI / 180,
38137                             x1 = x + rx * Math.cos(-ry * rad),
38138                             x2 = x + rx * Math.cos(-a * rad),
38139                             y1 = y + rx * Math.sin(-ry * rad),
38140                             y2 = y + rx * Math.sin(-a * rad),
38141                             res = [
38142                                 ["M", x1, y1],
38143                                 ["A", rx, rx, 0, +(a - ry > 180), 0, x2, y2]
38144                             ];
38145                     } else {
38146                         res = [
38147                             ["M", x, y],
38148                             ["m", 0, -ry],
38149                             ["a", rx, ry, 0, 1, 1, 0, 2 * ry],
38150                             ["a", rx, ry, 0, 1, 1, 0, -2 * ry],
38151                             ["z"]
38152                         ];
38153                     }
38154                     res.toString = toString;
38155                     return res;
38156                 }
38157                 var unit2px = Snap._unit2px,
38158                     getPath = {
38159                         path: function(el) {
38160                             return el.attr("path");
38161                         },
38162                         circle: function(el) {
38163                             var attr = unit2px(el);
38164                             return ellipsePath(attr.cx, attr.cy, attr.r);
38165                         },
38166                         ellipse: function(el) {
38167                             var attr = unit2px(el);
38168                             return ellipsePath(attr.cx || 0, attr.cy || 0, attr.rx, attr.ry);
38169                         },
38170                         rect: function(el) {
38171                             var attr = unit2px(el);
38172                             return rectPath(attr.x || 0, attr.y || 0, attr.width, attr.height, attr.rx, attr.ry);
38173                         },
38174                         image: function(el) {
38175                             var attr = unit2px(el);
38176                             return rectPath(attr.x || 0, attr.y || 0, attr.width, attr.height);
38177                         },
38178                         line: function(el) {
38179                             return "M" + [el.attr("x1") || 0, el.attr("y1") || 0, el.attr("x2"), el.attr("y2")];
38180                         },
38181                         polyline: function(el) {
38182                             return "M" + el.attr("points");
38183                         },
38184                         polygon: function(el) {
38185                             return "M" + el.attr("points") + "z";
38186                         },
38187                         deflt: function(el) {
38188                             var bbox = el.node.getBBox();
38189                             return rectPath(bbox.x, bbox.y, bbox.width, bbox.height);
38190                         }
38191                     };
38192
38193                 function pathToRelative(pathArray) {
38194                     var pth = paths(pathArray),
38195                         lowerCase = String.prototype.toLowerCase;
38196                     if (pth.rel) {
38197                         return pathClone(pth.rel);
38198                     }
38199                     if (!Snap.is(pathArray, "array") || !Snap.is(pathArray && pathArray[0], "array")) {
38200                         pathArray = Snap.parsePathString(pathArray);
38201                     }
38202                     var res = [],
38203                         x = 0,
38204                         y = 0,
38205                         mx = 0,
38206                         my = 0,
38207                         start = 0;
38208                     if (pathArray[0][0] == "M") {
38209                         x = pathArray[0][1];
38210                         y = pathArray[0][2];
38211                         mx = x;
38212                         my = y;
38213                         start++;
38214                         res.push(["M", x, y]);
38215                     }
38216                     for (var i = start, ii = pathArray.length; i < ii; i++) {
38217                         var r = res[i] = [],
38218                             pa = pathArray[i];
38219                         if (pa[0] != lowerCase.call(pa[0])) {
38220                             r[0] = lowerCase.call(pa[0]);
38221                             switch (r[0]) {
38222                                 case "a":
38223                                     r[1] = pa[1];
38224                                     r[2] = pa[2];
38225                                     r[3] = pa[3];
38226                                     r[4] = pa[4];
38227                                     r[5] = pa[5];
38228                                     r[6] = +(pa[6] - x).toFixed(3);
38229                                     r[7] = +(pa[7] - y).toFixed(3);
38230                                     break;
38231                                 case "v":
38232                                     r[1] = +(pa[1] - y).toFixed(3);
38233                                     break;
38234                                 case "m":
38235                                     mx = pa[1];
38236                                     my = pa[2];
38237                                 default:
38238                                     for (var j = 1, jj = pa.length; j < jj; j++) {
38239                                         r[j] = +(pa[j] - ((j % 2) ? x : y)).toFixed(3);
38240                                     }
38241                             }
38242                         } else {
38243                             r = res[i] = [];
38244                             if (pa[0] == "m") {
38245                                 mx = pa[1] + x;
38246                                 my = pa[2] + y;
38247                             }
38248                             for (var k = 0, kk = pa.length; k < kk; k++) {
38249                                 res[i][k] = pa[k];
38250                             }
38251                         }
38252                         var len = res[i].length;
38253                         switch (res[i][0]) {
38254                             case "z":
38255                                 x = mx;
38256                                 y = my;
38257                                 break;
38258                             case "h":
38259                                 x += +res[i][len - 1];
38260                                 break;
38261                             case "v":
38262                                 y += +res[i][len - 1];
38263                                 break;
38264                             default:
38265                                 x += +res[i][len - 2];
38266                                 y += +res[i][len - 1];
38267                         }
38268                     }
38269                     res.toString = toString;
38270                     pth.rel = pathClone(res);
38271                     return res;
38272                 }
38273
38274                 function pathToAbsolute(pathArray) {
38275                     var pth = paths(pathArray);
38276                     if (pth.abs) {
38277                         return pathClone(pth.abs);
38278                     }
38279                     if (!is(pathArray, "array") || !is(pathArray && pathArray[0], "array")) { // rough
38280                         // assumption
38281                         pathArray = Snap.parsePathString(pathArray);
38282                     }
38283                     if (!pathArray || !pathArray.length) {
38284                         return [
38285                             ["M", 0, 0]
38286                         ];
38287                     }
38288                     var res = [],
38289                         x = 0,
38290                         y = 0,
38291                         mx = 0,
38292                         my = 0,
38293                         start = 0,
38294                         pa0;
38295                     if (pathArray[0][0] == "M") {
38296                         x = +pathArray[0][1];
38297                         y = +pathArray[0][2];
38298                         mx = x;
38299                         my = y;
38300                         start++;
38301                         res[0] = ["M", x, y];
38302                     }
38303                     var crz = pathArray.length == 3 &&
38304                         pathArray[0][0] == "M" &&
38305                         pathArray[1][0].toUpperCase() == "R" &&
38306                         pathArray[2][0].toUpperCase() == "Z";
38307                     for (var r, pa, i = start, ii = pathArray.length; i < ii; i++) {
38308                         res.push(r = []);
38309                         pa = pathArray[i];
38310                         pa0 = pa[0];
38311                         if (pa0 != pa0.toUpperCase()) {
38312                             r[0] = pa0.toUpperCase();
38313                             switch (r[0]) {
38314                                 case "A":
38315                                     r[1] = pa[1];
38316                                     r[2] = pa[2];
38317                                     r[3] = pa[3];
38318                                     r[4] = pa[4];
38319                                     r[5] = pa[5];
38320                                     r[6] = +pa[6] + x;
38321                                     r[7] = +pa[7] + y;
38322                                     break;
38323                                 case "V":
38324                                     r[1] = +pa[1] + y;
38325                                     break;
38326                                 case "H":
38327                                     r[1] = +pa[1] + x;
38328                                     break;
38329                                 case "R":
38330                                     var dots = [x, y].concat(pa.slice(1));
38331                                     for (var j = 2, jj = dots.length; j < jj; j++) {
38332                                         dots[j] = +dots[j] + x;
38333                                         dots[++j] = +dots[j] + y;
38334                                     }
38335                                     res.pop();
38336                                     res = res.concat(catmullRom2bezier(dots, crz));
38337                                     break;
38338                                 case "O":
38339                                     res.pop();
38340                                     dots = ellipsePath(x, y, pa[1], pa[2]);
38341                                     dots.push(dots[0]);
38342                                     res = res.concat(dots);
38343                                     break;
38344                                 case "U":
38345                                     res.pop();
38346                                     res = res.concat(ellipsePath(x, y, pa[1], pa[2], pa[3]));
38347                                     r = ["U"].concat(res[res.length - 1].slice(-2));
38348                                     break;
38349                                 case "M":
38350                                     mx = +pa[1] + x;
38351                                     my = +pa[2] + y;
38352                                 default:
38353                                     for (j = 1, jj = pa.length; j < jj; j++) {
38354                                         r[j] = +pa[j] + ((j % 2) ? x : y);
38355                                     }
38356                             }
38357                         } else if (pa0 == "R") {
38358                             dots = [x, y].concat(pa.slice(1));
38359                             res.pop();
38360                             res = res.concat(catmullRom2bezier(dots, crz));
38361                             r = ["R"].concat(pa.slice(-2));
38362                         } else if (pa0 == "O") {
38363                             res.pop();
38364                             dots = ellipsePath(x, y, pa[1], pa[2]);
38365                             dots.push(dots[0]);
38366                             res = res.concat(dots);
38367                         } else if (pa0 == "U") {
38368                             res.pop();
38369                             res = res.concat(ellipsePath(x, y, pa[1], pa[2], pa[3]));
38370                             r = ["U"].concat(res[res.length - 1].slice(-2));
38371                         } else {
38372                             for (var k = 0, kk = pa.length; k < kk; k++) {
38373                                 r[k] = pa[k];
38374                             }
38375                         }
38376                         pa0 = pa0.toUpperCase();
38377                         if (pa0 != "O") {
38378                             switch (r[0]) {
38379                                 case "Z":
38380                                     x = +mx;
38381                                     y = +my;
38382                                     break;
38383                                 case "H":
38384                                     x = r[1];
38385                                     break;
38386                                 case "V":
38387                                     y = r[1];
38388                                     break;
38389                                 case "M":
38390                                     mx = r[r.length - 2];
38391                                     my = r[r.length - 1];
38392                                 default:
38393                                     x = r[r.length - 2];
38394                                     y = r[r.length - 1];
38395                             }
38396                         }
38397                     }
38398                     res.toString = toString;
38399                     pth.abs = pathClone(res);
38400                     return res;
38401                 }
38402
38403                 function l2c(x1, y1, x2, y2) {
38404                     return [x1, y1, x2, y2, x2, y2];
38405                 }
38406
38407                 function q2c(x1, y1, ax, ay, x2, y2) {
38408                     var _13 = 1 / 3,
38409                         _23 = 2 / 3;
38410                     return [
38411                         _13 * x1 + _23 * ax,
38412                         _13 * y1 + _23 * ay,
38413                         _13 * x2 + _23 * ax,
38414                         _13 * y2 + _23 * ay,
38415                         x2,
38416                         y2
38417                     ];
38418                 }
38419
38420                 function a2c(x1, y1, rx, ry, angle, large_arc_flag, sweep_flag, x2, y2, recursive) {
38421                     // for more information of where this math came from visit:
38422                     // http://www.w3.org/TR/SVG11/implnote.html#ArcImplementationNotes
38423                     var _120 = PI * 120 / 180,
38424                         rad = PI / 180 * (+angle || 0),
38425                         res = [],
38426                         xy,
38427                         rotate = Snap._.cacher(function(x, y, rad) {
38428                             var X = x * math.cos(rad) - y * math.sin(rad),
38429                                 Y = x * math.sin(rad) + y * math.cos(rad);
38430                             return {
38431                                 x: X,
38432                                 y: Y
38433                             };
38434                         });
38435                     if (!recursive) {
38436                         xy = rotate(x1, y1, -rad);
38437                         x1 = xy.x;
38438                         y1 = xy.y;
38439                         xy = rotate(x2, y2, -rad);
38440                         x2 = xy.x;
38441                         y2 = xy.y;
38442                         var cos = math.cos(PI / 180 * angle),
38443                             sin = math.sin(PI / 180 * angle),
38444                             x = (x1 - x2) / 2,
38445                             y = (y1 - y2) / 2;
38446                         var h = (x * x) / (rx * rx) + (y * y) / (ry * ry);
38447                         if (h > 1) {
38448                             h = math.sqrt(h);
38449                             rx = h * rx;
38450                             ry = h * ry;
38451                         }
38452                         var rx2 = rx * rx,
38453                             ry2 = ry * ry,
38454                             k = (large_arc_flag == sweep_flag ? -1 : 1) *
38455                             math.sqrt(abs((rx2 * ry2 - rx2 * y * y - ry2 * x * x) / (rx2 * y * y + ry2 * x * x))),
38456                             cx = k * rx * y / ry + (x1 + x2) / 2,
38457                             cy = k * -ry * x / rx + (y1 + y2) / 2,
38458                             f1 = math.asin(((y1 - cy) / ry).toFixed(9)),
38459                             f2 = math.asin(((y2 - cy) / ry).toFixed(9));
38460
38461                         f1 = x1 < cx ? PI - f1 : f1;
38462                         f2 = x2 < cx ? PI - f2 : f2;
38463                         f1 < 0 && (f1 = PI * 2 + f1);
38464                         f2 < 0 && (f2 = PI * 2 + f2);
38465                         if (sweep_flag && f1 > f2) {
38466                             f1 = f1 - PI * 2;
38467                         }
38468                         if (!sweep_flag && f2 > f1) {
38469                             f2 = f2 - PI * 2;
38470                         }
38471                     } else {
38472                         f1 = recursive[0];
38473                         f2 = recursive[1];
38474                         cx = recursive[2];
38475                         cy = recursive[3];
38476                     }
38477                     var df = f2 - f1;
38478                     if (abs(df) > _120) {
38479                         var f2old = f2,
38480                             x2old = x2,
38481                             y2old = y2;
38482                         f2 = f1 + _120 * (sweep_flag && f2 > f1 ? 1 : -1);
38483                         x2 = cx + rx * math.cos(f2);
38484                         y2 = cy + ry * math.sin(f2);
38485                         res = a2c(x2, y2, rx, ry, angle, 0, sweep_flag, x2old, y2old, [f2, f2old, cx, cy]);
38486                     }
38487                     df = f2 - f1;
38488                     var c1 = math.cos(f1),
38489                         s1 = math.sin(f1),
38490                         c2 = math.cos(f2),
38491                         s2 = math.sin(f2),
38492                         t = math.tan(df / 4),
38493                         hx = 4 / 3 * rx * t,
38494                         hy = 4 / 3 * ry * t,
38495                         m1 = [x1, y1],
38496                         m2 = [x1 + hx * s1, y1 - hy * c1],
38497                         m3 = [x2 + hx * s2, y2 - hy * c2],
38498                         m4 = [x2, y2];
38499                     m2[0] = 2 * m1[0] - m2[0];
38500                     m2[1] = 2 * m1[1] - m2[1];
38501                     if (recursive) {
38502                         return [m2, m3, m4].concat(res);
38503                     } else {
38504                         res = [m2, m3, m4].concat(res).join().split(",");
38505                         var newres = [];
38506                         for (var i = 0, ii = res.length; i < ii; i++) {
38507                             newres[i] = i % 2 ? rotate(res[i - 1], res[i], rad).y : rotate(res[i], res[i + 1], rad).x;
38508                         }
38509                         return newres;
38510                     }
38511                 }
38512
38513                 function findDotAtSegment(p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y, t) {
38514                     var t1 = 1 - t;
38515                     return {
38516                         x: pow(t1, 3) * p1x + pow(t1, 2) * 3 * t * c1x + t1 * 3 * t * t * c2x + pow(t, 3) * p2x,
38517                         y: pow(t1, 3) * p1y + pow(t1, 2) * 3 * t * c1y + t1 * 3 * t * t * c2y + pow(t, 3) * p2y
38518                     };
38519                 }
38520
38521                 // Returns bounding box of cubic bezier curve.
38522                 // Source:
38523                 // http://blog.hackers-cafe.net/2009/06/how-to-calculate-bezier-curves-bounding.html
38524                 // Original version: NISHIO Hirokazu
38525                 // Modifications: https://github.com/timo22345
38526                 function curveDim(x0, y0, x1, y1, x2, y2, x3, y3) {
38527                     var tvalues = [],
38528                         bounds = [
38529                             [],
38530                             []
38531                         ],
38532                         a, b, c, t, t1, t2, b2ac, sqrtb2ac;
38533                     for (var i = 0; i < 2; ++i) {
38534                         if (i == 0) {
38535                             b = 6 * x0 - 12 * x1 + 6 * x2;
38536                             a = -3 * x0 + 9 * x1 - 9 * x2 + 3 * x3;
38537                             c = 3 * x1 - 3 * x0;
38538                         } else {
38539                             b = 6 * y0 - 12 * y1 + 6 * y2;
38540                             a = -3 * y0 + 9 * y1 - 9 * y2 + 3 * y3;
38541                             c = 3 * y1 - 3 * y0;
38542                         }
38543                         if (abs(a) < 1e-12) {
38544                             if (abs(b) < 1e-12) {
38545                                 continue;
38546                             }
38547                             t = -c / b;
38548                             if (0 < t && t < 1) {
38549                                 tvalues.push(t);
38550                             }
38551                             continue;
38552                         }
38553                         b2ac = b * b - 4 * c * a;
38554                         sqrtb2ac = math.sqrt(b2ac);
38555                         if (b2ac < 0) {
38556                             continue;
38557                         }
38558                         t1 = (-b + sqrtb2ac) / (2 * a);
38559                         if (0 < t1 && t1 < 1) {
38560                             tvalues.push(t1);
38561                         }
38562                         t2 = (-b - sqrtb2ac) / (2 * a);
38563                         if (0 < t2 && t2 < 1) {
38564                             tvalues.push(t2);
38565                         }
38566                     }
38567
38568                     var x, y, j = tvalues.length,
38569                         jlen = j,
38570                         mt;
38571                     while (j--) {
38572                         t = tvalues[j];
38573                         mt = 1 - t;
38574                         bounds[0][j] = (mt * mt * mt * x0) + (3 * mt * mt * t * x1) + (3 * mt * t * t * x2) + (t * t * t * x3);
38575                         bounds[1][j] = (mt * mt * mt * y0) + (3 * mt * mt * t * y1) + (3 * mt * t * t * y2) + (t * t * t * y3);
38576                     }
38577
38578                     bounds[0][jlen] = x0;
38579                     bounds[1][jlen] = y0;
38580                     bounds[0][jlen + 1] = x3;
38581                     bounds[1][jlen + 1] = y3;
38582                     bounds[0].length = bounds[1].length = jlen + 2;
38583
38584
38585                     return {
38586                         min: {
38587                             x: mmin.apply(0, bounds[0]),
38588                             y: mmin.apply(0, bounds[1])
38589                         },
38590                         max: {
38591                             x: mmax.apply(0, bounds[0]),
38592                             y: mmax.apply(0, bounds[1])
38593                         }
38594                     };
38595                 }
38596
38597                 function path2curve(path, path2) {
38598                     var pth = !path2 && paths(path);
38599                     if (!path2 && pth.curve) {
38600                         return pathClone(pth.curve);
38601                     }
38602                     var p = pathToAbsolute(path),
38603                         p2 = path2 && pathToAbsolute(path2),
38604                         attrs = {
38605                             x: 0,
38606                             y: 0,
38607                             bx: 0,
38608                             by: 0,
38609                             X: 0,
38610                             Y: 0,
38611                             qx: null,
38612                             qy: null
38613                         },
38614                         attrs2 = {
38615                             x: 0,
38616                             y: 0,
38617                             bx: 0,
38618                             by: 0,
38619                             X: 0,
38620                             Y: 0,
38621                             qx: null,
38622                             qy: null
38623                         },
38624                         processPath = function(path, d, pcom) {
38625                             var nx, ny;
38626                             if (!path) {
38627                                 return ["C", d.x, d.y, d.x, d.y, d.x, d.y];
38628                             }!(path[0] in {
38629                                 T: 1,
38630                                 Q: 1
38631                             }) && (d.qx = d.qy = null);
38632                             switch (path[0]) {
38633                                 case "M":
38634                                     d.X = path[1];
38635                                     d.Y = path[2];
38636                                     break;
38637                                 case "A":
38638                                     path = ["C"].concat(a2c.apply(0, [d.x, d.y].concat(path.slice(1))));
38639                                     break;
38640                                 case "S":
38641                                     if (pcom == "C" || pcom == "S") { // In "S" case we
38642                                         // have to take into
38643                                         // account, if the
38644                                         // previous command
38645                                         // is C/S.
38646                                         nx = d.x * 2 - d.bx; // And reflect the
38647                                         // previous
38648                                         ny = d.y * 2 - d.by; // command's control
38649                                         // point relative to
38650                                         // the current
38651                                         // point.
38652                                     } else { // or some else or
38653                                         // nothing
38654                                         nx = d.x;
38655                                         ny = d.y;
38656                                     }
38657                                     path = ["C", nx, ny].concat(path.slice(1));
38658                                     break;
38659                                 case "T":
38660                                     if (pcom == "Q" || pcom == "T") { // In "T" case we
38661                                         // have to take into
38662                                         // account, if the
38663                                         // previous command
38664                                         // is Q/T.
38665                                         d.qx = d.x * 2 - d.qx; // And make a
38666                                         // reflection
38667                                         // similar
38668                                         d.qy = d.y * 2 - d.qy; // to case "S".
38669                                     } else { // or something else
38670                                         // or nothing
38671                                         d.qx = d.x;
38672                                         d.qy = d.y;
38673                                     }
38674                                     path = ["C"].concat(q2c(d.x, d.y, d.qx, d.qy, path[1], path[2]));
38675                                     break;
38676                                 case "Q":
38677                                     d.qx = path[1];
38678                                     d.qy = path[2];
38679                                     path = ["C"].concat(q2c(d.x, d.y, path[1], path[2], path[3], path[4]));
38680                                     break;
38681                                 case "L":
38682                                     path = ["C"].concat(l2c(d.x, d.y, path[1], path[2]));
38683                                     break;
38684                                 case "H":
38685                                     path = ["C"].concat(l2c(d.x, d.y, path[1], d.y));
38686                                     break;
38687                                 case "V":
38688                                     path = ["C"].concat(l2c(d.x, d.y, d.x, path[1]));
38689                                     break;
38690                                 case "Z":
38691                                     path = ["C"].concat(l2c(d.x, d.y, d.X, d.Y));
38692                                     break;
38693                             }
38694                             return path;
38695                         },
38696                         fixArc = function(pp, i) {
38697                             if (pp[i].length > 7) {
38698                                 pp[i].shift();
38699                                 var pi = pp[i];
38700                                 while (pi.length) {
38701                                     pcoms1[i] = "A"; // if created multiple C:s, their
38702                                     // original seg is saved
38703                                     p2 && (pcoms2[i] = "A"); // the same as above
38704                                     pp.splice(i++, 0, ["C"].concat(pi.splice(0, 6)));
38705                                 }
38706                                 pp.splice(i, 1);
38707                                 ii = mmax(p.length, p2 && p2.length || 0);
38708                             }
38709                         },
38710                         fixM = function(path1, path2, a1, a2, i) {
38711                             if (path1 && path2 && path1[i][0] == "M" && path2[i][0] != "M") {
38712                                 path2.splice(i, 0, ["M", a2.x, a2.y]);
38713                                 a1.bx = 0;
38714                                 a1.by = 0;
38715                                 a1.x = path1[i][1];
38716                                 a1.y = path1[i][2];
38717                                 ii = mmax(p.length, p2 && p2.length || 0);
38718                             }
38719                         },
38720                         pcoms1 = [], // path commands of original path p
38721                         pcoms2 = [], // path commands of original path p2
38722                         pfirst = "", // temporary holder for original path command
38723                         pcom = ""; // holder for previous path command of original path
38724                     for (var i = 0, ii = mmax(p.length, p2 && p2.length || 0); i < ii; i++) {
38725                         p[i] && (pfirst = p[i][0]); // save current path command
38726
38727                         if (pfirst != "C") // C is not saved yet, because it may be result
38728                         // of conversion
38729                         {
38730                             pcoms1[i] = pfirst; // Save current path command
38731                             i && (pcom = pcoms1[i - 1]); // Get previous path command
38732                             // pcom
38733                         }
38734                         p[i] = processPath(p[i], attrs, pcom); // Previous path command is
38735                         // inputted to processPath
38736
38737                         if (pcoms1[i] != "A" && pfirst == "C") pcoms1[i] = "C"; // A is the
38738                         // only
38739                         // command
38740                         // which may produce multiple C:s
38741                         // so we have to make sure that C is also C in original path
38742
38743                         fixArc(p, i); // fixArc adds also the right amount of A:s to
38744                         // pcoms1
38745
38746                         if (p2) { // the same procedures is done to p2
38747                             p2[i] && (pfirst = p2[i][0]);
38748                             if (pfirst != "C") {
38749                                 pcoms2[i] = pfirst;
38750                                 i && (pcom = pcoms2[i - 1]);
38751                             }
38752                             p2[i] = processPath(p2[i], attrs2, pcom);
38753
38754                             if (pcoms2[i] != "A" && pfirst == "C") {
38755                                 pcoms2[i] = "C";
38756                             }
38757
38758                             fixArc(p2, i);
38759                         }
38760                         fixM(p, p2, attrs, attrs2, i);
38761                         fixM(p2, p, attrs2, attrs, i);
38762                         var seg = p[i],
38763                             seg2 = p2 && p2[i],
38764                             seglen = seg.length,
38765                             seg2len = p2 && seg2.length;
38766                         attrs.x = seg[seglen - 2];
38767                         attrs.y = seg[seglen - 1];
38768                         attrs.bx = toFloat(seg[seglen - 4]) || attrs.x;
38769                         attrs.by = toFloat(seg[seglen - 3]) || attrs.y;
38770                         attrs2.bx = p2 && (toFloat(seg2[seg2len - 4]) || attrs2.x);
38771                         attrs2.by = p2 && (toFloat(seg2[seg2len - 3]) || attrs2.y);
38772                         attrs2.x = p2 && seg2[seg2len - 2];
38773                         attrs2.y = p2 && seg2[seg2len - 1];
38774                     }
38775                     if (!p2) {
38776                         pth.curve = pathClone(p);
38777                     }
38778                     return p2 ? [p, p2] : p;
38779                 }
38780
38781                 function mapPath(path, matrix) {
38782                     if (!matrix) {
38783                         return path;
38784                     }
38785                     var x, y, i, j, ii, jj, pathi;
38786                     path = path2curve(path);
38787                     for (i = 0, ii = path.length; i < ii; i++) {
38788                         pathi = path[i];
38789                         for (j = 1, jj = pathi.length; j < jj; j += 2) {
38790                             x = matrix.x(pathi[j], pathi[j + 1]);
38791                             y = matrix.y(pathi[j], pathi[j + 1]);
38792                             pathi[j] = x;
38793                             pathi[j + 1] = y;
38794                         }
38795                     }
38796                     return path;
38797                 }
38798
38799                 // http://schepers.cc/getting-to-the-point
38800                 function catmullRom2bezier(crp, z) {
38801                     var d = [];
38802                     for (var i = 0, iLen = crp.length; iLen - 2 * !z > i; i += 2) {
38803                         var p = [{
38804                             x: +crp[i - 2],
38805                             y: +crp[i - 1]
38806                         }, {
38807                             x: +crp[i],
38808                             y: +crp[i + 1]
38809                         }, {
38810                             x: +crp[i + 2],
38811                             y: +crp[i + 3]
38812                         }, {
38813                             x: +crp[i + 4],
38814                             y: +crp[i + 5]
38815                         }];
38816                         if (z) {
38817                             if (!i) {
38818                                 p[0] = {
38819                                     x: +crp[iLen - 2],
38820                                     y: +crp[iLen - 1]
38821                                 };
38822                             } else if (iLen - 4 == i) {
38823                                 p[3] = {
38824                                     x: +crp[0],
38825                                     y: +crp[1]
38826                                 };
38827                             } else if (iLen - 2 == i) {
38828                                 p[2] = {
38829                                     x: +crp[0],
38830                                     y: +crp[1]
38831                                 };
38832                                 p[3] = {
38833                                     x: +crp[2],
38834                                     y: +crp[3]
38835                                 };
38836                             }
38837                         } else {
38838                             if (iLen - 4 == i) {
38839                                 p[3] = p[2];
38840                             } else if (!i) {
38841                                 p[0] = {
38842                                     x: +crp[i],
38843                                     y: +crp[i + 1]
38844                                 };
38845                             }
38846                         }
38847                         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,
38848                             p[2].x,
38849                             p[2].y
38850                         ]);
38851                     }
38852
38853                     return d;
38854                 }
38855
38856                 // export
38857                 Snap.path = paths;
38858
38859                 /*
38860                  * \ Snap.path.getTotalLength [ method ] * Returns the length of the given
38861                  * path in pixels * - path (string) SVG path string * = (number) length \
38862                  */
38863                 Snap.path.getTotalLength = getTotalLength;
38864                 /*
38865                  * \ Snap.path.getPointAtLength [ method ] * Returns the coordinates of the
38866                  * point located at the given length along the given path * - path (string)
38867                  * SVG path string - length (number) length, in pixels, from the start of
38868                  * the path, excluding non-rendering jumps * = (object) representation of
38869                  * the point: o { o x: (number) x coordinate, o y: (number) y coordinate, o
38870                  * alpha: (number) angle of derivative o } \
38871                  */
38872                 Snap.path.getPointAtLength = getPointAtLength;
38873                 /*
38874                  * \ Snap.path.getSubpath [ method ] * Returns the subpath of a given path
38875                  * between given start and end lengths * - path (string) SVG path string -
38876                  * from (number) length, in pixels, from the start of the path to the start
38877                  * of the segment - to (number) length, in pixels, from the start of the
38878                  * path to the end of the segment * = (string) path string definition for
38879                  * the segment \
38880                  */
38881                 Snap.path.getSubpath = function(path, from, to) {
38882                     if (this.getTotalLength(path) - to < 1e-6) {
38883                         return getSubpathsAtLength(path, from).end;
38884                     }
38885                     var a = getSubpathsAtLength(path, to, 1);
38886                     return from ? getSubpathsAtLength(a, from).end : a;
38887                 };
38888                 /*
38889                  * \ Element.getTotalLength [ method ] * Returns the length of the path in
38890                  * pixels (only works for `path` elements) = (number) length \
38891                  */
38892                 elproto.getTotalLength = function() {
38893                     if (this.node.getTotalLength) {
38894                         return this.node.getTotalLength();
38895                     }
38896                 };
38897                 // SIERRA Element.getPointAtLength()/Element.getTotalLength(): If a <path>
38898                 // is broken into different segments, is the jump distance to the new
38899                 // coordinates set by the _M_ or _m_ commands calculated as part of the
38900                 // path's total length?
38901                 /*
38902                  * \ Element.getPointAtLength [ method ] * Returns coordinates of the point
38903                  * located at the given length on the given path (only works for `path`
38904                  * elements) * - length (number) length, in pixels, from the start of the
38905                  * path, excluding non-rendering jumps * = (object) representation of the
38906                  * point: o { o x: (number) x coordinate, o y: (number) y coordinate, o
38907                  * alpha: (number) angle of derivative o } \
38908                  */
38909                 elproto.getPointAtLength = function(length) {
38910                     return getPointAtLength(this.attr("d"), length);
38911                 };
38912                 // SIERRA Element.getSubpath(): Similar to the problem for
38913                 // Element.getPointAtLength(). Unclear how this would work for a segmented
38914                 // path. Overall, the concept of _subpath_ and what I'm calling a _segment_
38915                 // (series of non-_M_ or _Z_ commands) is unclear.
38916                 /*
38917                  * \ Element.getSubpath [ method ] * Returns subpath of a given element from
38918                  * given start and end lengths (only works for `path` elements) * - from
38919                  * (number) length, in pixels, from the start of the path to the start of
38920                  * the segment - to (number) length, in pixels, from the start of the path
38921                  * to the end of the segment * = (string) path string definition for the
38922                  * segment \
38923                  */
38924                 elproto.getSubpath = function(from, to) {
38925                     return Snap.path.getSubpath(this.attr("d"), from, to);
38926                 };
38927                 Snap._.box = box;
38928                 /*
38929                  * \ Snap.path.findDotsAtSegment [ method ] * Utility method * Finds dot
38930                  * coordinates on the given cubic beziér curve at the given t - p1x
38931                  * (number) x of the first point of the curve - p1y (number) y of the first
38932                  * point of the curve - c1x (number) x of the first anchor of the curve -
38933                  * c1y (number) y of the first anchor of the curve - c2x (number) x of the
38934                  * second anchor of the curve - c2y (number) y of the second anchor of the
38935                  * curve - p2x (number) x of the second point of the curve - p2y (number) y
38936                  * of the second point of the curve - t (number) position on the curve
38937                  * (0..1) = (object) point information in format: o { o x: (number) x
38938                  * coordinate of the point, o y: (number) y coordinate of the point, o m: {
38939                  * o x: (number) x coordinate of the left anchor, o y: (number) y coordinate
38940                  * of the left anchor o }, o n: { o x: (number) x coordinate of the right
38941                  * anchor, o y: (number) y coordinate of the right anchor o }, o start: { o
38942                  * x: (number) x coordinate of the start of the curve, o y: (number) y
38943                  * coordinate of the start of the curve o }, o end: { o x: (number) x
38944                  * coordinate of the end of the curve, o y: (number) y coordinate of the end
38945                  * of the curve o }, o alpha: (number) angle of the curve derivative at the
38946                  * point o } \
38947                  */
38948                 Snap.path.findDotsAtSegment = findDotsAtSegment;
38949                 /*
38950                  * \ Snap.path.bezierBBox [ method ] * Utility method * Returns the bounding
38951                  * box of a given cubic beziér curve - p1x (number) x of the first point
38952                  * of the curve - p1y (number) y of the first point of the curve - c1x
38953                  * (number) x of the first anchor of the curve - c1y (number) y of the first
38954                  * anchor of the curve - c2x (number) x of the second anchor of the curve -
38955                  * c2y (number) y of the second anchor of the curve - p2x (number) x of the
38956                  * second point of the curve - p2y (number) y of the second point of the
38957                  * curve or - bez (array) array of six points for beziér curve = (object)
38958                  * bounding box o { o x: (number) x coordinate of the left top point of the
38959                  * box, o y: (number) y coordinate of the left top point of the box, o x2:
38960                  * (number) x coordinate of the right bottom point of the box, o y2:
38961                  * (number) y coordinate of the right bottom point of the box, o width:
38962                  * (number) width of the box, o height: (number) height of the box o } \
38963                  */
38964                 Snap.path.bezierBBox = bezierBBox;
38965                 /*
38966                  * \ Snap.path.isPointInsideBBox [ method ] * Utility method * Returns
38967                  * `true` if given point is inside bounding box - bbox (string) bounding box -
38968                  * x (string) x coordinate of the point - y (string) y coordinate of the
38969                  * point = (boolean) `true` if point is inside \
38970                  */
38971                 Snap.path.isPointInsideBBox = isPointInsideBBox;
38972                 /*
38973                  * \ Snap.path.isBBoxIntersect [ method ] * Utility method * Returns `true`
38974                  * if two bounding boxes intersect - bbox1 (string) first bounding box -
38975                  * bbox2 (string) second bounding box = (boolean) `true` if bounding boxes
38976                  * intersect \
38977                  */
38978                 Snap.path.isBBoxIntersect = isBBoxIntersect;
38979                 /*
38980                  * \ Snap.path.intersection [ method ] * Utility method * Finds
38981                  * intersections of two paths - path1 (string) path string - path2 (string)
38982                  * path string = (array) dots of intersection o [ o { o x: (number) x
38983                  * coordinate of the point, o y: (number) y coordinate of the point, o t1:
38984                  * (number) t value for segment of path1, o t2: (number) t value for segment
38985                  * of path2, o segment1: (number) order number for segment of path1, o
38986                  * segment2: (number) order number for segment of path2, o bez1: (array)
38987                  * eight coordinates representing beziér curve for the segment of path1,
38988                  * o bez2: (array) eight coordinates representing beziér curve for the
38989                  * segment of path2 o } o ] \
38990                  */
38991                 Snap.path.intersection = pathIntersection;
38992                 Snap.path.intersectionNumber = pathIntersectionNumber;
38993                 /*
38994                  * \ Snap.path.isPointInside [ method ] * Utility method * Returns `true` if
38995                  * given point is inside a given closed path.
38996                  * 
38997                  * Note: fill mode doesn’t affect the result of this method. - path
38998                  * (string) path string - x (number) x of the point - y (number) y of the
38999                  * point = (boolean) `true` if point is inside the path \
39000                  */
39001                 Snap.path.isPointInside = isPointInsidePath;
39002                 /*
39003                  * \ Snap.path.getBBox [ method ] * Utility method * Returns the bounding
39004                  * box of a given path - path (string) path string = (object) bounding box o {
39005                  * o x: (number) x coordinate of the left top point of the box, o y:
39006                  * (number) y coordinate of the left top point of the box, o x2: (number) x
39007                  * coordinate of the right bottom point of the box, o y2: (number) y
39008                  * coordinate of the right bottom point of the box, o width: (number) width
39009                  * of the box, o height: (number) height of the box o } \
39010                  */
39011                 Snap.path.getBBox = pathBBox;
39012                 Snap.path.get = getPath;
39013                 /*
39014                  * \ Snap.path.toRelative [ method ] * Utility method * Converts path
39015                  * coordinates into relative values - path (string) path string = (array)
39016                  * path string \
39017                  */
39018                 Snap.path.toRelative = pathToRelative;
39019                 /*
39020                  * \ Snap.path.toAbsolute [ method ] * Utility method * Converts path
39021                  * coordinates into absolute values - path (string) path string = (array)
39022                  * path string \
39023                  */
39024                 Snap.path.toAbsolute = pathToAbsolute;
39025                 /*
39026                  * \ Snap.path.toCubic [ method ] * Utility method * Converts path to a new
39027                  * path where all segments are cubic beziér curves - pathString
39028                  * (string|array) path string or array of segments = (array) array of
39029                  * segments \
39030                  */
39031                 Snap.path.toCubic = path2curve;
39032                 /*
39033                  * \ Snap.path.map [ method ] * Transform the path string with the given
39034                  * matrix - path (string) path string - matrix (object) see @Matrix =
39035                  * (string) transformed path string \
39036                  */
39037                 Snap.path.map = mapPath;
39038                 Snap.path.toString = toString;
39039                 Snap.path.clone = pathClone;
39040             });
39041             // Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.
39042             // 
39043             // Licensed under the Apache License, Version 2.0 (the "License");
39044             // you may not use this file except in compliance with the License.
39045             // You may obtain a copy of the License at
39046             // 
39047             // http://www.apache.org/licenses/LICENSE-2.0
39048             // 
39049             // Unless required by applicable law or agreed to in writing, software
39050             // distributed under the License is distributed on an "AS IS" BASIS,
39051             // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
39052             // See the License for the specific language governing permissions and
39053             // limitations under the License.
39054             Snap.plugin(function(Snap, Element, Paper, glob) {
39055                 var elproto = Element.prototype,
39056                     has = "hasOwnProperty",
39057                     supportsTouch = "createTouch" in glob.doc,
39058                     events = [
39059                         "click", "dblclick", "mousedown", "mousemove", "mouseout",
39060                         "mouseover", "mouseup", "touchstart", "touchmove", "touchend",
39061                         "touchcancel", "keyup"
39062                     ],
39063                     touchMap = {
39064                         mousedown: "touchstart",
39065                         mousemove: "touchmove",
39066                         mouseup: "touchend"
39067                     },
39068                     getScroll = function(xy, el) {
39069                         var name = xy == "y" ? "scrollTop" : "scrollLeft",
39070                             doc = el && el.node ? el.node.ownerDocument : glob.doc;
39071                         return doc[name in doc.documentElement ? "documentElement" : "body"][name];
39072                     },
39073                     preventDefault = function() {
39074                         this.returnValue = false;
39075                     },
39076                     preventTouch = function() {
39077                         return this.originalEvent.preventDefault();
39078                     },
39079                     stopPropagation = function() {
39080                         this.cancelBubble = true;
39081                     },
39082                     stopTouch = function() {
39083                         return this.originalEvent.stopPropagation();
39084                     },
39085                     addEvent = (function() {
39086                         if (glob.doc.addEventListener) {
39087                             return function(obj, type, fn, element) {
39088                                 var realName = supportsTouch && touchMap[type] ? touchMap[type] : type,
39089                                     f = function(e) {
39090                                         var scrollY = getScroll("y", element),
39091                                             scrollX = getScroll("x", element);
39092                                         if (supportsTouch && touchMap[has](type)) {
39093                                             for (var i = 0, ii = e.targetTouches && e.targetTouches.length; i < ii; i++) {
39094                                                 if (e.targetTouches[i].target == obj || obj.contains(e.targetTouches[i].target)) {
39095                                                     var olde = e;
39096                                                     e = e.targetTouches[i];
39097                                                     e.originalEvent = olde;
39098                                                     e.preventDefault = preventTouch;
39099                                                     e.stopPropagation = stopTouch;
39100                                                     break;
39101                                                 }
39102                                             }
39103                                         }
39104                                         var x = e.clientX + scrollX,
39105                                             y = e.clientY + scrollY;
39106                                         return fn.call(element, e, x, y);
39107                                     };
39108
39109                                 if (type !== realName) {
39110                                     obj.addEventListener(type, f, false);
39111                                 }
39112
39113                                 obj.addEventListener(realName, f, false);
39114
39115                                 return function() {
39116                                     if (type !== realName) {
39117                                         obj.removeEventListener(type, f, false);
39118                                     }
39119
39120                                     obj.removeEventListener(realName, f, false);
39121                                     return true;
39122                                 };
39123                             };
39124                         } else if (glob.doc.attachEvent) {
39125                             return function(obj, type, fn, element) {
39126                                 var f = function(e) {
39127                                     e = e || element.node.ownerDocument.window.event;
39128                                     var scrollY = getScroll("y", element),
39129                                         scrollX = getScroll("x", element),
39130                                         x = e.clientX + scrollX,
39131                                         y = e.clientY + scrollY;
39132                                     e.preventDefault = e.preventDefault || preventDefault;
39133                                     e.stopPropagation = e.stopPropagation || stopPropagation;
39134                                     return fn.call(element, e, x, y);
39135                                 };
39136                                 obj.attachEvent("on" + type, f);
39137                                 var detacher = function() {
39138                                     obj.detachEvent("on" + type, f);
39139                                     return true;
39140                                 };
39141                                 return detacher;
39142                             };
39143                         }
39144                     })(),
39145                     drag = [],
39146                     dragMove = function(e) {
39147                         var x = e.clientX,
39148                             y = e.clientY,
39149                             scrollY = getScroll("y"),
39150                             scrollX = getScroll("x"),
39151                             dragi,
39152                             j = drag.length;
39153                         while (j--) {
39154                             dragi = drag[j];
39155                             if (supportsTouch) {
39156                                 var i = e.touches && e.touches.length,
39157                                     touch;
39158                                 while (i--) {
39159                                     touch = e.touches[i];
39160                                     if (touch.identifier == dragi.el._drag.id || dragi.el.node.contains(touch.target)) {
39161                                         x = touch.clientX;
39162                                         y = touch.clientY;
39163                                         (e.originalEvent ? e.originalEvent : e).preventDefault();
39164                                         break;
39165                                     }
39166                                 }
39167                             } else {
39168                                 e.preventDefault();
39169                             }
39170                             var node = dragi.el.node,
39171                                 o,
39172                                 next = node.nextSibling,
39173                                 parent = node.parentNode,
39174                                 display = node.style.display;
39175                             // glob.win.opera && parent.removeChild(node);
39176                             // node.style.display = "none";
39177                             // o = dragi.el.paper.getElementByPoint(x, y);
39178                             // node.style.display = display;
39179                             // glob.win.opera && (next ? parent.insertBefore(node, next) :
39180                             // parent.appendChild(node));
39181                             // o && eve("snap.drag.over." + dragi.el.id, dragi.el, o);
39182                             x += scrollX;
39183                             y += scrollY;
39184                             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);
39185                         }
39186                     },
39187                     dragUp = function(e) {
39188                         Snap.unmousemove(dragMove).unmouseup(dragUp);
39189                         var i = drag.length,
39190                             dragi;
39191                         while (i--) {
39192                             dragi = drag[i];
39193                             dragi.el._drag = {};
39194                             eve("snap.drag.end." + dragi.el.id, dragi.end_scope || dragi.start_scope || dragi.move_scope || dragi.el, e);
39195                         }
39196                         drag = [];
39197                     };
39198                 /*
39199                  * \ Element.click [ method ] * Adds a click event handler to the element -
39200                  * handler (function) handler for the event = (object) @Element \
39201                  */
39202                 /*
39203                  * \ Element.unclick [ method ] * Removes a click event handler from the
39204                  * element - handler (function) handler for the event = (object) @Element \
39205                  */
39206
39207                 /*
39208                  * \ Element.dblclick [ method ] * Adds a double click event handler to the
39209                  * element - handler (function) handler for the event = (object) @Element \
39210                  */
39211                 /*
39212                  * \ Element.undblclick [ method ] * Removes a double click event handler
39213                  * from the element - handler (function) handler for the event = (object)
39214                  * @Element \
39215                  */
39216
39217                 /*
39218                  * \ Element.mousedown [ method ] * Adds a mousedown event handler to the
39219                  * element - handler (function) handler for the event = (object) @Element \
39220                  */
39221                 /*
39222                  * \ Element.unmousedown [ method ] * Removes a mousedown event handler from
39223                  * the element - handler (function) handler for the event = (object)
39224                  * @Element \
39225                  */
39226
39227                 /*
39228                  * \ Element.mousemove [ method ] * Adds a mousemove event handler to the
39229                  * element - handler (function) handler for the event = (object) @Element \
39230                  */
39231                 /*
39232                  * \ Element.unmousemove [ method ] * Removes a mousemove event handler from
39233                  * the element - handler (function) handler for the event = (object)
39234                  * @Element \
39235                  */
39236
39237                 /*
39238                  * \ Element.mouseout [ method ] * Adds a mouseout event handler to the
39239                  * element - handler (function) handler for the event = (object) @Element \
39240                  */
39241                 /*
39242                  * \ Element.unmouseout [ method ] * Removes a mouseout event handler from
39243                  * the element - handler (function) handler for the event = (object)
39244                  * @Element \
39245                  */
39246
39247                 /*
39248                  * \ Element.mouseover [ method ] * Adds a mouseover event handler to the
39249                  * element - handler (function) handler for the event = (object) @Element \
39250                  */
39251                 /*
39252                  * \ Element.unmouseover [ method ] * Removes a mouseover event handler from
39253                  * the element - handler (function) handler for the event = (object)
39254                  * @Element \
39255                  */
39256
39257                 /*
39258                  * \ Element.mouseup [ method ] * Adds a mouseup event handler to the
39259                  * element - handler (function) handler for the event = (object) @Element \
39260                  */
39261                 /*
39262                  * \ Element.unmouseup [ method ] * Removes a mouseup event handler from the
39263                  * element - handler (function) handler for the event = (object) @Element \
39264                  */
39265
39266                 /*
39267                  * \ Element.touchstart [ method ] * Adds a touchstart event handler to the
39268                  * element - handler (function) handler for the event = (object) @Element \
39269                  */
39270                 /*
39271                  * \ Element.untouchstart [ method ] * Removes a touchstart event handler
39272                  * from the element - handler (function) handler for the event = (object)
39273                  * @Element \
39274                  */
39275
39276                 /*
39277                  * \ Element.touchmove [ method ] * Adds a touchmove event handler to the
39278                  * element - handler (function) handler for the event = (object) @Element \
39279                  */
39280                 /*
39281                  * \ Element.untouchmove [ method ] * Removes a touchmove event handler from
39282                  * the element - handler (function) handler for the event = (object)
39283                  * @Element \
39284                  */
39285
39286                 /*
39287                  * \ Element.touchend [ method ] * Adds a touchend event handler to the
39288                  * element - handler (function) handler for the event = (object) @Element \
39289                  */
39290                 /*
39291                  * \ Element.untouchend [ method ] * Removes a touchend event handler from
39292                  * the element - handler (function) handler for the event = (object)
39293                  * @Element \
39294                  */
39295
39296                 /*
39297                  * \ Element.touchcancel [ method ] * Adds a touchcancel event handler to
39298                  * the element - handler (function) handler for the event = (object)
39299                  * @Element \
39300                  */
39301                 /*
39302                  * \ Element.untouchcancel [ method ] * Removes a touchcancel event handler
39303                  * from the element - handler (function) handler for the event = (object)
39304                  * @Element \
39305                  */
39306                 for (var i = events.length; i--;) {
39307                     (function(eventName) {
39308                         Snap[eventName] = elproto[eventName] = function(fn, scope) {
39309                             if (Snap.is(fn, "function")) {
39310                                 this.events = this.events || [];
39311                                 this.events.push({
39312                                     name: eventName,
39313                                     f: fn,
39314                                     unbind: addEvent(this.node || document, eventName, fn, scope || this)
39315                                 });
39316                             }
39317                             return this;
39318                         };
39319                         Snap["un" + eventName] =
39320                             elproto["un" + eventName] = function(fn) {
39321                                 var events = this.events || [],
39322                                     l = events.length;
39323                                 while (l--)
39324                                     if (events[l].name == eventName &&
39325                                         (events[l].f == fn || !fn)) {
39326                                         events[l].unbind();
39327                                         events.splice(l, 1);
39328                                         !events.length && delete this.events;
39329                                         return this;
39330                                     }
39331                                 return this;
39332                             };
39333                     })(events[i]);
39334                 }
39335                 /*
39336                  * \ Element.hover [ method ] * Adds hover event handlers to the element -
39337                  * f_in (function) handler for hover in - f_out (function) handler for hover
39338                  * out - icontext (object) #optional context for hover in handler - ocontext
39339                  * (object) #optional context for hover out handler = (object) @Element \
39340                  */
39341                 elproto.hover = function(f_in, f_out, scope_in, scope_out) {
39342                     return this.mouseover(f_in, scope_in).mouseout(f_out, scope_out || scope_in);
39343                 };
39344                 /*
39345                  * \ Element.unhover [ method ] * Removes hover event handlers from the
39346                  * element - f_in (function) handler for hover in - f_out (function) handler
39347                  * for hover out = (object) @Element \
39348                  */
39349                 elproto.unhover = function(f_in, f_out) {
39350                     return this.unmouseover(f_in).unmouseout(f_out);
39351                 };
39352                 var draggable = [];
39353                 // SIERRA unclear what _context_ refers to for starting, ending, moving the
39354                 // drag gesture.
39355                 // SIERRA Element.drag(): _x position of the mouse_: Where are the x/y
39356                 // values offset from?
39357                 // SIERRA Element.drag(): much of this member's doc appears to be duplicated
39358                 // for some reason.
39359                 // SIERRA Unclear about this sentence: _Additionally following drag events
39360                 // will be triggered: drag.start.<id> on start, drag.end.<id> on end and
39361                 // drag.move.<id> on every move._ Is there a global _drag_ object to which
39362                 // you can assign handlers keyed by an element's ID?
39363                 /*
39364                  * \ Element.drag [ method ] * Adds event handlers for an element's drag
39365                  * gesture * - onmove (function) handler for moving - onstart (function)
39366                  * handler for drag start - onend (function) handler for drag end - mcontext
39367                  * (object) #optional context for moving handler - scontext (object)
39368                  * #optional context for drag start handler - econtext (object) #optional
39369                  * context for drag end handler Additionaly following `drag` events are
39370                  * triggered: `drag.start.<id>` on start, `drag.end.<id>` on end and
39371                  * `drag.move.<id>` on every move. When element is dragged over another
39372                  * element `drag.over.<id>` fires as well.
39373                  * 
39374                  * Start event and start handler are called in specified context or in
39375                  * context of the element with following parameters: o x (number) x position
39376                  * of the mouse o y (number) y position of the mouse o event (object) DOM
39377                  * event object Move event and move handler are called in specified context
39378                  * or in context of the element with following parameters: o dx (number)
39379                  * shift by x from the start point o dy (number) shift by y from the start
39380                  * point o x (number) x position of the mouse o y (number) y position of the
39381                  * mouse o event (object) DOM event object End event and end handler are
39382                  * called in specified context or in context of the element with following
39383                  * parameters: o event (object) DOM event object = (object) @Element \
39384                  */
39385                 elproto.drag = function(onmove, onstart, onend, move_scope, start_scope, end_scope) {
39386                     if (!arguments.length) {
39387                         var origTransform;
39388                         return this.drag(function(dx, dy) {
39389                             this.attr({
39390                                 transform: origTransform + (origTransform ? "T" : "t") + [dx, dy]
39391                             });
39392                         }, function() {
39393                             origTransform = this.transform().local;
39394                         });
39395                     }
39396
39397                     function start(e, x, y) {
39398                         (e.originalEvent || e).preventDefault();
39399                         this._drag.x = x;
39400                         this._drag.y = y;
39401                         this._drag.id = e.identifier;
39402                         !drag.length && Snap.mousemove(dragMove).mouseup(dragUp);
39403                         drag.push({
39404                             el: this,
39405                             move_scope: move_scope,
39406                             start_scope: start_scope,
39407                             end_scope: end_scope
39408                         });
39409                         onstart && eve.on("snap.drag.start." + this.id, onstart);
39410                         onmove && eve.on("snap.drag.move." + this.id, onmove);
39411                         onend && eve.on("snap.drag.end." + this.id, onend);
39412                         eve("snap.drag.start." + this.id, start_scope || move_scope || this, x, y, e);
39413                     }
39414                     this._drag = {};
39415                     draggable.push({
39416                         el: this,
39417                         start: start
39418                     });
39419                     this.mousedown(start);
39420                     return this;
39421                 };
39422                 /*
39423                  * Element.onDragOver [ method ] * Shortcut to assign event handler for
39424                  * `drag.over.<id>` event, where `id` is the element's `id` (see
39425                  * @Element.id) - f (function) handler for event, first argument would be
39426                  * the element you are dragging over \
39427                  */
39428                 // elproto.onDragOver = function (f) {
39429                 // f ? eve.on("snap.drag.over." + this.id, f) : eve.unbind("snap.drag.over."
39430                 // + this.id);
39431                 // };
39432                 /*
39433                  * \ Element.undrag [ method ] * Removes all drag event handlers from the
39434                  * given element \
39435                  */
39436                 elproto.undrag = function() {
39437                     var i = draggable.length;
39438                     while (i--)
39439                         if (draggable[i].el == this) {
39440                             this.unmousedown(draggable[i].start);
39441                             draggable.splice(i, 1);
39442                             eve.unbind("snap.drag.*." + this.id);
39443                         }!draggable.length && Snap.unmousemove(dragMove).unmouseup(dragUp);
39444                     return this;
39445                 };
39446             });
39447             // Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.
39448             // 
39449             // Licensed under the Apache License, Version 2.0 (the "License");
39450             // you may not use this file except in compliance with the License.
39451             // You may obtain a copy of the License at
39452             // 
39453             // http://www.apache.org/licenses/LICENSE-2.0
39454             // 
39455             // Unless required by applicable law or agreed to in writing, software
39456             // distributed under the License is distributed on an "AS IS" BASIS,
39457             // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
39458             // See the License for the specific language governing permissions and
39459             // limitations under the License.
39460             Snap.plugin(function(Snap, Element, Paper, glob) {
39461                 var elproto = Element.prototype,
39462                     pproto = Paper.prototype,
39463                     rgurl = /^\s*url\((.+)\)/,
39464                     Str = String,
39465                     $ = Snap._.$;
39466                 Snap.filter = {};
39467                 /*
39468                  * \ Paper.filter [ method ] * Creates a `<filter>` element * - filstr
39469                  * (string) SVG fragment of filter provided as a string = (object) @Element
39470                  * Note: It is recommended to use filters embedded into the page inside an
39471                  * empty SVG element. > Usage | var f = paper.filter('<feGaussianBlur
39472                  * stdDeviation="2"/>'), | c = paper.circle(10, 10, 10).attr({ | filter: f |
39473                  * }); \
39474                  */
39475                 pproto.filter = function(filstr) {
39476                     var paper = this;
39477                     if (paper.type != "svg") {
39478                         paper = paper.paper;
39479                     }
39480                     var f = Snap.parse(Str(filstr)),
39481                         id = Snap._.id(),
39482                         width = paper.node.offsetWidth,
39483                         height = paper.node.offsetHeight,
39484                         filter = $("filter");
39485                     $(filter, {
39486                         id: id,
39487                         filterUnits: "userSpaceOnUse"
39488                     });
39489                     filter.appendChild(f.node);
39490                     paper.defs.appendChild(filter);
39491                     return new Element(filter);
39492                 };
39493
39494                 eve.on("snap.util.getattr.filter", function() {
39495                     eve.stop();
39496                     var p = $(this.node, "filter");
39497                     if (p) {
39498                         var match = Str(p).match(rgurl);
39499                         return match && Snap.select(match[1]);
39500                     }
39501                 });
39502                 eve.on("snap.util.attr.filter", function(value) {
39503                     if (value instanceof Element && value.type == "filter") {
39504                         eve.stop();
39505                         var id = value.node.id;
39506                         if (!id) {
39507                             $(value.node, {
39508                                 id: value.id
39509                             });
39510                             id = value.id;
39511                         }
39512                         $(this.node, {
39513                             filter: Snap.url(id)
39514                         });
39515                     }
39516                     if (!value || value == "none") {
39517                         eve.stop();
39518                         this.node.removeAttribute("filter");
39519                     }
39520                 });
39521                 /*
39522                  * \ Snap.filter.blur [ method ] * Returns an SVG markup string for the blur
39523                  * filter * - x (number) amount of horizontal blur, in pixels - y (number)
39524                  * #optional amount of vertical blur, in pixels = (string) filter
39525                  * representation > Usage | var f = paper.filter(Snap.filter.blur(5, 10)), |
39526                  * c = paper.circle(10, 10, 10).attr({ | filter: f | }); \
39527                  */
39528                 Snap.filter.blur = function(x, y) {
39529                     if (x == null) {
39530                         x = 2;
39531                     }
39532                     var def = y == null ? x : [x, y];
39533                     return Snap.format('\<feGaussianBlur stdDeviation="{def}"/>', {
39534                         def: def
39535                     });
39536                 };
39537                 Snap.filter.blur.toString = function() {
39538                     return this();
39539                 };
39540                 /*
39541                  * \ Snap.filter.shadow [ method ] * Returns an SVG markup string for the
39542                  * shadow filter * - dx (number) #optional horizontal shift of the shadow,
39543                  * in pixels - dy (number) #optional vertical shift of the shadow, in pixels -
39544                  * blur (number) #optional amount of blur - color (string) #optional color
39545                  * of the shadow - opacity (number) #optional `0..1` opacity of the shadow
39546                  * or - dx (number) #optional horizontal shift of the shadow, in pixels - dy
39547                  * (number) #optional vertical shift of the shadow, in pixels - color
39548                  * (string) #optional color of the shadow - opacity (number) #optional
39549                  * `0..1` opacity of the shadow which makes blur default to `4`. Or - dx
39550                  * (number) #optional horizontal shift of the shadow, in pixels - dy
39551                  * (number) #optional vertical shift of the shadow, in pixels - opacity
39552                  * (number) #optional `0..1` opacity of the shadow = (string) filter
39553                  * representation > Usage | var f = paper.filter(Snap.filter.shadow(0, 2,
39554                  * 3)), | c = paper.circle(10, 10, 10).attr({ | filter: f | }); \
39555                  */
39556                 Snap.filter.shadow = function(dx, dy, blur, color, opacity) {
39557                     if (typeof blur == "string") {
39558                         color = blur;
39559                         opacity = color;
39560                         blur = 4;
39561                     }
39562                     if (typeof color != "string") {
39563                         opacity = color;
39564                         color = "#000";
39565                     }
39566                     color = color || "#000";
39567                     if (blur == null) {
39568                         blur = 4;
39569                     }
39570                     if (opacity == null) {
39571                         opacity = 1;
39572                     }
39573                     if (dx == null) {
39574                         dx = 0;
39575                         dy = 2;
39576                     }
39577                     if (dy == null) {
39578                         dy = dx;
39579                     }
39580                     color = Snap.color(color);
39581                     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>', {
39582                         color: color,
39583                         dx: dx,
39584                         dy: dy,
39585                         blur: blur,
39586                         opacity: opacity
39587                     });
39588                 };
39589                 Snap.filter.shadow.toString = function() {
39590                     return this();
39591                 };
39592                 /*
39593                  * \ Snap.filter.grayscale [ method ] * Returns an SVG markup string for the
39594                  * grayscale filter * - amount (number) amount of filter (`0..1`) = (string)
39595                  * filter representation \
39596                  */
39597                 Snap.filter.grayscale = function(amount) {
39598                     if (amount == null) {
39599                         amount = 1;
39600                     }
39601                     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"/>', {
39602                         a: 0.2126 + 0.7874 * (1 - amount),
39603                         b: 0.7152 - 0.7152 * (1 - amount),
39604                         c: 0.0722 - 0.0722 * (1 - amount),
39605                         d: 0.2126 - 0.2126 * (1 - amount),
39606                         e: 0.7152 + 0.2848 * (1 - amount),
39607                         f: 0.0722 - 0.0722 * (1 - amount),
39608                         g: 0.2126 - 0.2126 * (1 - amount),
39609                         h: 0.0722 + 0.9278 * (1 - amount)
39610                     });
39611                 };
39612                 Snap.filter.grayscale.toString = function() {
39613                     return this();
39614                 };
39615                 /*
39616                  * \ Snap.filter.sepia [ method ] * Returns an SVG markup string for the
39617                  * sepia filter * - amount (number) amount of filter (`0..1`) = (string)
39618                  * filter representation \
39619                  */
39620                 Snap.filter.sepia = function(amount) {
39621                     if (amount == null) {
39622                         amount = 1;
39623                     }
39624                     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"/>', {
39625                         a: 0.393 + 0.607 * (1 - amount),
39626                         b: 0.769 - 0.769 * (1 - amount),
39627                         c: 0.189 - 0.189 * (1 - amount),
39628                         d: 0.349 - 0.349 * (1 - amount),
39629                         e: 0.686 + 0.314 * (1 - amount),
39630                         f: 0.168 - 0.168 * (1 - amount),
39631                         g: 0.272 - 0.272 * (1 - amount),
39632                         h: 0.534 - 0.534 * (1 - amount),
39633                         i: 0.131 + 0.869 * (1 - amount)
39634                     });
39635                 };
39636                 Snap.filter.sepia.toString = function() {
39637                     return this();
39638                 };
39639                 /*
39640                  * \ Snap.filter.saturate [ method ] * Returns an SVG markup string for the
39641                  * saturate filter * - amount (number) amount of filter (`0..1`) = (string)
39642                  * filter representation \
39643                  */
39644                 Snap.filter.saturate = function(amount) {
39645                     if (amount == null) {
39646                         amount = 1;
39647                     }
39648                     return Snap.format('<feColorMatrix type="saturate" values="{amount}"/>', {
39649                         amount: 1 - amount
39650                     });
39651                 };
39652                 Snap.filter.saturate.toString = function() {
39653                     return this();
39654                 };
39655                 /*
39656                  * \ Snap.filter.hueRotate [ method ] * Returns an SVG markup string for the
39657                  * hue-rotate filter * - angle (number) angle of rotation = (string) filter
39658                  * representation \
39659                  */
39660                 Snap.filter.hueRotate = function(angle) {
39661                     angle = angle || 0;
39662                     return Snap.format('<feColorMatrix type="hueRotate" values="{angle}"/>', {
39663                         angle: angle
39664                     });
39665                 };
39666                 Snap.filter.hueRotate.toString = function() {
39667                     return this();
39668                 };
39669                 /*
39670                  * \ Snap.filter.invert [ method ] * Returns an SVG markup string for the
39671                  * invert filter * - amount (number) amount of filter (`0..1`) = (string)
39672                  * filter representation \
39673                  */
39674                 Snap.filter.invert = function(amount) {
39675                     if (amount == null) {
39676                         amount = 1;
39677                     }
39678                     return Snap.format('<feComponentTransfer><feFuncR type="table" tableValues="{amount} {amount2}"/><feFuncG type="table" tableValues="{amount} {amount2}"/><feFuncB type="table" tableValues="{amount} {amount2}"/></feComponentTransfer>', {
39679                         amount: amount,
39680                         amount2: 1 - amount
39681                     });
39682                 };
39683                 Snap.filter.invert.toString = function() {
39684                     return this();
39685                 };
39686                 /*
39687                  * \ Snap.filter.brightness [ method ] * Returns an SVG markup string for
39688                  * the brightness filter * - amount (number) amount of filter (`0..1`) =
39689                  * (string) filter representation \
39690                  */
39691                 Snap.filter.brightness = function(amount) {
39692                     if (amount == null) {
39693                         amount = 1;
39694                     }
39695                     return Snap.format('<feComponentTransfer><feFuncR type="linear" slope="{amount}"/><feFuncG type="linear" slope="{amount}"/><feFuncB type="linear" slope="{amount}"/></feComponentTransfer>', {
39696                         amount: amount
39697                     });
39698                 };
39699                 Snap.filter.brightness.toString = function() {
39700                     return this();
39701                 };
39702                 /*
39703                  * \ Snap.filter.contrast [ method ] * Returns an SVG markup string for the
39704                  * contrast filter * - amount (number) amount of filter (`0..1`) = (string)
39705                  * filter representation \
39706                  */
39707                 Snap.filter.contrast = function(amount) {
39708                     if (amount == null) {
39709                         amount = 1;
39710                     }
39711                     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>', {
39712                         amount: amount,
39713                         amount2: .5 - amount / 2
39714                     });
39715                 };
39716                 Snap.filter.contrast.toString = function() {
39717                     return this();
39718                 };
39719             });
39720
39721             return Snap;
39722         }));
39723     }, {
39724         "eve": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\eve\\eve.js"
39725     }],
39726     "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\vendor\\snapsvg.js": [function(require, module, exports) {
39727         'use strict';
39728
39729         var snapsvg = module.exports = require('snapsvg');
39730
39731         snapsvg.plugin(function(Snap, Element) {
39732
39733             /*
39734              * \ Element.children [ method ] * Returns array of all the children of the
39735              * element. = (array) array of Elements \
39736              */
39737             Element.prototype.children = function() {
39738                 var out = [],
39739                     ch = this.node.childNodes;
39740                 for (var i = 0, ii = ch.length; i < ii; i++) {
39741                     out[i] = new Snap(ch[i]);
39742                 }
39743                 return out;
39744             };
39745         });
39746
39747
39748         /**
39749          * @class ClassPlugin
39750          * 
39751          * Extends snapsvg with methods to add and remove classes
39752          */
39753         snapsvg.plugin(function(Snap, Element, Paper, global) {
39754
39755             function split(str) {
39756                 return str.split(/\s+/);
39757             }
39758
39759             function join(array) {
39760                 return array.join(' ');
39761             }
39762
39763             function getClasses(e) {
39764                 return split(e.attr('class') || '');
39765             }
39766
39767             function setClasses(e, classes) {
39768                 e.attr('class', join(classes));
39769             }
39770
39771             /**
39772              * @method snapsvg.Element#addClass
39773              * 
39774              * @example
39775              * 
39776              * e.attr('class', 'selector');
39777              * 
39778              * e.addClass('foo bar'); // adds classes foo and bar e.attr('class'); // ->
39779              * 'selector foo bar'
39780              * 
39781              * e.addClass('fooBar'); e.attr('class'); // -> 'selector foo bar fooBar'
39782              * 
39783              * @param {String}
39784              *            cls classes to be added to the element
39785              * 
39786              * @return {snapsvg.Element} the element (this)
39787              */
39788             Element.prototype.addClass = function(cls) {
39789                 var current = getClasses(this),
39790                     add = split(cls),
39791                     i, e;
39792
39793                 for (i = 0, e; !!(e = add[i]); i++) {
39794                     if (current.indexOf(e) === -1) {
39795                         current.push(e);
39796                     }
39797                 }
39798
39799                 setClasses(this, current);
39800
39801                 return this;
39802             };
39803
39804             /**
39805              * @method snapsvg.Element#hasClass
39806              * 
39807              * @param {String}
39808              *            cls the class to query for
39809              * @return {Boolean} returns true if the element has the given class
39810              */
39811             Element.prototype.hasClass = function(cls) {
39812                 if (!cls) {
39813                     throw new Error('[snapsvg] syntax: hasClass(clsStr)');
39814                 }
39815
39816                 return getClasses(this).indexOf(cls) !== -1;
39817             };
39818
39819             /**
39820              * @method snapsvg.Element#removeClass
39821              * 
39822              * @example
39823              * 
39824              * e.attr('class', 'foo bar');
39825              * 
39826              * e.removeClass('foo'); e.attr('class'); // -> 'bar'
39827              * 
39828              * e.removeClass('foo bar'); // removes classes foo and bar e.attr('class'); // -> ''
39829              * 
39830              * @param {String}
39831              *            cls classes to be removed from element
39832              * 
39833              * @return {snapsvg.Element} the element (this)
39834              */
39835             Element.prototype.removeClass = function(cls) {
39836                 var current = getClasses(this),
39837                     remove = split(cls),
39838                     i, e, idx;
39839
39840                 for (i = 0, e; !!(e = remove[i]); i++) {
39841                     idx = current.indexOf(e);
39842
39843                     if (idx !== -1) {
39844                         // remove element from array
39845                         current.splice(idx, 1);
39846                     }
39847                 }
39848
39849                 setClasses(this, current);
39850
39851                 return this;
39852             };
39853
39854         });
39855
39856         /**
39857          * @class TranslatePlugin
39858          * 
39859          * Extends snapsvg with methods to translate elements
39860          */
39861         snapsvg.plugin(function(Snap, Element, Paper, global) {
39862
39863             /*
39864              * @method snapsvg.Element#translate
39865              * 
39866              * @example
39867              * 
39868              * e.translate(10, 20);
39869              *  // sets transform matrix to translate(10, 20)
39870              * 
39871              * @param {Number} x translation @param {Number} y translation
39872              * 
39873              * @return {snapsvg.Element} the element (this)
39874              */
39875             Element.prototype.translate = function(x, y) {
39876                 var matrix = new Snap.Matrix();
39877                 matrix.translate(x, y);
39878                 return this.transform(matrix);
39879             };
39880         });
39881
39882
39883         /**
39884          * @class CreatePlugin
39885          * 
39886          * Create an svg element without attaching it to the dom
39887          */
39888         snapsvg.plugin(function(Snap) {
39889
39890             Snap.create = function(name, attrs) {
39891                 return Snap._.wrap(Snap._.$(name, attrs));
39892             };
39893         });
39894
39895
39896         /**
39897          * @class CreatSnapAtPlugin
39898          * 
39899          * Extends snap.svg with a method to create a SVG element at a specific position
39900          * in the DOM.
39901          */
39902         snapsvg.plugin(function(Snap, Element, Paper, global) {
39903
39904             /*
39905              * @method snapsvg.createSnapAt
39906              * 
39907              * @example
39908              * 
39909              * snapsvg.createSnapAt(parentNode, 200, 200);
39910              * 
39911              * @param {Number} width of svg @param {Number} height of svg @param
39912              * {Object} parentNode svg Element will be child of this
39913              * 
39914              * @return {snapsvg.Element} the newly created wrapped SVG element instance
39915              */
39916             Snap.createSnapAt = function(width, height, parentNode) {
39917
39918                 var svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
39919                 svg.setAttribute('width', width);
39920                 svg.setAttribute('height', height);
39921                 if (!parentNode) {
39922                     parentNode = document.body;
39923                 }
39924                 parentNode.appendChild(svg);
39925
39926                 return new Snap(svg);
39927             };
39928         });
39929     }, {
39930         "snapsvg": "\\bpmn-js-examples-master\\modeler\\node_modules\\diagram-js\\node_modules\\snapsvg\\dist\\snap.svg.js"
39931     }],
39932     "\\bpmn-js-examples-master\\modeler\\node_modules\\jquery\\dist\\jquery.js": [function(require, module, exports) {
39933         /*
39934          * ! jQuery JavaScript Library v2.1.4 http://jquery.com/
39935          * 
39936          * Includes Sizzle.js http://sizzlejs.com/
39937          * 
39938          * Copyright 2005, 2014 jQuery Foundation, Inc. and other contributors Released
39939          * under the MIT license http://jquery.org/license
39940          * 
39941          * Date: 2015-04-28T16:01Z
39942          */
39943
39944         (function(global, factory) {
39945
39946             if (typeof module === "object" && typeof module.exports === "object") {
39947                 // For CommonJS and CommonJS-like environments where a proper `window`
39948                 // is present, execute the factory and get jQuery.
39949                 // For environments that do not have a `window` with a `document`
39950                 // (such as Node.js), expose a factory as module.exports.
39951                 // This accentuates the need for the creation of a real `window`.
39952                 // e.g. var jQuery = require("jquery")(window);
39953                 // See ticket #14549 for more info.
39954                 module.exports = global.document ?
39955                     factory(global, true) :
39956                     function(w) {
39957                         if (!w.document) {
39958                             throw new Error("jQuery requires a window with a document");
39959                         }
39960                         return factory(w);
39961                     };
39962             } else {
39963                 factory(global);
39964             }
39965
39966             // Pass this if window is not defined yet
39967         }(typeof window !== "undefined" ? window : this, function(window, noGlobal) {
39968
39969             // Support: Firefox 18+
39970             // Can't be in strict mode, several libs including ASP.NET trace
39971             // the stack via arguments.caller.callee and Firefox dies if
39972             // you try to trace through "use strict" call chains. (#13335)
39973             //
39974
39975             var arr = [];
39976
39977             var slice = arr.slice;
39978
39979             var concat = arr.concat;
39980
39981             var push = arr.push;
39982
39983             var indexOf = arr.indexOf;
39984
39985             var class2type = {};
39986
39987             var toString = class2type.toString;
39988
39989             var hasOwn = class2type.hasOwnProperty;
39990
39991             var support = {};
39992
39993
39994
39995             var
39996             // Use the correct document accordingly with window argument (sandbox)
39997                 document = window.document,
39998
39999                 version = "2.1.4",
40000
40001                 // Define a local copy of jQuery
40002                 jQuery = function(selector, context) {
40003                     // The jQuery object is actually just the init constructor 'enhanced'
40004                     // Need init if jQuery is called (just allow error to be thrown if not
40005                     // included)
40006                     return new jQuery.fn.init(selector, context);
40007                 },
40008
40009                 // Support: Android<4.1
40010                 // Make sure we trim BOM and NBSP
40011                 rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,
40012
40013                 // Matches dashed string for camelizing
40014                 rmsPrefix = /^-ms-/,
40015                 rdashAlpha = /-([\da-z])/gi,
40016
40017                 // Used by jQuery.camelCase as callback to replace()
40018                 fcamelCase = function(all, letter) {
40019                     return letter.toUpperCase();
40020                 };
40021
40022             jQuery.fn = jQuery.prototype = {
40023                 // The current version of jQuery being used
40024                 jquery: version,
40025
40026                 constructor: jQuery,
40027
40028                 // Start with an empty selector
40029                 selector: "",
40030
40031                 // The default length of a jQuery object is 0
40032                 length: 0,
40033
40034                 toArray: function() {
40035                     return slice.call(this);
40036                 },
40037
40038                 // Get the Nth element in the matched element set OR
40039                 // Get the whole matched element set as a clean array
40040                 get: function(num) {
40041                     return num != null ?
40042
40043                         // Return just the one element from the set
40044                         (num < 0 ? this[num + this.length] : this[num]) :
40045
40046                         // Return all the elements in a clean array
40047                         slice.call(this);
40048                 },
40049
40050                 // Take an array of elements and push it onto the stack
40051                 // (returning the new matched element set)
40052                 pushStack: function(elems) {
40053
40054                     // Build a new jQuery matched element set
40055                     var ret = jQuery.merge(this.constructor(), elems);
40056
40057                     // Add the old object onto the stack (as a reference)
40058                     ret.prevObject = this;
40059                     ret.context = this.context;
40060
40061                     // Return the newly-formed element set
40062                     return ret;
40063                 },
40064
40065                 // Execute a callback for every element in the matched set.
40066                 // (You can seed the arguments with an array of args, but this is
40067                 // only used internally.)
40068                 each: function(callback, args) {
40069                     return jQuery.each(this, callback, args);
40070                 },
40071
40072                 map: function(callback) {
40073                     return this.pushStack(jQuery.map(this, function(elem, i) {
40074                         return callback.call(elem, i, elem);
40075                     }));
40076                 },
40077
40078                 slice: function() {
40079                     return this.pushStack(slice.apply(this, arguments));
40080                 },
40081
40082                 first: function() {
40083                     return this.eq(0);
40084                 },
40085
40086                 last: function() {
40087                     return this.eq(-1);
40088                 },
40089
40090                 eq: function(i) {
40091                     var len = this.length,
40092                         j = +i + (i < 0 ? len : 0);
40093                     return this.pushStack(j >= 0 && j < len ? [this[j]] : []);
40094                 },
40095
40096                 end: function() {
40097                     return this.prevObject || this.constructor(null);
40098                 },
40099
40100                 // For internal use only.
40101                 // Behaves like an Array's method, not like a jQuery method.
40102                 push: push,
40103                 sort: arr.sort,
40104                 splice: arr.splice
40105             };
40106
40107             jQuery.extend = jQuery.fn.extend = function() {
40108                 var options, name, src, copy, copyIsArray, clone,
40109                     target = arguments[0] || {},
40110                     i = 1,
40111                     length = arguments.length,
40112                     deep = false;
40113
40114                 // Handle a deep copy situation
40115                 if (typeof target === "boolean") {
40116                     deep = target;
40117
40118                     // Skip the boolean and the target
40119                     target = arguments[i] || {};
40120                     i++;
40121                 }
40122
40123                 // Handle case when target is a string or something (possible in deep copy)
40124                 if (typeof target !== "object" && !jQuery.isFunction(target)) {
40125                     target = {};
40126                 }
40127
40128                 // Extend jQuery itself if only one argument is passed
40129                 if (i === length) {
40130                     target = this;
40131                     i--;
40132                 }
40133
40134                 for (; i < length; i++) {
40135                     // Only deal with non-null/undefined values
40136                     if ((options = arguments[i]) != null) {
40137                         // Extend the base object
40138                         for (name in options) {
40139                             src = target[name];
40140                             copy = options[name];
40141
40142                             // Prevent never-ending loop
40143                             if (target === copy) {
40144                                 continue;
40145                             }
40146
40147                             // Recurse if we're merging plain objects or arrays
40148                             if (deep && copy && (jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)))) {
40149                                 if (copyIsArray) {
40150                                     copyIsArray = false;
40151                                     clone = src && jQuery.isArray(src) ? src : [];
40152
40153                                 } else {
40154                                     clone = src && jQuery.isPlainObject(src) ? src : {};
40155                                 }
40156
40157                                 // Never move original objects, clone them
40158                                 target[name] = jQuery.extend(deep, clone, copy);
40159
40160                                 // Don't bring in undefined values
40161                             } else if (copy !== undefined) {
40162                                 target[name] = copy;
40163                             }
40164                         }
40165                     }
40166                 }
40167
40168                 // Return the modified object
40169                 return target;
40170             };
40171
40172             jQuery.extend({
40173                 // Unique for each copy of jQuery on the page
40174                 expando: "jQuery" + (version + Math.random()).replace(/\D/g, ""),
40175
40176                 // Assume jQuery is ready without the ready module
40177                 isReady: true,
40178
40179                 error: function(msg) {
40180                     throw new Error(msg);
40181                 },
40182
40183                 noop: function() {},
40184
40185                 isFunction: function(obj) {
40186                     return jQuery.type(obj) === "function";
40187                 },
40188
40189                 isArray: Array.isArray,
40190
40191                 isWindow: function(obj) {
40192                     return obj != null && obj === obj.window;
40193                 },
40194
40195                 isNumeric: function(obj) {
40196                     // parseFloat NaNs numeric-cast false positives (null|true|false|"")
40197                     // ...but misinterprets leading-number strings, particularly hex
40198                     // literals ("0x...")
40199                     // subtraction forces infinities to NaN
40200                     // adding 1 corrects loss of precision from parseFloat (#15100)
40201                     return !jQuery.isArray(obj) && (obj - parseFloat(obj) + 1) >= 0;
40202                 },
40203
40204                 isPlainObject: function(obj) {
40205                     // Not plain objects:
40206                     // - Any object or value whose internal [[Class]] property is not
40207                     // "[object Object]"
40208                     // - DOM nodes
40209                     // - window
40210                     if (jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow(obj)) {
40211                         return false;
40212                     }
40213
40214                     if (obj.constructor &&
40215                         !hasOwn.call(obj.constructor.prototype, "isPrototypeOf")) {
40216                         return false;
40217                     }
40218
40219                     // If the function hasn't returned already, we're confident that
40220                     // |obj| is a plain object, created by {} or constructed with new Object
40221                     return true;
40222                 },
40223
40224                 isEmptyObject: function(obj) {
40225                     var name;
40226                     for (name in obj) {
40227                         return false;
40228                     }
40229                     return true;
40230                 },
40231
40232                 type: function(obj) {
40233                     if (obj == null) {
40234                         return obj + "";
40235                     }
40236                     // Support: Android<4.0, iOS<6 (functionish RegExp)
40237                     return typeof obj === "object" || typeof obj === "function" ?
40238                         class2type[toString.call(obj)] || "object" :
40239                         typeof obj;
40240                 },
40241
40242                 // Evaluates a script in a global context
40243                 globalEval: function(code) {
40244                     var script,
40245                         indirect = eval;
40246
40247                     code = jQuery.trim(code);
40248
40249                     if (code) {
40250                         // If the code includes a valid, prologue position
40251                         // strict mode pragma, execute code by injecting a
40252                         // script tag into the document.
40253                         if (code.indexOf("use strict") === 1) {
40254                             script = document.createElement("script");
40255                             script.text = code;
40256                             document.head.appendChild(script).parentNode.removeChild(script);
40257                         } else {
40258                             // Otherwise, avoid the DOM node creation, insertion
40259                             // and removal by using an indirect global eval
40260                             indirect(code);
40261                         }
40262                     }
40263                 },
40264
40265                 // Convert dashed to camelCase; used by the css and data modules
40266                 // Support: IE9-11+
40267                 // Microsoft forgot to hump their vendor prefix (#9572)
40268                 camelCase: function(string) {
40269                     return string.replace(rmsPrefix, "ms-").replace(rdashAlpha, fcamelCase);
40270                 },
40271
40272                 nodeName: function(elem, name) {
40273                     return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
40274                 },
40275
40276                 // args is for internal usage only
40277                 each: function(obj, callback, args) {
40278                     var value,
40279                         i = 0,
40280                         length = obj.length,
40281                         isArray = isArraylike(obj);
40282
40283                     if (args) {
40284                         if (isArray) {
40285                             for (; i < length; i++) {
40286                                 value = callback.apply(obj[i], args);
40287
40288                                 if (value === false) {
40289                                     break;
40290                                 }
40291                             }
40292                         } else {
40293                             for (i in obj) {
40294                                 value = callback.apply(obj[i], args);
40295
40296                                 if (value === false) {
40297                                     break;
40298                                 }
40299                             }
40300                         }
40301
40302                         // A special, fast, case for the most common use of each
40303                     } else {
40304                         if (isArray) {
40305                             for (; i < length; i++) {
40306                                 value = callback.call(obj[i], i, obj[i]);
40307
40308                                 if (value === false) {
40309                                     break;
40310                                 }
40311                             }
40312                         } else {
40313                             for (i in obj) {
40314                                 value = callback.call(obj[i], i, obj[i]);
40315
40316                                 if (value === false) {
40317                                     break;
40318                                 }
40319                             }
40320                         }
40321                     }
40322
40323                     return obj;
40324                 },
40325
40326                 // Support: Android<4.1
40327                 trim: function(text) {
40328                     return text == null ?
40329                         "" :
40330                         (text + "").replace(rtrim, "");
40331                 },
40332
40333                 // results is for internal usage only
40334                 makeArray: function(arr, results) {
40335                     var ret = results || [];
40336
40337                     if (arr != null) {
40338                         if (isArraylike(Object(arr))) {
40339                             jQuery.merge(ret,
40340                                 typeof arr === "string" ? [arr] : arr
40341                             );
40342                         } else {
40343                             push.call(ret, arr);
40344                         }
40345                     }
40346
40347                     return ret;
40348                 },
40349
40350                 inArray: function(elem, arr, i) {
40351                     return arr == null ? -1 : indexOf.call(arr, elem, i);
40352                 },
40353
40354                 merge: function(first, second) {
40355                     var len = +second.length,
40356                         j = 0,
40357                         i = first.length;
40358
40359                     for (; j < len; j++) {
40360                         first[i++] = second[j];
40361                     }
40362
40363                     first.length = i;
40364
40365                     return first;
40366                 },
40367
40368                 grep: function(elems, callback, invert) {
40369                     var callbackInverse,
40370                         matches = [],
40371                         i = 0,
40372                         length = elems.length,
40373                         callbackExpect = !invert;
40374
40375                     // Go through the array, only saving the items
40376                     // that pass the validator function
40377                     for (; i < length; i++) {
40378                         callbackInverse = !callback(elems[i], i);
40379                         if (callbackInverse !== callbackExpect) {
40380                             matches.push(elems[i]);
40381                         }
40382                     }
40383
40384                     return matches;
40385                 },
40386
40387                 // arg is for internal usage only
40388                 map: function(elems, callback, arg) {
40389                     var value,
40390                         i = 0,
40391                         length = elems.length,
40392                         isArray = isArraylike(elems),
40393                         ret = [];
40394
40395                     // Go through the array, translating each of the items to their new
40396                     // values
40397                     if (isArray) {
40398                         for (; i < length; i++) {
40399                             value = callback(elems[i], i, arg);
40400
40401                             if (value != null) {
40402                                 ret.push(value);
40403                             }
40404                         }
40405
40406                         // Go through every key on the object,
40407                     } else {
40408                         for (i in elems) {
40409                             value = callback(elems[i], i, arg);
40410
40411                             if (value != null) {
40412                                 ret.push(value);
40413                             }
40414                         }
40415                     }
40416
40417                     // Flatten any nested arrays
40418                     return concat.apply([], ret);
40419                 },
40420
40421                 // A global GUID counter for objects
40422                 guid: 1,
40423
40424                 // Bind a function to a context, optionally partially applying any
40425                 // arguments.
40426                 proxy: function(fn, context) {
40427                     var tmp, args, proxy;
40428
40429                     if (typeof context === "string") {
40430                         tmp = fn[context];
40431                         context = fn;
40432                         fn = tmp;
40433                     }
40434
40435                     // Quick check to determine if target is callable, in the spec
40436                     // this throws a TypeError, but we will just return undefined.
40437                     if (!jQuery.isFunction(fn)) {
40438                         return undefined;
40439                     }
40440
40441                     // Simulated bind
40442                     args = slice.call(arguments, 2);
40443                     proxy = function() {
40444                         return fn.apply(context || this, args.concat(slice.call(arguments)));
40445                     };
40446
40447                     // Set the guid of unique handler to the same of original handler, so it
40448                     // can be removed
40449                     proxy.guid = fn.guid = fn.guid || jQuery.guid++;
40450
40451                     return proxy;
40452                 },
40453
40454                 now: Date.now,
40455
40456                 // jQuery.support is not used in Core but other projects attach their
40457                 // properties to it so it needs to exist.
40458                 support: support
40459             });
40460
40461             // Populate the class2type map
40462             jQuery.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(i, name) {
40463                 class2type["[object " + name + "]"] = name.toLowerCase();
40464             });
40465
40466             function isArraylike(obj) {
40467
40468                 // Support: iOS 8.2 (not reproducible in simulator)
40469                 // `in` check used to prevent JIT error (gh-2145)
40470                 // hasOwn isn't used here due to false negatives
40471                 // regarding Nodelist length in IE
40472                 var length = "length" in obj && obj.length,
40473                     type = jQuery.type(obj);
40474
40475                 if (type === "function" || jQuery.isWindow(obj)) {
40476                     return false;
40477                 }
40478
40479                 if (obj.nodeType === 1 && length) {
40480                     return true;
40481                 }
40482
40483                 return type === "array" || length === 0 ||
40484                     typeof length === "number" && length > 0 && (length - 1) in obj;
40485             }
40486             var Sizzle =
40487                 /*
40488                  * ! Sizzle CSS Selector Engine v2.2.0-pre http://sizzlejs.com/
40489                  * 
40490                  * Copyright 2008, 2014 jQuery Foundation, Inc. and other contributors Released
40491                  * under the MIT license http://jquery.org/license
40492                  * 
40493                  * Date: 2014-12-16
40494                  */
40495                 (function(window) {
40496
40497                     var i,
40498                         support,
40499                         Expr,
40500                         getText,
40501                         isXML,
40502                         tokenize,
40503                         compile,
40504                         select,
40505                         outermostContext,
40506                         sortInput,
40507                         hasDuplicate,
40508
40509                         // Local document vars
40510                         setDocument,
40511                         document,
40512                         docElem,
40513                         documentIsHTML,
40514                         rbuggyQSA,
40515                         rbuggyMatches,
40516                         matches,
40517                         contains,
40518
40519                         // Instance-specific data
40520                         expando = "sizzle" + 1 * new Date(),
40521                         preferredDoc = window.document,
40522                         dirruns = 0,
40523                         done = 0,
40524                         classCache = createCache(),
40525                         tokenCache = createCache(),
40526                         compilerCache = createCache(),
40527                         sortOrder = function(a, b) {
40528                             if (a === b) {
40529                                 hasDuplicate = true;
40530                             }
40531                             return 0;
40532                         },
40533
40534                         // General-purpose constants
40535                         MAX_NEGATIVE = 1 << 31,
40536
40537                         // Instance methods
40538                         hasOwn = ({}).hasOwnProperty,
40539                         arr = [],
40540                         pop = arr.pop,
40541                         push_native = arr.push,
40542                         push = arr.push,
40543                         slice = arr.slice,
40544                         // Use a stripped-down indexOf as it's faster than native
40545                         // http://jsperf.com/thor-indexof-vs-for/5
40546                         indexOf = function(list, elem) {
40547                             var i = 0,
40548                                 len = list.length;
40549                             for (; i < len; i++) {
40550                                 if (list[i] === elem) {
40551                                     return i;
40552                                 }
40553                             }
40554                             return -1;
40555                         },
40556
40557                         booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",
40558
40559                         // Regular expressions
40560
40561                         // Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace
40562                         whitespace = "[\\x20\\t\\r\\n\\f]",
40563                         // http://www.w3.org/TR/css3-syntax/#characters
40564                         characterEncoding = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",
40565
40566                         // Loosely modeled on CSS identifier characters
40567                         // An unquoted value should be a CSS identifier
40568                         // http://www.w3.org/TR/css3-selectors/#attribute-selectors
40569                         // Proper syntax:
40570                         // http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier
40571                         identifier = characterEncoding.replace("w", "w#"),
40572
40573                         // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors
40574                         attributes = "\\[" + whitespace + "*(" + characterEncoding + ")(?:" + whitespace +
40575                         // Operator (capture 2)
40576                         "*([*^$|!~]?=)" + whitespace +
40577                         // "Attribute values must be CSS identifiers [capture 5] or strings
40578                         // [capture 3 or capture 4]"
40579                         "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace +
40580                         "*\\]",
40581
40582                         pseudos = ":(" + characterEncoding + ")(?:\\((" +
40583                         // To reduce the number of selectors needing tokenize in the preFilter,
40584                         // prefer arguments:
40585                         // 1. quoted (capture 3; capture 4 or capture 5)
40586                         "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" +
40587                         // 2. simple (capture 6)
40588                         "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" +
40589                         // 3. anything else (capture 2)
40590                         ".*" +
40591                         ")\\)|)",
40592
40593                         // Leading and non-escaped trailing whitespace, capturing some
40594                         // non-whitespace characters preceding the latter
40595                         rwhitespace = new RegExp(whitespace + "+", "g"),
40596                         rtrim = new RegExp("^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g"),
40597
40598                         rcomma = new RegExp("^" + whitespace + "*," + whitespace + "*"),
40599                         rcombinators = new RegExp("^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*"),
40600
40601                         rattributeQuotes = new RegExp("=" + whitespace + "*([^\\]'\"]*?)" + whitespace + "*\\]", "g"),
40602
40603                         rpseudo = new RegExp(pseudos),
40604                         ridentifier = new RegExp("^" + identifier + "$"),
40605
40606                         matchExpr = {
40607                             "ID": new RegExp("^#(" + characterEncoding + ")"),
40608                             "CLASS": new RegExp("^\\.(" + characterEncoding + ")"),
40609                             "TAG": new RegExp("^(" + characterEncoding.replace("w", "w*") + ")"),
40610                             "ATTR": new RegExp("^" + attributes),
40611                             "PSEUDO": new RegExp("^" + pseudos),
40612                             "CHILD": new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace +
40613                                 "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace +
40614                                 "*(\\d+)|))" + whitespace + "*\\)|)", "i"),
40615                             "bool": new RegExp("^(?:" + booleans + ")$", "i"),
40616                             // For use in libraries implementing .is()
40617                             // We use this for POS matching in `select`
40618                             "needsContext": new RegExp("^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" +
40619                                 whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i")
40620                         },
40621
40622                         rinputs = /^(?:input|select|textarea|button)$/i,
40623                         rheader = /^h\d$/i,
40624
40625                         rnative = /^[^{]+\{\s*\[native \w/,
40626
40627                         // Easily-parseable/retrievable ID or TAG or CLASS selectors
40628                         rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
40629
40630                         rsibling = /[+~]/,
40631                         rescape = /'|\\/g,
40632
40633                         // CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters
40634                         runescape = new RegExp("\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig"),
40635                         funescape = function(_, escaped, escapedWhitespace) {
40636                             var high = "0x" + escaped - 0x10000;
40637                             // NaN means non-codepoint
40638                             // Support: Firefox<24
40639                             // Workaround erroneous numeric interpretation of +"0x"
40640                             return high !== high || escapedWhitespace ?
40641                                 escaped :
40642                                 high < 0 ?
40643                                 // BMP codepoint
40644                                 String.fromCharCode(high + 0x10000) :
40645                                 // Supplemental Plane codepoint (surrogate pair)
40646                                 String.fromCharCode(high >> 10 | 0xD800, high & 0x3FF | 0xDC00);
40647                         },
40648
40649                         // Used for iframes
40650                         // See setDocument()
40651                         // Removing the function wrapper causes a "Permission Denied"
40652                         // error in IE
40653                         unloadHandler = function() {
40654                             setDocument();
40655                         };
40656
40657                     // Optimize for push.apply( _, NodeList )
40658                     try {
40659                         push.apply(
40660                             (arr = slice.call(preferredDoc.childNodes)),
40661                             preferredDoc.childNodes
40662                         );
40663                         // Support: Android<4.0
40664                         // Detect silently failing push.apply
40665                         arr[preferredDoc.childNodes.length].nodeType;
40666                     } catch (e) {
40667                         push = {
40668                             apply: arr.length ?
40669
40670                                 // Leverage slice if possible
40671                                 function(target, els) {
40672                                     push_native.apply(target, slice.call(els));
40673                                 } :
40674
40675                                 // Support: IE<9
40676                                 // Otherwise append directly
40677                                 function(target, els) {
40678                                     var j = target.length,
40679                                         i = 0;
40680                                     // Can't trust NodeList.length
40681                                     while ((target[j++] = els[i++])) {}
40682                                     target.length = j - 1;
40683                                 }
40684                         };
40685                     }
40686
40687                     function Sizzle(selector, context, results, seed) {
40688                         var match, elem, m, nodeType,
40689                             // QSA vars
40690                             i, groups, old, nid, newContext, newSelector;
40691
40692                         if ((context ? context.ownerDocument || context : preferredDoc) !== document) {
40693                             setDocument(context);
40694                         }
40695
40696                         context = context || document;
40697                         results = results || [];
40698                         nodeType = context.nodeType;
40699
40700                         if (typeof selector !== "string" || !selector ||
40701                             nodeType !== 1 && nodeType !== 9 && nodeType !== 11) {
40702
40703                             return results;
40704                         }
40705
40706                         if (!seed && documentIsHTML) {
40707
40708                             // Try to shortcut find operations when possible (e.g., not under
40709                             // DocumentFragment)
40710                             if (nodeType !== 11 && (match = rquickExpr.exec(selector))) {
40711                                 // Speed-up: Sizzle("#ID")
40712                                 if ((m = match[1])) {
40713                                     if (nodeType === 9) {
40714                                         elem = context.getElementById(m);
40715                                         // Check parentNode to catch when Blackberry 4.6 returns
40716                                         // nodes that are no longer in the document (jQuery #6963)
40717                                         if (elem && elem.parentNode) {
40718                                             // Handle the case where IE, Opera, and Webkit return
40719                                             // items
40720                                             // by name instead of ID
40721                                             if (elem.id === m) {
40722                                                 results.push(elem);
40723                                                 return results;
40724                                             }
40725                                         } else {
40726                                             return results;
40727                                         }
40728                                     } else {
40729                                         // Context is not a document
40730                                         if (context.ownerDocument && (elem = context.ownerDocument.getElementById(m)) &&
40731                                             contains(context, elem) && elem.id === m) {
40732                                             results.push(elem);
40733                                             return results;
40734                                         }
40735                                     }
40736
40737                                     // Speed-up: Sizzle("TAG")
40738                                 } else if (match[2]) {
40739                                     push.apply(results, context.getElementsByTagName(selector));
40740                                     return results;
40741
40742                                     // Speed-up: Sizzle(".CLASS")
40743                                 } else if ((m = match[3]) && support.getElementsByClassName) {
40744                                     push.apply(results, context.getElementsByClassName(m));
40745                                     return results;
40746                                 }
40747                             }
40748
40749                             // QSA path
40750                             if (support.qsa && (!rbuggyQSA || !rbuggyQSA.test(selector))) {
40751                                 nid = old = expando;
40752                                 newContext = context;
40753                                 newSelector = nodeType !== 1 && selector;
40754
40755                                 // qSA works strangely on Element-rooted queries
40756                                 // We can work around this by specifying an extra ID on the root
40757                                 // and working up from there (Thanks to Andrew Dupont for the
40758                                 // technique)
40759                                 // IE 8 doesn't work on object elements
40760                                 if (nodeType === 1 && context.nodeName.toLowerCase() !== "object") {
40761                                     groups = tokenize(selector);
40762
40763                                     if ((old = context.getAttribute("id"))) {
40764                                         nid = old.replace(rescape, "\\$&");
40765                                     } else {
40766                                         context.setAttribute("id", nid);
40767                                     }
40768                                     nid = "[id='" + nid + "'] ";
40769
40770                                     i = groups.length;
40771                                     while (i--) {
40772                                         groups[i] = nid + toSelector(groups[i]);
40773                                     }
40774                                     newContext = rsibling.test(selector) && testContext(context.parentNode) || context;
40775                                     newSelector = groups.join(",");
40776                                 }
40777
40778                                 if (newSelector) {
40779                                     try {
40780                                         push.apply(results,
40781                                             newContext.querySelectorAll(newSelector)
40782                                         );
40783                                         return results;
40784                                     } catch (qsaError) {} finally {
40785                                         if (!old) {
40786                                             context.removeAttribute("id");
40787                                         }
40788                                     }
40789                                 }
40790                             }
40791                         }
40792
40793                         // All others
40794                         return select(selector.replace(rtrim, "$1"), context, results, seed);
40795                     }
40796
40797                     /**
40798                      * Create key-value caches of limited size
40799                      * 
40800                      * @returns {Function(string, Object)} Returns the Object data after storing it
40801                      *          on itself with property name the (space-suffixed) string and (if the
40802                      *          cache is larger than Expr.cacheLength) deleting the oldest entry
40803                      */
40804                     function createCache() {
40805                         var keys = [];
40806
40807                         function cache(key, value) {
40808                             // Use (key + " ") to avoid collision with native prototype properties
40809                             // (see Issue #157)
40810                             if (keys.push(key + " ") > Expr.cacheLength) {
40811                                 // Only keep the most recent entries
40812                                 delete cache[keys.shift()];
40813                             }
40814                             return (cache[key + " "] = value);
40815                         }
40816                         return cache;
40817                     }
40818
40819                     /**
40820                      * Mark a function for special use by Sizzle
40821                      * 
40822                      * @param {Function}
40823                      *            fn The function to mark
40824                      */
40825                     function markFunction(fn) {
40826                         fn[expando] = true;
40827                         return fn;
40828                     }
40829
40830                     /**
40831                      * Support testing using an element
40832                      * 
40833                      * @param {Function}
40834                      *            fn Passed the created div and expects a boolean result
40835                      */
40836                     function assert(fn) {
40837                         var div = document.createElement("div");
40838
40839                         try {
40840                             return !!fn(div);
40841                         } catch (e) {
40842                             return false;
40843                         } finally {
40844                             // Remove from its parent by default
40845                             if (div.parentNode) {
40846                                 div.parentNode.removeChild(div);
40847                             }
40848                             // release memory in IE
40849                             div = null;
40850                         }
40851                     }
40852
40853                     /**
40854                      * Adds the same handler for all of the specified attrs
40855                      * 
40856                      * @param {String}
40857                      *            attrs Pipe-separated list of attributes
40858                      * @param {Function}
40859                      *            handler The method that will be applied
40860                      */
40861                     function addHandle(attrs, handler) {
40862                         var arr = attrs.split("|"),
40863                             i = attrs.length;
40864
40865                         while (i--) {
40866                             Expr.attrHandle[arr[i]] = handler;
40867                         }
40868                     }
40869
40870                     /**
40871                      * Checks document order of two siblings
40872                      * 
40873                      * @param {Element}
40874                      *            a
40875                      * @param {Element}
40876                      *            b
40877                      * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a
40878                      *          follows b
40879                      */
40880                     function siblingCheck(a, b) {
40881                         var cur = b && a,
40882                             diff = cur && a.nodeType === 1 && b.nodeType === 1 &&
40883                             (~b.sourceIndex || MAX_NEGATIVE) -
40884                             (~a.sourceIndex || MAX_NEGATIVE);
40885
40886                         // Use IE sourceIndex if available on both nodes
40887                         if (diff) {
40888                             return diff;
40889                         }
40890
40891                         // Check if b follows a
40892                         if (cur) {
40893                             while ((cur = cur.nextSibling)) {
40894                                 if (cur === b) {
40895                                     return -1;
40896                                 }
40897                             }
40898                         }
40899
40900                         return a ? 1 : -1;
40901                     }
40902
40903                     /**
40904                      * Returns a function to use in pseudos for input types
40905                      * 
40906                      * @param {String}
40907                      *            type
40908                      */
40909                     function createInputPseudo(type) {
40910                         return function(elem) {
40911                             var name = elem.nodeName.toLowerCase();
40912                             return name === "input" && elem.type === type;
40913                         };
40914                     }
40915
40916                     /**
40917                      * Returns a function to use in pseudos for buttons
40918                      * 
40919                      * @param {String}
40920                      *            type
40921                      */
40922                     function createButtonPseudo(type) {
40923                         return function(elem) {
40924                             var name = elem.nodeName.toLowerCase();
40925                             return (name === "input" || name === "button") && elem.type === type;
40926                         };
40927                     }
40928
40929                     /**
40930                      * Returns a function to use in pseudos for positionals
40931                      * 
40932                      * @param {Function}
40933                      *            fn
40934                      */
40935                     function createPositionalPseudo(fn) {
40936                         return markFunction(function(argument) {
40937                             argument = +argument;
40938                             return markFunction(function(seed, matches) {
40939                                 var j,
40940                                     matchIndexes = fn([], seed.length, argument),
40941                                     i = matchIndexes.length;
40942
40943                                 // Match elements found at the specified indexes
40944                                 while (i--) {
40945                                     if (seed[(j = matchIndexes[i])]) {
40946                                         seed[j] = !(matches[j] = seed[j]);
40947                                     }
40948                                 }
40949                             });
40950                         });
40951                     }
40952
40953                     /**
40954                      * Checks a node for validity as a Sizzle context
40955                      * 
40956                      * @param {Element|Object=}
40957                      *            context
40958                      * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a
40959                      *          falsy value
40960                      */
40961                     function testContext(context) {
40962                         return context && typeof context.getElementsByTagName !== "undefined" && context;
40963                     }
40964
40965                     // Expose support vars for convenience
40966                     support = Sizzle.support = {};
40967
40968                     /**
40969                      * Detects XML nodes
40970                      * 
40971                      * @param {Element|Object}
40972                      *            elem An element or a document
40973                      * @returns {Boolean} True iff elem is a non-HTML XML node
40974                      */
40975                     isXML = Sizzle.isXML = function(elem) {
40976                         // documentElement is verified for cases where it doesn't yet exist
40977                         // (such as loading iframes in IE - #4833)
40978                         var documentElement = elem && (elem.ownerDocument || elem).documentElement;
40979                         return documentElement ? documentElement.nodeName !== "HTML" : false;
40980                     };
40981
40982                     /**
40983                      * Sets document-related variables once based on the current document
40984                      * 
40985                      * @param {Element|Object}
40986                      *            [doc] An element or document object to use to set the document
40987                      * @returns {Object} Returns the current document
40988                      */
40989                     setDocument = Sizzle.setDocument = function(node) {
40990                         var hasCompare, parent,
40991                             doc = node ? node.ownerDocument || node : preferredDoc;
40992
40993                         // If no document and documentElement is available, return
40994                         if (doc === document || doc.nodeType !== 9 || !doc.documentElement) {
40995                             return document;
40996                         }
40997
40998                         // Set our document
40999                         document = doc;
41000                         docElem = doc.documentElement;
41001                         parent = doc.defaultView;
41002
41003                         // Support: IE>8
41004                         // If iframe document is assigned to "document" variable and if iframe has
41005                         // been reloaded,
41006                         // IE will throw "permission denied" error when accessing "document"
41007                         // variable, see jQuery #13936
41008                         // IE6-8 do not support the defaultView property so parent will be undefined
41009                         if (parent && parent !== parent.top) {
41010                             // IE11 does not have attachEvent, so all must suffer
41011                             if (parent.addEventListener) {
41012                                 parent.addEventListener("unload", unloadHandler, false);
41013                             } else if (parent.attachEvent) {
41014                                 parent.attachEvent("onunload", unloadHandler);
41015                             }
41016                         }
41017
41018                         /*
41019                          * Support tests
41020                          * ----------------------------------------------------------------------
41021                          */
41022                         documentIsHTML = !isXML(doc);
41023
41024                         /*
41025                          * Attributes
41026                          * ----------------------------------------------------------------------
41027                          */
41028
41029                         // Support: IE<8
41030                         // Verify that getAttribute really returns attributes and not properties
41031                         // (excepting IE8 booleans)
41032                         support.attributes = assert(function(div) {
41033                             div.className = "i";
41034                             return !div.getAttribute("className");
41035                         });
41036
41037                         /***************************************************************************
41038                          * getElement(s)By
41039                          * ----------------------------------------------------------------------
41040                          */
41041
41042                         // Check if getElementsByTagName("*") returns only elements
41043                         support.getElementsByTagName = assert(function(div) {
41044                             div.appendChild(doc.createComment(""));
41045                             return !div.getElementsByTagName("*").length;
41046                         });
41047
41048                         // Support: IE<9
41049                         support.getElementsByClassName = rnative.test(doc.getElementsByClassName);
41050
41051                         // Support: IE<10
41052                         // Check if getElementById returns elements by name
41053                         // The broken getElementById methods don't pick up programatically-set
41054                         // names,
41055                         // so use a roundabout getElementsByName test
41056                         support.getById = assert(function(div) {
41057                             docElem.appendChild(div).id = expando;
41058                             return !doc.getElementsByName || !doc.getElementsByName(expando).length;
41059                         });
41060
41061                         // ID find and filter
41062                         if (support.getById) {
41063                             Expr.find["ID"] = function(id, context) {
41064                                 if (typeof context.getElementById !== "undefined" && documentIsHTML) {
41065                                     var m = context.getElementById(id);
41066                                     // Check parentNode to catch when Blackberry 4.6 returns
41067                                     // nodes that are no longer in the document #6963
41068                                     return m && m.parentNode ? [m] : [];
41069                                 }
41070                             };
41071                             Expr.filter["ID"] = function(id) {
41072                                 var attrId = id.replace(runescape, funescape);
41073                                 return function(elem) {
41074                                     return elem.getAttribute("id") === attrId;
41075                                 };
41076                             };
41077                         } else {
41078                             // Support: IE6/7
41079                             // getElementById is not reliable as a find shortcut
41080                             delete Expr.find["ID"];
41081
41082                             Expr.filter["ID"] = function(id) {
41083                                 var attrId = id.replace(runescape, funescape);
41084                                 return function(elem) {
41085                                     var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id");
41086                                     return node && node.value === attrId;
41087                                 };
41088                             };
41089                         }
41090
41091                         // Tag
41092                         Expr.find["TAG"] = support.getElementsByTagName ?
41093                             function(tag, context) {
41094                                 if (typeof context.getElementsByTagName !== "undefined") {
41095                                     return context.getElementsByTagName(tag);
41096
41097                                     // DocumentFragment nodes don't have gEBTN
41098                                 } else if (support.qsa) {
41099                                     return context.querySelectorAll(tag);
41100                                 }
41101                             } :
41102
41103                             function(tag, context) {
41104                                 var elem,
41105                                     tmp = [],
41106                                     i = 0,
41107                                     // By happy coincidence, a (broken) gEBTN appears on
41108                                     // DocumentFragment nodes too
41109                                     results = context.getElementsByTagName(tag);
41110
41111                                 // Filter out possible comments
41112                                 if (tag === "*") {
41113                                     while ((elem = results[i++])) {
41114                                         if (elem.nodeType === 1) {
41115                                             tmp.push(elem);
41116                                         }
41117                                     }
41118
41119                                     return tmp;
41120                                 }
41121                                 return results;
41122                             };
41123
41124                         // Class
41125                         Expr.find["CLASS"] = support.getElementsByClassName && function(className, context) {
41126                             if (documentIsHTML) {
41127                                 return context.getElementsByClassName(className);
41128                             }
41129                         };
41130
41131                         /*
41132                          * QSA/matchesSelector
41133                          * ----------------------------------------------------------------------
41134                          */
41135
41136                         // QSA and matchesSelector support
41137
41138                         // matchesSelector(:active) reports false when true (IE9/Opera 11.5)
41139                         rbuggyMatches = [];
41140
41141                         // qSa(:focus) reports false when true (Chrome 21)
41142                         // We allow this because of a bug in IE8/9 that throws an error
41143                         // whenever `document.activeElement` is accessed on an iframe
41144                         // So, we allow :focus to pass through QSA all the time to avoid the IE
41145                         // error
41146                         // See http://bugs.jquery.com/ticket/13378
41147                         rbuggyQSA = [];
41148
41149                         if ((support.qsa = rnative.test(doc.querySelectorAll))) {
41150                             // Build QSA regex
41151                             // Regex strategy adopted from Diego Perini
41152                             assert(function(div) {
41153                                 // Select is set to empty string on purpose
41154                                 // This is to test IE's treatment of not explicitly
41155                                 // setting a boolean content attribute,
41156                                 // since its presence should be enough
41157                                 // http://bugs.jquery.com/ticket/12359
41158                                 docElem.appendChild(div).innerHTML = "<a id='" + expando + "'></a>" +
41159                                     "<select id='" + expando + "-\f]' msallowcapture=''>" +
41160                                     "<option selected=''></option></select>";
41161
41162                                 // Support: IE8, Opera 11-12.16
41163                                 // Nothing should be selected when empty strings follow ^= or $= or
41164                                 // *=
41165                                 // The test attribute must be unknown in Opera but "safe" for WinRT
41166                                 // http://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section
41167                                 if (div.querySelectorAll("[msallowcapture^='']").length) {
41168                                     rbuggyQSA.push("[*^$]=" + whitespace + "*(?:''|\"\")");
41169                                 }
41170
41171                                 // Support: IE8
41172                                 // Boolean attributes and "value" are not treated correctly
41173                                 if (!div.querySelectorAll("[selected]").length) {
41174                                     rbuggyQSA.push("\\[" + whitespace + "*(?:value|" + booleans + ")");
41175                                 }
41176
41177                                 // Support: Chrome<29, Android<4.2+, Safari<7.0+, iOS<7.0+,
41178                                 // PhantomJS<1.9.7+
41179                                 if (!div.querySelectorAll("[id~=" + expando + "-]").length) {
41180                                     rbuggyQSA.push("~=");
41181                                 }
41182
41183                                 // Webkit/Opera - :checked should return selected option elements
41184                                 // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
41185                                 // IE8 throws error here and will not see later tests
41186                                 if (!div.querySelectorAll(":checked").length) {
41187                                     rbuggyQSA.push(":checked");
41188                                 }
41189
41190                                 // Support: Safari 8+, iOS 8+
41191                                 // https://bugs.webkit.org/show_bug.cgi?id=136851
41192                                 // In-page `selector#id sibing-combinator selector` fails
41193                                 if (!div.querySelectorAll("a#" + expando + "+*").length) {
41194                                     rbuggyQSA.push(".#.+[+~]");
41195                                 }
41196                             });
41197
41198                             assert(function(div) {
41199                                 // Support: Windows 8 Native Apps
41200                                 // The type and name attributes are restricted during .innerHTML
41201                                 // assignment
41202                                 var input = doc.createElement("input");
41203                                 input.setAttribute("type", "hidden");
41204                                 div.appendChild(input).setAttribute("name", "D");
41205
41206                                 // Support: IE8
41207                                 // Enforce case-sensitivity of name attribute
41208                                 if (div.querySelectorAll("[name=d]").length) {
41209                                     rbuggyQSA.push("name" + whitespace + "*[*^$|!~]?=");
41210                                 }
41211
41212                                 // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements
41213                                 // are still enabled)
41214                                 // IE8 throws error here and will not see later tests
41215                                 if (!div.querySelectorAll(":enabled").length) {
41216                                     rbuggyQSA.push(":enabled", ":disabled");
41217                                 }
41218
41219                                 // Opera 10-11 does not throw on post-comma invalid pseudos
41220                                 div.querySelectorAll("*,:x");
41221                                 rbuggyQSA.push(",.*:");
41222                             });
41223                         }
41224
41225                         if ((support.matchesSelector = rnative.test((matches = docElem.matches ||
41226                                 docElem.webkitMatchesSelector ||
41227                                 docElem.mozMatchesSelector ||
41228                                 docElem.oMatchesSelector ||
41229                                 docElem.msMatchesSelector)))) {
41230
41231                             assert(function(div) {
41232                                 // Check to see if it's possible to do matchesSelector
41233                                 // on a disconnected node (IE 9)
41234                                 support.disconnectedMatch = matches.call(div, "div");
41235
41236                                 // This should fail with an exception
41237                                 // Gecko does not error, returns false instead
41238                                 matches.call(div, "[s!='']:x");
41239                                 rbuggyMatches.push("!=", pseudos);
41240                             });
41241                         }
41242
41243                         rbuggyQSA = rbuggyQSA.length && new RegExp(rbuggyQSA.join("|"));
41244                         rbuggyMatches = rbuggyMatches.length && new RegExp(rbuggyMatches.join("|"));
41245
41246                         /*
41247                          * Contains
41248                          * ----------------------------------------------------------------------
41249                          */
41250                         hasCompare = rnative.test(docElem.compareDocumentPosition);
41251
41252                         // Element contains another
41253                         // Purposefully does not implement inclusive descendent
41254                         // As in, an element does not contain itself
41255                         contains = hasCompare || rnative.test(docElem.contains) ?
41256                             function(a, b) {
41257                                 var adown = a.nodeType === 9 ? a.documentElement : a,
41258                                     bup = b && b.parentNode;
41259                                 return a === bup || !!(bup && bup.nodeType === 1 && (
41260                                     adown.contains ?
41261                                     adown.contains(bup) :
41262                                     a.compareDocumentPosition && a.compareDocumentPosition(bup) & 16
41263                                 ));
41264                             } :
41265                             function(a, b) {
41266                                 if (b) {
41267                                     while ((b = b.parentNode)) {
41268                                         if (b === a) {
41269                                             return true;
41270                                         }
41271                                     }
41272                                 }
41273                                 return false;
41274                             };
41275
41276                         /*
41277                          * Sorting
41278                          * ----------------------------------------------------------------------
41279                          */
41280
41281                         // Document order sorting
41282                         sortOrder = hasCompare ?
41283                             function(a, b) {
41284
41285                                 // Flag for duplicate removal
41286                                 if (a === b) {
41287                                     hasDuplicate = true;
41288                                     return 0;
41289                                 }
41290
41291                                 // Sort on method existence if only one input has
41292                                 // compareDocumentPosition
41293                                 var compare = !a.compareDocumentPosition - !b.compareDocumentPosition;
41294                                 if (compare) {
41295                                     return compare;
41296                                 }
41297
41298                                 // Calculate position if both inputs belong to the same document
41299                                 compare = (a.ownerDocument || a) === (b.ownerDocument || b) ?
41300                                     a.compareDocumentPosition(b) :
41301
41302                                     // Otherwise we know they are disconnected
41303                                     1;
41304
41305                                 // Disconnected nodes
41306                                 if (compare & 1 ||
41307                                     (!support.sortDetached && b.compareDocumentPosition(a) === compare)) {
41308
41309                                     // Choose the first element that is related to our preferred
41310                                     // document
41311                                     if (a === doc || a.ownerDocument === preferredDoc && contains(preferredDoc, a)) {
41312                                         return -1;
41313                                     }
41314                                     if (b === doc || b.ownerDocument === preferredDoc && contains(preferredDoc, b)) {
41315                                         return 1;
41316                                     }
41317
41318                                     // Maintain original order
41319                                     return sortInput ?
41320                                         (indexOf(sortInput, a) - indexOf(sortInput, b)) :
41321                                         0;
41322                                 }
41323
41324                                 return compare & 4 ? -1 : 1;
41325                             } :
41326                             function(a, b) {
41327                                 // Exit early if the nodes are identical
41328                                 if (a === b) {
41329                                     hasDuplicate = true;
41330                                     return 0;
41331                                 }
41332
41333                                 var cur,
41334                                     i = 0,
41335                                     aup = a.parentNode,
41336                                     bup = b.parentNode,
41337                                     ap = [a],
41338                                     bp = [b];
41339
41340                                 // Parentless nodes are either documents or disconnected
41341                                 if (!aup || !bup) {
41342                                     return a === doc ? -1 :
41343                                         b === doc ? 1 :
41344                                         aup ? -1 :
41345                                         bup ? 1 :
41346                                         sortInput ?
41347                                         (indexOf(sortInput, a) - indexOf(sortInput, b)) :
41348                                         0;
41349
41350                                     // If the nodes are siblings, we can do a quick check
41351                                 } else if (aup === bup) {
41352                                     return siblingCheck(a, b);
41353                                 }
41354
41355                                 // Otherwise we need full lists of their ancestors for comparison
41356                                 cur = a;
41357                                 while ((cur = cur.parentNode)) {
41358                                     ap.unshift(cur);
41359                                 }
41360                                 cur = b;
41361                                 while ((cur = cur.parentNode)) {
41362                                     bp.unshift(cur);
41363                                 }
41364
41365                                 // Walk down the tree looking for a discrepancy
41366                                 while (ap[i] === bp[i]) {
41367                                     i++;
41368                                 }
41369
41370                                 return i ?
41371                                     // Do a sibling check if the nodes have a common ancestor
41372                                     siblingCheck(ap[i], bp[i]) :
41373
41374                                     // Otherwise nodes in our document sort first
41375                                     ap[i] === preferredDoc ? -1 :
41376                                     bp[i] === preferredDoc ? 1 :
41377                                     0;
41378                             };
41379
41380                         return doc;
41381                     };
41382
41383                     Sizzle.matches = function(expr, elements) {
41384                         return Sizzle(expr, null, null, elements);
41385                     };
41386
41387                     Sizzle.matchesSelector = function(elem, expr) {
41388                         // Set document vars if needed
41389                         if ((elem.ownerDocument || elem) !== document) {
41390                             setDocument(elem);
41391                         }
41392
41393                         // Make sure that attribute selectors are quoted
41394                         expr = expr.replace(rattributeQuotes, "='$1']");
41395
41396                         if (support.matchesSelector && documentIsHTML &&
41397                             (!rbuggyMatches || !rbuggyMatches.test(expr)) &&
41398                             (!rbuggyQSA || !rbuggyQSA.test(expr))) {
41399
41400                             try {
41401                                 var ret = matches.call(elem, expr);
41402
41403                                 // IE 9's matchesSelector returns false on disconnected nodes
41404                                 if (ret || support.disconnectedMatch ||
41405                                     // As well, disconnected nodes are said to be in a document
41406                                     // fragment in IE 9
41407                                     elem.document && elem.document.nodeType !== 11) {
41408                                     return ret;
41409                                 }
41410                             } catch (e) {}
41411                         }
41412
41413                         return Sizzle(expr, document, null, [elem]).length > 0;
41414                     };
41415
41416                     Sizzle.contains = function(context, elem) {
41417                         // Set document vars if needed
41418                         if ((context.ownerDocument || context) !== document) {
41419                             setDocument(context);
41420                         }
41421                         return contains(context, elem);
41422                     };
41423
41424                     Sizzle.attr = function(elem, name) {
41425                         // Set document vars if needed
41426                         if ((elem.ownerDocument || elem) !== document) {
41427                             setDocument(elem);
41428                         }
41429
41430                         var fn = Expr.attrHandle[name.toLowerCase()],
41431                             // Don't get fooled by Object.prototype properties (jQuery #13807)
41432                             val = fn && hasOwn.call(Expr.attrHandle, name.toLowerCase()) ?
41433                             fn(elem, name, !documentIsHTML) :
41434                             undefined;
41435
41436                         return val !== undefined ?
41437                             val :
41438                             support.attributes || !documentIsHTML ?
41439                             elem.getAttribute(name) :
41440                             (val = elem.getAttributeNode(name)) && val.specified ?
41441                             val.value :
41442                             null;
41443                     };
41444
41445                     Sizzle.error = function(msg) {
41446                         throw new Error("Syntax error, unrecognized expression: " + msg);
41447                     };
41448
41449                     /**
41450                      * Document sorting and removing duplicates
41451                      * 
41452                      * @param {ArrayLike}
41453                      *            results
41454                      */
41455                     Sizzle.uniqueSort = function(results) {
41456                         var elem,
41457                             duplicates = [],
41458                             j = 0,
41459                             i = 0;
41460
41461                         // Unless we *know* we can detect duplicates, assume their presence
41462                         hasDuplicate = !support.detectDuplicates;
41463                         sortInput = !support.sortStable && results.slice(0);
41464                         results.sort(sortOrder);
41465
41466                         if (hasDuplicate) {
41467                             while ((elem = results[i++])) {
41468                                 if (elem === results[i]) {
41469                                     j = duplicates.push(i);
41470                                 }
41471                             }
41472                             while (j--) {
41473                                 results.splice(duplicates[j], 1);
41474                             }
41475                         }
41476
41477                         // Clear input after sorting to release objects
41478                         // See https://github.com/jquery/sizzle/pull/225
41479                         sortInput = null;
41480
41481                         return results;
41482                     };
41483
41484                     /**
41485                      * Utility function for retrieving the text value of an array of DOM nodes
41486                      * 
41487                      * @param {Array|Element}
41488                      *            elem
41489                      */
41490                     getText = Sizzle.getText = function(elem) {
41491                         var node,
41492                             ret = "",
41493                             i = 0,
41494                             nodeType = elem.nodeType;
41495
41496                         if (!nodeType) {
41497                             // If no nodeType, this is expected to be an array
41498                             while ((node = elem[i++])) {
41499                                 // Do not traverse comment nodes
41500                                 ret += getText(node);
41501                             }
41502                         } else if (nodeType === 1 || nodeType === 9 || nodeType === 11) {
41503                             // Use textContent for elements
41504                             // innerText usage removed for consistency of new lines (jQuery #11153)
41505                             if (typeof elem.textContent === "string") {
41506                                 return elem.textContent;
41507                             } else {
41508                                 // Traverse its children
41509                                 for (elem = elem.firstChild; elem; elem = elem.nextSibling) {
41510                                     ret += getText(elem);
41511                                 }
41512                             }
41513                         } else if (nodeType === 3 || nodeType === 4) {
41514                             return elem.nodeValue;
41515                         }
41516                         // Do not include comment or processing instruction nodes
41517
41518                         return ret;
41519                     };
41520
41521                     Expr = Sizzle.selectors = {
41522
41523                         // Can be adjusted by the user
41524                         cacheLength: 50,
41525
41526                         createPseudo: markFunction,
41527
41528                         match: matchExpr,
41529
41530                         attrHandle: {},
41531
41532                         find: {},
41533
41534                         relative: {
41535                             ">": {
41536                                 dir: "parentNode",
41537                                 first: true
41538                             },
41539                             " ": {
41540                                 dir: "parentNode"
41541                             },
41542                             "+": {
41543                                 dir: "previousSibling",
41544                                 first: true
41545                             },
41546                             "~": {
41547                                 dir: "previousSibling"
41548                             }
41549                         },
41550
41551                         preFilter: {
41552                             "ATTR": function(match) {
41553                                 match[1] = match[1].replace(runescape, funescape);
41554
41555                                 // Move the given value to match[3] whether quoted or unquoted
41556                                 match[3] = (match[3] || match[4] || match[5] || "").replace(runescape, funescape);
41557
41558                                 if (match[2] === "~=") {
41559                                     match[3] = " " + match[3] + " ";
41560                                 }
41561
41562                                 return match.slice(0, 4);
41563                             },
41564
41565                             "CHILD": function(match) {
41566                                 /*
41567                                  * matches from matchExpr["CHILD"] 1 type (only|nth|...) 2 what
41568                                  * (child|of-type) 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...) 4
41569                                  * xn-component of xn+y argument ([+-]?\d*n|) 5 sign of xn-component
41570                                  * 6 x of xn-component 7 sign of y-component 8 y of y-component
41571                                  */
41572                                 match[1] = match[1].toLowerCase();
41573
41574                                 if (match[1].slice(0, 3) === "nth") {
41575                                     // nth-* requires argument
41576                                     if (!match[3]) {
41577                                         Sizzle.error(match[0]);
41578                                     }
41579
41580                                     // numeric x and y parameters for Expr.filter.CHILD
41581                                     // remember that false/true cast respectively to 0/1
41582                                     match[4] = +(match[4] ? match[5] + (match[6] || 1) : 2 * (match[3] === "even" || match[3] === "odd"));
41583                                     match[5] = +((match[7] + match[8]) || match[3] === "odd");
41584
41585                                     // other types prohibit arguments
41586                                 } else if (match[3]) {
41587                                     Sizzle.error(match[0]);
41588                                 }
41589
41590                                 return match;
41591                             },
41592
41593                             "PSEUDO": function(match) {
41594                                 var excess,
41595                                     unquoted = !match[6] && match[2];
41596
41597                                 if (matchExpr["CHILD"].test(match[0])) {
41598                                     return null;
41599                                 }
41600
41601                                 // Accept quoted arguments as-is
41602                                 if (match[3]) {
41603                                     match[2] = match[4] || match[5] || "";
41604
41605                                     // Strip excess characters from unquoted arguments
41606                                 } else if (unquoted && rpseudo.test(unquoted) &&
41607                                     // Get excess from tokenize (recursively)
41608                                     (excess = tokenize(unquoted, true)) &&
41609                                     // advance to the next closing parenthesis
41610                                     (excess = unquoted.indexOf(")", unquoted.length - excess) - unquoted.length)) {
41611
41612                                     // excess is a negative index
41613                                     match[0] = match[0].slice(0, excess);
41614                                     match[2] = unquoted.slice(0, excess);
41615                                 }
41616
41617                                 // Return only captures needed by the pseudo filter method (type and
41618                                 // argument)
41619                                 return match.slice(0, 3);
41620                             }
41621                         },
41622
41623                         filter: {
41624
41625                             "TAG": function(nodeNameSelector) {
41626                                 var nodeName = nodeNameSelector.replace(runescape, funescape).toLowerCase();
41627                                 return nodeNameSelector === "*" ?
41628                                     function() {
41629                                         return true;
41630                                     } :
41631                                     function(elem) {
41632                                         return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;
41633                                     };
41634                             },
41635
41636                             "CLASS": function(className) {
41637                                 var pattern = classCache[className + " "];
41638
41639                                 return pattern ||
41640                                     (pattern = new RegExp("(^|" + whitespace + ")" + className + "(" + whitespace + "|$)")) &&
41641                                     classCache(className, function(elem) {
41642                                         return pattern.test(typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== "undefined" && elem.getAttribute("class") || "");
41643                                     });
41644                             },
41645
41646                             "ATTR": function(name, operator, check) {
41647                                 return function(elem) {
41648                                     var result = Sizzle.attr(elem, name);
41649
41650                                     if (result == null) {
41651                                         return operator === "!=";
41652                                     }
41653                                     if (!operator) {
41654                                         return true;
41655                                     }
41656
41657                                     result += "";
41658
41659                                     return operator === "=" ? result === check :
41660                                         operator === "!=" ? result !== check :
41661                                         operator === "^=" ? check && result.indexOf(check) === 0 :
41662                                         operator === "*=" ? check && result.indexOf(check) > -1 :
41663                                         operator === "$=" ? check && result.slice(-check.length) === check :
41664                                         operator === "~=" ? (" " + result.replace(rwhitespace, " ") + " ").indexOf(check) > -1 :
41665                                         operator === "|=" ? result === check || result.slice(0, check.length + 1) === check + "-" :
41666                                         false;
41667                                 };
41668                             },
41669
41670                             "CHILD": function(type, what, argument, first, last) {
41671                                 var simple = type.slice(0, 3) !== "nth",
41672                                     forward = type.slice(-4) !== "last",
41673                                     ofType = what === "of-type";
41674
41675                                 return first === 1 && last === 0 ?
41676
41677                                     // Shortcut for :nth-*(n)
41678                                     function(elem) {
41679                                         return !!elem.parentNode;
41680                                     } :
41681
41682                                     function(elem, context, xml) {
41683                                         var cache, outerCache, node, diff, nodeIndex, start,
41684                                             dir = simple !== forward ? "nextSibling" : "previousSibling",
41685                                             parent = elem.parentNode,
41686                                             name = ofType && elem.nodeName.toLowerCase(),
41687                                             useCache = !xml && !ofType;
41688
41689                                         if (parent) {
41690
41691                                             // :(first|last|only)-(child|of-type)
41692                                             if (simple) {
41693                                                 while (dir) {
41694                                                     node = elem;
41695                                                     while ((node = node[dir])) {
41696                                                         if (ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1) {
41697                                                             return false;
41698                                                         }
41699                                                     }
41700                                                     // Reverse direction for :only-* (if we haven't
41701                                                     // yet done so)
41702                                                     start = dir = type === "only" && !start && "nextSibling";
41703                                                 }
41704                                                 return true;
41705                                             }
41706
41707                                             start = [forward ? parent.firstChild : parent.lastChild];
41708
41709                                             // non-xml :nth-child(...) stores cache data on `parent`
41710                                             if (forward && useCache) {
41711                                                 // Seek `elem` from a previously-cached index
41712                                                 outerCache = parent[expando] || (parent[expando] = {});
41713                                                 cache = outerCache[type] || [];
41714                                                 nodeIndex = cache[0] === dirruns && cache[1];
41715                                                 diff = cache[0] === dirruns && cache[2];
41716                                                 node = nodeIndex && parent.childNodes[nodeIndex];
41717
41718                                                 while ((node = ++nodeIndex && node && node[dir] ||
41719
41720                                                         // Fallback to seeking `elem` from the start
41721                                                         (diff = nodeIndex = 0) || start.pop())) {
41722
41723                                                     // When found, cache indexes on `parent` and
41724                                                     // break
41725                                                     if (node.nodeType === 1 && ++diff && node === elem) {
41726                                                         outerCache[type] = [dirruns, nodeIndex, diff];
41727                                                         break;
41728                                                     }
41729                                                 }
41730
41731                                                 // Use previously-cached element index if available
41732                                             } else if (useCache && (cache = (elem[expando] || (elem[expando] = {}))[type]) && cache[0] === dirruns) {
41733                                                 diff = cache[1];
41734
41735                                                 // xml :nth-child(...) or :nth-last-child(...) or
41736                                                 // :nth(-last)?-of-type(...)
41737                                             } else {
41738                                                 // Use the same loop as above to seek `elem` from
41739                                                 // the start
41740                                                 while ((node = ++nodeIndex && node && node[dir] ||
41741                                                         (diff = nodeIndex = 0) || start.pop())) {
41742
41743                                                     if ((ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1) && ++diff) {
41744                                                         // Cache the index of each encountered
41745                                                         // element
41746                                                         if (useCache) {
41747                                                             (node[expando] || (node[expando] = {}))[type] = [dirruns, diff];
41748                                                         }
41749
41750                                                         if (node === elem) {
41751                                                             break;
41752                                                         }
41753                                                     }
41754                                                 }
41755                                             }
41756
41757                                             // Incorporate the offset, then check against cycle size
41758                                             diff -= last;
41759                                             return diff === first || (diff % first === 0 && diff / first >= 0);
41760                                         }
41761                                     };
41762                             },
41763
41764                             "PSEUDO": function(pseudo, argument) {
41765                                 // pseudo-class names are case-insensitive
41766                                 // http://www.w3.org/TR/selectors/#pseudo-classes
41767                                 // Prioritize by case sensitivity in case custom pseudos are added
41768                                 // with uppercase letters
41769                                 // Remember that setFilters inherits from pseudos
41770                                 var args,
41771                                     fn = Expr.pseudos[pseudo] || Expr.setFilters[pseudo.toLowerCase()] ||
41772                                     Sizzle.error("unsupported pseudo: " + pseudo);
41773
41774                                 // The user may use createPseudo to indicate that
41775                                 // arguments are needed to create the filter function
41776                                 // just as Sizzle does
41777                                 if (fn[expando]) {
41778                                     return fn(argument);
41779                                 }
41780
41781                                 // But maintain support for old signatures
41782                                 if (fn.length > 1) {
41783                                     args = [pseudo, pseudo, "", argument];
41784                                     return Expr.setFilters.hasOwnProperty(pseudo.toLowerCase()) ?
41785                                         markFunction(function(seed, matches) {
41786                                             var idx,
41787                                                 matched = fn(seed, argument),
41788                                                 i = matched.length;
41789                                             while (i--) {
41790                                                 idx = indexOf(seed, matched[i]);
41791                                                 seed[idx] = !(matches[idx] = matched[i]);
41792                                             }
41793                                         }) :
41794                                         function(elem) {
41795                                             return fn(elem, 0, args);
41796                                         };
41797                                 }
41798
41799                                 return fn;
41800                             }
41801                         },
41802
41803                         pseudos: {
41804                             // Potentially complex pseudos
41805                             "not": markFunction(function(selector) {
41806                                 // Trim the selector passed to compile
41807                                 // to avoid treating leading and trailing
41808                                 // spaces as combinators
41809                                 var input = [],
41810                                     results = [],
41811                                     matcher = compile(selector.replace(rtrim, "$1"));
41812
41813                                 return matcher[expando] ?
41814                                     markFunction(function(seed, matches, context, xml) {
41815                                         var elem,
41816                                             unmatched = matcher(seed, null, xml, []),
41817                                             i = seed.length;
41818
41819                                         // Match elements unmatched by `matcher`
41820                                         while (i--) {
41821                                             if ((elem = unmatched[i])) {
41822                                                 seed[i] = !(matches[i] = elem);
41823                                             }
41824                                         }
41825                                     }) :
41826                                     function(elem, context, xml) {
41827                                         input[0] = elem;
41828                                         matcher(input, null, xml, results);
41829                                         // Don't keep the element (issue #299)
41830                                         input[0] = null;
41831                                         return !results.pop();
41832                                     };
41833                             }),
41834
41835                             "has": markFunction(function(selector) {
41836                                 return function(elem) {
41837                                     return Sizzle(selector, elem).length > 0;
41838                                 };
41839                             }),
41840
41841                             "contains": markFunction(function(text) {
41842                                 text = text.replace(runescape, funescape);
41843                                 return function(elem) {
41844                                     return (elem.textContent || elem.innerText || getText(elem)).indexOf(text) > -1;
41845                                 };
41846                             }),
41847
41848                             // "Whether an element is represented by a :lang() selector
41849                             // is based solely on the element's language value
41850                             // being equal to the identifier C,
41851                             // or beginning with the identifier C immediately followed by "-".
41852                             // The matching of C against the element's language value is performed
41853                             // case-insensitively.
41854                             // The identifier C does not have to be a valid language name."
41855                             // http://www.w3.org/TR/selectors/#lang-pseudo
41856                             "lang": markFunction(function(lang) {
41857                                 // lang value must be a valid identifier
41858                                 if (!ridentifier.test(lang || "")) {
41859                                     Sizzle.error("unsupported lang: " + lang);
41860                                 }
41861                                 lang = lang.replace(runescape, funescape).toLowerCase();
41862                                 return function(elem) {
41863                                     var elemLang;
41864                                     do {
41865                                         if ((elemLang = documentIsHTML ?
41866                                                 elem.lang :
41867                                                 elem.getAttribute("xml:lang") || elem.getAttribute("lang"))) {
41868
41869                                             elemLang = elemLang.toLowerCase();
41870                                             return elemLang === lang || elemLang.indexOf(lang + "-") === 0;
41871                                         }
41872                                     } while ((elem = elem.parentNode) && elem.nodeType === 1);
41873                                     return false;
41874                                 };
41875                             }),
41876
41877                             // Miscellaneous
41878                             "target": function(elem) {
41879                                 var hash = window.location && window.location.hash;
41880                                 return hash && hash.slice(1) === elem.id;
41881                             },
41882
41883                             "root": function(elem) {
41884                                 return elem === docElem;
41885                             },
41886
41887                             "focus": function(elem) {
41888                                 return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex);
41889                             },
41890
41891                             // Boolean properties
41892                             "enabled": function(elem) {
41893                                 return elem.disabled === false;
41894                             },
41895
41896                             "disabled": function(elem) {
41897                                 return elem.disabled === true;
41898                             },
41899
41900                             "checked": function(elem) {
41901                                 // In CSS3, :checked should return both checked and selected
41902                                 // elements
41903                                 // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
41904                                 var nodeName = elem.nodeName.toLowerCase();
41905                                 return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected);
41906                             },
41907
41908                             "selected": function(elem) {
41909                                 // Accessing this property makes selected-by-default
41910                                 // options in Safari work properly
41911                                 if (elem.parentNode) {
41912                                     elem.parentNode.selectedIndex;
41913                                 }
41914
41915                                 return elem.selected === true;
41916                             },
41917
41918                             // Contents
41919                             "empty": function(elem) {
41920                                 // http://www.w3.org/TR/selectors/#empty-pseudo
41921                                 // :empty is negated by element (1) or content nodes (text: 3;
41922                                 // cdata: 4; entity ref: 5),
41923                                 // but not by others (comment: 8; processing instruction: 7; etc.)
41924                                 // nodeType < 6 works because attributes (2) do not appear as
41925                                 // children
41926                                 for (elem = elem.firstChild; elem; elem = elem.nextSibling) {
41927                                     if (elem.nodeType < 6) {
41928                                         return false;
41929                                     }
41930                                 }
41931                                 return true;
41932                             },
41933
41934                             "parent": function(elem) {
41935                                 return !Expr.pseudos["empty"](elem);
41936                             },
41937
41938                             // Element/input types
41939                             "header": function(elem) {
41940                                 return rheader.test(elem.nodeName);
41941                             },
41942
41943                             "input": function(elem) {
41944                                 return rinputs.test(elem.nodeName);
41945                             },
41946
41947                             "button": function(elem) {
41948                                 var name = elem.nodeName.toLowerCase();
41949                                 return name === "input" && elem.type === "button" || name === "button";
41950                             },
41951
41952                             "text": function(elem) {
41953                                 var attr;
41954                                 return elem.nodeName.toLowerCase() === "input" &&
41955                                     elem.type === "text" &&
41956
41957                                     // Support: IE<8
41958                                     // New HTML5 attribute values (e.g., "search") appear with
41959                                     // elem.type === "text"
41960                                     ((attr = elem.getAttribute("type")) == null || attr.toLowerCase() === "text");
41961                             },
41962
41963                             // Position-in-collection
41964                             "first": createPositionalPseudo(function() {
41965                                 return [0];
41966                             }),
41967
41968                             "last": createPositionalPseudo(function(matchIndexes, length) {
41969                                 return [length - 1];
41970                             }),
41971
41972                             "eq": createPositionalPseudo(function(matchIndexes, length, argument) {
41973                                 return [argument < 0 ? argument + length : argument];
41974                             }),
41975
41976                             "even": createPositionalPseudo(function(matchIndexes, length) {
41977                                 var i = 0;
41978                                 for (; i < length; i += 2) {
41979                                     matchIndexes.push(i);
41980                                 }
41981                                 return matchIndexes;
41982                             }),
41983
41984                             "odd": createPositionalPseudo(function(matchIndexes, length) {
41985                                 var i = 1;
41986                                 for (; i < length; i += 2) {
41987                                     matchIndexes.push(i);
41988                                 }
41989                                 return matchIndexes;
41990                             }),
41991
41992                             "lt": createPositionalPseudo(function(matchIndexes, length, argument) {
41993                                 var i = argument < 0 ? argument + length : argument;
41994                                 for (; --i >= 0;) {
41995                                     matchIndexes.push(i);
41996                                 }
41997                                 return matchIndexes;
41998                             }),
41999
42000                             "gt": createPositionalPseudo(function(matchIndexes, length, argument) {
42001                                 var i = argument < 0 ? argument + length : argument;
42002                                 for (; ++i < length;) {
42003                                     matchIndexes.push(i);
42004                                 }
42005                                 return matchIndexes;
42006                             })
42007                         }
42008                     };
42009
42010                     Expr.pseudos["nth"] = Expr.pseudos["eq"];
42011
42012                     // Add button/input type pseudos
42013                     for (i in {
42014                             radio: true,
42015                             checkbox: true,
42016                             file: true,
42017                             password: true,
42018                             image: true
42019                         }) {
42020                         Expr.pseudos[i] = createInputPseudo(i);
42021                     }
42022                     for (i in {
42023                             submit: true,
42024                             reset: true
42025                         }) {
42026                         Expr.pseudos[i] = createButtonPseudo(i);
42027                     }
42028
42029                     // Easy API for creating new setFilters
42030                     function setFilters() {}
42031                     setFilters.prototype = Expr.filters = Expr.pseudos;
42032                     Expr.setFilters = new setFilters();
42033
42034                     tokenize = Sizzle.tokenize = function(selector, parseOnly) {
42035                         var matched, match, tokens, type,
42036                             soFar, groups, preFilters,
42037                             cached = tokenCache[selector + " "];
42038
42039                         if (cached) {
42040                             return parseOnly ? 0 : cached.slice(0);
42041                         }
42042
42043                         soFar = selector;
42044                         groups = [];
42045                         preFilters = Expr.preFilter;
42046
42047                         while (soFar) {
42048
42049                             // Comma and first run
42050                             if (!matched || (match = rcomma.exec(soFar))) {
42051                                 if (match) {
42052                                     // Don't consume trailing commas as valid
42053                                     soFar = soFar.slice(match[0].length) || soFar;
42054                                 }
42055                                 groups.push((tokens = []));
42056                             }
42057
42058                             matched = false;
42059
42060                             // Combinators
42061                             if ((match = rcombinators.exec(soFar))) {
42062                                 matched = match.shift();
42063                                 tokens.push({
42064                                     value: matched,
42065                                     // Cast descendant combinators to space
42066                                     type: match[0].replace(rtrim, " ")
42067                                 });
42068                                 soFar = soFar.slice(matched.length);
42069                             }
42070
42071                             // Filters
42072                             for (type in Expr.filter) {
42073                                 if ((match = matchExpr[type].exec(soFar)) && (!preFilters[type] ||
42074                                         (match = preFilters[type](match)))) {
42075                                     matched = match.shift();
42076                                     tokens.push({
42077                                         value: matched,
42078                                         type: type,
42079                                         matches: match
42080                                     });
42081                                     soFar = soFar.slice(matched.length);
42082                                 }
42083                             }
42084
42085                             if (!matched) {
42086                                 break;
42087                             }
42088                         }
42089
42090                         // Return the length of the invalid excess
42091                         // if we're just parsing
42092                         // Otherwise, throw an error or return tokens
42093                         return parseOnly ?
42094                             soFar.length :
42095                             soFar ?
42096                             Sizzle.error(selector) :
42097                             // Cache the tokens
42098                             tokenCache(selector, groups).slice(0);
42099                     };
42100
42101                     function toSelector(tokens) {
42102                         var i = 0,
42103                             len = tokens.length,
42104                             selector = "";
42105                         for (; i < len; i++) {
42106                             selector += tokens[i].value;
42107                         }
42108                         return selector;
42109                     }
42110
42111                     function addCombinator(matcher, combinator, base) {
42112                         var dir = combinator.dir,
42113                             checkNonElements = base && dir === "parentNode",
42114                             doneName = done++;
42115
42116                         return combinator.first ?
42117                             // Check against closest ancestor/preceding element
42118                             function(elem, context, xml) {
42119                                 while ((elem = elem[dir])) {
42120                                     if (elem.nodeType === 1 || checkNonElements) {
42121                                         return matcher(elem, context, xml);
42122                                     }
42123                                 }
42124                             } :
42125
42126                             // Check against all ancestor/preceding elements
42127                             function(elem, context, xml) {
42128                                 var oldCache, outerCache,
42129                                     newCache = [dirruns, doneName];
42130
42131                                 // We can't set arbitrary data on XML nodes, so they don't benefit
42132                                 // from dir caching
42133                                 if (xml) {
42134                                     while ((elem = elem[dir])) {
42135                                         if (elem.nodeType === 1 || checkNonElements) {
42136                                             if (matcher(elem, context, xml)) {
42137                                                 return true;
42138                                             }
42139                                         }
42140                                     }
42141                                 } else {
42142                                     while ((elem = elem[dir])) {
42143                                         if (elem.nodeType === 1 || checkNonElements) {
42144                                             outerCache = elem[expando] || (elem[expando] = {});
42145                                             if ((oldCache = outerCache[dir]) &&
42146                                                 oldCache[0] === dirruns && oldCache[1] === doneName) {
42147
42148                                                 // Assign to newCache so results back-propagate to
42149                                                 // previous elements
42150                                                 return (newCache[2] = oldCache[2]);
42151                                             } else {
42152                                                 // Reuse newcache so results back-propagate to
42153                                                 // previous elements
42154                                                 outerCache[dir] = newCache;
42155
42156                                                 // A match means we're done; a fail means we have to
42157                                                 // keep checking
42158                                                 if ((newCache[2] = matcher(elem, context, xml))) {
42159                                                     return true;
42160                                                 }
42161                                             }
42162                                         }
42163                                     }
42164                                 }
42165                             };
42166                     }
42167
42168                     function elementMatcher(matchers) {
42169                         return matchers.length > 1 ?
42170                             function(elem, context, xml) {
42171                                 var i = matchers.length;
42172                                 while (i--) {
42173                                     if (!matchers[i](elem, context, xml)) {
42174                                         return false;
42175                                     }
42176                                 }
42177                                 return true;
42178                             } :
42179                             matchers[0];
42180                     }
42181
42182                     function multipleContexts(selector, contexts, results) {
42183                         var i = 0,
42184                             len = contexts.length;
42185                         for (; i < len; i++) {
42186                             Sizzle(selector, contexts[i], results);
42187                         }
42188                         return results;
42189                     }
42190
42191                     function condense(unmatched, map, filter, context, xml) {
42192                         var elem,
42193                             newUnmatched = [],
42194                             i = 0,
42195                             len = unmatched.length,
42196                             mapped = map != null;
42197
42198                         for (; i < len; i++) {
42199                             if ((elem = unmatched[i])) {
42200                                 if (!filter || filter(elem, context, xml)) {
42201                                     newUnmatched.push(elem);
42202                                     if (mapped) {
42203                                         map.push(i);
42204                                     }
42205                                 }
42206                             }
42207                         }
42208
42209                         return newUnmatched;
42210                     }
42211
42212                     function setMatcher(preFilter, selector, matcher, postFilter, postFinder, postSelector) {
42213                         if (postFilter && !postFilter[expando]) {
42214                             postFilter = setMatcher(postFilter);
42215                         }
42216                         if (postFinder && !postFinder[expando]) {
42217                             postFinder = setMatcher(postFinder, postSelector);
42218                         }
42219                         return markFunction(function(seed, results, context, xml) {
42220                             var temp, i, elem,
42221                                 preMap = [],
42222                                 postMap = [],
42223                                 preexisting = results.length,
42224
42225                                 // Get initial elements from seed or context
42226                                 elems = seed || multipleContexts(selector || "*", context.nodeType ? [context] : context, []),
42227
42228                                 // Prefilter to get matcher input, preserving a map for seed-results
42229                                 // synchronization
42230                                 matcherIn = preFilter && (seed || !selector) ?
42231                                 condense(elems, preMap, preFilter, context, xml) :
42232                                 elems,
42233
42234                                 matcherOut = matcher ?
42235                                 // If we have a postFinder, or filtered seed, or non-seed
42236                                 // postFilter or preexisting results,
42237                                 postFinder || (seed ? preFilter : preexisting || postFilter) ?
42238
42239                                 // ...intermediate processing is necessary
42240                                 [] :
42241
42242                                 // ...otherwise use results directly
42243                                 results :
42244                                 matcherIn;
42245
42246                             // Find primary matches
42247                             if (matcher) {
42248                                 matcher(matcherIn, matcherOut, context, xml);
42249                             }
42250
42251                             // Apply postFilter
42252                             if (postFilter) {
42253                                 temp = condense(matcherOut, postMap);
42254                                 postFilter(temp, [], context, xml);
42255
42256                                 // Un-match failing elements by moving them back to matcherIn
42257                                 i = temp.length;
42258                                 while (i--) {
42259                                     if ((elem = temp[i])) {
42260                                         matcherOut[postMap[i]] = !(matcherIn[postMap[i]] = elem);
42261                                     }
42262                                 }
42263                             }
42264
42265                             if (seed) {
42266                                 if (postFinder || preFilter) {
42267                                     if (postFinder) {
42268                                         // Get the final matcherOut by condensing this intermediate
42269                                         // into postFinder contexts
42270                                         temp = [];
42271                                         i = matcherOut.length;
42272                                         while (i--) {
42273                                             if ((elem = matcherOut[i])) {
42274                                                 // Restore matcherIn since elem is not yet a final
42275                                                 // match
42276                                                 temp.push((matcherIn[i] = elem));
42277                                             }
42278                                         }
42279                                         postFinder(null, (matcherOut = []), temp, xml);
42280                                     }
42281
42282                                     // Move matched elements from seed to results to keep them
42283                                     // synchronized
42284                                     i = matcherOut.length;
42285                                     while (i--) {
42286                                         if ((elem = matcherOut[i]) &&
42287                                             (temp = postFinder ? indexOf(seed, elem) : preMap[i]) > -1) {
42288
42289                                             seed[temp] = !(results[temp] = elem);
42290                                         }
42291                                     }
42292                                 }
42293
42294                                 // Add elements to results, through postFinder if defined
42295                             } else {
42296                                 matcherOut = condense(
42297                                     matcherOut === results ?
42298                                     matcherOut.splice(preexisting, matcherOut.length) :
42299                                     matcherOut
42300                                 );
42301                                 if (postFinder) {
42302                                     postFinder(null, results, matcherOut, xml);
42303                                 } else {
42304                                     push.apply(results, matcherOut);
42305                                 }
42306                             }
42307                         });
42308                     }
42309
42310                     function matcherFromTokens(tokens) {
42311                         var checkContext, matcher, j,
42312                             len = tokens.length,
42313                             leadingRelative = Expr.relative[tokens[0].type],
42314                             implicitRelative = leadingRelative || Expr.relative[" "],
42315                             i = leadingRelative ? 1 : 0,
42316
42317                             // The foundational matcher ensures that elements are reachable from
42318                             // top-level context(s)
42319                             matchContext = addCombinator(function(elem) {
42320                                 return elem === checkContext;
42321                             }, implicitRelative, true),
42322                             matchAnyContext = addCombinator(function(elem) {
42323                                 return indexOf(checkContext, elem) > -1;
42324                             }, implicitRelative, true),
42325                             matchers = [function(elem, context, xml) {
42326                                 var ret = (!leadingRelative && (xml || context !== outermostContext)) || (
42327                                     (checkContext = context).nodeType ?
42328                                     matchContext(elem, context, xml) :
42329                                     matchAnyContext(elem, context, xml));
42330                                 // Avoid hanging onto element (issue #299)
42331                                 checkContext = null;
42332                                 return ret;
42333                             }];
42334
42335                         for (; i < len; i++) {
42336                             if ((matcher = Expr.relative[tokens[i].type])) {
42337                                 matchers = [addCombinator(elementMatcher(matchers), matcher)];
42338                             } else {
42339                                 matcher = Expr.filter[tokens[i].type].apply(null, tokens[i].matches);
42340
42341                                 // Return special upon seeing a positional matcher
42342                                 if (matcher[expando]) {
42343                                     // Find the next relative operator (if any) for proper handling
42344                                     j = ++i;
42345                                     for (; j < len; j++) {
42346                                         if (Expr.relative[tokens[j].type]) {
42347                                             break;
42348                                         }
42349                                     }
42350                                     return setMatcher(
42351                                         i > 1 && elementMatcher(matchers),
42352                                         i > 1 && toSelector(
42353                                             // If the preceding token was a descendant combinator,
42354                                             // insert an implicit any-element `*`
42355                                             tokens.slice(0, i - 1).concat({
42356                                                 value: tokens[i - 2].type === " " ? "*" : ""
42357                                             })
42358                                         ).replace(rtrim, "$1"),
42359                                         matcher,
42360                                         i < j && matcherFromTokens(tokens.slice(i, j)),
42361                                         j < len && matcherFromTokens((tokens = tokens.slice(j))),
42362                                         j < len && toSelector(tokens)
42363                                     );
42364                                 }
42365                                 matchers.push(matcher);
42366                             }
42367                         }
42368
42369                         return elementMatcher(matchers);
42370                     }
42371
42372                     function matcherFromGroupMatchers(elementMatchers, setMatchers) {
42373                         var bySet = setMatchers.length > 0,
42374                             byElement = elementMatchers.length > 0,
42375                             superMatcher = function(seed, context, xml, results, outermost) {
42376                                 var elem, j, matcher,
42377                                     matchedCount = 0,
42378                                     i = "0",
42379                                     unmatched = seed && [],
42380                                     setMatched = [],
42381                                     contextBackup = outermostContext,
42382                                     // We must always have either seed elements or outermost context
42383                                     elems = seed || byElement && Expr.find["TAG"]("*", outermost),
42384                                     // Use integer dirruns iff this is the outermost matcher
42385                                     dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1),
42386                                     len = elems.length;
42387
42388                                 if (outermost) {
42389                                     outermostContext = context !== document && context;
42390                                 }
42391
42392                                 // Add elements passing elementMatchers directly to results
42393                                 // Keep `i` a string if there are no elements so `matchedCount` will
42394                                 // be "00" below
42395                                 // Support: IE<9, Safari
42396                                 // Tolerate NodeList properties (IE: "length"; Safari: <number>)
42397                                 // matching elements by id
42398                                 for (; i !== len && (elem = elems[i]) != null; i++) {
42399                                     if (byElement && elem) {
42400                                         j = 0;
42401                                         while ((matcher = elementMatchers[j++])) {
42402                                             if (matcher(elem, context, xml)) {
42403                                                 results.push(elem);
42404                                                 break;
42405                                             }
42406                                         }
42407                                         if (outermost) {
42408                                             dirruns = dirrunsUnique;
42409                                         }
42410                                     }
42411
42412                                     // Track unmatched elements for set filters
42413                                     if (bySet) {
42414                                         // They will have gone through all possible matchers
42415                                         if ((elem = !matcher && elem)) {
42416                                             matchedCount--;
42417                                         }
42418
42419                                         // Lengthen the array for every element, matched or not
42420                                         if (seed) {
42421                                             unmatched.push(elem);
42422                                         }
42423                                     }
42424                                 }
42425
42426                                 // Apply set filters to unmatched elements
42427                                 matchedCount += i;
42428                                 if (bySet && i !== matchedCount) {
42429                                     j = 0;
42430                                     while ((matcher = setMatchers[j++])) {
42431                                         matcher(unmatched, setMatched, context, xml);
42432                                     }
42433
42434                                     if (seed) {
42435                                         // Reintegrate element matches to eliminate the need for
42436                                         // sorting
42437                                         if (matchedCount > 0) {
42438                                             while (i--) {
42439                                                 if (!(unmatched[i] || setMatched[i])) {
42440                                                     setMatched[i] = pop.call(results);
42441                                                 }
42442                                             }
42443                                         }
42444
42445                                         // Discard index placeholder values to get only actual
42446                                         // matches
42447                                         setMatched = condense(setMatched);
42448                                     }
42449
42450                                     // Add matches to results
42451                                     push.apply(results, setMatched);
42452
42453                                     // Seedless set matches succeeding multiple successful matchers
42454                                     // stipulate sorting
42455                                     if (outermost && !seed && setMatched.length > 0 &&
42456                                         (matchedCount + setMatchers.length) > 1) {
42457
42458                                         Sizzle.uniqueSort(results);
42459                                     }
42460                                 }
42461
42462                                 // Override manipulation of globals by nested matchers
42463                                 if (outermost) {
42464                                     dirruns = dirrunsUnique;
42465                                     outermostContext = contextBackup;
42466                                 }
42467
42468                                 return unmatched;
42469                             };
42470
42471                         return bySet ?
42472                             markFunction(superMatcher) :
42473                             superMatcher;
42474                     }
42475
42476                     compile = Sizzle.compile = function(selector, match /* Internal Use Only */ ) {
42477                         var i,
42478                             setMatchers = [],
42479                             elementMatchers = [],
42480                             cached = compilerCache[selector + " "];
42481
42482                         if (!cached) {
42483                             // Generate a function of recursive functions that can be used to check
42484                             // each element
42485                             if (!match) {
42486                                 match = tokenize(selector);
42487                             }
42488                             i = match.length;
42489                             while (i--) {
42490                                 cached = matcherFromTokens(match[i]);
42491                                 if (cached[expando]) {
42492                                     setMatchers.push(cached);
42493                                 } else {
42494                                     elementMatchers.push(cached);
42495                                 }
42496                             }
42497
42498                             // Cache the compiled function
42499                             cached = compilerCache(selector, matcherFromGroupMatchers(elementMatchers, setMatchers));
42500
42501                             // Save selector and tokenization
42502                             cached.selector = selector;
42503                         }
42504                         return cached;
42505                     };
42506
42507                     /**
42508                      * A low-level selection function that works with Sizzle's compiled selector
42509                      * functions
42510                      * 
42511                      * @param {String|Function}
42512                      *            selector A selector or a pre-compiled selector function built with
42513                      *            Sizzle.compile
42514                      * @param {Element}
42515                      *            context
42516                      * @param {Array}
42517                      *            [results]
42518                      * @param {Array}
42519                      *            [seed] A set of elements to match against
42520                      */
42521                     select = Sizzle.select = function(selector, context, results, seed) {
42522                         var i, tokens, token, type, find,
42523                             compiled = typeof selector === "function" && selector,
42524                             match = !seed && tokenize((selector = compiled.selector || selector));
42525
42526                         results = results || [];
42527
42528                         // Try to minimize operations if there is no seed and only one group
42529                         if (match.length === 1) {
42530
42531                             // Take a shortcut and set the context if the root selector is an ID
42532                             tokens = match[0] = match[0].slice(0);
42533                             if (tokens.length > 2 && (token = tokens[0]).type === "ID" &&
42534                                 support.getById && context.nodeType === 9 && documentIsHTML &&
42535                                 Expr.relative[tokens[1].type]) {
42536
42537                                 context = (Expr.find["ID"](token.matches[0].replace(runescape, funescape), context) || [])[0];
42538                                 if (!context) {
42539                                     return results;
42540
42541                                     // Precompiled matchers will still verify ancestry, so step up a
42542                                     // level
42543                                 } else if (compiled) {
42544                                     context = context.parentNode;
42545                                 }
42546
42547                                 selector = selector.slice(tokens.shift().value.length);
42548                             }
42549
42550                             // Fetch a seed set for right-to-left matching
42551                             i = matchExpr["needsContext"].test(selector) ? 0 : tokens.length;
42552                             while (i--) {
42553                                 token = tokens[i];
42554
42555                                 // Abort if we hit a combinator
42556                                 if (Expr.relative[(type = token.type)]) {
42557                                     break;
42558                                 }
42559                                 if ((find = Expr.find[type])) {
42560                                     // Search, expanding context for leading sibling combinators
42561                                     if ((seed = find(
42562                                             token.matches[0].replace(runescape, funescape),
42563                                             rsibling.test(tokens[0].type) && testContext(context.parentNode) || context
42564                                         ))) {
42565
42566                                         // If seed is empty or no tokens remain, we can return early
42567                                         tokens.splice(i, 1);
42568                                         selector = seed.length && toSelector(tokens);
42569                                         if (!selector) {
42570                                             push.apply(results, seed);
42571                                             return results;
42572                                         }
42573
42574                                         break;
42575                                     }
42576                                 }
42577                             }
42578                         }
42579
42580                         // Compile and execute a filtering function if one is not provided
42581                         // Provide `match` to avoid retokenization if we modified the selector above
42582                         (compiled || compile(selector, match))(
42583                             seed,
42584                             context, !documentIsHTML,
42585                             results,
42586                             rsibling.test(selector) && testContext(context.parentNode) || context
42587                         );
42588                         return results;
42589                     };
42590
42591                     // One-time assignments
42592
42593                     // Sort stability
42594                     support.sortStable = expando.split("").sort(sortOrder).join("") === expando;
42595
42596                     // Support: Chrome 14-35+
42597                     // Always assume duplicates if they aren't passed to the comparison function
42598                     support.detectDuplicates = !!hasDuplicate;
42599
42600                     // Initialize against the default document
42601                     setDocument();
42602
42603                     // Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27)
42604                     // Detached nodes confoundingly follow *each other*
42605                     support.sortDetached = assert(function(div1) {
42606                         // Should return 1, but returns 4 (following)
42607                         return div1.compareDocumentPosition(document.createElement("div")) & 1;
42608                     });
42609
42610                     // Support: IE<8
42611                     // Prevent attribute/property "interpolation"
42612                     // http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
42613                     if (!assert(function(div) {
42614                             div.innerHTML = "<a href='#'></a>";
42615                             return div.firstChild.getAttribute("href") === "#";
42616                         })) {
42617                         addHandle("type|href|height|width", function(elem, name, isXML) {
42618                             if (!isXML) {
42619                                 return elem.getAttribute(name, name.toLowerCase() === "type" ? 1 : 2);
42620                             }
42621                         });
42622                     }
42623
42624                     // Support: IE<9
42625                     // Use defaultValue in place of getAttribute("value")
42626                     if (!support.attributes || !assert(function(div) {
42627                             div.innerHTML = "<input/>";
42628                             div.firstChild.setAttribute("value", "");
42629                             return div.firstChild.getAttribute("value") === "";
42630                         })) {
42631                         addHandle("value", function(elem, name, isXML) {
42632                             if (!isXML && elem.nodeName.toLowerCase() === "input") {
42633                                 return elem.defaultValue;
42634                             }
42635                         });
42636                     }
42637
42638                     // Support: IE<9
42639                     // Use getAttributeNode to fetch booleans when getAttribute lies
42640                     if (!assert(function(div) {
42641                             return div.getAttribute("disabled") == null;
42642                         })) {
42643                         addHandle(booleans, function(elem, name, isXML) {
42644                             var val;
42645                             if (!isXML) {
42646                                 return elem[name] === true ? name.toLowerCase() :
42647                                     (val = elem.getAttributeNode(name)) && val.specified ?
42648                                     val.value :
42649                                     null;
42650                             }
42651                         });
42652                     }
42653
42654                     return Sizzle;
42655
42656                 })(window);
42657
42658
42659
42660             jQuery.find = Sizzle;
42661             jQuery.expr = Sizzle.selectors;
42662             jQuery.expr[":"] = jQuery.expr.pseudos;
42663             jQuery.unique = Sizzle.uniqueSort;
42664             jQuery.text = Sizzle.getText;
42665             jQuery.isXMLDoc = Sizzle.isXML;
42666             jQuery.contains = Sizzle.contains;
42667
42668
42669
42670             var rneedsContext = jQuery.expr.match.needsContext;
42671
42672             var rsingleTag = (/^<(\w+)\s*\/?>(?:<\/\1>|)$/);
42673
42674
42675
42676             var risSimple = /^.[^:#\[\.,]*$/;
42677
42678             // Implement the identical functionality for filter and not
42679             function winnow(elements, qualifier, not) {
42680                 if (jQuery.isFunction(qualifier)) {
42681                     return jQuery.grep(elements, function(elem, i) {
42682                         /* jshint -W018 */
42683                         return !!qualifier.call(elem, i, elem) !== not;
42684                     });
42685
42686                 }
42687
42688                 if (qualifier.nodeType) {
42689                     return jQuery.grep(elements, function(elem) {
42690                         return (elem === qualifier) !== not;
42691                     });
42692
42693                 }
42694
42695                 if (typeof qualifier === "string") {
42696                     if (risSimple.test(qualifier)) {
42697                         return jQuery.filter(qualifier, elements, not);
42698                     }
42699
42700                     qualifier = jQuery.filter(qualifier, elements);
42701                 }
42702
42703                 return jQuery.grep(elements, function(elem) {
42704                     return (indexOf.call(qualifier, elem) >= 0) !== not;
42705                 });
42706             }
42707
42708             jQuery.filter = function(expr, elems, not) {
42709                 var elem = elems[0];
42710
42711                 if (not) {
42712                     expr = ":not(" + expr + ")";
42713                 }
42714
42715                 return elems.length === 1 && elem.nodeType === 1 ?
42716                     jQuery.find.matchesSelector(elem, expr) ? [elem] : [] :
42717                     jQuery.find.matches(expr, jQuery.grep(elems, function(elem) {
42718                         return elem.nodeType === 1;
42719                     }));
42720             };
42721
42722             jQuery.fn.extend({
42723                 find: function(selector) {
42724                     var i,
42725                         len = this.length,
42726                         ret = [],
42727                         self = this;
42728
42729                     if (typeof selector !== "string") {
42730                         return this.pushStack(jQuery(selector).filter(function() {
42731                             for (i = 0; i < len; i++) {
42732                                 if (jQuery.contains(self[i], this)) {
42733                                     return true;
42734                                 }
42735                             }
42736                         }));
42737                     }
42738
42739                     for (i = 0; i < len; i++) {
42740                         jQuery.find(selector, self[i], ret);
42741                     }
42742
42743                     // Needed because $( selector, context ) becomes $( context ).find(
42744                     // selector )
42745                     ret = this.pushStack(len > 1 ? jQuery.unique(ret) : ret);
42746                     ret.selector = this.selector ? this.selector + " " + selector : selector;
42747                     return ret;
42748                 },
42749                 filter: function(selector) {
42750                     return this.pushStack(winnow(this, selector || [], false));
42751                 },
42752                 not: function(selector) {
42753                     return this.pushStack(winnow(this, selector || [], true));
42754                 },
42755                 is: function(selector) {
42756                     return !!winnow(
42757                         this,
42758
42759                         // If this is a positional/relative selector, check membership in
42760                         // the returned set
42761                         // so $("p:first").is("p:last") won't return true for a doc with two
42762                         // "p".
42763                         typeof selector === "string" && rneedsContext.test(selector) ?
42764                         jQuery(selector) :
42765                         selector || [],
42766                         false
42767                     ).length;
42768                 }
42769             });
42770
42771
42772             // Initialize a jQuery object
42773
42774
42775             // A central reference to the root jQuery(document)
42776             var rootjQuery,
42777
42778                 // A simple way to check for HTML strings
42779                 // Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
42780                 // Strict HTML recognition (#11290: must start with <)
42781                 rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,
42782
42783                 init = jQuery.fn.init = function(selector, context) {
42784                     var match, elem;
42785
42786                     // HANDLE: $(""), $(null), $(undefined), $(false)
42787                     if (!selector) {
42788                         return this;
42789                     }
42790
42791                     // Handle HTML strings
42792                     if (typeof selector === "string") {
42793                         if (selector[0] === "<" && selector[selector.length - 1] === ">" && selector.length >= 3) {
42794                             // Assume that strings that start and end with <> are HTML and
42795                             // skip the regex check
42796                             match = [null, selector, null];
42797
42798                         } else {
42799                             match = rquickExpr.exec(selector);
42800                         }
42801
42802                         // Match html or make sure no context is specified for #id
42803                         if (match && (match[1] || !context)) {
42804
42805                             // HANDLE: $(html) -> $(array)
42806                             if (match[1]) {
42807                                 context = context instanceof jQuery ? context[0] : context;
42808
42809                                 // Option to run scripts is true for back-compat
42810                                 // Intentionally let the error be thrown if parseHTML is not
42811                                 // present
42812                                 jQuery.merge(this, jQuery.parseHTML(
42813                                     match[1],
42814                                     context && context.nodeType ? context.ownerDocument || context : document,
42815                                     true
42816                                 ));
42817
42818                                 // HANDLE: $(html, props)
42819                                 if (rsingleTag.test(match[1]) && jQuery.isPlainObject(context)) {
42820                                     for (match in context) {
42821                                         // Properties of context are called as methods if
42822                                         // possible
42823                                         if (jQuery.isFunction(this[match])) {
42824                                             this[match](context[match]);
42825
42826                                             // ...and otherwise set as attributes
42827                                         } else {
42828                                             this.attr(match, context[match]);
42829                                         }
42830                                     }
42831                                 }
42832
42833                                 return this;
42834
42835                                 // HANDLE: $(#id)
42836                             } else {
42837                                 elem = document.getElementById(match[2]);
42838
42839                                 // Support: Blackberry 4.6
42840                                 // gEBID returns nodes no longer in the document (#6963)
42841                                 if (elem && elem.parentNode) {
42842                                     // Inject the element directly into the jQuery object
42843                                     this.length = 1;
42844                                     this[0] = elem;
42845                                 }
42846
42847                                 this.context = document;
42848                                 this.selector = selector;
42849                                 return this;
42850                             }
42851
42852                             // HANDLE: $(expr, $(...))
42853                         } else if (!context || context.jquery) {
42854                             return (context || rootjQuery).find(selector);
42855
42856                             // HANDLE: $(expr, context)
42857                             // (which is just equivalent to: $(context).find(expr)
42858                         } else {
42859                             return this.constructor(context).find(selector);
42860                         }
42861
42862                         // HANDLE: $(DOMElement)
42863                     } else if (selector.nodeType) {
42864                         this.context = this[0] = selector;
42865                         this.length = 1;
42866                         return this;
42867
42868                         // HANDLE: $(function)
42869                         // Shortcut for document ready
42870                     } else if (jQuery.isFunction(selector)) {
42871                         return typeof rootjQuery.ready !== "undefined" ?
42872                             rootjQuery.ready(selector) :
42873                             // Execute immediately if ready is not present
42874                             selector(jQuery);
42875                     }
42876
42877                     if (selector.selector !== undefined) {
42878                         this.selector = selector.selector;
42879                         this.context = selector.context;
42880                     }
42881
42882                     return jQuery.makeArray(selector, this);
42883                 };
42884
42885             // Give the init function the jQuery prototype for later instantiation
42886             init.prototype = jQuery.fn;
42887
42888             // Initialize central reference
42889             rootjQuery = jQuery(document);
42890
42891
42892             var rparentsprev = /^(?:parents|prev(?:Until|All))/,
42893                 // Methods guaranteed to produce a unique set when starting from a unique
42894                 // set
42895                 guaranteedUnique = {
42896                     children: true,
42897                     contents: true,
42898                     next: true,
42899                     prev: true
42900                 };
42901
42902             jQuery.extend({
42903                 dir: function(elem, dir, until) {
42904                     var matched = [],
42905                         truncate = until !== undefined;
42906
42907                     while ((elem = elem[dir]) && elem.nodeType !== 9) {
42908                         if (elem.nodeType === 1) {
42909                             if (truncate && jQuery(elem).is(until)) {
42910                                 break;
42911                             }
42912                             matched.push(elem);
42913                         }
42914                     }
42915                     return matched;
42916                 },
42917
42918                 sibling: function(n, elem) {
42919                     var matched = [];
42920
42921                     for (; n; n = n.nextSibling) {
42922                         if (n.nodeType === 1 && n !== elem) {
42923                             matched.push(n);
42924                         }
42925                     }
42926
42927                     return matched;
42928                 }
42929             });
42930
42931             jQuery.fn.extend({
42932                 has: function(target) {
42933                     var targets = jQuery(target, this),
42934                         l = targets.length;
42935
42936                     return this.filter(function() {
42937                         var i = 0;
42938                         for (; i < l; i++) {
42939                             if (jQuery.contains(this, targets[i])) {
42940                                 return true;
42941                             }
42942                         }
42943                     });
42944                 },
42945
42946                 closest: function(selectors, context) {
42947                     var cur,
42948                         i = 0,
42949                         l = this.length,
42950                         matched = [],
42951                         pos = rneedsContext.test(selectors) || typeof selectors !== "string" ?
42952                         jQuery(selectors, context || this.context) :
42953                         0;
42954
42955                     for (; i < l; i++) {
42956                         for (cur = this[i]; cur && cur !== context; cur = cur.parentNode) {
42957                             // Always skip document fragments
42958                             if (cur.nodeType < 11 && (pos ?
42959                                     pos.index(cur) > -1 :
42960
42961                                     // Don't pass non-elements to Sizzle
42962                                     cur.nodeType === 1 &&
42963                                     jQuery.find.matchesSelector(cur, selectors))) {
42964
42965                                 matched.push(cur);
42966                                 break;
42967                             }
42968                         }
42969                     }
42970
42971                     return this.pushStack(matched.length > 1 ? jQuery.unique(matched) : matched);
42972                 },
42973
42974                 // Determine the position of an element within the set
42975                 index: function(elem) {
42976
42977                     // No argument, return index in parent
42978                     if (!elem) {
42979                         return (this[0] && this[0].parentNode) ? this.first().prevAll().length : -1;
42980                     }
42981
42982                     // Index in selector
42983                     if (typeof elem === "string") {
42984                         return indexOf.call(jQuery(elem), this[0]);
42985                     }
42986
42987                     // Locate the position of the desired element
42988                     return indexOf.call(this,
42989
42990                         // If it receives a jQuery object, the first element is used
42991                         elem.jquery ? elem[0] : elem
42992                     );
42993                 },
42994
42995                 add: function(selector, context) {
42996                     return this.pushStack(
42997                         jQuery.unique(
42998                             jQuery.merge(this.get(), jQuery(selector, context))
42999                         )
43000                     );
43001                 },
43002
43003                 addBack: function(selector) {
43004                     return this.add(selector == null ?
43005                         this.prevObject : this.prevObject.filter(selector)
43006                     );
43007                 }
43008             });
43009
43010             function sibling(cur, dir) {
43011                 while ((cur = cur[dir]) && cur.nodeType !== 1) {}
43012                 return cur;
43013             }
43014
43015             jQuery.each({
43016                 parent: function(elem) {
43017                     var parent = elem.parentNode;
43018                     return parent && parent.nodeType !== 11 ? parent : null;
43019                 },
43020                 parents: function(elem) {
43021                     return jQuery.dir(elem, "parentNode");
43022                 },
43023                 parentsUntil: function(elem, i, until) {
43024                     return jQuery.dir(elem, "parentNode", until);
43025                 },
43026                 next: function(elem) {
43027                     return sibling(elem, "nextSibling");
43028                 },
43029                 prev: function(elem) {
43030                     return sibling(elem, "previousSibling");
43031                 },
43032                 nextAll: function(elem) {
43033                     return jQuery.dir(elem, "nextSibling");
43034                 },
43035                 prevAll: function(elem) {
43036                     return jQuery.dir(elem, "previousSibling");
43037                 },
43038                 nextUntil: function(elem, i, until) {
43039                     return jQuery.dir(elem, "nextSibling", until);
43040                 },
43041                 prevUntil: function(elem, i, until) {
43042                     return jQuery.dir(elem, "previousSibling", until);
43043                 },
43044                 siblings: function(elem) {
43045                     return jQuery.sibling((elem.parentNode || {}).firstChild, elem);
43046                 },
43047                 children: function(elem) {
43048                     return jQuery.sibling(elem.firstChild);
43049                 },
43050                 contents: function(elem) {
43051                     return elem.contentDocument || jQuery.merge([], elem.childNodes);
43052                 }
43053             }, function(name, fn) {
43054                 jQuery.fn[name] = function(until, selector) {
43055                     var matched = jQuery.map(this, fn, until);
43056
43057                     if (name.slice(-5) !== "Until") {
43058                         selector = until;
43059                     }
43060
43061                     if (selector && typeof selector === "string") {
43062                         matched = jQuery.filter(selector, matched);
43063                     }
43064
43065                     if (this.length > 1) {
43066                         // Remove duplicates
43067                         if (!guaranteedUnique[name]) {
43068                             jQuery.unique(matched);
43069                         }
43070
43071                         // Reverse order for parents* and prev-derivatives
43072                         if (rparentsprev.test(name)) {
43073                             matched.reverse();
43074                         }
43075                     }
43076
43077                     return this.pushStack(matched);
43078                 };
43079             });
43080             var rnotwhite = (/\S+/g);
43081
43082
43083
43084             // String to Object options format cache
43085             var optionsCache = {};
43086
43087             // Convert String-formatted options into Object-formatted ones and store in
43088             // cache
43089             function createOptions(options) {
43090                 var object = optionsCache[options] = {};
43091                 jQuery.each(options.match(rnotwhite) || [], function(_, flag) {
43092                     object[flag] = true;
43093                 });
43094                 return object;
43095             }
43096
43097             /*
43098              * Create a callback list using the following parameters:
43099              * 
43100              * options: an optional list of space-separated options that will change how the
43101              * callback list behaves or a more traditional option object
43102              * 
43103              * By default a callback list will act like an event callback list and can be
43104              * "fired" multiple times.
43105              * 
43106              * Possible options:
43107              * 
43108              * once: will ensure the callback list can only be fired once (like a Deferred)
43109              * 
43110              * memory: will keep track of previous values and will call any callback added
43111              * after the list has been fired right away with the latest "memorized" values
43112              * (like a Deferred)
43113              * 
43114              * unique: will ensure a callback can only be added once (no duplicate in the
43115              * list)
43116              * 
43117              * stopOnFalse: interrupt callings when a callback returns false
43118              * 
43119              */
43120             jQuery.Callbacks = function(options) {
43121
43122                 // Convert options from String-formatted to Object-formatted if needed
43123                 // (we check in cache first)
43124                 options = typeof options === "string" ?
43125                     (optionsCache[options] || createOptions(options)) :
43126                     jQuery.extend({}, options);
43127
43128                 var // Last fire value (for non-forgettable lists)
43129                     memory,
43130                     // Flag to know if list was already fired
43131                     fired,
43132                     // Flag to know if list is currently firing
43133                     firing,
43134                     // First callback to fire (used internally by add and fireWith)
43135                     firingStart,
43136                     // End of the loop when firing
43137                     firingLength,
43138                     // Index of currently firing callback (modified by remove if needed)
43139                     firingIndex,
43140                     // Actual callback list
43141                     list = [],
43142                     // Stack of fire calls for repeatable lists
43143                     stack = !options.once && [],
43144                     // Fire callbacks
43145                     fire = function(data) {
43146                         memory = options.memory && data;
43147                         fired = true;
43148                         firingIndex = firingStart || 0;
43149                         firingStart = 0;
43150                         firingLength = list.length;
43151                         firing = true;
43152                         for (; list && firingIndex < firingLength; firingIndex++) {
43153                             if (list[firingIndex].apply(data[0], data[1]) === false && options.stopOnFalse) {
43154                                 memory = false; // To prevent further calls using add
43155                                 break;
43156                             }
43157                         }
43158                         firing = false;
43159                         if (list) {
43160                             if (stack) {
43161                                 if (stack.length) {
43162                                     fire(stack.shift());
43163                                 }
43164                             } else if (memory) {
43165                                 list = [];
43166                             } else {
43167                                 self.disable();
43168                             }
43169                         }
43170                     },
43171                     // Actual Callbacks object
43172                     self = {
43173                         // Add a callback or a collection of callbacks to the list
43174                         add: function() {
43175                             if (list) {
43176                                 // First, we save the current length
43177                                 var start = list.length;
43178                                 (function add(args) {
43179                                     jQuery.each(args, function(_, arg) {
43180                                         var type = jQuery.type(arg);
43181                                         if (type === "function") {
43182                                             if (!options.unique || !self.has(arg)) {
43183                                                 list.push(arg);
43184                                             }
43185                                         } else if (arg && arg.length && type !== "string") {
43186                                             // Inspect recursively
43187                                             add(arg);
43188                                         }
43189                                     });
43190                                 })(arguments);
43191                                 // Do we need to add the callbacks to the
43192                                 // current firing batch?
43193                                 if (firing) {
43194                                     firingLength = list.length;
43195                                     // With memory, if we're not firing then
43196                                     // we should call right away
43197                                 } else if (memory) {
43198                                     firingStart = start;
43199                                     fire(memory);
43200                                 }
43201                             }
43202                             return this;
43203                         },
43204                         // Remove a callback from the list
43205                         remove: function() {
43206                             if (list) {
43207                                 jQuery.each(arguments, function(_, arg) {
43208                                     var index;
43209                                     while ((index = jQuery.inArray(arg, list, index)) > -1) {
43210                                         list.splice(index, 1);
43211                                         // Handle firing indexes
43212                                         if (firing) {
43213                                             if (index <= firingLength) {
43214                                                 firingLength--;
43215                                             }
43216                                             if (index <= firingIndex) {
43217                                                 firingIndex--;
43218                                             }
43219                                         }
43220                                     }
43221                                 });
43222                             }
43223                             return this;
43224                         },
43225                         // Check if a given callback is in the list.
43226                         // If no argument is given, return whether or not list has callbacks
43227                         // attached.
43228                         has: function(fn) {
43229                             return fn ? jQuery.inArray(fn, list) > -1 : !!(list && list.length);
43230                         },
43231                         // Remove all callbacks from the list
43232                         empty: function() {
43233                             list = [];
43234                             firingLength = 0;
43235                             return this;
43236                         },
43237                         // Have the list do nothing anymore
43238                         disable: function() {
43239                             list = stack = memory = undefined;
43240                             return this;
43241                         },
43242                         // Is it disabled?
43243                         disabled: function() {
43244                             return !list;
43245                         },
43246                         // Lock the list in its current state
43247                         lock: function() {
43248                             stack = undefined;
43249                             if (!memory) {
43250                                 self.disable();
43251                             }
43252                             return this;
43253                         },
43254                         // Is it locked?
43255                         locked: function() {
43256                             return !stack;
43257                         },
43258                         // Call all callbacks with the given context and arguments
43259                         fireWith: function(context, args) {
43260                             if (list && (!fired || stack)) {
43261                                 args = args || [];
43262                                 args = [context, args.slice ? args.slice() : args];
43263                                 if (firing) {
43264                                     stack.push(args);
43265                                 } else {
43266                                     fire(args);
43267                                 }
43268                             }
43269                             return this;
43270                         },
43271                         // Call all the callbacks with the given arguments
43272                         fire: function() {
43273                             self.fireWith(this, arguments);
43274                             return this;
43275                         },
43276                         // To know if the callbacks have already been called at least once
43277                         fired: function() {
43278                             return !!fired;
43279                         }
43280                     };
43281
43282                 return self;
43283             };
43284
43285
43286             jQuery.extend({
43287
43288                 Deferred: function(func) {
43289                     var tuples = [
43290                             // action, add listener, listener list, final state
43291                             ["resolve", "done", jQuery.Callbacks("once memory"), "resolved"],
43292                             ["reject", "fail", jQuery.Callbacks("once memory"), "rejected"],
43293                             ["notify", "progress", jQuery.Callbacks("memory")]
43294                         ],
43295                         state = "pending",
43296                         promise = {
43297                             state: function() {
43298                                 return state;
43299                             },
43300                             always: function() {
43301                                 deferred.done(arguments).fail(arguments);
43302                                 return this;
43303                             },
43304                             then: function( /* fnDone, fnFail, fnProgress */ ) {
43305                                 var fns = arguments;
43306                                 return jQuery.Deferred(function(newDefer) {
43307                                     jQuery.each(tuples, function(i, tuple) {
43308                                         var fn = jQuery.isFunction(fns[i]) && fns[i];
43309                                         // deferred[ done | fail | progress ] for forwarding
43310                                         // actions to newDefer
43311                                         deferred[tuple[1]](function() {
43312                                             var returned = fn && fn.apply(this, arguments);
43313                                             if (returned && jQuery.isFunction(returned.promise)) {
43314                                                 returned.promise()
43315                                                     .done(newDefer.resolve)
43316                                                     .fail(newDefer.reject)
43317                                                     .progress(newDefer.notify);
43318                                             } else {
43319                                                 newDefer[tuple[0] + "With"](this === promise ? newDefer.promise() : this, fn ? [returned] : arguments);
43320                                             }
43321                                         });
43322                                     });
43323                                     fns = null;
43324                                 }).promise();
43325                             },
43326                             // Get a promise for this deferred
43327                             // If obj is provided, the promise aspect is added to the object
43328                             promise: function(obj) {
43329                                 return obj != null ? jQuery.extend(obj, promise) : promise;
43330                             }
43331                         },
43332                         deferred = {};
43333
43334                     // Keep pipe for back-compat
43335                     promise.pipe = promise.then;
43336
43337                     // Add list-specific methods
43338                     jQuery.each(tuples, function(i, tuple) {
43339                         var list = tuple[2],
43340                             stateString = tuple[3];
43341
43342                         // promise[ done | fail | progress ] = list.add
43343                         promise[tuple[1]] = list.add;
43344
43345                         // Handle state
43346                         if (stateString) {
43347                             list.add(function() {
43348                                 // state = [ resolved | rejected ]
43349                                 state = stateString;
43350
43351                                 // [ reject_list | resolve_list ].disable; progress_list.lock
43352                             }, tuples[i ^ 1][2].disable, tuples[2][2].lock);
43353                         }
43354
43355                         // deferred[ resolve | reject | notify ]
43356                         deferred[tuple[0]] = function() {
43357                             deferred[tuple[0] + "With"](this === deferred ? promise : this, arguments);
43358                             return this;
43359                         };
43360                         deferred[tuple[0] + "With"] = list.fireWith;
43361                     });
43362
43363                     // Make the deferred a promise
43364                     promise.promise(deferred);
43365
43366                     // Call given func if any
43367                     if (func) {
43368                         func.call(deferred, deferred);
43369                     }
43370
43371                     // All done!
43372                     return deferred;
43373                 },
43374
43375                 // Deferred helper
43376                 when: function(subordinate /* , ..., subordinateN */ ) {
43377                     var i = 0,
43378                         resolveValues = slice.call(arguments),
43379                         length = resolveValues.length,
43380
43381                         // the count of uncompleted subordinates
43382                         remaining = length !== 1 || (subordinate && jQuery.isFunction(subordinate.promise)) ? length : 0,
43383
43384                         // the master Deferred. If resolveValues consist of only a single
43385                         // Deferred, just use that.
43386                         deferred = remaining === 1 ? subordinate : jQuery.Deferred(),
43387
43388                         // Update function for both resolve and progress values
43389                         updateFunc = function(i, contexts, values) {
43390                             return function(value) {
43391                                 contexts[i] = this;
43392                                 values[i] = arguments.length > 1 ? slice.call(arguments) : value;
43393                                 if (values === progressValues) {
43394                                     deferred.notifyWith(contexts, values);
43395                                 } else if (!(--remaining)) {
43396                                     deferred.resolveWith(contexts, values);
43397                                 }
43398                             };
43399                         },
43400
43401                         progressValues, progressContexts, resolveContexts;
43402
43403                     // Add listeners to Deferred subordinates; treat others as resolved
43404                     if (length > 1) {
43405                         progressValues = new Array(length);
43406                         progressContexts = new Array(length);
43407                         resolveContexts = new Array(length);
43408                         for (; i < length; i++) {
43409                             if (resolveValues[i] && jQuery.isFunction(resolveValues[i].promise)) {
43410                                 resolveValues[i].promise()
43411                                     .done(updateFunc(i, resolveContexts, resolveValues))
43412                                     .fail(deferred.reject)
43413                                     .progress(updateFunc(i, progressContexts, progressValues));
43414                             } else {
43415                                 --remaining;
43416                             }
43417                         }
43418                     }
43419
43420                     // If we're not waiting on anything, resolve the master
43421                     if (!remaining) {
43422                         deferred.resolveWith(resolveContexts, resolveValues);
43423                     }
43424
43425                     return deferred.promise();
43426                 }
43427             });
43428
43429
43430             // The deferred used on DOM ready
43431             var readyList;
43432
43433             jQuery.fn.ready = function(fn) {
43434                 // Add the callback
43435                 jQuery.ready.promise().done(fn);
43436
43437                 return this;
43438             };
43439
43440             jQuery.extend({
43441                 // Is the DOM ready to be used? Set to true once it occurs.
43442                 isReady: false,
43443
43444                 // A counter to track how many items to wait for before
43445                 // the ready event fires. See #6781
43446                 readyWait: 1,
43447
43448                 // Hold (or release) the ready event
43449                 holdReady: function(hold) {
43450                     if (hold) {
43451                         jQuery.readyWait++;
43452                     } else {
43453                         jQuery.ready(true);
43454                     }
43455                 },
43456
43457                 // Handle when the DOM is ready
43458                 ready: function(wait) {
43459
43460                     // Abort if there are pending holds or we're already ready
43461                     if (wait === true ? --jQuery.readyWait : jQuery.isReady) {
43462                         return;
43463                     }
43464
43465                     // Remember that the DOM is ready
43466                     jQuery.isReady = true;
43467
43468                     // If a normal DOM Ready event fired, decrement, and wait if need be
43469                     if (wait !== true && --jQuery.readyWait > 0) {
43470                         return;
43471                     }
43472
43473                     // If there are functions bound, to execute
43474                     readyList.resolveWith(document, [jQuery]);
43475
43476                     // Trigger any bound ready events
43477                     if (jQuery.fn.triggerHandler) {
43478                         jQuery(document).triggerHandler("ready");
43479                         jQuery(document).off("ready");
43480                     }
43481                 }
43482             });
43483
43484             /**
43485              * The ready event handler and self cleanup method
43486              */
43487             function completed() {
43488                 document.removeEventListener("DOMContentLoaded", completed, false);
43489                 window.removeEventListener("load", completed, false);
43490                 jQuery.ready();
43491             }
43492
43493             jQuery.ready.promise = function(obj) {
43494                 if (!readyList) {
43495
43496                     readyList = jQuery.Deferred();
43497
43498                     // Catch cases where $(document).ready() is called after the browser
43499                     // event has already occurred.
43500                     // We once tried to use readyState "interactive" here, but it caused
43501                     // issues like the one
43502                     // discovered by ChrisS here:
43503                     // http://bugs.jquery.com/ticket/12282#comment:15
43504                     if (document.readyState === "complete") {
43505                         // Handle it asynchronously to allow scripts the opportunity to
43506                         // delay ready
43507                         setTimeout(jQuery.ready);
43508
43509                     } else {
43510
43511                         // Use the handy event callback
43512                         document.addEventListener("DOMContentLoaded", completed, false);
43513
43514                         // A fallback to window.onload, that will always work
43515                         window.addEventListener("load", completed, false);
43516                     }
43517                 }
43518                 return readyList.promise(obj);
43519             };
43520
43521             // Kick off the DOM ready check even if the user does not
43522             jQuery.ready.promise();
43523
43524
43525
43526
43527             // Multifunctional method to get and set values of a collection
43528             // The value/s can optionally be executed if it's a function
43529             var access = jQuery.access = function(elems, fn, key, value, chainable, emptyGet, raw) {
43530                 var i = 0,
43531                     len = elems.length,
43532                     bulk = key == null;
43533
43534                 // Sets many values
43535                 if (jQuery.type(key) === "object") {
43536                     chainable = true;
43537                     for (i in key) {
43538                         jQuery.access(elems, fn, i, key[i], true, emptyGet, raw);
43539                     }
43540
43541                     // Sets one value
43542                 } else if (value !== undefined) {
43543                     chainable = true;
43544
43545                     if (!jQuery.isFunction(value)) {
43546                         raw = true;
43547                     }
43548
43549                     if (bulk) {
43550                         // Bulk operations run against the entire set
43551                         if (raw) {
43552                             fn.call(elems, value);
43553                             fn = null;
43554
43555                             // ...except when executing function values
43556                         } else {
43557                             bulk = fn;
43558                             fn = function(elem, key, value) {
43559                                 return bulk.call(jQuery(elem), value);
43560                             };
43561                         }
43562                     }
43563
43564                     if (fn) {
43565                         for (; i < len; i++) {
43566                             fn(elems[i], key, raw ? value : value.call(elems[i], i, fn(elems[i], key)));
43567                         }
43568                     }
43569                 }
43570
43571                 return chainable ?
43572                     elems :
43573
43574                     // Gets
43575                     bulk ?
43576                     fn.call(elems) :
43577                     len ? fn(elems[0], key) : emptyGet;
43578             };
43579
43580
43581             /**
43582              * Determines whether an object can have data
43583              */
43584             jQuery.acceptData = function(owner) {
43585                 // Accepts only:
43586                 // - Node
43587                 // - Node.ELEMENT_NODE
43588                 // - Node.DOCUMENT_NODE
43589                 // - Object
43590                 // - Any
43591                 /* jshint -W018 */
43592                 return owner.nodeType === 1 || owner.nodeType === 9 || !(+owner.nodeType);
43593             };
43594
43595
43596             function Data() {
43597                 // Support: Android<4,
43598                 // Old WebKit does not have Object.preventExtensions/freeze method,
43599                 // return new empty object instead with no [[set]] accessor
43600                 Object.defineProperty(this.cache = {}, 0, {
43601                     get: function() {
43602                         return {};
43603                     }
43604                 });
43605
43606                 this.expando = jQuery.expando + Data.uid++;
43607             }
43608
43609             Data.uid = 1;
43610             Data.accepts = jQuery.acceptData;
43611
43612             Data.prototype = {
43613                 key: function(owner) {
43614                     // We can accept data for non-element nodes in modern browsers,
43615                     // but we should not, see #8335.
43616                     // Always return the key for a frozen object.
43617                     if (!Data.accepts(owner)) {
43618                         return 0;
43619                     }
43620
43621                     var descriptor = {},
43622                         // Check if the owner object already has a cache key
43623                         unlock = owner[this.expando];
43624
43625                     // If not, create one
43626                     if (!unlock) {
43627                         unlock = Data.uid++;
43628
43629                         // Secure it in a non-enumerable, non-writable property
43630                         try {
43631                             descriptor[this.expando] = {
43632                                 value: unlock
43633                             };
43634                             Object.defineProperties(owner, descriptor);
43635
43636                             // Support: Android<4
43637                             // Fallback to a less secure definition
43638                         } catch (e) {
43639                             descriptor[this.expando] = unlock;
43640                             jQuery.extend(owner, descriptor);
43641                         }
43642                     }
43643
43644                     // Ensure the cache object
43645                     if (!this.cache[unlock]) {
43646                         this.cache[unlock] = {};
43647                     }
43648
43649                     return unlock;
43650                 },
43651                 set: function(owner, data, value) {
43652                     var prop,
43653                         // There may be an unlock assigned to this node,
43654                         // if there is no entry for this "owner", create one inline
43655                         // and set the unlock as though an owner entry had always existed
43656                         unlock = this.key(owner),
43657                         cache = this.cache[unlock];
43658
43659                     // Handle: [ owner, key, value ] args
43660                     if (typeof data === "string") {
43661                         cache[data] = value;
43662
43663                         // Handle: [ owner, { properties } ] args
43664                     } else {
43665                         // Fresh assignments by object are shallow copied
43666                         if (jQuery.isEmptyObject(cache)) {
43667                             jQuery.extend(this.cache[unlock], data);
43668                             // Otherwise, copy the properties one-by-one to the cache object
43669                         } else {
43670                             for (prop in data) {
43671                                 cache[prop] = data[prop];
43672                             }
43673                         }
43674                     }
43675                     return cache;
43676                 },
43677                 get: function(owner, key) {
43678                     // Either a valid cache is found, or will be created.
43679                     // New caches will be created and the unlock returned,
43680                     // allowing direct access to the newly created
43681                     // empty data object. A valid owner object must be provided.
43682                     var cache = this.cache[this.key(owner)];
43683
43684                     return key === undefined ?
43685                         cache : cache[key];
43686                 },
43687                 access: function(owner, key, value) {
43688                     var stored;
43689                     // In cases where either:
43690                     //
43691                     // 1. No key was specified
43692                     // 2. A string key was specified, but no value provided
43693                     //
43694                     // Take the "read" path and allow the get method to determine
43695                     // which value to return, respectively either:
43696                     //
43697                     // 1. The entire cache object
43698                     // 2. The data stored at the key
43699                     //
43700                     if (key === undefined ||
43701                         ((key && typeof key === "string") && value === undefined)) {
43702
43703                         stored = this.get(owner, key);
43704
43705                         return stored !== undefined ?
43706                             stored : this.get(owner, jQuery.camelCase(key));
43707                     }
43708
43709                     // [*]When the key is not a string, or both a key and value
43710                     // are specified, set or extend (existing objects) with either:
43711                     //
43712                     // 1. An object of properties
43713                     // 2. A key and value
43714                     //
43715                     this.set(owner, key, value);
43716
43717                     // Since the "set" path can have two possible entry points
43718                     // return the expected data based on which path was taken[*]
43719                     return value !== undefined ? value : key;
43720                 },
43721                 remove: function(owner, key) {
43722                     var i, name, camel,
43723                         unlock = this.key(owner),
43724                         cache = this.cache[unlock];
43725
43726                     if (key === undefined) {
43727                         this.cache[unlock] = {};
43728
43729                     } else {
43730                         // Support array or space separated string of keys
43731                         if (jQuery.isArray(key)) {
43732                             // If "name" is an array of keys...
43733                             // When data is initially created, via ("key", "val") signature,
43734                             // keys will be converted to camelCase.
43735                             // Since there is no way to tell _how_ a key was added, remove
43736                             // both plain key and camelCase key. #12786
43737                             // This will only penalize the array argument path.
43738                             name = key.concat(key.map(jQuery.camelCase));
43739                         } else {
43740                             camel = jQuery.camelCase(key);
43741                             // Try the string as a key before any manipulation
43742                             if (key in cache) {
43743                                 name = [key, camel];
43744                             } else {
43745                                 // If a key with the spaces exists, use it.
43746                                 // Otherwise, create an array by matching non-whitespace
43747                                 name = camel;
43748                                 name = name in cache ? [name] : (name.match(rnotwhite) || []);
43749                             }
43750                         }
43751
43752                         i = name.length;
43753                         while (i--) {
43754                             delete cache[name[i]];
43755                         }
43756                     }
43757                 },
43758                 hasData: function(owner) {
43759                     return !jQuery.isEmptyObject(
43760                         this.cache[owner[this.expando]] || {}
43761                     );
43762                 },
43763                 discard: function(owner) {
43764                     if (owner[this.expando]) {
43765                         delete this.cache[owner[this.expando]];
43766                     }
43767                 }
43768             };
43769             var data_priv = new Data();
43770
43771             var data_user = new Data();
43772
43773
43774
43775             // Implementation Summary
43776             //
43777             // 1. Enforce API surface and semantic compatibility with 1.9.x branch
43778             // 2. Improve the module's maintainability by reducing the storage
43779             // paths to a single mechanism.
43780             // 3. Use the same single mechanism to support "private" and "user" data.
43781             // 4. _Never_ expose "private" data to user code (TODO: Drop _data, _removeData)
43782             // 5. Avoid exposing implementation details on user objects (eg. expando
43783             // properties)
43784             // 6. Provide a clear path for implementation upgrade to WeakMap in 2014
43785
43786             var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,
43787                 rmultiDash = /([A-Z])/g;
43788
43789             function dataAttr(elem, key, data) {
43790                 var name;
43791
43792                 // If nothing was found internally, try to fetch any
43793                 // data from the HTML5 data-* attribute
43794                 if (data === undefined && elem.nodeType === 1) {
43795                     name = "data-" + key.replace(rmultiDash, "-$1").toLowerCase();
43796                     data = elem.getAttribute(name);
43797
43798                     if (typeof data === "string") {
43799                         try {
43800                             data = data === "true" ? true :
43801                                 data === "false" ? false :
43802                                 data === "null" ? null :
43803                                 // Only convert to a number if it doesn't change the string
43804                                 +data + "" === data ? +data :
43805                                 rbrace.test(data) ? jQuery.parseJSON(data) :
43806                                 data;
43807                         } catch (e) {}
43808
43809                         // Make sure we set the data so it isn't changed later
43810                         data_user.set(elem, key, data);
43811                     } else {
43812                         data = undefined;
43813                     }
43814                 }
43815                 return data;
43816             }
43817
43818             jQuery.extend({
43819                 hasData: function(elem) {
43820                     return data_user.hasData(elem) || data_priv.hasData(elem);
43821                 },
43822
43823                 data: function(elem, name, data) {
43824                     return data_user.access(elem, name, data);
43825                 },
43826
43827                 removeData: function(elem, name) {
43828                     data_user.remove(elem, name);
43829                 },
43830
43831                 // TODO: Now that all calls to _data and _removeData have been replaced
43832                 // with direct calls to data_priv methods, these can be deprecated.
43833                 _data: function(elem, name, data) {
43834                     return data_priv.access(elem, name, data);
43835                 },
43836
43837                 _removeData: function(elem, name) {
43838                     data_priv.remove(elem, name);
43839                 }
43840             });
43841
43842             jQuery.fn.extend({
43843                 data: function(key, value) {
43844                     var i, name, data,
43845                         elem = this[0],
43846                         attrs = elem && elem.attributes;
43847
43848                     // Gets all values
43849                     if (key === undefined) {
43850                         if (this.length) {
43851                             data = data_user.get(elem);
43852
43853                             if (elem.nodeType === 1 && !data_priv.get(elem, "hasDataAttrs")) {
43854                                 i = attrs.length;
43855                                 while (i--) {
43856
43857                                     // Support: IE11+
43858                                     // The attrs elements can be null (#14894)
43859                                     if (attrs[i]) {
43860                                         name = attrs[i].name;
43861                                         if (name.indexOf("data-") === 0) {
43862                                             name = jQuery.camelCase(name.slice(5));
43863                                             dataAttr(elem, name, data[name]);
43864                                         }
43865                                     }
43866                                 }
43867                                 data_priv.set(elem, "hasDataAttrs", true);
43868                             }
43869                         }
43870
43871                         return data;
43872                     }
43873
43874                     // Sets multiple values
43875                     if (typeof key === "object") {
43876                         return this.each(function() {
43877                             data_user.set(this, key);
43878                         });
43879                     }
43880
43881                     return access(this, function(value) {
43882                         var data,
43883                             camelKey = jQuery.camelCase(key);
43884
43885                         // The calling jQuery object (element matches) is not empty
43886                         // (and therefore has an element appears at this[ 0 ]) and the
43887                         // `value` parameter was not undefined. An empty jQuery object
43888                         // will result in `undefined` for elem = this[ 0 ] which will
43889                         // throw an exception if an attempt to read a data cache is made.
43890                         if (elem && value === undefined) {
43891                             // Attempt to get data from the cache
43892                             // with the key as-is
43893                             data = data_user.get(elem, key);
43894                             if (data !== undefined) {
43895                                 return data;
43896                             }
43897
43898                             // Attempt to get data from the cache
43899                             // with the key camelized
43900                             data = data_user.get(elem, camelKey);
43901                             if (data !== undefined) {
43902                                 return data;
43903                             }
43904
43905                             // Attempt to "discover" the data in
43906                             // HTML5 custom data-* attrs
43907                             data = dataAttr(elem, camelKey, undefined);
43908                             if (data !== undefined) {
43909                                 return data;
43910                             }
43911
43912                             // We tried really hard, but the data doesn't exist.
43913                             return;
43914                         }
43915
43916                         // Set the data...
43917                         this.each(function() {
43918                             // First, attempt to store a copy or reference of any
43919                             // data that might've been store with a camelCased key.
43920                             var data = data_user.get(this, camelKey);
43921
43922                             // For HTML5 data-* attribute interop, we have to
43923                             // store property names with dashes in a camelCase form.
43924                             // This might not apply to all properties...*
43925                             data_user.set(this, camelKey, value);
43926
43927                             // *... In the case of properties that might _actually_
43928                             // have dashes, we need to also store a copy of that
43929                             // unchanged property.
43930                             if (key.indexOf("-") !== -1 && data !== undefined) {
43931                                 data_user.set(this, key, value);
43932                             }
43933                         });
43934                     }, null, value, arguments.length > 1, null, true);
43935                 },
43936
43937                 removeData: function(key) {
43938                     return this.each(function() {
43939                         data_user.remove(this, key);
43940                     });
43941                 }
43942             });
43943
43944
43945             jQuery.extend({
43946                 queue: function(elem, type, data) {
43947                     var queue;
43948
43949                     if (elem) {
43950                         type = (type || "fx") + "queue";
43951                         queue = data_priv.get(elem, type);
43952
43953                         // Speed up dequeue by getting out quickly if this is just a lookup
43954                         if (data) {
43955                             if (!queue || jQuery.isArray(data)) {
43956                                 queue = data_priv.access(elem, type, jQuery.makeArray(data));
43957                             } else {
43958                                 queue.push(data);
43959                             }
43960                         }
43961                         return queue || [];
43962                     }
43963                 },
43964
43965                 dequeue: function(elem, type) {
43966                     type = type || "fx";
43967
43968                     var queue = jQuery.queue(elem, type),
43969                         startLength = queue.length,
43970                         fn = queue.shift(),
43971                         hooks = jQuery._queueHooks(elem, type),
43972                         next = function() {
43973                             jQuery.dequeue(elem, type);
43974                         };
43975
43976                     // If the fx queue is dequeued, always remove the progress sentinel
43977                     if (fn === "inprogress") {
43978                         fn = queue.shift();
43979                         startLength--;
43980                     }
43981
43982                     if (fn) {
43983
43984                         // Add a progress sentinel to prevent the fx queue from being
43985                         // automatically dequeued
43986                         if (type === "fx") {
43987                             queue.unshift("inprogress");
43988                         }
43989
43990                         // Clear up the last queue stop function
43991                         delete hooks.stop;
43992                         fn.call(elem, next, hooks);
43993                     }
43994
43995                     if (!startLength && hooks) {
43996                         hooks.empty.fire();
43997                     }
43998                 },
43999
44000                 // Not public - generate a queueHooks object, or return the current one
44001                 _queueHooks: function(elem, type) {
44002                     var key = type + "queueHooks";
44003                     return data_priv.get(elem, key) || data_priv.access(elem, key, {
44004                         empty: jQuery.Callbacks("once memory").add(function() {
44005                             data_priv.remove(elem, [type + "queue", key]);
44006                         })
44007                     });
44008                 }
44009             });
44010
44011             jQuery.fn.extend({
44012                 queue: function(type, data) {
44013                     var setter = 2;
44014
44015                     if (typeof type !== "string") {
44016                         data = type;
44017                         type = "fx";
44018                         setter--;
44019                     }
44020
44021                     if (arguments.length < setter) {
44022                         return jQuery.queue(this[0], type);
44023                     }
44024
44025                     return data === undefined ?
44026                         this :
44027                         this.each(function() {
44028                             var queue = jQuery.queue(this, type, data);
44029
44030                             // Ensure a hooks for this queue
44031                             jQuery._queueHooks(this, type);
44032
44033                             if (type === "fx" && queue[0] !== "inprogress") {
44034                                 jQuery.dequeue(this, type);
44035                             }
44036                         });
44037                 },
44038                 dequeue: function(type) {
44039                     return this.each(function() {
44040                         jQuery.dequeue(this, type);
44041                     });
44042                 },
44043                 clearQueue: function(type) {
44044                     return this.queue(type || "fx", []);
44045                 },
44046                 // Get a promise resolved when queues of a certain type
44047                 // are emptied (fx is the type by default)
44048                 promise: function(type, obj) {
44049                     var tmp,
44050                         count = 1,
44051                         defer = jQuery.Deferred(),
44052                         elements = this,
44053                         i = this.length,
44054                         resolve = function() {
44055                             if (!(--count)) {
44056                                 defer.resolveWith(elements, [elements]);
44057                             }
44058                         };
44059
44060                     if (typeof type !== "string") {
44061                         obj = type;
44062                         type = undefined;
44063                     }
44064                     type = type || "fx";
44065
44066                     while (i--) {
44067                         tmp = data_priv.get(elements[i], type + "queueHooks");
44068                         if (tmp && tmp.empty) {
44069                             count++;
44070                             tmp.empty.add(resolve);
44071                         }
44072                     }
44073                     resolve();
44074                     return defer.promise(obj);
44075                 }
44076             });
44077             var pnum = (/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/).source;
44078
44079             var cssExpand = ["Top", "Right", "Bottom", "Left"];
44080
44081             var isHidden = function(elem, el) {
44082                 // isHidden might be called from jQuery#filter function;
44083                 // in that case, element will be second argument
44084                 elem = el || elem;
44085                 return jQuery.css(elem, "display") === "none" || !jQuery.contains(elem.ownerDocument, elem);
44086             };
44087
44088             var rcheckableType = (/^(?:checkbox|radio)$/i);
44089
44090
44091
44092             (function() {
44093                 var fragment = document.createDocumentFragment(),
44094                     div = fragment.appendChild(document.createElement("div")),
44095                     input = document.createElement("input");
44096
44097                 // Support: Safari<=5.1
44098                 // Check state lost if the name is set (#11217)
44099                 // Support: Windows Web Apps (WWA)
44100                 // `name` and `type` must use .setAttribute for WWA (#14901)
44101                 input.setAttribute("type", "radio");
44102                 input.setAttribute("checked", "checked");
44103                 input.setAttribute("name", "t");
44104
44105                 div.appendChild(input);
44106
44107                 // Support: Safari<=5.1, Android<4.2
44108                 // Older WebKit doesn't clone checked state correctly in fragments
44109                 support.checkClone = div.cloneNode(true).cloneNode(true).lastChild.checked;
44110
44111                 // Support: IE<=11+
44112                 // Make sure textarea (and checkbox) defaultValue is properly cloned
44113                 div.innerHTML = "<textarea>x</textarea>";
44114                 support.noCloneChecked = !!div.cloneNode(true).lastChild.defaultValue;
44115             })();
44116             var strundefined = typeof undefined;
44117
44118
44119
44120             support.focusinBubbles = "onfocusin" in window;
44121
44122
44123             var
44124                 rkeyEvent = /^key/,
44125                 rmouseEvent = /^(?:mouse|pointer|contextmenu)|click/,
44126                 rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,
44127                 rtypenamespace = /^([^.]*)(?:\.(.+)|)$/;
44128
44129             function returnTrue() {
44130                 return true;
44131             }
44132
44133             function returnFalse() {
44134                 return false;
44135             }
44136
44137             function safeActiveElement() {
44138                 try {
44139                     return document.activeElement;
44140                 } catch (err) {}
44141             }
44142
44143             /*
44144              * Helper functions for managing events -- not part of the public interface.
44145              * Props to Dean Edwards' addEvent library for many of the ideas.
44146              */
44147             jQuery.event = {
44148
44149                 global: {},
44150
44151                 add: function(elem, types, handler, data, selector) {
44152
44153                     var handleObjIn, eventHandle, tmp,
44154                         events, t, handleObj,
44155                         special, handlers, type, namespaces, origType,
44156                         elemData = data_priv.get(elem);
44157
44158                     // Don't attach events to noData or text/comment nodes (but allow plain
44159                     // objects)
44160                     if (!elemData) {
44161                         return;
44162                     }
44163
44164                     // Caller can pass in an object of custom data in lieu of the handler
44165                     if (handler.handler) {
44166                         handleObjIn = handler;
44167                         handler = handleObjIn.handler;
44168                         selector = handleObjIn.selector;
44169                     }
44170
44171                     // Make sure that the handler has a unique ID, used to find/remove it
44172                     // later
44173                     if (!handler.guid) {
44174                         handler.guid = jQuery.guid++;
44175                     }
44176
44177                     // Init the element's event structure and main handler, if this is the
44178                     // first
44179                     if (!(events = elemData.events)) {
44180                         events = elemData.events = {};
44181                     }
44182                     if (!(eventHandle = elemData.handle)) {
44183                         eventHandle = elemData.handle = function(e) {
44184                             // Discard the second event of a jQuery.event.trigger() and
44185                             // when an event is called after a page has unloaded
44186                             return typeof jQuery !== strundefined && jQuery.event.triggered !== e.type ?
44187                                 jQuery.event.dispatch.apply(elem, arguments) : undefined;
44188                         };
44189                     }
44190
44191                     // Handle multiple events separated by a space
44192                     types = (types || "").match(rnotwhite) || [""];
44193                     t = types.length;
44194                     while (t--) {
44195                         tmp = rtypenamespace.exec(types[t]) || [];
44196                         type = origType = tmp[1];
44197                         namespaces = (tmp[2] || "").split(".").sort();
44198
44199                         // There *must* be a type, no attaching namespace-only handlers
44200                         if (!type) {
44201                             continue;
44202                         }
44203
44204                         // If event changes its type, use the special event handlers for the
44205                         // changed type
44206                         special = jQuery.event.special[type] || {};
44207
44208                         // If selector defined, determine special event api type, otherwise
44209                         // given type
44210                         type = (selector ? special.delegateType : special.bindType) || type;
44211
44212                         // Update special based on newly reset type
44213                         special = jQuery.event.special[type] || {};
44214
44215                         // handleObj is passed to all event handlers
44216                         handleObj = jQuery.extend({
44217                             type: type,
44218                             origType: origType,
44219                             data: data,
44220                             handler: handler,
44221                             guid: handler.guid,
44222                             selector: selector,
44223                             needsContext: selector && jQuery.expr.match.needsContext.test(selector),
44224                             namespace: namespaces.join(".")
44225                         }, handleObjIn);
44226
44227                         // Init the event handler queue if we're the first
44228                         if (!(handlers = events[type])) {
44229                             handlers = events[type] = [];
44230                             handlers.delegateCount = 0;
44231
44232                             // Only use addEventListener if the special events handler
44233                             // returns false
44234                             if (!special.setup || special.setup.call(elem, data, namespaces, eventHandle) === false) {
44235                                 if (elem.addEventListener) {
44236                                     elem.addEventListener(type, eventHandle, false);
44237                                 }
44238                             }
44239                         }
44240
44241                         if (special.add) {
44242                             special.add.call(elem, handleObj);
44243
44244                             if (!handleObj.handler.guid) {
44245                                 handleObj.handler.guid = handler.guid;
44246                             }
44247                         }
44248
44249                         // Add to the element's handler list, delegates in front
44250                         if (selector) {
44251                             handlers.splice(handlers.delegateCount++, 0, handleObj);
44252                         } else {
44253                             handlers.push(handleObj);
44254                         }
44255
44256                         // Keep track of which events have ever been used, for event
44257                         // optimization
44258                         jQuery.event.global[type] = true;
44259                     }
44260
44261                 },
44262
44263                 // Detach an event or set of events from an element
44264                 remove: function(elem, types, handler, selector, mappedTypes) {
44265
44266                     var j, origCount, tmp,
44267                         events, t, handleObj,
44268                         special, handlers, type, namespaces, origType,
44269                         elemData = data_priv.hasData(elem) && data_priv.get(elem);
44270
44271                     if (!elemData || !(events = elemData.events)) {
44272                         return;
44273                     }
44274
44275                     // Once for each type.namespace in types; type may be omitted
44276                     types = (types || "").match(rnotwhite) || [""];
44277                     t = types.length;
44278                     while (t--) {
44279                         tmp = rtypenamespace.exec(types[t]) || [];
44280                         type = origType = tmp[1];
44281                         namespaces = (tmp[2] || "").split(".").sort();
44282
44283                         // Unbind all events (on this namespace, if provided) for the
44284                         // element
44285                         if (!type) {
44286                             for (type in events) {
44287                                 jQuery.event.remove(elem, type + types[t], handler, selector, true);
44288                             }
44289                             continue;
44290                         }
44291
44292                         special = jQuery.event.special[type] || {};
44293                         type = (selector ? special.delegateType : special.bindType) || type;
44294                         handlers = events[type] || [];
44295                         tmp = tmp[2] && new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)");
44296
44297                         // Remove matching events
44298                         origCount = j = handlers.length;
44299                         while (j--) {
44300                             handleObj = handlers[j];
44301
44302                             if ((mappedTypes || origType === handleObj.origType) &&
44303                                 (!handler || handler.guid === handleObj.guid) &&
44304                                 (!tmp || tmp.test(handleObj.namespace)) &&
44305                                 (!selector || selector === handleObj.selector || selector === "**" && handleObj.selector)) {
44306                                 handlers.splice(j, 1);
44307
44308                                 if (handleObj.selector) {
44309                                     handlers.delegateCount--;
44310                                 }
44311                                 if (special.remove) {
44312                                     special.remove.call(elem, handleObj);
44313                                 }
44314                             }
44315                         }
44316
44317                         // Remove generic event handler if we removed something and no more
44318                         // handlers exist
44319                         // (avoids potential for endless recursion during removal of special
44320                         // event handlers)
44321                         if (origCount && !handlers.length) {
44322                             if (!special.teardown || special.teardown.call(elem, namespaces, elemData.handle) === false) {
44323                                 jQuery.removeEvent(elem, type, elemData.handle);
44324                             }
44325
44326                             delete events[type];
44327                         }
44328                     }
44329
44330                     // Remove the expando if it's no longer used
44331                     if (jQuery.isEmptyObject(events)) {
44332                         delete elemData.handle;
44333                         data_priv.remove(elem, "events");
44334                     }
44335                 },
44336
44337                 trigger: function(event, data, elem, onlyHandlers) {
44338
44339                     var i, cur, tmp, bubbleType, ontype, handle, special,
44340                         eventPath = [elem || document],
44341                         type = hasOwn.call(event, "type") ? event.type : event,
44342                         namespaces = hasOwn.call(event, "namespace") ? event.namespace.split(".") : [];
44343
44344                     cur = tmp = elem = elem || document;
44345
44346                     // Don't do events on text and comment nodes
44347                     if (elem.nodeType === 3 || elem.nodeType === 8) {
44348                         return;
44349                     }
44350
44351                     // focus/blur morphs to focusin/out; ensure we're not firing them right
44352                     // now
44353                     if (rfocusMorph.test(type + jQuery.event.triggered)) {
44354                         return;
44355                     }
44356
44357                     if (type.indexOf(".") >= 0) {
44358                         // Namespaced trigger; create a regexp to match event type in
44359                         // handle()
44360                         namespaces = type.split(".");
44361                         type = namespaces.shift();
44362                         namespaces.sort();
44363                     }
44364                     ontype = type.indexOf(":") < 0 && "on" + type;
44365
44366                     // Caller can pass in a jQuery.Event object, Object, or just an event
44367                     // type string
44368                     event = event[jQuery.expando] ?
44369                         event :
44370                         new jQuery.Event(type, typeof event === "object" && event);
44371
44372                     // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always
44373                     // true)
44374                     event.isTrigger = onlyHandlers ? 2 : 3;
44375                     event.namespace = namespaces.join(".");
44376                     event.namespace_re = event.namespace ?
44377                         new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)") :
44378                         null;
44379
44380                     // Clean up the event in case it is being reused
44381                     event.result = undefined;
44382                     if (!event.target) {
44383                         event.target = elem;
44384                     }
44385
44386                     // Clone any incoming data and prepend the event, creating the handler
44387                     // arg list
44388                     data = data == null ? [event] :
44389                         jQuery.makeArray(data, [event]);
44390
44391                     // Allow special events to draw outside the lines
44392                     special = jQuery.event.special[type] || {};
44393                     if (!onlyHandlers && special.trigger && special.trigger.apply(elem, data) === false) {
44394                         return;
44395                     }
44396
44397                     // Determine event propagation path in advance, per W3C events spec
44398                     // (#9951)
44399                     // Bubble up to document, then to window; watch for a global
44400                     // ownerDocument var (#9724)
44401                     if (!onlyHandlers && !special.noBubble && !jQuery.isWindow(elem)) {
44402
44403                         bubbleType = special.delegateType || type;
44404                         if (!rfocusMorph.test(bubbleType + type)) {
44405                             cur = cur.parentNode;
44406                         }
44407                         for (; cur; cur = cur.parentNode) {
44408                             eventPath.push(cur);
44409                             tmp = cur;
44410                         }
44411
44412                         // Only add window if we got to document (e.g., not plain obj or
44413                         // detached DOM)
44414                         if (tmp === (elem.ownerDocument || document)) {
44415                             eventPath.push(tmp.defaultView || tmp.parentWindow || window);
44416                         }
44417                     }
44418
44419                     // Fire handlers on the event path
44420                     i = 0;
44421                     while ((cur = eventPath[i++]) && !event.isPropagationStopped()) {
44422
44423                         event.type = i > 1 ?
44424                             bubbleType :
44425                             special.bindType || type;
44426
44427                         // jQuery handler
44428                         handle = (data_priv.get(cur, "events") || {})[event.type] && data_priv.get(cur, "handle");
44429                         if (handle) {
44430                             handle.apply(cur, data);
44431                         }
44432
44433                         // Native handler
44434                         handle = ontype && cur[ontype];
44435                         if (handle && handle.apply && jQuery.acceptData(cur)) {
44436                             event.result = handle.apply(cur, data);
44437                             if (event.result === false) {
44438                                 event.preventDefault();
44439                             }
44440                         }
44441                     }
44442                     event.type = type;
44443
44444                     // If nobody prevented the default action, do it now
44445                     if (!onlyHandlers && !event.isDefaultPrevented()) {
44446
44447                         if ((!special._default || special._default.apply(eventPath.pop(), data) === false) &&
44448                             jQuery.acceptData(elem)) {
44449
44450                             // Call a native DOM method on the target with the same name
44451                             // name as the event.
44452                             // Don't do default actions on window, that's where global
44453                             // variables be (#6170)
44454                             if (ontype && jQuery.isFunction(elem[type]) && !jQuery.isWindow(elem)) {
44455
44456                                 // Don't re-trigger an onFOO event when we call its FOO()
44457                                 // method
44458                                 tmp = elem[ontype];
44459
44460                                 if (tmp) {
44461                                     elem[ontype] = null;
44462                                 }
44463
44464                                 // Prevent re-triggering of the same event, since we already
44465                                 // bubbled it above
44466                                 jQuery.event.triggered = type;
44467                                 elem[type]();
44468                                 jQuery.event.triggered = undefined;
44469
44470                                 if (tmp) {
44471                                     elem[ontype] = tmp;
44472                                 }
44473                             }
44474                         }
44475                     }
44476
44477                     return event.result;
44478                 },
44479
44480                 dispatch: function(event) {
44481
44482                     // Make a writable jQuery.Event from the native event object
44483                     event = jQuery.event.fix(event);
44484
44485                     var i, j, ret, matched, handleObj,
44486                         handlerQueue = [],
44487                         args = slice.call(arguments),
44488                         handlers = (data_priv.get(this, "events") || {})[event.type] || [],
44489                         special = jQuery.event.special[event.type] || {};
44490
44491                     // Use the fix-ed jQuery.Event rather than the (read-only) native event
44492                     args[0] = event;
44493                     event.delegateTarget = this;
44494
44495                     // Call the preDispatch hook for the mapped type, and let it bail if
44496                     // desired
44497                     if (special.preDispatch && special.preDispatch.call(this, event) === false) {
44498                         return;
44499                     }
44500
44501                     // Determine handlers
44502                     handlerQueue = jQuery.event.handlers.call(this, event, handlers);
44503
44504                     // Run delegates first; they may want to stop propagation beneath us
44505                     i = 0;
44506                     while ((matched = handlerQueue[i++]) && !event.isPropagationStopped()) {
44507                         event.currentTarget = matched.elem;
44508
44509                         j = 0;
44510                         while ((handleObj = matched.handlers[j++]) && !event.isImmediatePropagationStopped()) {
44511
44512                             // Triggered event must either 1) have no namespace, or 2) have
44513                             // namespace(s)
44514                             // a subset or equal to those in the bound event (both can have
44515                             // no namespace).
44516                             if (!event.namespace_re || event.namespace_re.test(handleObj.namespace)) {
44517
44518                                 event.handleObj = handleObj;
44519                                 event.data = handleObj.data;
44520
44521                                 ret = ((jQuery.event.special[handleObj.origType] || {}).handle || handleObj.handler)
44522                                     .apply(matched.elem, args);
44523
44524                                 if (ret !== undefined) {
44525                                     if ((event.result = ret) === false) {
44526                                         event.preventDefault();
44527                                         event.stopPropagation();
44528                                     }
44529                                 }
44530                             }
44531                         }
44532                     }
44533
44534                     // Call the postDispatch hook for the mapped type
44535                     if (special.postDispatch) {
44536                         special.postDispatch.call(this, event);
44537                     }
44538
44539                     return event.result;
44540                 },
44541
44542                 handlers: function(event, handlers) {
44543                     var i, matches, sel, handleObj,
44544                         handlerQueue = [],
44545                         delegateCount = handlers.delegateCount,
44546                         cur = event.target;
44547
44548                     // Find delegate handlers
44549                     // Black-hole SVG <use> instance trees (#13180)
44550                     // Avoid non-left-click bubbling in Firefox (#3861)
44551                     if (delegateCount && cur.nodeType && (!event.button || event.type !== "click")) {
44552
44553                         for (; cur !== this; cur = cur.parentNode || this) {
44554
44555                             // Don't process clicks on disabled elements (#6911, #8165,
44556                             // #11382, #11764)
44557                             if (cur.disabled !== true || event.type !== "click") {
44558                                 matches = [];
44559                                 for (i = 0; i < delegateCount; i++) {
44560                                     handleObj = handlers[i];
44561
44562                                     // Don't conflict with Object.prototype properties
44563                                     // (#13203)
44564                                     sel = handleObj.selector + " ";
44565
44566                                     if (matches[sel] === undefined) {
44567                                         matches[sel] = handleObj.needsContext ?
44568                                             jQuery(sel, this).index(cur) >= 0 :
44569                                             jQuery.find(sel, this, null, [cur]).length;
44570                                     }
44571                                     if (matches[sel]) {
44572                                         matches.push(handleObj);
44573                                     }
44574                                 }
44575                                 if (matches.length) {
44576                                     handlerQueue.push({
44577                                         elem: cur,
44578                                         handlers: matches
44579                                     });
44580                                 }
44581                             }
44582                         }
44583                     }
44584
44585                     // Add the remaining (directly-bound) handlers
44586                     if (delegateCount < handlers.length) {
44587                         handlerQueue.push({
44588                             elem: this,
44589                             handlers: handlers.slice(delegateCount)
44590                         });
44591                     }
44592
44593                     return handlerQueue;
44594                 },
44595
44596                 // Includes some event props shared by KeyEvent and MouseEvent
44597                 props: "altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),
44598
44599                 fixHooks: {},
44600
44601                 keyHooks: {
44602                     props: "char charCode key keyCode".split(" "),
44603                     filter: function(event, original) {
44604
44605                         // Add which for key events
44606                         if (event.which == null) {
44607                             event.which = original.charCode != null ? original.charCode : original.keyCode;
44608                         }
44609
44610                         return event;
44611                     }
44612                 },
44613
44614                 mouseHooks: {
44615                     props: "button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement".split(" "),
44616                     filter: function(event, original) {
44617                         var eventDoc, doc, body,
44618                             button = original.button;
44619
44620                         // Calculate pageX/Y if missing and clientX/Y available
44621                         if (event.pageX == null && original.clientX != null) {
44622                             eventDoc = event.target.ownerDocument || document;
44623                             doc = eventDoc.documentElement;
44624                             body = eventDoc.body;
44625
44626                             event.pageX = original.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc && doc.clientLeft || body && body.clientLeft || 0);
44627                             event.pageY = original.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) - (doc && doc.clientTop || body && body.clientTop || 0);
44628                         }
44629
44630                         // Add which for click: 1 === left; 2 === middle; 3 === right
44631                         // Note: button is not normalized, so don't use it
44632                         if (!event.which && button !== undefined) {
44633                             event.which = (button & 1 ? 1 : (button & 2 ? 3 : (button & 4 ? 2 : 0)));
44634                         }
44635
44636                         return event;
44637                     }
44638                 },
44639
44640                 fix: function(event) {
44641                     if (event[jQuery.expando]) {
44642                         return event;
44643                     }
44644
44645                     // Create a writable copy of the event object and normalize some
44646                     // properties
44647                     var i, prop, copy,
44648                         type = event.type,
44649                         originalEvent = event,
44650                         fixHook = this.fixHooks[type];
44651
44652                     if (!fixHook) {
44653                         this.fixHooks[type] = fixHook =
44654                             rmouseEvent.test(type) ? this.mouseHooks :
44655                             rkeyEvent.test(type) ? this.keyHooks : {};
44656                     }
44657                     copy = fixHook.props ? this.props.concat(fixHook.props) : this.props;
44658
44659                     event = new jQuery.Event(originalEvent);
44660
44661                     i = copy.length;
44662                     while (i--) {
44663                         prop = copy[i];
44664                         event[prop] = originalEvent[prop];
44665                     }
44666
44667                     // Support: Cordova 2.5 (WebKit) (#13255)
44668                     // All events should have a target; Cordova deviceready doesn't
44669                     if (!event.target) {
44670                         event.target = document;
44671                     }
44672
44673                     // Support: Safari 6.0+, Chrome<28
44674                     // Target should not be a text node (#504, #13143)
44675                     if (event.target.nodeType === 3) {
44676                         event.target = event.target.parentNode;
44677                     }
44678
44679                     return fixHook.filter ? fixHook.filter(event, originalEvent) : event;
44680                 },
44681
44682                 special: {
44683                     load: {
44684                         // Prevent triggered image.load events from bubbling to window.load
44685                         noBubble: true
44686                     },
44687                     focus: {
44688                         // Fire native event if possible so blur/focus sequence is correct
44689                         trigger: function() {
44690                             if (this !== safeActiveElement() && this.focus) {
44691                                 this.focus();
44692                                 return false;
44693                             }
44694                         },
44695                         delegateType: "focusin"
44696                     },
44697                     blur: {
44698                         trigger: function() {
44699                             if (this === safeActiveElement() && this.blur) {
44700                                 this.blur();
44701                                 return false;
44702                             }
44703                         },
44704                         delegateType: "focusout"
44705                     },
44706                     click: {
44707                         // For checkbox, fire native event so checked state will be right
44708                         trigger: function() {
44709                             if (this.type === "checkbox" && this.click && jQuery.nodeName(this, "input")) {
44710                                 this.click();
44711                                 return false;
44712                             }
44713                         },
44714
44715                         // For cross-browser consistency, don't fire native .click() on
44716                         // links
44717                         _default: function(event) {
44718                             return jQuery.nodeName(event.target, "a");
44719                         }
44720                     },
44721
44722                     beforeunload: {
44723                         postDispatch: function(event) {
44724
44725                             // Support: Firefox 20+
44726                             // Firefox doesn't alert if the returnValue field is not set.
44727                             if (event.result !== undefined && event.originalEvent) {
44728                                 event.originalEvent.returnValue = event.result;
44729                             }
44730                         }
44731                     }
44732                 },
44733
44734                 simulate: function(type, elem, event, bubble) {
44735                     // Piggyback on a donor event to simulate a different one.
44736                     // Fake originalEvent to avoid donor's stopPropagation, but if the
44737                     // simulated event prevents default then we do the same on the donor.
44738                     var e = jQuery.extend(
44739                         new jQuery.Event(),
44740                         event, {
44741                             type: type,
44742                             isSimulated: true,
44743                             originalEvent: {}
44744                         }
44745                     );
44746                     if (bubble) {
44747                         jQuery.event.trigger(e, null, elem);
44748                     } else {
44749                         jQuery.event.dispatch.call(elem, e);
44750                     }
44751                     if (e.isDefaultPrevented()) {
44752                         event.preventDefault();
44753                     }
44754                 }
44755             };
44756
44757             jQuery.removeEvent = function(elem, type, handle) {
44758                 if (elem.removeEventListener) {
44759                     elem.removeEventListener(type, handle, false);
44760                 }
44761             };
44762
44763             jQuery.Event = function(src, props) {
44764                 // Allow instantiation without the 'new' keyword
44765                 if (!(this instanceof jQuery.Event)) {
44766                     return new jQuery.Event(src, props);
44767                 }
44768
44769                 // Event object
44770                 if (src && src.type) {
44771                     this.originalEvent = src;
44772                     this.type = src.type;
44773
44774                     // Events bubbling up the document may have been marked as prevented
44775                     // by a handler lower down the tree; reflect the correct value.
44776                     this.isDefaultPrevented = src.defaultPrevented ||
44777                         src.defaultPrevented === undefined &&
44778                         // Support: Android<4.0
44779                         src.returnValue === false ?
44780                         returnTrue :
44781                         returnFalse;
44782
44783                     // Event type
44784                 } else {
44785                     this.type = src;
44786                 }
44787
44788                 // Put explicitly provided properties onto the event object
44789                 if (props) {
44790                     jQuery.extend(this, props);
44791                 }
44792
44793                 // Create a timestamp if incoming event doesn't have one
44794                 this.timeStamp = src && src.timeStamp || jQuery.now();
44795
44796                 // Mark it as fixed
44797                 this[jQuery.expando] = true;
44798             };
44799
44800             // jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language
44801             // Binding
44802             // http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
44803             jQuery.Event.prototype = {
44804                 isDefaultPrevented: returnFalse,
44805                 isPropagationStopped: returnFalse,
44806                 isImmediatePropagationStopped: returnFalse,
44807
44808                 preventDefault: function() {
44809                     var e = this.originalEvent;
44810
44811                     this.isDefaultPrevented = returnTrue;
44812
44813                     if (e && e.preventDefault) {
44814                         e.preventDefault();
44815                     }
44816                 },
44817                 stopPropagation: function() {
44818                     var e = this.originalEvent;
44819
44820                     this.isPropagationStopped = returnTrue;
44821
44822                     if (e && e.stopPropagation) {
44823                         e.stopPropagation();
44824                     }
44825                 },
44826                 stopImmediatePropagation: function() {
44827                     var e = this.originalEvent;
44828
44829                     this.isImmediatePropagationStopped = returnTrue;
44830
44831                     if (e && e.stopImmediatePropagation) {
44832                         e.stopImmediatePropagation();
44833                     }
44834
44835                     this.stopPropagation();
44836                 }
44837             };
44838
44839             // Create mouseenter/leave events using mouseover/out and event-time checks
44840             // Support: Chrome 15+
44841             jQuery.each({
44842                 mouseenter: "mouseover",
44843                 mouseleave: "mouseout",
44844                 pointerenter: "pointerover",
44845                 pointerleave: "pointerout"
44846             }, function(orig, fix) {
44847                 jQuery.event.special[orig] = {
44848                     delegateType: fix,
44849                     bindType: fix,
44850
44851                     handle: function(event) {
44852                         var ret,
44853                             target = this,
44854                             related = event.relatedTarget,
44855                             handleObj = event.handleObj;
44856
44857                         // For mousenter/leave call the handler if related is outside the
44858                         // target.
44859                         // NB: No relatedTarget if the mouse left/entered the browser window
44860                         if (!related || (related !== target && !jQuery.contains(target, related))) {
44861                             event.type = handleObj.origType;
44862                             ret = handleObj.handler.apply(this, arguments);
44863                             event.type = fix;
44864                         }
44865                         return ret;
44866                     }
44867                 };
44868             });
44869
44870             // Support: Firefox, Chrome, Safari
44871             // Create "bubbling" focus and blur events
44872             if (!support.focusinBubbles) {
44873                 jQuery.each({
44874                     focus: "focusin",
44875                     blur: "focusout"
44876                 }, function(orig, fix) {
44877
44878                     // Attach a single capturing handler on the document while someone wants
44879                     // focusin/focusout
44880                     var handler = function(event) {
44881                         jQuery.event.simulate(fix, event.target, jQuery.event.fix(event), true);
44882                     };
44883
44884                     jQuery.event.special[fix] = {
44885                         setup: function() {
44886                             var doc = this.ownerDocument || this,
44887                                 attaches = data_priv.access(doc, fix);
44888
44889                             if (!attaches) {
44890                                 doc.addEventListener(orig, handler, true);
44891                             }
44892                             data_priv.access(doc, fix, (attaches || 0) + 1);
44893                         },
44894                         teardown: function() {
44895                             var doc = this.ownerDocument || this,
44896                                 attaches = data_priv.access(doc, fix) - 1;
44897
44898                             if (!attaches) {
44899                                 doc.removeEventListener(orig, handler, true);
44900                                 data_priv.remove(doc, fix);
44901
44902                             } else {
44903                                 data_priv.access(doc, fix, attaches);
44904                             }
44905                         }
44906                     };
44907                 });
44908             }
44909
44910             jQuery.fn.extend({
44911
44912                 on: function(types, selector, data, fn, /* INTERNAL */ one) {
44913                     var origFn, type;
44914
44915                     // Types can be a map of types/handlers
44916                     if (typeof types === "object") {
44917                         // ( types-Object, selector, data )
44918                         if (typeof selector !== "string") {
44919                             // ( types-Object, data )
44920                             data = data || selector;
44921                             selector = undefined;
44922                         }
44923                         for (type in types) {
44924                             this.on(type, selector, data, types[type], one);
44925                         }
44926                         return this;
44927                     }
44928
44929                     if (data == null && fn == null) {
44930                         // ( types, fn )
44931                         fn = selector;
44932                         data = selector = undefined;
44933                     } else if (fn == null) {
44934                         if (typeof selector === "string") {
44935                             // ( types, selector, fn )
44936                             fn = data;
44937                             data = undefined;
44938                         } else {
44939                             // ( types, data, fn )
44940                             fn = data;
44941                             data = selector;
44942                             selector = undefined;
44943                         }
44944                     }
44945                     if (fn === false) {
44946                         fn = returnFalse;
44947                     } else if (!fn) {
44948                         return this;
44949                     }
44950
44951                     if (one === 1) {
44952                         origFn = fn;
44953                         fn = function(event) {
44954                             // Can use an empty set, since event contains the info
44955                             jQuery().off(event);
44956                             return origFn.apply(this, arguments);
44957                         };
44958                         // Use same guid so caller can remove using origFn
44959                         fn.guid = origFn.guid || (origFn.guid = jQuery.guid++);
44960                     }
44961                     return this.each(function() {
44962                         jQuery.event.add(this, types, fn, data, selector);
44963                     });
44964                 },
44965                 one: function(types, selector, data, fn) {
44966                     return this.on(types, selector, data, fn, 1);
44967                 },
44968                 off: function(types, selector, fn) {
44969                     var handleObj, type;
44970                     if (types && types.preventDefault && types.handleObj) {
44971                         // ( event ) dispatched jQuery.Event
44972                         handleObj = types.handleObj;
44973                         jQuery(types.delegateTarget).off(
44974                             handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType,
44975                             handleObj.selector,
44976                             handleObj.handler
44977                         );
44978                         return this;
44979                     }
44980                     if (typeof types === "object") {
44981                         // ( types-object [, selector] )
44982                         for (type in types) {
44983                             this.off(type, selector, types[type]);
44984                         }
44985                         return this;
44986                     }
44987                     if (selector === false || typeof selector === "function") {
44988                         // ( types [, fn] )
44989                         fn = selector;
44990                         selector = undefined;
44991                     }
44992                     if (fn === false) {
44993                         fn = returnFalse;
44994                     }
44995                     return this.each(function() {
44996                         jQuery.event.remove(this, types, fn, selector);
44997                     });
44998                 },
44999
45000                 trigger: function(type, data) {
45001                     return this.each(function() {
45002                         jQuery.event.trigger(type, data, this);
45003                     });
45004                 },
45005                 triggerHandler: function(type, data) {
45006                     var elem = this[0];
45007                     if (elem) {
45008                         return jQuery.event.trigger(type, data, elem, true);
45009                     }
45010                 }
45011             });
45012
45013
45014             var
45015                 rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,
45016                 rtagName = /<([\w:]+)/,
45017                 rhtml = /<|&#?\w+;/,
45018                 rnoInnerhtml = /<(?:script|style|link)/i,
45019                 // checked="checked" or checked
45020                 rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
45021                 rscriptType = /^$|\/(?:java|ecma)script/i,
45022                 rscriptTypeMasked = /^true\/(.*)/,
45023                 rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,
45024
45025                 // We have to close these tags to support XHTML (#13200)
45026                 wrapMap = {
45027
45028                     // Support: IE9
45029                     option: [1, "<select multiple='multiple'>", "</select>"],
45030
45031                     thead: [1, "<table>", "</table>"],
45032                     col: [2, "<table><colgroup>", "</colgroup></table>"],
45033                     tr: [2, "<table><tbody>", "</tbody></table>"],
45034                     td: [3, "<table><tbody><tr>", "</tr></tbody></table>"],
45035
45036                     _default: [0, "", ""]
45037                 };
45038
45039             // Support: IE9
45040             wrapMap.optgroup = wrapMap.option;
45041
45042             wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
45043             wrapMap.th = wrapMap.td;
45044
45045             // Support: 1.x compatibility
45046             // Manipulating tables requires a tbody
45047             function manipulationTarget(elem, content) {
45048                 return jQuery.nodeName(elem, "table") &&
45049                     jQuery.nodeName(content.nodeType !== 11 ? content : content.firstChild, "tr") ?
45050
45051                     elem.getElementsByTagName("tbody")[0] ||
45052                     elem.appendChild(elem.ownerDocument.createElement("tbody")) :
45053                     elem;
45054             }
45055
45056             // Replace/restore the type attribute of script elements for safe DOM
45057             // manipulation
45058             function disableScript(elem) {
45059                 elem.type = (elem.getAttribute("type") !== null) + "/" + elem.type;
45060                 return elem;
45061             }
45062
45063             function restoreScript(elem) {
45064                 var match = rscriptTypeMasked.exec(elem.type);
45065
45066                 if (match) {
45067                     elem.type = match[1];
45068                 } else {
45069                     elem.removeAttribute("type");
45070                 }
45071
45072                 return elem;
45073             }
45074
45075             // Mark scripts as having already been evaluated
45076             function setGlobalEval(elems, refElements) {
45077                 var i = 0,
45078                     l = elems.length;
45079
45080                 for (; i < l; i++) {
45081                     data_priv.set(
45082                         elems[i], "globalEval", !refElements || data_priv.get(refElements[i], "globalEval")
45083                     );
45084                 }
45085             }
45086
45087             function cloneCopyEvent(src, dest) {
45088                 var i, l, type, pdataOld, pdataCur, udataOld, udataCur, events;
45089
45090                 if (dest.nodeType !== 1) {
45091                     return;
45092                 }
45093
45094                 // 1. Copy private data: events, handlers, etc.
45095                 if (data_priv.hasData(src)) {
45096                     pdataOld = data_priv.access(src);
45097                     pdataCur = data_priv.set(dest, pdataOld);
45098                     events = pdataOld.events;
45099
45100                     if (events) {
45101                         delete pdataCur.handle;
45102                         pdataCur.events = {};
45103
45104                         for (type in events) {
45105                             for (i = 0, l = events[type].length; i < l; i++) {
45106                                 jQuery.event.add(dest, type, events[type][i]);
45107                             }
45108                         }
45109                     }
45110                 }
45111
45112                 // 2. Copy user data
45113                 if (data_user.hasData(src)) {
45114                     udataOld = data_user.access(src);
45115                     udataCur = jQuery.extend({}, udataOld);
45116
45117                     data_user.set(dest, udataCur);
45118                 }
45119             }
45120
45121             function getAll(context, tag) {
45122                 var ret = context.getElementsByTagName ? context.getElementsByTagName(tag || "*") :
45123                     context.querySelectorAll ? context.querySelectorAll(tag || "*") : [];
45124
45125                 return tag === undefined || tag && jQuery.nodeName(context, tag) ?
45126                     jQuery.merge([context], ret) :
45127                     ret;
45128             }
45129
45130             // Fix IE bugs, see support tests
45131             function fixInput(src, dest) {
45132                 var nodeName = dest.nodeName.toLowerCase();
45133
45134                 // Fails to persist the checked state of a cloned checkbox or radio button.
45135                 if (nodeName === "input" && rcheckableType.test(src.type)) {
45136                     dest.checked = src.checked;
45137
45138                     // Fails to return the selected option to the default selected state when
45139                     // cloning options
45140                 } else if (nodeName === "input" || nodeName === "textarea") {
45141                     dest.defaultValue = src.defaultValue;
45142                 }
45143             }
45144
45145             jQuery.extend({
45146                 clone: function(elem, dataAndEvents, deepDataAndEvents) {
45147                     var i, l, srcElements, destElements,
45148                         clone = elem.cloneNode(true),
45149                         inPage = jQuery.contains(elem.ownerDocument, elem);
45150
45151                     // Fix IE cloning issues
45152                     if (!support.noCloneChecked && (elem.nodeType === 1 || elem.nodeType === 11) &&
45153                         !jQuery.isXMLDoc(elem)) {
45154
45155                         // We eschew Sizzle here for performance reasons:
45156                         // http://jsperf.com/getall-vs-sizzle/2
45157                         destElements = getAll(clone);
45158                         srcElements = getAll(elem);
45159
45160                         for (i = 0, l = srcElements.length; i < l; i++) {
45161                             fixInput(srcElements[i], destElements[i]);
45162                         }
45163                     }
45164
45165                     // Copy the events from the original to the clone
45166                     if (dataAndEvents) {
45167                         if (deepDataAndEvents) {
45168                             srcElements = srcElements || getAll(elem);
45169                             destElements = destElements || getAll(clone);
45170
45171                             for (i = 0, l = srcElements.length; i < l; i++) {
45172                                 cloneCopyEvent(srcElements[i], destElements[i]);
45173                             }
45174                         } else {
45175                             cloneCopyEvent(elem, clone);
45176                         }
45177                     }
45178
45179                     // Preserve script evaluation history
45180                     destElements = getAll(clone, "script");
45181                     if (destElements.length > 0) {
45182                         setGlobalEval(destElements, !inPage && getAll(elem, "script"));
45183                     }
45184
45185                     // Return the cloned set
45186                     return clone;
45187                 },
45188
45189                 buildFragment: function(elems, context, scripts, selection) {
45190                     var elem, tmp, tag, wrap, contains, j,
45191                         fragment = context.createDocumentFragment(),
45192                         nodes = [],
45193                         i = 0,
45194                         l = elems.length;
45195
45196                     for (; i < l; i++) {
45197                         elem = elems[i];
45198
45199                         if (elem || elem === 0) {
45200
45201                             // Add nodes directly
45202                             if (jQuery.type(elem) === "object") {
45203                                 // Support: QtWebKit, PhantomJS
45204                                 // push.apply(_, arraylike) throws on ancient WebKit
45205                                 jQuery.merge(nodes, elem.nodeType ? [elem] : elem);
45206
45207                                 // Convert non-html into a text node
45208                             } else if (!rhtml.test(elem)) {
45209                                 nodes.push(context.createTextNode(elem));
45210
45211                                 // Convert html into DOM nodes
45212                             } else {
45213                                 tmp = tmp || fragment.appendChild(context.createElement("div"));
45214
45215                                 // Deserialize a standard representation
45216                                 tag = (rtagName.exec(elem) || ["", ""])[1].toLowerCase();
45217                                 wrap = wrapMap[tag] || wrapMap._default;
45218                                 tmp.innerHTML = wrap[1] + elem.replace(rxhtmlTag, "<$1></$2>") + wrap[2];
45219
45220                                 // Descend through wrappers to the right content
45221                                 j = wrap[0];
45222                                 while (j--) {
45223                                     tmp = tmp.lastChild;
45224                                 }
45225
45226                                 // Support: QtWebKit, PhantomJS
45227                                 // push.apply(_, arraylike) throws on ancient WebKit
45228                                 jQuery.merge(nodes, tmp.childNodes);
45229
45230                                 // Remember the top-level container
45231                                 tmp = fragment.firstChild;
45232
45233                                 // Ensure the created nodes are orphaned (#12392)
45234                                 tmp.textContent = "";
45235                             }
45236                         }
45237                     }
45238
45239                     // Remove wrapper from fragment
45240                     fragment.textContent = "";
45241
45242                     i = 0;
45243                     while ((elem = nodes[i++])) {
45244
45245                         // #4087 - If origin and destination elements are the same, and this
45246                         // is
45247                         // that element, do not do anything
45248                         if (selection && jQuery.inArray(elem, selection) !== -1) {
45249                             continue;
45250                         }
45251
45252                         contains = jQuery.contains(elem.ownerDocument, elem);
45253
45254                         // Append to fragment
45255                         tmp = getAll(fragment.appendChild(elem), "script");
45256
45257                         // Preserve script evaluation history
45258                         if (contains) {
45259                             setGlobalEval(tmp);
45260                         }
45261
45262                         // Capture executables
45263                         if (scripts) {
45264                             j = 0;
45265                             while ((elem = tmp[j++])) {
45266                                 if (rscriptType.test(elem.type || "")) {
45267                                     scripts.push(elem);
45268                                 }
45269                             }
45270                         }
45271                     }
45272
45273                     return fragment;
45274                 },
45275
45276                 cleanData: function(elems) {
45277                     var data, elem, type, key,
45278                         special = jQuery.event.special,
45279                         i = 0;
45280
45281                     for (;
45282                         (elem = elems[i]) !== undefined; i++) {
45283                         if (jQuery.acceptData(elem)) {
45284                             key = elem[data_priv.expando];
45285
45286                             if (key && (data = data_priv.cache[key])) {
45287                                 if (data.events) {
45288                                     for (type in data.events) {
45289                                         if (special[type]) {
45290                                             jQuery.event.remove(elem, type);
45291
45292                                             // This is a shortcut to avoid jQuery.event.remove's
45293                                             // overhead
45294                                         } else {
45295                                             jQuery.removeEvent(elem, type, data.handle);
45296                                         }
45297                                     }
45298                                 }
45299                                 if (data_priv.cache[key]) {
45300                                     // Discard any remaining `private` data
45301                                     delete data_priv.cache[key];
45302                                 }
45303                             }
45304                         }
45305                         // Discard any remaining `user` data
45306                         delete data_user.cache[elem[data_user.expando]];
45307                     }
45308                 }
45309             });
45310
45311             jQuery.fn.extend({
45312                 text: function(value) {
45313                     return access(this, function(value) {
45314                         return value === undefined ?
45315                             jQuery.text(this) :
45316                             this.empty().each(function() {
45317                                 if (this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9) {
45318                                     this.textContent = value;
45319                                 }
45320                             });
45321                     }, null, value, arguments.length);
45322                 },
45323
45324                 append: function() {
45325                     return this.domManip(arguments, function(elem) {
45326                         if (this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9) {
45327                             var target = manipulationTarget(this, elem);
45328                             target.appendChild(elem);
45329                         }
45330                     });
45331                 },
45332
45333                 prepend: function() {
45334                     return this.domManip(arguments, function(elem) {
45335                         if (this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9) {
45336                             var target = manipulationTarget(this, elem);
45337                             target.insertBefore(elem, target.firstChild);
45338                         }
45339                     });
45340                 },
45341
45342                 before: function() {
45343                     return this.domManip(arguments, function(elem) {
45344                         if (this.parentNode) {
45345                             this.parentNode.insertBefore(elem, this);
45346                         }
45347                     });
45348                 },
45349
45350                 after: function() {
45351                     return this.domManip(arguments, function(elem) {
45352                         if (this.parentNode) {
45353                             this.parentNode.insertBefore(elem, this.nextSibling);
45354                         }
45355                     });
45356                 },
45357
45358                 remove: function(selector, keepData /* Internal Use Only */ ) {
45359                     var elem,
45360                         elems = selector ? jQuery.filter(selector, this) : this,
45361                         i = 0;
45362
45363                     for (;
45364                         (elem = elems[i]) != null; i++) {
45365                         if (!keepData && elem.nodeType === 1) {
45366                             jQuery.cleanData(getAll(elem));
45367                         }
45368
45369                         if (elem.parentNode) {
45370                             if (keepData && jQuery.contains(elem.ownerDocument, elem)) {
45371                                 setGlobalEval(getAll(elem, "script"));
45372                             }
45373                             elem.parentNode.removeChild(elem);
45374                         }
45375                     }
45376
45377                     return this;
45378                 },
45379
45380                 empty: function() {
45381                     var elem,
45382                         i = 0;
45383
45384                     for (;
45385                         (elem = this[i]) != null; i++) {
45386                         if (elem.nodeType === 1) {
45387
45388                             // Prevent memory leaks
45389                             jQuery.cleanData(getAll(elem, false));
45390
45391                             // Remove any remaining nodes
45392                             elem.textContent = "";
45393                         }
45394                     }
45395
45396                     return this;
45397                 },
45398
45399                 clone: function(dataAndEvents, deepDataAndEvents) {
45400                     dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
45401                     deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
45402
45403                     return this.map(function() {
45404                         return jQuery.clone(this, dataAndEvents, deepDataAndEvents);
45405                     });
45406                 },
45407
45408                 html: function(value) {
45409                     return access(this, function(value) {
45410                         var elem = this[0] || {},
45411                             i = 0,
45412                             l = this.length;
45413
45414                         if (value === undefined && elem.nodeType === 1) {
45415                             return elem.innerHTML;
45416                         }
45417
45418                         // See if we can take a shortcut and just use innerHTML
45419                         if (typeof value === "string" && !rnoInnerhtml.test(value) &&
45420                             !wrapMap[(rtagName.exec(value) || ["", ""])[1].toLowerCase()]) {
45421
45422                             value = value.replace(rxhtmlTag, "<$1></$2>");
45423
45424                             try {
45425                                 for (; i < l; i++) {
45426                                     elem = this[i] || {};
45427
45428                                     // Remove element nodes and prevent memory leaks
45429                                     if (elem.nodeType === 1) {
45430                                         jQuery.cleanData(getAll(elem, false));
45431                                         elem.innerHTML = value;
45432                                     }
45433                                 }
45434
45435                                 elem = 0;
45436
45437                                 // If using innerHTML throws an exception, use the fallback
45438                                 // method
45439                             } catch (e) {}
45440                         }
45441
45442                         if (elem) {
45443                             this.empty().append(value);
45444                         }
45445                     }, null, value, arguments.length);
45446                 },
45447
45448                 replaceWith: function() {
45449                     var arg = arguments[0];
45450
45451                     // Make the changes, replacing each context element with the new content
45452                     this.domManip(arguments, function(elem) {
45453                         arg = this.parentNode;
45454
45455                         jQuery.cleanData(getAll(this));
45456
45457                         if (arg) {
45458                             arg.replaceChild(elem, this);
45459                         }
45460                     });
45461
45462                     // Force removal if there was no new content (e.g., from empty
45463                     // arguments)
45464                     return arg && (arg.length || arg.nodeType) ? this : this.remove();
45465                 },
45466
45467                 detach: function(selector) {
45468                     return this.remove(selector, true);
45469                 },
45470
45471                 domManip: function(args, callback) {
45472
45473                     // Flatten any nested arrays
45474                     args = concat.apply([], args);
45475
45476                     var fragment, first, scripts, hasScripts, node, doc,
45477                         i = 0,
45478                         l = this.length,
45479                         set = this,
45480                         iNoClone = l - 1,
45481                         value = args[0],
45482                         isFunction = jQuery.isFunction(value);
45483
45484                     // We can't cloneNode fragments that contain checked, in WebKit
45485                     if (isFunction ||
45486                         (l > 1 && typeof value === "string" &&
45487                             !support.checkClone && rchecked.test(value))) {
45488                         return this.each(function(index) {
45489                             var self = set.eq(index);
45490                             if (isFunction) {
45491                                 args[0] = value.call(this, index, self.html());
45492                             }
45493                             self.domManip(args, callback);
45494                         });
45495                     }
45496
45497                     if (l) {
45498                         fragment = jQuery.buildFragment(args, this[0].ownerDocument, false, this);
45499                         first = fragment.firstChild;
45500
45501                         if (fragment.childNodes.length === 1) {
45502                             fragment = first;
45503                         }
45504
45505                         if (first) {
45506                             scripts = jQuery.map(getAll(fragment, "script"), disableScript);
45507                             hasScripts = scripts.length;
45508
45509                             // Use the original fragment for the last item instead of the
45510                             // first because it can end up
45511                             // being emptied incorrectly in certain situations (#8070).
45512                             for (; i < l; i++) {
45513                                 node = fragment;
45514
45515                                 if (i !== iNoClone) {
45516                                     node = jQuery.clone(node, true, true);
45517
45518                                     // Keep references to cloned scripts for later
45519                                     // restoration
45520                                     if (hasScripts) {
45521                                         // Support: QtWebKit
45522                                         // jQuery.merge because push.apply(_, arraylike)
45523                                         // throws
45524                                         jQuery.merge(scripts, getAll(node, "script"));
45525                                     }
45526                                 }
45527
45528                                 callback.call(this[i], node, i);
45529                             }
45530
45531                             if (hasScripts) {
45532                                 doc = scripts[scripts.length - 1].ownerDocument;
45533
45534                                 // Reenable scripts
45535                                 jQuery.map(scripts, restoreScript);
45536
45537                                 // Evaluate executable scripts on first document insertion
45538                                 for (i = 0; i < hasScripts; i++) {
45539                                     node = scripts[i];
45540                                     if (rscriptType.test(node.type || "") &&
45541                                         !data_priv.access(node, "globalEval") && jQuery.contains(doc, node)) {
45542
45543                                         if (node.src) {
45544                                             // Optional AJAX dependency, but won't run
45545                                             // scripts if not present
45546                                             if (jQuery._evalUrl) {
45547                                                 jQuery._evalUrl(node.src);
45548                                             }
45549                                         } else {
45550                                             jQuery.globalEval(node.textContent.replace(rcleanScript, ""));
45551                                         }
45552                                     }
45553                                 }
45554                             }
45555                         }
45556                     }
45557
45558                     return this;
45559                 }
45560             });
45561
45562             jQuery.each({
45563                 appendTo: "append",
45564                 prependTo: "prepend",
45565                 insertBefore: "before",
45566                 insertAfter: "after",
45567                 replaceAll: "replaceWith"
45568             }, function(name, original) {
45569                 jQuery.fn[name] = function(selector) {
45570                     var elems,
45571                         ret = [],
45572                         insert = jQuery(selector),
45573                         last = insert.length - 1,
45574                         i = 0;
45575
45576                     for (; i <= last; i++) {
45577                         elems = i === last ? this : this.clone(true);
45578                         jQuery(insert[i])[original](elems);
45579
45580                         // Support: QtWebKit
45581                         // .get() because push.apply(_, arraylike) throws
45582                         push.apply(ret, elems.get());
45583                     }
45584
45585                     return this.pushStack(ret);
45586                 };
45587             });
45588
45589
45590             var iframe,
45591                 elemdisplay = {};
45592
45593             /**
45594              * Retrieve the actual display of a element
45595              * 
45596              * @param {String}
45597              *            name nodeName of the element
45598              * @param {Object}
45599              *            doc Document object
45600              */
45601             // Called only from within defaultDisplay
45602             function actualDisplay(name, doc) {
45603                 var style,
45604                     elem = jQuery(doc.createElement(name)).appendTo(doc.body),
45605
45606                     // getDefaultComputedStyle might be reliably used only on attached
45607                     // element
45608                     display = window.getDefaultComputedStyle && (style = window.getDefaultComputedStyle(elem[0])) ?
45609
45610                     // Use of this method is a temporary fix (more like optimization)
45611                     // until something better comes along,
45612                     // since it was removed from specification and supported only in FF
45613                     style.display : jQuery.css(elem[0], "display");
45614
45615                 // We don't have any data stored on the element,
45616                 // so use "detach" method as fast way to get rid of the element
45617                 elem.detach();
45618
45619                 return display;
45620             }
45621
45622             /**
45623              * Try to determine the default display value of an element
45624              * 
45625              * @param {String}
45626              *            nodeName
45627              */
45628             function defaultDisplay(nodeName) {
45629                 var doc = document,
45630                     display = elemdisplay[nodeName];
45631
45632                 if (!display) {
45633                     display = actualDisplay(nodeName, doc);
45634
45635                     // If the simple way fails, read from inside an iframe
45636                     if (display === "none" || !display) {
45637
45638                         // Use the already-created iframe if possible
45639                         iframe = (iframe || jQuery("<iframe frameborder='0' width='0' height='0'/>")).appendTo(doc.documentElement);
45640
45641                         // Always write a new HTML skeleton so Webkit and Firefox don't
45642                         // choke on reuse
45643                         doc = iframe[0].contentDocument;
45644
45645                         // Support: IE
45646                         doc.write();
45647                         doc.close();
45648
45649                         display = actualDisplay(nodeName, doc);
45650                         iframe.detach();
45651                     }
45652
45653                     // Store the correct default display
45654                     elemdisplay[nodeName] = display;
45655                 }
45656
45657                 return display;
45658             }
45659             var rmargin = (/^margin/);
45660
45661             var rnumnonpx = new RegExp("^(" + pnum + ")(?!px)[a-z%]+$", "i");
45662
45663             var getStyles = function(elem) {
45664                 // Support: IE<=11+, Firefox<=30+ (#15098, #14150)
45665                 // IE throws on elements created in popups
45666                 // FF meanwhile throws on frame elements through
45667                 // "defaultView.getComputedStyle"
45668                 if (elem.ownerDocument.defaultView.opener) {
45669                     return elem.ownerDocument.defaultView.getComputedStyle(elem, null);
45670                 }
45671
45672                 return window.getComputedStyle(elem, null);
45673             };
45674
45675
45676
45677             function curCSS(elem, name, computed) {
45678                 var width, minWidth, maxWidth, ret,
45679                     style = elem.style;
45680
45681                 computed = computed || getStyles(elem);
45682
45683                 // Support: IE9
45684                 // getPropertyValue is only needed for .css('filter') (#12537)
45685                 if (computed) {
45686                     ret = computed.getPropertyValue(name) || computed[name];
45687                 }
45688
45689                 if (computed) {
45690
45691                     if (ret === "" && !jQuery.contains(elem.ownerDocument, elem)) {
45692                         ret = jQuery.style(elem, name);
45693                     }
45694
45695                     // Support: iOS < 6
45696                     // A tribute to the "awesome hack by Dean Edwards"
45697                     // iOS < 6 (at least) returns percentage for a larger set of values, but
45698                     // width seems to be reliably pixels
45699                     // this is against the CSSOM draft spec:
45700                     // http://dev.w3.org/csswg/cssom/#resolved-values
45701                     if (rnumnonpx.test(ret) && rmargin.test(name)) {
45702
45703                         // Remember the original values
45704                         width = style.width;
45705                         minWidth = style.minWidth;
45706                         maxWidth = style.maxWidth;
45707
45708                         // Put in the new values to get a computed value out
45709                         style.minWidth = style.maxWidth = style.width = ret;
45710                         ret = computed.width;
45711
45712                         // Revert the changed values
45713                         style.width = width;
45714                         style.minWidth = minWidth;
45715                         style.maxWidth = maxWidth;
45716                     }
45717                 }
45718
45719                 return ret !== undefined ?
45720                     // Support: IE
45721                     // IE returns zIndex value as an integer.
45722                     ret + "" :
45723                     ret;
45724             }
45725
45726
45727             function addGetHookIf(conditionFn, hookFn) {
45728                 // Define the hook, we'll check on the first run if it's really needed.
45729                 return {
45730                     get: function() {
45731                         if (conditionFn()) {
45732                             // Hook not needed (or it's not possible to use it due
45733                             // to missing dependency), remove it.
45734                             delete this.get;
45735                             return;
45736                         }
45737
45738                         // Hook needed; redefine it so that the support test is not executed
45739                         // again.
45740                         return (this.get = hookFn).apply(this, arguments);
45741                     }
45742                 };
45743             }
45744
45745
45746             (function() {
45747                 var pixelPositionVal, boxSizingReliableVal,
45748                     docElem = document.documentElement,
45749                     container = document.createElement("div"),
45750                     div = document.createElement("div");
45751
45752                 if (!div.style) {
45753                     return;
45754                 }
45755
45756                 // Support: IE9-11+
45757                 // Style of cloned element affects source element cloned (#8908)
45758                 div.style.backgroundClip = "content-box";
45759                 div.cloneNode(true).style.backgroundClip = "";
45760                 support.clearCloneStyle = div.style.backgroundClip === "content-box";
45761
45762                 container.style.cssText = "border:0;width:0;height:0;top:0;left:-9999px;margin-top:1px;" +
45763                     "position:absolute";
45764                 container.appendChild(div);
45765
45766                 // Executing both pixelPosition & boxSizingReliable tests require only one
45767                 // layout
45768                 // so they're executed at the same time to save the second computation.
45769                 function computePixelPositionAndBoxSizingReliable() {
45770                     div.style.cssText =
45771                         // Support: Firefox<29, Android 2.3
45772                         // Vendor-prefix box-sizing
45773                         "-webkit-box-sizing:border-box;-moz-box-sizing:border-box;" +
45774                         "box-sizing:border-box;display:block;margin-top:1%;top:1%;" +
45775                         "border:1px;padding:1px;width:4px;position:absolute";
45776                     div.innerHTML = "";
45777                     docElem.appendChild(container);
45778
45779                     var divStyle = window.getComputedStyle(div, null);
45780                     pixelPositionVal = divStyle.top !== "1%";
45781                     boxSizingReliableVal = divStyle.width === "4px";
45782
45783                     docElem.removeChild(container);
45784                 }
45785
45786                 // Support: node.js jsdom
45787                 // Don't assume that getComputedStyle is a property of the global object
45788                 if (window.getComputedStyle) {
45789                     jQuery.extend(support, {
45790                         pixelPosition: function() {
45791
45792                             // This test is executed only once but we still do memoizing
45793                             // since we can use the boxSizingReliable pre-computing.
45794                             // No need to check if the test was already performed, though.
45795                             computePixelPositionAndBoxSizingReliable();
45796                             return pixelPositionVal;
45797                         },
45798                         boxSizingReliable: function() {
45799                             if (boxSizingReliableVal == null) {
45800                                 computePixelPositionAndBoxSizingReliable();
45801                             }
45802                             return boxSizingReliableVal;
45803                         },
45804                         reliableMarginRight: function() {
45805
45806                             // Support: Android 2.3
45807                             // Check if div with explicit width and no margin-right
45808                             // incorrectly
45809                             // gets computed margin-right based on width of container.
45810                             // (#3333)
45811                             // WebKit Bug 13343 - getComputedStyle returns wrong value for
45812                             // margin-right
45813                             // This support function is only executed once so no memoizing
45814                             // is needed.
45815                             var ret,
45816                                 marginDiv = div.appendChild(document.createElement("div"));
45817
45818                             // Reset CSS: box-sizing; display; margin; border; padding
45819                             marginDiv.style.cssText = div.style.cssText =
45820                                 // Support: Firefox<29, Android 2.3
45821                                 // Vendor-prefix box-sizing
45822                                 "-webkit-box-sizing:content-box;-moz-box-sizing:content-box;" +
45823                                 "box-sizing:content-box;display:block;margin:0;border:0;padding:0";
45824                             marginDiv.style.marginRight = marginDiv.style.width = "0";
45825                             div.style.width = "1px";
45826                             docElem.appendChild(container);
45827
45828                             ret = !parseFloat(window.getComputedStyle(marginDiv, null).marginRight);
45829
45830                             docElem.removeChild(container);
45831                             div.removeChild(marginDiv);
45832
45833                             return ret;
45834                         }
45835                     });
45836                 }
45837             })();
45838
45839
45840             // A method for quickly swapping in/out CSS properties to get correct
45841             // calculations.
45842             jQuery.swap = function(elem, options, callback, args) {
45843                 var ret, name,
45844                     old = {};
45845
45846                 // Remember the old values, and insert the new ones
45847                 for (name in options) {
45848                     old[name] = elem.style[name];
45849                     elem.style[name] = options[name];
45850                 }
45851
45852                 ret = callback.apply(elem, args || []);
45853
45854                 // Revert the old values
45855                 for (name in options) {
45856                     elem.style[name] = old[name];
45857                 }
45858
45859                 return ret;
45860             };
45861
45862
45863             var
45864             // Swappable if display is none or starts with table except "table",
45865             // "table-cell", or "table-caption"
45866             // See here for display values:
45867             // https://developer.mozilla.org/en-US/docs/CSS/display
45868                 rdisplayswap = /^(none|table(?!-c[ea]).+)/,
45869                 rnumsplit = new RegExp("^(" + pnum + ")(.*)$", "i"),
45870                 rrelNum = new RegExp("^([+-])=(" + pnum + ")", "i"),
45871
45872                 cssShow = {
45873                     position: "absolute",
45874                     visibility: "hidden",
45875                     display: "block"
45876                 },
45877                 cssNormalTransform = {
45878                     letterSpacing: "0",
45879                     fontWeight: "400"
45880                 },
45881
45882                 cssPrefixes = ["Webkit", "O", "Moz", "ms"];
45883
45884             // Return a css property mapped to a potentially vendor prefixed property
45885             function vendorPropName(style, name) {
45886
45887                 // Shortcut for names that are not vendor prefixed
45888                 if (name in style) {
45889                     return name;
45890                 }
45891
45892                 // Check for vendor prefixed names
45893                 var capName = name[0].toUpperCase() + name.slice(1),
45894                     origName = name,
45895                     i = cssPrefixes.length;
45896
45897                 while (i--) {
45898                     name = cssPrefixes[i] + capName;
45899                     if (name in style) {
45900                         return name;
45901                     }
45902                 }
45903
45904                 return origName;
45905             }
45906
45907             function setPositiveNumber(elem, value, subtract) {
45908                 var matches = rnumsplit.exec(value);
45909                 return matches ?
45910                     // Guard against undefined "subtract", e.g., when used as in cssHooks
45911                     Math.max(0, matches[1] - (subtract || 0)) + (matches[2] || "px") :
45912                     value;
45913             }
45914
45915             function augmentWidthOrHeight(elem, name, extra, isBorderBox, styles) {
45916                 var i = extra === (isBorderBox ? "border" : "content") ?
45917                     // If we already have the right measurement, avoid augmentation
45918                     4 :
45919                     // Otherwise initialize for horizontal or vertical properties
45920                     name === "width" ? 1 : 0,
45921
45922                     val = 0;
45923
45924                 for (; i < 4; i += 2) {
45925                     // Both box models exclude margin, so add it if we want it
45926                     if (extra === "margin") {
45927                         val += jQuery.css(elem, extra + cssExpand[i], true, styles);
45928                     }
45929
45930                     if (isBorderBox) {
45931                         // border-box includes padding, so remove it if we want content
45932                         if (extra === "content") {
45933                             val -= jQuery.css(elem, "padding" + cssExpand[i], true, styles);
45934                         }
45935
45936                         // At this point, extra isn't border nor margin, so remove border
45937                         if (extra !== "margin") {
45938                             val -= jQuery.css(elem, "border" + cssExpand[i] + "Width", true, styles);
45939                         }
45940                     } else {
45941                         // At this point, extra isn't content, so add padding
45942                         val += jQuery.css(elem, "padding" + cssExpand[i], true, styles);
45943
45944                         // At this point, extra isn't content nor padding, so add border
45945                         if (extra !== "padding") {
45946                             val += jQuery.css(elem, "border" + cssExpand[i] + "Width", true, styles);
45947                         }
45948                     }
45949                 }
45950
45951                 return val;
45952             }
45953
45954             function getWidthOrHeight(elem, name, extra) {
45955
45956                 // Start with offset property, which is equivalent to the border-box value
45957                 var valueIsBorderBox = true,
45958                     val = name === "width" ? elem.offsetWidth : elem.offsetHeight,
45959                     styles = getStyles(elem),
45960                     isBorderBox = jQuery.css(elem, "boxSizing", false, styles) === "border-box";
45961
45962                 // Some non-html elements return undefined for offsetWidth, so check for
45963                 // null/undefined
45964                 // svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285
45965                 // MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668
45966                 if (val <= 0 || val == null) {
45967                     // Fall back to computed then uncomputed css if necessary
45968                     val = curCSS(elem, name, styles);
45969                     if (val < 0 || val == null) {
45970                         val = elem.style[name];
45971                     }
45972
45973                     // Computed unit is not pixels. Stop here and return.
45974                     if (rnumnonpx.test(val)) {
45975                         return val;
45976                     }
45977
45978                     // Check for style in case a browser which returns unreliable values
45979                     // for getComputedStyle silently falls back to the reliable elem.style
45980                     valueIsBorderBox = isBorderBox &&
45981                         (support.boxSizingReliable() || val === elem.style[name]);
45982
45983                     // Normalize "", auto, and prepare for extra
45984                     val = parseFloat(val) || 0;
45985                 }
45986
45987                 // Use the active box-sizing model to add/subtract irrelevant styles
45988                 return (val +
45989                     augmentWidthOrHeight(
45990                         elem,
45991                         name,
45992                         extra || (isBorderBox ? "border" : "content"),
45993                         valueIsBorderBox,
45994                         styles
45995                     )
45996                 ) + "px";
45997             }
45998
45999             function showHide(elements, show) {
46000                 var display, elem, hidden,
46001                     values = [],
46002                     index = 0,
46003                     length = elements.length;
46004
46005                 for (; index < length; index++) {
46006                     elem = elements[index];
46007                     if (!elem.style) {
46008                         continue;
46009                     }
46010
46011                     values[index] = data_priv.get(elem, "olddisplay");
46012                     display = elem.style.display;
46013                     if (show) {
46014                         // Reset the inline display of this element to learn if it is
46015                         // being hidden by cascaded rules or not
46016                         if (!values[index] && display === "none") {
46017                             elem.style.display = "";
46018                         }
46019
46020                         // Set elements which have been overridden with display: none
46021                         // in a stylesheet to whatever the default browser style is
46022                         // for such an element
46023                         if (elem.style.display === "" && isHidden(elem)) {
46024                             values[index] = data_priv.access(elem, "olddisplay", defaultDisplay(elem.nodeName));
46025                         }
46026                     } else {
46027                         hidden = isHidden(elem);
46028
46029                         if (display !== "none" || !hidden) {
46030                             data_priv.set(elem, "olddisplay", hidden ? display : jQuery.css(elem, "display"));
46031                         }
46032                     }
46033                 }
46034
46035                 // Set the display of most of the elements in a second loop
46036                 // to avoid the constant reflow
46037                 for (index = 0; index < length; index++) {
46038                     elem = elements[index];
46039                     if (!elem.style) {
46040                         continue;
46041                     }
46042                     if (!show || elem.style.display === "none" || elem.style.display === "") {
46043                         elem.style.display = show ? values[index] || "" : "none";
46044                     }
46045                 }
46046
46047                 return elements;
46048             }
46049
46050             jQuery.extend({
46051
46052                 // Add in style property hooks for overriding the default
46053                 // behavior of getting and setting a style property
46054                 cssHooks: {
46055                     opacity: {
46056                         get: function(elem, computed) {
46057                             if (computed) {
46058
46059                                 // We should always get a number back from opacity
46060                                 var ret = curCSS(elem, "opacity");
46061                                 return ret === "" ? "1" : ret;
46062                             }
46063                         }
46064                     }
46065                 },
46066
46067                 // Don't automatically add "px" to these possibly-unitless properties
46068                 cssNumber: {
46069                     "columnCount": true,
46070                     "fillOpacity": true,
46071                     "flexGrow": true,
46072                     "flexShrink": true,
46073                     "fontWeight": true,
46074                     "lineHeight": true,
46075                     "opacity": true,
46076                     "order": true,
46077                     "orphans": true,
46078                     "widows": true,
46079                     "zIndex": true,
46080                     "zoom": true
46081                 },
46082
46083                 // Add in properties whose names you wish to fix before
46084                 // setting or getting the value
46085                 cssProps: {
46086                     "float": "cssFloat"
46087                 },
46088
46089                 // Get and set the style property on a DOM Node
46090                 style: function(elem, name, value, extra) {
46091
46092                     // Don't set styles on text and comment nodes
46093                     if (!elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style) {
46094                         return;
46095                     }
46096
46097                     // Make sure that we're working with the right name
46098                     var ret, type, hooks,
46099                         origName = jQuery.camelCase(name),
46100                         style = elem.style;
46101
46102                     name = jQuery.cssProps[origName] || (jQuery.cssProps[origName] = vendorPropName(style, origName));
46103
46104                     // Gets hook for the prefixed version, then unprefixed version
46105                     hooks = jQuery.cssHooks[name] || jQuery.cssHooks[origName];
46106
46107                     // Check if we're setting a value
46108                     if (value !== undefined) {
46109                         type = typeof value;
46110
46111                         // Convert "+=" or "-=" to relative numbers (#7345)
46112                         if (type === "string" && (ret = rrelNum.exec(value))) {
46113                             value = (ret[1] + 1) * ret[2] + parseFloat(jQuery.css(elem, name));
46114                             // Fixes bug #9237
46115                             type = "number";
46116                         }
46117
46118                         // Make sure that null and NaN values aren't set (#7116)
46119                         if (value == null || value !== value) {
46120                             return;
46121                         }
46122
46123                         // If a number, add 'px' to the (except for certain CSS properties)
46124                         if (type === "number" && !jQuery.cssNumber[origName]) {
46125                             value += "px";
46126                         }
46127
46128                         // Support: IE9-11+
46129                         // background-* props affect original clone's values
46130                         if (!support.clearCloneStyle && value === "" && name.indexOf("background") === 0) {
46131                             style[name] = "inherit";
46132                         }
46133
46134                         // If a hook was provided, use that value, otherwise just set the
46135                         // specified value
46136                         if (!hooks || !("set" in hooks) || (value = hooks.set(elem, value, extra)) !== undefined) {
46137                             style[name] = value;
46138                         }
46139
46140                     } else {
46141                         // If a hook was provided get the non-computed value from there
46142                         if (hooks && "get" in hooks && (ret = hooks.get(elem, false, extra)) !== undefined) {
46143                             return ret;
46144                         }
46145
46146                         // Otherwise just get the value from the style object
46147                         return style[name];
46148                     }
46149                 },
46150
46151                 css: function(elem, name, extra, styles) {
46152                     var val, num, hooks,
46153                         origName = jQuery.camelCase(name);
46154
46155                     // Make sure that we're working with the right name
46156                     name = jQuery.cssProps[origName] || (jQuery.cssProps[origName] = vendorPropName(elem.style, origName));
46157
46158                     // Try prefixed name followed by the unprefixed name
46159                     hooks = jQuery.cssHooks[name] || jQuery.cssHooks[origName];
46160
46161                     // If a hook was provided get the computed value from there
46162                     if (hooks && "get" in hooks) {
46163                         val = hooks.get(elem, true, extra);
46164                     }
46165
46166                     // Otherwise, if a way to get the computed value exists, use that
46167                     if (val === undefined) {
46168                         val = curCSS(elem, name, styles);
46169                     }
46170
46171                     // Convert "normal" to computed value
46172                     if (val === "normal" && name in cssNormalTransform) {
46173                         val = cssNormalTransform[name];
46174                     }
46175
46176                     // Make numeric if forced or a qualifier was provided and val looks
46177                     // numeric
46178                     if (extra === "" || extra) {
46179                         num = parseFloat(val);
46180                         return extra === true || jQuery.isNumeric(num) ? num || 0 : val;
46181                     }
46182                     return val;
46183                 }
46184             });
46185
46186             jQuery.each(["height", "width"], function(i, name) {
46187                 jQuery.cssHooks[name] = {
46188                     get: function(elem, computed, extra) {
46189                         if (computed) {
46190
46191                             // Certain elements can have dimension info if we invisibly show
46192                             // them
46193                             // but it must have a current display style that would benefit
46194                             return rdisplayswap.test(jQuery.css(elem, "display")) && elem.offsetWidth === 0 ?
46195                                 jQuery.swap(elem, cssShow, function() {
46196                                     return getWidthOrHeight(elem, name, extra);
46197                                 }) :
46198                                 getWidthOrHeight(elem, name, extra);
46199                         }
46200                     },
46201
46202                     set: function(elem, value, extra) {
46203                         var styles = extra && getStyles(elem);
46204                         return setPositiveNumber(elem, value, extra ?
46205                             augmentWidthOrHeight(
46206                                 elem,
46207                                 name,
46208                                 extra,
46209                                 jQuery.css(elem, "boxSizing", false, styles) === "border-box",
46210                                 styles
46211                             ) : 0
46212                         );
46213                     }
46214                 };
46215             });
46216
46217             // Support: Android 2.3
46218             jQuery.cssHooks.marginRight = addGetHookIf(support.reliableMarginRight,
46219                 function(elem, computed) {
46220                     if (computed) {
46221                         return jQuery.swap(elem, {
46222                                 "display": "inline-block"
46223                             },
46224                             curCSS, [elem, "marginRight"]);
46225                     }
46226                 }
46227             );
46228
46229             // These hooks are used by animate to expand properties
46230             jQuery.each({
46231                 margin: "",
46232                 padding: "",
46233                 border: "Width"
46234             }, function(prefix, suffix) {
46235                 jQuery.cssHooks[prefix + suffix] = {
46236                     expand: function(value) {
46237                         var i = 0,
46238                             expanded = {},
46239
46240                             // Assumes a single number if not a string
46241                             parts = typeof value === "string" ? value.split(" ") : [value];
46242
46243                         for (; i < 4; i++) {
46244                             expanded[prefix + cssExpand[i] + suffix] =
46245                                 parts[i] || parts[i - 2] || parts[0];
46246                         }
46247
46248                         return expanded;
46249                     }
46250                 };
46251
46252                 if (!rmargin.test(prefix)) {
46253                     jQuery.cssHooks[prefix + suffix].set = setPositiveNumber;
46254                 }
46255             });
46256
46257             jQuery.fn.extend({
46258                 css: function(name, value) {
46259                     return access(this, function(elem, name, value) {
46260                         var styles, len,
46261                             map = {},
46262                             i = 0;
46263
46264                         if (jQuery.isArray(name)) {
46265                             styles = getStyles(elem);
46266                             len = name.length;
46267
46268                             for (; i < len; i++) {
46269                                 map[name[i]] = jQuery.css(elem, name[i], false, styles);
46270                             }
46271
46272                             return map;
46273                         }
46274
46275                         return value !== undefined ?
46276                             jQuery.style(elem, name, value) :
46277                             jQuery.css(elem, name);
46278                     }, name, value, arguments.length > 1);
46279                 },
46280                 show: function() {
46281                     return showHide(this, true);
46282                 },
46283                 hide: function() {
46284                     return showHide(this);
46285                 },
46286                 toggle: function(state) {
46287                     if (typeof state === "boolean") {
46288                         return state ? this.show() : this.hide();
46289                     }
46290
46291                     return this.each(function() {
46292                         if (isHidden(this)) {
46293                             jQuery(this).show();
46294                         } else {
46295                             jQuery(this).hide();
46296                         }
46297                     });
46298                 }
46299             });
46300
46301
46302             function Tween(elem, options, prop, end, easing) {
46303                 return new Tween.prototype.init(elem, options, prop, end, easing);
46304             }
46305             jQuery.Tween = Tween;
46306
46307             Tween.prototype = {
46308                 constructor: Tween,
46309                 init: function(elem, options, prop, end, easing, unit) {
46310                     this.elem = elem;
46311                     this.prop = prop;
46312                     this.easing = easing || "swing";
46313                     this.options = options;
46314                     this.start = this.now = this.cur();
46315                     this.end = end;
46316                     this.unit = unit || (jQuery.cssNumber[prop] ? "" : "px");
46317                 },
46318                 cur: function() {
46319                     var hooks = Tween.propHooks[this.prop];
46320
46321                     return hooks && hooks.get ?
46322                         hooks.get(this) :
46323                         Tween.propHooks._default.get(this);
46324                 },
46325                 run: function(percent) {
46326                     var eased,
46327                         hooks = Tween.propHooks[this.prop];
46328
46329                     if (this.options.duration) {
46330                         this.pos = eased = jQuery.easing[this.easing](
46331                             percent, this.options.duration * percent, 0, 1, this.options.duration
46332                         );
46333                     } else {
46334                         this.pos = eased = percent;
46335                     }
46336                     this.now = (this.end - this.start) * eased + this.start;
46337
46338                     if (this.options.step) {
46339                         this.options.step.call(this.elem, this.now, this);
46340                     }
46341
46342                     if (hooks && hooks.set) {
46343                         hooks.set(this);
46344                     } else {
46345                         Tween.propHooks._default.set(this);
46346                     }
46347                     return this;
46348                 }
46349             };
46350
46351             Tween.prototype.init.prototype = Tween.prototype;
46352
46353             Tween.propHooks = {
46354                 _default: {
46355                     get: function(tween) {
46356                         var result;
46357
46358                         if (tween.elem[tween.prop] != null &&
46359                             (!tween.elem.style || tween.elem.style[tween.prop] == null)) {
46360                             return tween.elem[tween.prop];
46361                         }
46362
46363                         // Passing an empty string as a 3rd parameter to .css will
46364                         // automatically
46365                         // attempt a parseFloat and fallback to a string if the parse fails.
46366                         // Simple values such as "10px" are parsed to Float;
46367                         // complex values such as "rotate(1rad)" are returned as-is.
46368                         result = jQuery.css(tween.elem, tween.prop, "");
46369                         // Empty strings, null, undefined and "auto" are converted to 0.
46370                         return !result || result === "auto" ? 0 : result;
46371                     },
46372                     set: function(tween) {
46373                         // Use step hook for back compat.
46374                         // Use cssHook if its there.
46375                         // Use .style if available and use plain properties where available.
46376                         if (jQuery.fx.step[tween.prop]) {
46377                             jQuery.fx.step[tween.prop](tween);
46378                         } else if (tween.elem.style && (tween.elem.style[jQuery.cssProps[tween.prop]] != null || jQuery.cssHooks[tween.prop])) {
46379                             jQuery.style(tween.elem, tween.prop, tween.now + tween.unit);
46380                         } else {
46381                             tween.elem[tween.prop] = tween.now;
46382                         }
46383                     }
46384                 }
46385             };
46386
46387             // Support: IE9
46388             // Panic based approach to setting things on disconnected nodes
46389             Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {
46390                 set: function(tween) {
46391                     if (tween.elem.nodeType && tween.elem.parentNode) {
46392                         tween.elem[tween.prop] = tween.now;
46393                     }
46394                 }
46395             };
46396
46397             jQuery.easing = {
46398                 linear: function(p) {
46399                     return p;
46400                 },
46401                 swing: function(p) {
46402                     return 0.5 - Math.cos(p * Math.PI) / 2;
46403                 }
46404             };
46405
46406             jQuery.fx = Tween.prototype.init;
46407
46408             // Back Compat <1.8 extension point
46409             jQuery.fx.step = {};
46410
46411
46412
46413
46414             var
46415                 fxNow, timerId,
46416                 rfxtypes = /^(?:toggle|show|hide)$/,
46417                 rfxnum = new RegExp("^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i"),
46418                 rrun = /queueHooks$/,
46419                 animationPrefilters = [defaultPrefilter],
46420                 tweeners = {
46421                     "*": [function(prop, value) {
46422                         var tween = this.createTween(prop, value),
46423                             target = tween.cur(),
46424                             parts = rfxnum.exec(value),
46425                             unit = parts && parts[3] || (jQuery.cssNumber[prop] ? "" : "px"),
46426
46427                             // Starting value computation is required for potential unit
46428                             // mismatches
46429                             start = (jQuery.cssNumber[prop] || unit !== "px" && +target) &&
46430                             rfxnum.exec(jQuery.css(tween.elem, prop)),
46431                             scale = 1,
46432                             maxIterations = 20;
46433
46434                         if (start && start[3] !== unit) {
46435                             // Trust units reported by jQuery.css
46436                             unit = unit || start[3];
46437
46438                             // Make sure we update the tween properties later on
46439                             parts = parts || [];
46440
46441                             // Iteratively approximate from a nonzero starting point
46442                             start = +target || 1;
46443
46444                             do {
46445                                 // If previous iteration zeroed out, double until we get
46446                                 // *something*.
46447                                 // Use string for doubling so we don't accidentally see
46448                                 // scale as unchanged below
46449                                 scale = scale || ".5";
46450
46451                                 // Adjust and apply
46452                                 start = start / scale;
46453                                 jQuery.style(tween.elem, prop, start + unit);
46454
46455                                 // Update scale, tolerating zero or NaN from tween.cur(),
46456                                 // break the loop if scale is unchanged or perfect, or if we've
46457                                 // just had enough
46458                             } while (scale !== (scale = tween.cur() / target) && scale !== 1 && --maxIterations);
46459                         }
46460
46461                         // Update tween properties
46462                         if (parts) {
46463                             start = tween.start = +start || +target || 0;
46464                             tween.unit = unit;
46465                             // If a +=/-= token was provided, we're doing a relative
46466                             // animation
46467                             tween.end = parts[1] ?
46468                                 start + (parts[1] + 1) * parts[2] :
46469                                 +parts[2];
46470                         }
46471
46472                         return tween;
46473                     }]
46474                 };
46475
46476             // Animations created synchronously will run synchronously
46477             function createFxNow() {
46478                 setTimeout(function() {
46479                     fxNow = undefined;
46480                 });
46481                 return (fxNow = jQuery.now());
46482             }
46483
46484             // Generate parameters to create a standard animation
46485             function genFx(type, includeWidth) {
46486                 var which,
46487                     i = 0,
46488                     attrs = {
46489                         height: type
46490                     };
46491
46492                 // If we include width, step value is 1 to do all cssExpand values,
46493                 // otherwise step value is 2 to skip over Left and Right
46494                 includeWidth = includeWidth ? 1 : 0;
46495                 for (; i < 4; i += 2 - includeWidth) {
46496                     which = cssExpand[i];
46497                     attrs["margin" + which] = attrs["padding" + which] = type;
46498                 }
46499
46500                 if (includeWidth) {
46501                     attrs.opacity = attrs.width = type;
46502                 }
46503
46504                 return attrs;
46505             }
46506
46507             function createTween(value, prop, animation) {
46508                 var tween,
46509                     collection = (tweeners[prop] || []).concat(tweeners["*"]),
46510                     index = 0,
46511                     length = collection.length;
46512                 for (; index < length; index++) {
46513                     if ((tween = collection[index].call(animation, prop, value))) {
46514
46515                         // We're done with this property
46516                         return tween;
46517                     }
46518                 }
46519             }
46520
46521             function defaultPrefilter(elem, props, opts) {
46522                 /* jshint validthis: true */
46523                 var prop, value, toggle, tween, hooks, oldfire, display, checkDisplay,
46524                     anim = this,
46525                     orig = {},
46526                     style = elem.style,
46527                     hidden = elem.nodeType && isHidden(elem),
46528                     dataShow = data_priv.get(elem, "fxshow");
46529
46530                 // Handle queue: false promises
46531                 if (!opts.queue) {
46532                     hooks = jQuery._queueHooks(elem, "fx");
46533                     if (hooks.unqueued == null) {
46534                         hooks.unqueued = 0;
46535                         oldfire = hooks.empty.fire;
46536                         hooks.empty.fire = function() {
46537                             if (!hooks.unqueued) {
46538                                 oldfire();
46539                             }
46540                         };
46541                     }
46542                     hooks.unqueued++;
46543
46544                     anim.always(function() {
46545                         // Ensure the complete handler is called before this completes
46546                         anim.always(function() {
46547                             hooks.unqueued--;
46548                             if (!jQuery.queue(elem, "fx").length) {
46549                                 hooks.empty.fire();
46550                             }
46551                         });
46552                     });
46553                 }
46554
46555                 // Height/width overflow pass
46556                 if (elem.nodeType === 1 && ("height" in props || "width" in props)) {
46557                     // Make sure that nothing sneaks out
46558                     // Record all 3 overflow attributes because IE9-10 do not
46559                     // change the overflow attribute when overflowX and
46560                     // overflowY are set to the same value
46561                     opts.overflow = [style.overflow, style.overflowX, style.overflowY];
46562
46563                     // Set display property to inline-block for height/width
46564                     // animations on inline elements that are having width/height animated
46565                     display = jQuery.css(elem, "display");
46566
46567                     // Test default display if display is currently "none"
46568                     checkDisplay = display === "none" ?
46569                         data_priv.get(elem, "olddisplay") || defaultDisplay(elem.nodeName) : display;
46570
46571                     if (checkDisplay === "inline" && jQuery.css(elem, "float") === "none") {
46572                         style.display = "inline-block";
46573                     }
46574                 }
46575
46576                 if (opts.overflow) {
46577                     style.overflow = "hidden";
46578                     anim.always(function() {
46579                         style.overflow = opts.overflow[0];
46580                         style.overflowX = opts.overflow[1];
46581                         style.overflowY = opts.overflow[2];
46582                     });
46583                 }
46584
46585                 // show/hide pass
46586                 for (prop in props) {
46587                     value = props[prop];
46588                     if (rfxtypes.exec(value)) {
46589                         delete props[prop];
46590                         toggle = toggle || value === "toggle";
46591                         if (value === (hidden ? "hide" : "show")) {
46592
46593                             // If there is dataShow left over from a stopped hide or show
46594                             // and we are going to proceed with show, we should pretend to
46595                             // be hidden
46596                             if (value === "show" && dataShow && dataShow[prop] !== undefined) {
46597                                 hidden = true;
46598                             } else {
46599                                 continue;
46600                             }
46601                         }
46602                         orig[prop] = dataShow && dataShow[prop] || jQuery.style(elem, prop);
46603
46604                         // Any non-fx value stops us from restoring the original display value
46605                     } else {
46606                         display = undefined;
46607                     }
46608                 }
46609
46610                 if (!jQuery.isEmptyObject(orig)) {
46611                     if (dataShow) {
46612                         if ("hidden" in dataShow) {
46613                             hidden = dataShow.hidden;
46614                         }
46615                     } else {
46616                         dataShow = data_priv.access(elem, "fxshow", {});
46617                     }
46618
46619                     // Store state if its toggle - enables .stop().toggle() to "reverse"
46620                     if (toggle) {
46621                         dataShow.hidden = !hidden;
46622                     }
46623                     if (hidden) {
46624                         jQuery(elem).show();
46625                     } else {
46626                         anim.done(function() {
46627                             jQuery(elem).hide();
46628                         });
46629                     }
46630                     anim.done(function() {
46631                         var prop;
46632
46633                         data_priv.remove(elem, "fxshow");
46634                         for (prop in orig) {
46635                             jQuery.style(elem, prop, orig[prop]);
46636                         }
46637                     });
46638                     for (prop in orig) {
46639                         tween = createTween(hidden ? dataShow[prop] : 0, prop, anim);
46640
46641                         if (!(prop in dataShow)) {
46642                             dataShow[prop] = tween.start;
46643                             if (hidden) {
46644                                 tween.end = tween.start;
46645                                 tween.start = prop === "width" || prop === "height" ? 1 : 0;
46646                             }
46647                         }
46648                     }
46649
46650                     // If this is a noop like .hide().hide(), restore an overwritten display
46651                     // value
46652                 } else if ((display === "none" ? defaultDisplay(elem.nodeName) : display) === "inline") {
46653                     style.display = display;
46654                 }
46655             }
46656
46657             function propFilter(props, specialEasing) {
46658                 var index, name, easing, value, hooks;
46659
46660                 // camelCase, specialEasing and expand cssHook pass
46661                 for (index in props) {
46662                     name = jQuery.camelCase(index);
46663                     easing = specialEasing[name];
46664                     value = props[index];
46665                     if (jQuery.isArray(value)) {
46666                         easing = value[1];
46667                         value = props[index] = value[0];
46668                     }
46669
46670                     if (index !== name) {
46671                         props[name] = value;
46672                         delete props[index];
46673                     }
46674
46675                     hooks = jQuery.cssHooks[name];
46676                     if (hooks && "expand" in hooks) {
46677                         value = hooks.expand(value);
46678                         delete props[name];
46679
46680                         // Not quite $.extend, this won't overwrite existing keys.
46681                         // Reusing 'index' because we have the correct "name"
46682                         for (index in value) {
46683                             if (!(index in props)) {
46684                                 props[index] = value[index];
46685                                 specialEasing[index] = easing;
46686                             }
46687                         }
46688                     } else {
46689                         specialEasing[name] = easing;
46690                     }
46691                 }
46692             }
46693
46694             function Animation(elem, properties, options) {
46695                 var result,
46696                     stopped,
46697                     index = 0,
46698                     length = animationPrefilters.length,
46699                     deferred = jQuery.Deferred().always(function() {
46700                         // Don't match elem in the :animated selector
46701                         delete tick.elem;
46702                     }),
46703                     tick = function() {
46704                         if (stopped) {
46705                             return false;
46706                         }
46707                         var currentTime = fxNow || createFxNow(),
46708                             remaining = Math.max(0, animation.startTime + animation.duration - currentTime),
46709                             // Support: Android 2.3
46710                             // Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )`
46711                             // (#12497)
46712                             temp = remaining / animation.duration || 0,
46713                             percent = 1 - temp,
46714                             index = 0,
46715                             length = animation.tweens.length;
46716
46717                         for (; index < length; index++) {
46718                             animation.tweens[index].run(percent);
46719                         }
46720
46721                         deferred.notifyWith(elem, [animation, percent, remaining]);
46722
46723                         if (percent < 1 && length) {
46724                             return remaining;
46725                         } else {
46726                             deferred.resolveWith(elem, [animation]);
46727                             return false;
46728                         }
46729                     },
46730                     animation = deferred.promise({
46731                         elem: elem,
46732                         props: jQuery.extend({}, properties),
46733                         opts: jQuery.extend(true, {
46734                             specialEasing: {}
46735                         }, options),
46736                         originalProperties: properties,
46737                         originalOptions: options,
46738                         startTime: fxNow || createFxNow(),
46739                         duration: options.duration,
46740                         tweens: [],
46741                         createTween: function(prop, end) {
46742                             var tween = jQuery.Tween(elem, animation.opts, prop, end,
46743                                 animation.opts.specialEasing[prop] || animation.opts.easing);
46744                             animation.tweens.push(tween);
46745                             return tween;
46746                         },
46747                         stop: function(gotoEnd) {
46748                             var index = 0,
46749                                 // If we are going to the end, we want to run all the tweens
46750                                 // otherwise we skip this part
46751                                 length = gotoEnd ? animation.tweens.length : 0;
46752                             if (stopped) {
46753                                 return this;
46754                             }
46755                             stopped = true;
46756                             for (; index < length; index++) {
46757                                 animation.tweens[index].run(1);
46758                             }
46759
46760                             // Resolve when we played the last frame; otherwise, reject
46761                             if (gotoEnd) {
46762                                 deferred.resolveWith(elem, [animation, gotoEnd]);
46763                             } else {
46764                                 deferred.rejectWith(elem, [animation, gotoEnd]);
46765                             }
46766                             return this;
46767                         }
46768                     }),
46769                     props = animation.props;
46770
46771                 propFilter(props, animation.opts.specialEasing);
46772
46773                 for (; index < length; index++) {
46774                     result = animationPrefilters[index].call(animation, elem, props, animation.opts);
46775                     if (result) {
46776                         return result;
46777                     }
46778                 }
46779
46780                 jQuery.map(props, createTween, animation);
46781
46782                 if (jQuery.isFunction(animation.opts.start)) {
46783                     animation.opts.start.call(elem, animation);
46784                 }
46785
46786                 jQuery.fx.timer(
46787                     jQuery.extend(tick, {
46788                         elem: elem,
46789                         anim: animation,
46790                         queue: animation.opts.queue
46791                     })
46792                 );
46793
46794                 // attach callbacks from options
46795                 return animation.progress(animation.opts.progress)
46796                     .done(animation.opts.done, animation.opts.complete)
46797                     .fail(animation.opts.fail)
46798                     .always(animation.opts.always);
46799             }
46800
46801             jQuery.Animation = jQuery.extend(Animation, {
46802
46803                 tweener: function(props, callback) {
46804                     if (jQuery.isFunction(props)) {
46805                         callback = props;
46806                         props = ["*"];
46807                     } else {
46808                         props = props.split(" ");
46809                     }
46810
46811                     var prop,
46812                         index = 0,
46813                         length = props.length;
46814
46815                     for (; index < length; index++) {
46816                         prop = props[index];
46817                         tweeners[prop] = tweeners[prop] || [];
46818                         tweeners[prop].unshift(callback);
46819                     }
46820                 },
46821
46822                 prefilter: function(callback, prepend) {
46823                     if (prepend) {
46824                         animationPrefilters.unshift(callback);
46825                     } else {
46826                         animationPrefilters.push(callback);
46827                     }
46828                 }
46829             });
46830
46831             jQuery.speed = function(speed, easing, fn) {
46832                 var opt = speed && typeof speed === "object" ? jQuery.extend({}, speed) : {
46833                     complete: fn || !fn && easing ||
46834                         jQuery.isFunction(speed) && speed,
46835                     duration: speed,
46836                     easing: fn && easing || easing && !jQuery.isFunction(easing) && easing
46837                 };
46838
46839                 opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration :
46840                     opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[opt.duration] : jQuery.fx.speeds._default;
46841
46842                 // Normalize opt.queue - true/undefined/null -> "fx"
46843                 if (opt.queue == null || opt.queue === true) {
46844                     opt.queue = "fx";
46845                 }
46846
46847                 // Queueing
46848                 opt.old = opt.complete;
46849
46850                 opt.complete = function() {
46851                     if (jQuery.isFunction(opt.old)) {
46852                         opt.old.call(this);
46853                     }
46854
46855                     if (opt.queue) {
46856                         jQuery.dequeue(this, opt.queue);
46857                     }
46858                 };
46859
46860                 return opt;
46861             };
46862
46863             jQuery.fn.extend({
46864                 fadeTo: function(speed, to, easing, callback) {
46865
46866                     // Show any hidden elements after setting opacity to 0
46867                     return this.filter(isHidden).css("opacity", 0).show()
46868
46869                     // Animate to the value specified
46870                     .end().animate({
46871                         opacity: to
46872                     }, speed, easing, callback);
46873                 },
46874                 animate: function(prop, speed, easing, callback) {
46875                     var empty = jQuery.isEmptyObject(prop),
46876                         optall = jQuery.speed(speed, easing, callback),
46877                         doAnimation = function() {
46878                             // Operate on a copy of prop so per-property easing won't be
46879                             // lost
46880                             var anim = Animation(this, jQuery.extend({}, prop), optall);
46881
46882                             // Empty animations, or finishing resolves immediately
46883                             if (empty || data_priv.get(this, "finish")) {
46884                                 anim.stop(true);
46885                             }
46886                         };
46887                     doAnimation.finish = doAnimation;
46888
46889                     return empty || optall.queue === false ?
46890                         this.each(doAnimation) :
46891                         this.queue(optall.queue, doAnimation);
46892                 },
46893                 stop: function(type, clearQueue, gotoEnd) {
46894                     var stopQueue = function(hooks) {
46895                         var stop = hooks.stop;
46896                         delete hooks.stop;
46897                         stop(gotoEnd);
46898                     };
46899
46900                     if (typeof type !== "string") {
46901                         gotoEnd = clearQueue;
46902                         clearQueue = type;
46903                         type = undefined;
46904                     }
46905                     if (clearQueue && type !== false) {
46906                         this.queue(type || "fx", []);
46907                     }
46908
46909                     return this.each(function() {
46910                         var dequeue = true,
46911                             index = type != null && type + "queueHooks",
46912                             timers = jQuery.timers,
46913                             data = data_priv.get(this);
46914
46915                         if (index) {
46916                             if (data[index] && data[index].stop) {
46917                                 stopQueue(data[index]);
46918                             }
46919                         } else {
46920                             for (index in data) {
46921                                 if (data[index] && data[index].stop && rrun.test(index)) {
46922                                     stopQueue(data[index]);
46923                                 }
46924                             }
46925                         }
46926
46927                         for (index = timers.length; index--;) {
46928                             if (timers[index].elem === this && (type == null || timers[index].queue === type)) {
46929                                 timers[index].anim.stop(gotoEnd);
46930                                 dequeue = false;
46931                                 timers.splice(index, 1);
46932                             }
46933                         }
46934
46935                         // Start the next in the queue if the last step wasn't forced.
46936                         // Timers currently will call their complete callbacks, which
46937                         // will dequeue but only if they were gotoEnd.
46938                         if (dequeue || !gotoEnd) {
46939                             jQuery.dequeue(this, type);
46940                         }
46941                     });
46942                 },
46943                 finish: function(type) {
46944                     if (type !== false) {
46945                         type = type || "fx";
46946                     }
46947                     return this.each(function() {
46948                         var index,
46949                             data = data_priv.get(this),
46950                             queue = data[type + "queue"],
46951                             hooks = data[type + "queueHooks"],
46952                             timers = jQuery.timers,
46953                             length = queue ? queue.length : 0;
46954
46955                         // Enable finishing flag on private data
46956                         data.finish = true;
46957
46958                         // Empty the queue first
46959                         jQuery.queue(this, type, []);
46960
46961                         if (hooks && hooks.stop) {
46962                             hooks.stop.call(this, true);
46963                         }
46964
46965                         // Look for any active animations, and finish them
46966                         for (index = timers.length; index--;) {
46967                             if (timers[index].elem === this && timers[index].queue === type) {
46968                                 timers[index].anim.stop(true);
46969                                 timers.splice(index, 1);
46970                             }
46971                         }
46972
46973                         // Look for any animations in the old queue and finish them
46974                         for (index = 0; index < length; index++) {
46975                             if (queue[index] && queue[index].finish) {
46976                                 queue[index].finish.call(this);
46977                             }
46978                         }
46979
46980                         // Turn off finishing flag
46981                         delete data.finish;
46982                     });
46983                 }
46984             });
46985
46986             jQuery.each(["toggle", "show", "hide"], function(i, name) {
46987                 var cssFn = jQuery.fn[name];
46988                 jQuery.fn[name] = function(speed, easing, callback) {
46989                     return speed == null || typeof speed === "boolean" ?
46990                         cssFn.apply(this, arguments) :
46991                         this.animate(genFx(name, true), speed, easing, callback);
46992                 };
46993             });
46994
46995             // Generate shortcuts for custom animations
46996             jQuery.each({
46997                 slideDown: genFx("show"),
46998                 slideUp: genFx("hide"),
46999                 slideToggle: genFx("toggle"),
47000                 fadeIn: {
47001                     opacity: "show"
47002                 },
47003                 fadeOut: {
47004                     opacity: "hide"
47005                 },
47006                 fadeToggle: {
47007                     opacity: "toggle"
47008                 }
47009             }, function(name, props) {
47010                 jQuery.fn[name] = function(speed, easing, callback) {
47011                     return this.animate(props, speed, easing, callback);
47012                 };
47013             });
47014
47015             jQuery.timers = [];
47016             jQuery.fx.tick = function() {
47017                 var timer,
47018                     i = 0,
47019                     timers = jQuery.timers;
47020
47021                 fxNow = jQuery.now();
47022
47023                 for (; i < timers.length; i++) {
47024                     timer = timers[i];
47025                     // Checks the timer has not already been removed
47026                     if (!timer() && timers[i] === timer) {
47027                         timers.splice(i--, 1);
47028                     }
47029                 }
47030
47031                 if (!timers.length) {
47032                     jQuery.fx.stop();
47033                 }
47034                 fxNow = undefined;
47035             };
47036
47037             jQuery.fx.timer = function(timer) {
47038                 jQuery.timers.push(timer);
47039                 if (timer()) {
47040                     jQuery.fx.start();
47041                 } else {
47042                     jQuery.timers.pop();
47043                 }
47044             };
47045
47046             jQuery.fx.interval = 13;
47047
47048             jQuery.fx.start = function() {
47049                 if (!timerId) {
47050                     timerId = setInterval(jQuery.fx.tick, jQuery.fx.interval);
47051                 }
47052             };
47053
47054             jQuery.fx.stop = function() {
47055                 clearInterval(timerId);
47056                 timerId = null;
47057             };
47058
47059             jQuery.fx.speeds = {
47060                 slow: 600,
47061                 fast: 200,
47062                 // Default speed
47063                 _default: 400
47064             };
47065
47066
47067             // Based off of the plugin by Clint Helfers, with permission.
47068             // http://blindsignals.com/index.php/2009/07/jquery-delay/
47069             jQuery.fn.delay = function(time, type) {
47070                 time = jQuery.fx ? jQuery.fx.speeds[time] || time : time;
47071                 type = type || "fx";
47072
47073                 return this.queue(type, function(next, hooks) {
47074                     var timeout = setTimeout(next, time);
47075                     hooks.stop = function() {
47076                         clearTimeout(timeout);
47077                     };
47078                 });
47079             };
47080
47081
47082             (function() {
47083                 var input = document.createElement("input"),
47084                     select = document.createElement("select"),
47085                     opt = select.appendChild(document.createElement("option"));
47086
47087                 input.type = "checkbox";
47088
47089                 // Support: iOS<=5.1, Android<=4.2+
47090                 // Default value for a checkbox should be "on"
47091                 support.checkOn = input.value !== "";
47092
47093                 // Support: IE<=11+
47094                 // Must access selectedIndex to make default options select
47095                 support.optSelected = opt.selected;
47096
47097                 // Support: Android<=2.3
47098                 // Options inside disabled selects are incorrectly marked as disabled
47099                 select.disabled = true;
47100                 support.optDisabled = !opt.disabled;
47101
47102                 // Support: IE<=11+
47103                 // An input loses its value after becoming a radio
47104                 input = document.createElement("input");
47105                 input.value = "t";
47106                 input.type = "radio";
47107                 support.radioValue = input.value === "t";
47108             })();
47109
47110
47111             var nodeHook, boolHook,
47112                 attrHandle = jQuery.expr.attrHandle;
47113
47114             jQuery.fn.extend({
47115                 attr: function(name, value) {
47116                     return access(this, jQuery.attr, name, value, arguments.length > 1);
47117                 },
47118
47119                 removeAttr: function(name) {
47120                     return this.each(function() {
47121                         jQuery.removeAttr(this, name);
47122                     });
47123                 }
47124             });
47125
47126             jQuery.extend({
47127                 attr: function(elem, name, value) {
47128                     var hooks, ret,
47129                         nType = elem.nodeType;
47130
47131                     // don't get/set attributes on text, comment and attribute nodes
47132                     if (!elem || nType === 3 || nType === 8 || nType === 2) {
47133                         return;
47134                     }
47135
47136                     // Fallback to prop when attributes are not supported
47137                     if (typeof elem.getAttribute === strundefined) {
47138                         return jQuery.prop(elem, name, value);
47139                     }
47140
47141                     // All attributes are lowercase
47142                     // Grab necessary hook if one is defined
47143                     if (nType !== 1 || !jQuery.isXMLDoc(elem)) {
47144                         name = name.toLowerCase();
47145                         hooks = jQuery.attrHooks[name] ||
47146                             (jQuery.expr.match.bool.test(name) ? boolHook : nodeHook);
47147                     }
47148
47149                     if (value !== undefined) {
47150
47151                         if (value === null) {
47152                             jQuery.removeAttr(elem, name);
47153
47154                         } else if (hooks && "set" in hooks && (ret = hooks.set(elem, value, name)) !== undefined) {
47155                             return ret;
47156
47157                         } else {
47158                             elem.setAttribute(name, value + "");
47159                             return value;
47160                         }
47161
47162                     } else if (hooks && "get" in hooks && (ret = hooks.get(elem, name)) !== null) {
47163                         return ret;
47164
47165                     } else {
47166                         ret = jQuery.find.attr(elem, name);
47167
47168                         // Non-existent attributes return null, we normalize to undefined
47169                         return ret == null ?
47170                             undefined :
47171                             ret;
47172                     }
47173                 },
47174
47175                 removeAttr: function(elem, value) {
47176                     var name, propName,
47177                         i = 0,
47178                         attrNames = value && value.match(rnotwhite);
47179
47180                     if (attrNames && elem.nodeType === 1) {
47181                         while ((name = attrNames[i++])) {
47182                             propName = jQuery.propFix[name] || name;
47183
47184                             // Boolean attributes get special treatment (#10870)
47185                             if (jQuery.expr.match.bool.test(name)) {
47186                                 // Set corresponding property to false
47187                                 elem[propName] = false;
47188                             }
47189
47190                             elem.removeAttribute(name);
47191                         }
47192                     }
47193                 },
47194
47195                 attrHooks: {
47196                     type: {
47197                         set: function(elem, value) {
47198                             if (!support.radioValue && value === "radio" &&
47199                                 jQuery.nodeName(elem, "input")) {
47200                                 var val = elem.value;
47201                                 elem.setAttribute("type", value);
47202                                 if (val) {
47203                                     elem.value = val;
47204                                 }
47205                                 return value;
47206                             }
47207                         }
47208                     }
47209                 }
47210             });
47211
47212             // Hooks for boolean attributes
47213             boolHook = {
47214                 set: function(elem, value, name) {
47215                     if (value === false) {
47216                         // Remove boolean attributes when set to false
47217                         jQuery.removeAttr(elem, name);
47218                     } else {
47219                         elem.setAttribute(name, name);
47220                     }
47221                     return name;
47222                 }
47223             };
47224             jQuery.each(jQuery.expr.match.bool.source.match(/\w+/g), function(i, name) {
47225                 var getter = attrHandle[name] || jQuery.find.attr;
47226
47227                 attrHandle[name] = function(elem, name, isXML) {
47228                     var ret, handle;
47229                     if (!isXML) {
47230                         // Avoid an infinite loop by temporarily removing this function from
47231                         // the getter
47232                         handle = attrHandle[name];
47233                         attrHandle[name] = ret;
47234                         ret = getter(elem, name, isXML) != null ?
47235                             name.toLowerCase() :
47236                             null;
47237                         attrHandle[name] = handle;
47238                     }
47239                     return ret;
47240                 };
47241             });
47242
47243
47244
47245
47246             var rfocusable = /^(?:input|select|textarea|button)$/i;
47247
47248             jQuery.fn.extend({
47249                 prop: function(name, value) {
47250                     return access(this, jQuery.prop, name, value, arguments.length > 1);
47251                 },
47252
47253                 removeProp: function(name) {
47254                     return this.each(function() {
47255                         delete this[jQuery.propFix[name] || name];
47256                     });
47257                 }
47258             });
47259
47260             jQuery.extend({
47261                 propFix: {
47262                     "for": "htmlFor",
47263                     "class": "className"
47264                 },
47265
47266                 prop: function(elem, name, value) {
47267                     var ret, hooks, notxml,
47268                         nType = elem.nodeType;
47269
47270                     // Don't get/set properties on text, comment and attribute nodes
47271                     if (!elem || nType === 3 || nType === 8 || nType === 2) {
47272                         return;
47273                     }
47274
47275                     notxml = nType !== 1 || !jQuery.isXMLDoc(elem);
47276
47277                     if (notxml) {
47278                         // Fix name and attach hooks
47279                         name = jQuery.propFix[name] || name;
47280                         hooks = jQuery.propHooks[name];
47281                     }
47282
47283                     if (value !== undefined) {
47284                         return hooks && "set" in hooks && (ret = hooks.set(elem, value, name)) !== undefined ?
47285                             ret :
47286                             (elem[name] = value);
47287
47288                     } else {
47289                         return hooks && "get" in hooks && (ret = hooks.get(elem, name)) !== null ?
47290                             ret :
47291                             elem[name];
47292                     }
47293                 },
47294
47295                 propHooks: {
47296                     tabIndex: {
47297                         get: function(elem) {
47298                             return elem.hasAttribute("tabindex") || rfocusable.test(elem.nodeName) || elem.href ?
47299                                 elem.tabIndex :
47300                                 -1;
47301                         }
47302                     }
47303                 }
47304             });
47305
47306             if (!support.optSelected) {
47307                 jQuery.propHooks.selected = {
47308                     get: function(elem) {
47309                         var parent = elem.parentNode;
47310                         if (parent && parent.parentNode) {
47311                             parent.parentNode.selectedIndex;
47312                         }
47313                         return null;
47314                     }
47315                 };
47316             }
47317
47318             jQuery.each([
47319                 "tabIndex",
47320                 "readOnly",
47321                 "maxLength",
47322                 "cellSpacing",
47323                 "cellPadding",
47324                 "rowSpan",
47325                 "colSpan",
47326                 "useMap",
47327                 "frameBorder",
47328                 "contentEditable"
47329             ], function() {
47330                 jQuery.propFix[this.toLowerCase()] = this;
47331             });
47332
47333
47334
47335
47336             var rclass = /[\t\r\n\f]/g;
47337
47338             jQuery.fn.extend({
47339                 addClass: function(value) {
47340                     var classes, elem, cur, clazz, j, finalValue,
47341                         proceed = typeof value === "string" && value,
47342                         i = 0,
47343                         len = this.length;
47344
47345                     if (jQuery.isFunction(value)) {
47346                         return this.each(function(j) {
47347                             jQuery(this).addClass(value.call(this, j, this.className));
47348                         });
47349                     }
47350
47351                     if (proceed) {
47352                         // The disjunction here is for better compressibility (see
47353                         // removeClass)
47354                         classes = (value || "").match(rnotwhite) || [];
47355
47356                         for (; i < len; i++) {
47357                             elem = this[i];
47358                             cur = elem.nodeType === 1 && (elem.className ?
47359                                 (" " + elem.className + " ").replace(rclass, " ") :
47360                                 " "
47361                             );
47362
47363                             if (cur) {
47364                                 j = 0;
47365                                 while ((clazz = classes[j++])) {
47366                                     if (cur.indexOf(" " + clazz + " ") < 0) {
47367                                         cur += clazz + " ";
47368                                     }
47369                                 }
47370
47371                                 // only assign if different to avoid unneeded rendering.
47372                                 finalValue = jQuery.trim(cur);
47373                                 if (elem.className !== finalValue) {
47374                                     elem.className = finalValue;
47375                                 }
47376                             }
47377                         }
47378                     }
47379
47380                     return this;
47381                 },
47382
47383                 removeClass: function(value) {
47384                     var classes, elem, cur, clazz, j, finalValue,
47385                         proceed = arguments.length === 0 || typeof value === "string" && value,
47386                         i = 0,
47387                         len = this.length;
47388
47389                     if (jQuery.isFunction(value)) {
47390                         return this.each(function(j) {
47391                             jQuery(this).removeClass(value.call(this, j, this.className));
47392                         });
47393                     }
47394                     if (proceed) {
47395                         classes = (value || "").match(rnotwhite) || [];
47396
47397                         for (; i < len; i++) {
47398                             elem = this[i];
47399                             // This expression is here for better compressibility (see
47400                             // addClass)
47401                             cur = elem.nodeType === 1 && (elem.className ?
47402                                 (" " + elem.className + " ").replace(rclass, " ") :
47403                                 ""
47404                             );
47405
47406                             if (cur) {
47407                                 j = 0;
47408                                 while ((clazz = classes[j++])) {
47409                                     // Remove *all* instances
47410                                     while (cur.indexOf(" " + clazz + " ") >= 0) {
47411                                         cur = cur.replace(" " + clazz + " ", " ");
47412                                     }
47413                                 }
47414
47415                                 // Only assign if different to avoid unneeded rendering.
47416                                 finalValue = value ? jQuery.trim(cur) : "";
47417                                 if (elem.className !== finalValue) {
47418                                     elem.className = finalValue;
47419                                 }
47420                             }
47421                         }
47422                     }
47423
47424                     return this;
47425                 },
47426
47427                 toggleClass: function(value, stateVal) {
47428                     var type = typeof value;
47429
47430                     if (typeof stateVal === "boolean" && type === "string") {
47431                         return stateVal ? this.addClass(value) : this.removeClass(value);
47432                     }
47433
47434                     if (jQuery.isFunction(value)) {
47435                         return this.each(function(i) {
47436                             jQuery(this).toggleClass(value.call(this, i, this.className, stateVal), stateVal);
47437                         });
47438                     }
47439
47440                     return this.each(function() {
47441                         if (type === "string") {
47442                             // Toggle individual class names
47443                             var className,
47444                                 i = 0,
47445                                 self = jQuery(this),
47446                                 classNames = value.match(rnotwhite) || [];
47447
47448                             while ((className = classNames[i++])) {
47449                                 // Check each className given, space separated list
47450                                 if (self.hasClass(className)) {
47451                                     self.removeClass(className);
47452                                 } else {
47453                                     self.addClass(className);
47454                                 }
47455                             }
47456
47457                             // Toggle whole class name
47458                         } else if (type === strundefined || type === "boolean") {
47459                             if (this.className) {
47460                                 // store className if set
47461                                 data_priv.set(this, "__className__", this.className);
47462                             }
47463
47464                             // If the element has a class name or if we're passed `false`,
47465                             // then remove the whole classname (if there was one, the above
47466                             // saved it).
47467                             // Otherwise bring back whatever was previously saved (if
47468                             // anything),
47469                             // falling back to the empty string if nothing was stored.
47470                             this.className = this.className || value === false ? "" : data_priv.get(this, "__className__") || "";
47471                         }
47472                     });
47473                 },
47474
47475                 hasClass: function(selector) {
47476                     var className = " " + selector + " ",
47477                         i = 0,
47478                         l = this.length;
47479                     for (; i < l; i++) {
47480                         if (this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf(className) >= 0) {
47481                             return true;
47482                         }
47483                     }
47484
47485                     return false;
47486                 }
47487             });
47488
47489
47490
47491
47492             var rreturn = /\r/g;
47493
47494             jQuery.fn.extend({
47495                 val: function(value) {
47496                     var hooks, ret, isFunction,
47497                         elem = this[0];
47498
47499                     if (!arguments.length) {
47500                         if (elem) {
47501                             hooks = jQuery.valHooks[elem.type] || jQuery.valHooks[elem.nodeName.toLowerCase()];
47502
47503                             if (hooks && "get" in hooks && (ret = hooks.get(elem, "value")) !== undefined) {
47504                                 return ret;
47505                             }
47506
47507                             ret = elem.value;
47508
47509                             return typeof ret === "string" ?
47510                                 // Handle most common string cases
47511                                 ret.replace(rreturn, "") :
47512                                 // Handle cases where value is null/undef or number
47513                                 ret == null ? "" : ret;
47514                         }
47515
47516                         return;
47517                     }
47518
47519                     isFunction = jQuery.isFunction(value);
47520
47521                     return this.each(function(i) {
47522                         var val;
47523
47524                         if (this.nodeType !== 1) {
47525                             return;
47526                         }
47527
47528                         if (isFunction) {
47529                             val = value.call(this, i, jQuery(this).val());
47530                         } else {
47531                             val = value;
47532                         }
47533
47534                         // Treat null/undefined as ""; convert numbers to string
47535                         if (val == null) {
47536                             val = "";
47537
47538                         } else if (typeof val === "number") {
47539                             val += "";
47540
47541                         } else if (jQuery.isArray(val)) {
47542                             val = jQuery.map(val, function(value) {
47543                                 return value == null ? "" : value + "";
47544                             });
47545                         }
47546
47547                         hooks = jQuery.valHooks[this.type] || jQuery.valHooks[this.nodeName.toLowerCase()];
47548
47549                         // If set returns undefined, fall back to normal setting
47550                         if (!hooks || !("set" in hooks) || hooks.set(this, val, "value") === undefined) {
47551                             this.value = val;
47552                         }
47553                     });
47554                 }
47555             });
47556
47557             jQuery.extend({
47558                 valHooks: {
47559                     option: {
47560                         get: function(elem) {
47561                             var val = jQuery.find.attr(elem, "value");
47562                             return val != null ?
47563                                 val :
47564                                 // Support: IE10-11+
47565                                 // option.text throws exceptions (#14686, #14858)
47566                                 jQuery.trim(jQuery.text(elem));
47567                         }
47568                     },
47569                     select: {
47570                         get: function(elem) {
47571                             var value, option,
47572                                 options = elem.options,
47573                                 index = elem.selectedIndex,
47574                                 one = elem.type === "select-one" || index < 0,
47575                                 values = one ? null : [],
47576                                 max = one ? index + 1 : options.length,
47577                                 i = index < 0 ?
47578                                 max :
47579                                 one ? index : 0;
47580
47581                             // Loop through all the selected options
47582                             for (; i < max; i++) {
47583                                 option = options[i];
47584
47585                                 // IE6-9 doesn't update selected after form reset (#2551)
47586                                 if ((option.selected || i === index) &&
47587                                     // Don't return options that are disabled or in a
47588                                     // disabled optgroup
47589                                     (support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null) &&
47590                                     (!option.parentNode.disabled || !jQuery.nodeName(option.parentNode, "optgroup"))) {
47591
47592                                     // Get the specific value for the option
47593                                     value = jQuery(option).val();
47594
47595                                     // We don't need an array for one selects
47596                                     if (one) {
47597                                         return value;
47598                                     }
47599
47600                                     // Multi-Selects return an array
47601                                     values.push(value);
47602                                 }
47603                             }
47604
47605                             return values;
47606                         },
47607
47608                         set: function(elem, value) {
47609                             var optionSet, option,
47610                                 options = elem.options,
47611                                 values = jQuery.makeArray(value),
47612                                 i = options.length;
47613
47614                             while (i--) {
47615                                 option = options[i];
47616                                 if ((option.selected = jQuery.inArray(option.value, values) >= 0)) {
47617                                     optionSet = true;
47618                                 }
47619                             }
47620
47621                             // Force browsers to behave consistently when non-matching value
47622                             // is set
47623                             if (!optionSet) {
47624                                 elem.selectedIndex = -1;
47625                             }
47626                             return values;
47627                         }
47628                     }
47629                 }
47630             });
47631
47632             // Radios and checkboxes getter/setter
47633             jQuery.each(["radio", "checkbox"], function() {
47634                 jQuery.valHooks[this] = {
47635                     set: function(elem, value) {
47636                         if (jQuery.isArray(value)) {
47637                             return (elem.checked = jQuery.inArray(jQuery(elem).val(), value) >= 0);
47638                         }
47639                     }
47640                 };
47641                 if (!support.checkOn) {
47642                     jQuery.valHooks[this].get = function(elem) {
47643                         return elem.getAttribute("value") === null ? "on" : elem.value;
47644                     };
47645                 }
47646             });
47647
47648
47649
47650
47651             // Return jQuery for attributes-only inclusion
47652
47653
47654             jQuery.each(("blur focus focusin focusout load resize scroll unload click dblclick " +
47655                 "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
47656                 "change select submit keydown keypress keyup error contextmenu").split(" "), function(i, name) {
47657
47658                 // Handle event binding
47659                 jQuery.fn[name] = function(data, fn) {
47660                     return arguments.length > 0 ?
47661                         this.on(name, null, data, fn) :
47662                         this.trigger(name);
47663                 };
47664             });
47665
47666             jQuery.fn.extend({
47667                 hover: function(fnOver, fnOut) {
47668                     return this.mouseenter(fnOver).mouseleave(fnOut || fnOver);
47669                 },
47670
47671                 bind: function(types, data, fn) {
47672                     return this.on(types, null, data, fn);
47673                 },
47674                 unbind: function(types, fn) {
47675                     return this.off(types, null, fn);
47676                 },
47677
47678                 delegate: function(selector, types, data, fn) {
47679                     return this.on(types, selector, data, fn);
47680                 },
47681                 undelegate: function(selector, types, fn) {
47682                     // ( namespace ) or ( selector, types [, fn] )
47683                     return arguments.length === 1 ? this.off(selector, "**") : this.off(types, selector || "**", fn);
47684                 }
47685             });
47686
47687
47688             var nonce = jQuery.now();
47689
47690             var rquery = (/\?/);
47691
47692
47693
47694             // Support: Android 2.3
47695             // Workaround failure to string-cast null input
47696             jQuery.parseJSON = function(data) {
47697                 return JSON.parse(data + "");
47698             };
47699
47700
47701             // Cross-browser xml parsing
47702             jQuery.parseXML = function(data) {
47703                 var xml, tmp;
47704                 if (!data || typeof data !== "string") {
47705                     return null;
47706                 }
47707
47708                 // Support: IE9
47709                 try {
47710                     tmp = new DOMParser();
47711                     xml = tmp.parseFromString(data, "text/xml");
47712                 } catch (e) {
47713                     xml = undefined;
47714                 }
47715
47716                 if (!xml || xml.getElementsByTagName("parsererror").length) {
47717                     jQuery.error("Invalid XML: " + data);
47718                 }
47719                 return xml;
47720             };
47721
47722
47723             var
47724                 rhash = /#.*$/,
47725                 rts = /([?&])_=[^&]*/,
47726                 rheaders = /^(.*?):[ \t]*([^\r\n]*)$/mg,
47727                 // #7653, #8125, #8152: local protocol detection
47728                 rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,
47729                 rnoContent = /^(?:GET|HEAD)$/,
47730                 rprotocol = /^\/\//,
47731                 rurl = /^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,
47732
47733                 /*
47734                  * Prefilters 1) They are useful to introduce custom dataTypes (see
47735                  * ajax/jsonp.js for an example) 2) These are called: - BEFORE asking for a
47736                  * transport - AFTER param serialization (s.data is a string if
47737                  * s.processData is true) 3) key is the dataType 4) the catchall symbol "*"
47738                  * can be used 5) execution will start with transport dataType and THEN
47739                  * continue down to "*" if needed
47740                  */
47741                 prefilters = {},
47742
47743                 /*
47744                  * Transports bindings 1) key is the dataType 2) the catchall symbol "*" can
47745                  * be used 3) selection will start with transport dataType and THEN go to
47746                  * "*" if needed
47747                  */
47748                 transports = {},
47749
47750                 // Avoid comment-prolog char sequence (#10098); must appease lint and evade
47751                 // compression
47752                 allTypes = "*/".concat("*"),
47753
47754                 // Document location
47755                 ajaxLocation = window.location.href,
47756
47757                 // Segment location into parts
47758                 ajaxLocParts = rurl.exec(ajaxLocation.toLowerCase()) || [];
47759
47760             // Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport
47761             function addToPrefiltersOrTransports(structure) {
47762
47763                 // dataTypeExpression is optional and defaults to "*"
47764                 return function(dataTypeExpression, func) {
47765
47766                     if (typeof dataTypeExpression !== "string") {
47767                         func = dataTypeExpression;
47768                         dataTypeExpression = "*";
47769                     }
47770
47771                     var dataType,
47772                         i = 0,
47773                         dataTypes = dataTypeExpression.toLowerCase().match(rnotwhite) || [];
47774
47775                     if (jQuery.isFunction(func)) {
47776                         // For each dataType in the dataTypeExpression
47777                         while ((dataType = dataTypes[i++])) {
47778                             // Prepend if requested
47779                             if (dataType[0] === "+") {
47780                                 dataType = dataType.slice(1) || "*";
47781                                 (structure[dataType] = structure[dataType] || []).unshift(func);
47782
47783                                 // Otherwise append
47784                             } else {
47785                                 (structure[dataType] = structure[dataType] || []).push(func);
47786                             }
47787                         }
47788                     }
47789                 };
47790             }
47791
47792             // Base inspection function for prefilters and transports
47793             function inspectPrefiltersOrTransports(structure, options, originalOptions, jqXHR) {
47794
47795                 var inspected = {},
47796                     seekingTransport = (structure === transports);
47797
47798                 function inspect(dataType) {
47799                     var selected;
47800                     inspected[dataType] = true;
47801                     jQuery.each(structure[dataType] || [], function(_, prefilterOrFactory) {
47802                         var dataTypeOrTransport = prefilterOrFactory(options, originalOptions, jqXHR);
47803                         if (typeof dataTypeOrTransport === "string" && !seekingTransport && !inspected[dataTypeOrTransport]) {
47804                             options.dataTypes.unshift(dataTypeOrTransport);
47805                             inspect(dataTypeOrTransport);
47806                             return false;
47807                         } else if (seekingTransport) {
47808                             return !(selected = dataTypeOrTransport);
47809                         }
47810                     });
47811                     return selected;
47812                 }
47813
47814                 return inspect(options.dataTypes[0]) || !inspected["*"] && inspect("*");
47815             }
47816
47817             // A special extend for ajax options
47818             // that takes "flat" options (not to be deep extended)
47819             // Fixes #9887
47820             function ajaxExtend(target, src) {
47821                 var key, deep,
47822                     flatOptions = jQuery.ajaxSettings.flatOptions || {};
47823
47824                 for (key in src) {
47825                     if (src[key] !== undefined) {
47826                         (flatOptions[key] ? target : (deep || (deep = {})))[key] = src[key];
47827                     }
47828                 }
47829                 if (deep) {
47830                     jQuery.extend(true, target, deep);
47831                 }
47832
47833                 return target;
47834             }
47835
47836             /*
47837              * Handles responses to an ajax request: - finds the right dataType (mediates
47838              * between content-type and expected dataType) - returns the corresponding
47839              * response
47840              */
47841             function ajaxHandleResponses(s, jqXHR, responses) {
47842
47843                 var ct, type, finalDataType, firstDataType,
47844                     contents = s.contents,
47845                     dataTypes = s.dataTypes;
47846
47847                 // Remove auto dataType and get content-type in the process
47848                 while (dataTypes[0] === "*") {
47849                     dataTypes.shift();
47850                     if (ct === undefined) {
47851                         ct = s.mimeType || jqXHR.getResponseHeader("Content-Type");
47852                     }
47853                 }
47854
47855                 // Check if we're dealing with a known content-type
47856                 if (ct) {
47857                     for (type in contents) {
47858                         if (contents[type] && contents[type].test(ct)) {
47859                             dataTypes.unshift(type);
47860                             break;
47861                         }
47862                     }
47863                 }
47864
47865                 // Check to see if we have a response for the expected dataType
47866                 if (dataTypes[0] in responses) {
47867                     finalDataType = dataTypes[0];
47868                 } else {
47869                     // Try convertible dataTypes
47870                     for (type in responses) {
47871                         if (!dataTypes[0] || s.converters[type + " " + dataTypes[0]]) {
47872                             finalDataType = type;
47873                             break;
47874                         }
47875                         if (!firstDataType) {
47876                             firstDataType = type;
47877                         }
47878                     }
47879                     // Or just use first one
47880                     finalDataType = finalDataType || firstDataType;
47881                 }
47882
47883                 // If we found a dataType
47884                 // We add the dataType to the list if needed
47885                 // and return the corresponding response
47886                 if (finalDataType) {
47887                     if (finalDataType !== dataTypes[0]) {
47888                         dataTypes.unshift(finalDataType);
47889                     }
47890                     return responses[finalDataType];
47891                 }
47892             }
47893
47894             /*
47895              * Chain conversions given the request and the original response Also sets the
47896              * responseXXX fields on the jqXHR instance
47897              */
47898             function ajaxConvert(s, response, jqXHR, isSuccess) {
47899                 var conv2, current, conv, tmp, prev,
47900                     converters = {},
47901                     // Work with a copy of dataTypes in case we need to modify it for
47902                     // conversion
47903                     dataTypes = s.dataTypes.slice();
47904
47905                 // Create converters map with lowercased keys
47906                 if (dataTypes[1]) {
47907                     for (conv in s.converters) {
47908                         converters[conv.toLowerCase()] = s.converters[conv];
47909                     }
47910                 }
47911
47912                 current = dataTypes.shift();
47913
47914                 // Convert to each sequential dataType
47915                 while (current) {
47916
47917                     if (s.responseFields[current]) {
47918                         jqXHR[s.responseFields[current]] = response;
47919                     }
47920
47921                     // Apply the dataFilter if provided
47922                     if (!prev && isSuccess && s.dataFilter) {
47923                         response = s.dataFilter(response, s.dataType);
47924                     }
47925
47926                     prev = current;
47927                     current = dataTypes.shift();
47928
47929                     if (current) {
47930
47931                         // There's only work to do if current dataType is non-auto
47932                         if (current === "*") {
47933
47934                             current = prev;
47935
47936                             // Convert response if prev dataType is non-auto and differs from
47937                             // current
47938                         } else if (prev !== "*" && prev !== current) {
47939
47940                             // Seek a direct converter
47941                             conv = converters[prev + " " + current] || converters["* " + current];
47942
47943                             // If none found, seek a pair
47944                             if (!conv) {
47945                                 for (conv2 in converters) {
47946
47947                                     // If conv2 outputs current
47948                                     tmp = conv2.split(" ");
47949                                     if (tmp[1] === current) {
47950
47951                                         // If prev can be converted to accepted input
47952                                         conv = converters[prev + " " + tmp[0]] ||
47953                                             converters["* " + tmp[0]];
47954                                         if (conv) {
47955                                             // Condense equivalence converters
47956                                             if (conv === true) {
47957                                                 conv = converters[conv2];
47958
47959                                                 // Otherwise, insert the intermediate dataType
47960                                             } else if (converters[conv2] !== true) {
47961                                                 current = tmp[0];
47962                                                 dataTypes.unshift(tmp[1]);
47963                                             }
47964                                             break;
47965                                         }
47966                                     }
47967                                 }
47968                             }
47969
47970                             // Apply converter (if not an equivalence)
47971                             if (conv !== true) {
47972
47973                                 // Unless errors are allowed to bubble, catch and return
47974                                 // them
47975                                 if (conv && s["throws"]) {
47976                                     response = conv(response);
47977                                 } else {
47978                                     try {
47979                                         response = conv(response);
47980                                     } catch (e) {
47981                                         return {
47982                                             state: "parsererror",
47983                                             error: conv ? e : "No conversion from " + prev + " to " + current
47984                                         };
47985                                     }
47986                                 }
47987                             }
47988                         }
47989                     }
47990                 }
47991
47992                 return {
47993                     state: "success",
47994                     data: response
47995                 };
47996             }
47997
47998             jQuery.extend({
47999
48000                 // Counter for holding the number of active queries
48001                 active: 0,
48002
48003                 // Last-Modified header cache for next request
48004                 lastModified: {},
48005                 etag: {},
48006
48007                 ajaxSettings: {
48008                     url: ajaxLocation,
48009                     type: "GET",
48010                     isLocal: rlocalProtocol.test(ajaxLocParts[1]),
48011                     global: true,
48012                     processData: true,
48013                     async: true,
48014                     contentType: "application/x-www-form-urlencoded; charset=UTF-8",
48015                     /*
48016                      * timeout: 0, data: null, dataType: null, username: null, password:
48017                      * null, cache: null, throws: false, traditional: false, headers: {},
48018                      */
48019
48020                     accepts: {
48021                         "*": allTypes,
48022                         text: "text/plain",
48023                         html: "text/html",
48024                         xml: "application/xml, text/xml",
48025                         json: "application/json, text/javascript"
48026                     },
48027
48028                     contents: {
48029                         xml: /xml/,
48030                         html: /html/,
48031                         json: /json/
48032                     },
48033
48034                     responseFields: {
48035                         xml: "responseXML",
48036                         text: "responseText",
48037                         json: "responseJSON"
48038                     },
48039
48040                     // Data converters
48041                     // Keys separate source (or catchall "*") and destination types with a
48042                     // single space
48043                     converters: {
48044
48045                         // Convert anything to text
48046                         "* text": String,
48047
48048                         // Text to html (true = no transformation)
48049                         "text html": true,
48050
48051                         // Evaluate text as a json expression
48052                         "text json": jQuery.parseJSON,
48053
48054                         // Parse text as xml
48055                         "text xml": jQuery.parseXML
48056                     },
48057
48058                     // For options that shouldn't be deep extended:
48059                     // you can add your own custom options here if
48060                     // and when you create one that shouldn't be
48061                     // deep extended (see ajaxExtend)
48062                     flatOptions: {
48063                         url: true,
48064                         context: true
48065                     }
48066                 },
48067
48068                 // Creates a full fledged settings object into target
48069                 // with both ajaxSettings and settings fields.
48070                 // If target is omitted, writes into ajaxSettings.
48071                 ajaxSetup: function(target, settings) {
48072                     return settings ?
48073
48074                         // Building a settings object
48075                         ajaxExtend(ajaxExtend(target, jQuery.ajaxSettings), settings) :
48076
48077                         // Extending ajaxSettings
48078                         ajaxExtend(jQuery.ajaxSettings, target);
48079                 },
48080
48081                 ajaxPrefilter: addToPrefiltersOrTransports(prefilters),
48082                 ajaxTransport: addToPrefiltersOrTransports(transports),
48083
48084                 // Main method
48085                 ajax: function(url, options) {
48086
48087                     // If url is an object, simulate pre-1.5 signature
48088                     if (typeof url === "object") {
48089                         options = url;
48090                         url = undefined;
48091                     }
48092
48093                     // Force options to be an object
48094                     options = options || {};
48095
48096                     var transport,
48097                         // URL without anti-cache param
48098                         cacheURL,
48099                         // Response headers
48100                         responseHeadersString,
48101                         responseHeaders,
48102                         // timeout handle
48103                         timeoutTimer,
48104                         // Cross-domain detection vars
48105                         parts,
48106                         // To know if global events are to be dispatched
48107                         fireGlobals,
48108                         // Loop variable
48109                         i,
48110                         // Create the final options object
48111                         s = jQuery.ajaxSetup({}, options),
48112                         // Callbacks context
48113                         callbackContext = s.context || s,
48114                         // Context for global events is callbackContext if it is a DOM node
48115                         // or jQuery collection
48116                         globalEventContext = s.context && (callbackContext.nodeType || callbackContext.jquery) ?
48117                         jQuery(callbackContext) :
48118                         jQuery.event,
48119                         // Deferreds
48120                         deferred = jQuery.Deferred(),
48121                         completeDeferred = jQuery.Callbacks("once memory"),
48122                         // Status-dependent callbacks
48123                         statusCode = s.statusCode || {},
48124                         // Headers (they are sent all at once)
48125                         requestHeaders = {},
48126                         requestHeadersNames = {},
48127                         // The jqXHR state
48128                         state = 0,
48129                         // Default abort message
48130                         strAbort = "canceled",
48131                         // Fake xhr
48132                         jqXHR = {
48133                             readyState: 0,
48134
48135                             // Builds headers hashtable if needed
48136                             getResponseHeader: function(key) {
48137                                 var match;
48138                                 if (state === 2) {
48139                                     if (!responseHeaders) {
48140                                         responseHeaders = {};
48141                                         while ((match = rheaders.exec(responseHeadersString))) {
48142                                             responseHeaders[match[1].toLowerCase()] = match[2];
48143                                         }
48144                                     }
48145                                     match = responseHeaders[key.toLowerCase()];
48146                                 }
48147                                 return match == null ? null : match;
48148                             },
48149
48150                             // Raw string
48151                             getAllResponseHeaders: function() {
48152                                 return state === 2 ? responseHeadersString : null;
48153                             },
48154
48155                             // Caches the header
48156                             setRequestHeader: function(name, value) {
48157                                 var lname = name.toLowerCase();
48158                                 if (!state) {
48159                                     name = requestHeadersNames[lname] = requestHeadersNames[lname] || name;
48160                                     requestHeaders[name] = value;
48161                                 }
48162                                 return this;
48163                             },
48164
48165                             // Overrides response content-type header
48166                             overrideMimeType: function(type) {
48167                                 if (!state) {
48168                                     s.mimeType = type;
48169                                 }
48170                                 return this;
48171                             },
48172
48173                             // Status-dependent callbacks
48174                             statusCode: function(map) {
48175                                 var code;
48176                                 if (map) {
48177                                     if (state < 2) {
48178                                         for (code in map) {
48179                                             // Lazy-add the new callback in a way that
48180                                             // preserves old ones
48181                                             statusCode[code] = [statusCode[code], map[code]];
48182                                         }
48183                                     } else {
48184                                         // Execute the appropriate callbacks
48185                                         jqXHR.always(map[jqXHR.status]);
48186                                     }
48187                                 }
48188                                 return this;
48189                             },
48190
48191                             // Cancel the request
48192                             abort: function(statusText) {
48193                                 var finalText = statusText || strAbort;
48194                                 if (transport) {
48195                                     transport.abort(finalText);
48196                                 }
48197                                 done(0, finalText);
48198                                 return this;
48199                             }
48200                         };
48201
48202                     // Attach deferreds
48203                     deferred.promise(jqXHR).complete = completeDeferred.add;
48204                     jqXHR.success = jqXHR.done;
48205                     jqXHR.error = jqXHR.fail;
48206
48207                     // Remove hash character (#7531: and string promotion)
48208                     // Add protocol if not provided (prefilters might expect it)
48209                     // Handle falsy url in the settings object (#10093: consistency with old
48210                     // signature)
48211                     // We also use the url parameter if available
48212                     s.url = ((url || s.url || ajaxLocation) + "").replace(rhash, "")
48213                         .replace(rprotocol, ajaxLocParts[1] + "//");
48214
48215                     // Alias method option to type as per ticket #12004
48216                     s.type = options.method || options.type || s.method || s.type;
48217
48218                     // Extract dataTypes list
48219                     s.dataTypes = jQuery.trim(s.dataType || "*").toLowerCase().match(rnotwhite) || [""];
48220
48221                     // A cross-domain request is in order when we have a protocol:host:port
48222                     // mismatch
48223                     if (s.crossDomain == null) {
48224                         parts = rurl.exec(s.url.toLowerCase());
48225                         s.crossDomain = !!(parts &&
48226                             (parts[1] !== ajaxLocParts[1] || parts[2] !== ajaxLocParts[2] ||
48227                                 (parts[3] || (parts[1] === "http:" ? "80" : "443")) !==
48228                                 (ajaxLocParts[3] || (ajaxLocParts[1] === "http:" ? "80" : "443")))
48229                         );
48230                     }
48231
48232                     // Convert data if not already a string
48233                     if (s.data && s.processData && typeof s.data !== "string") {
48234                         s.data = jQuery.param(s.data, s.traditional);
48235                     }
48236
48237                     // Apply prefilters
48238                     inspectPrefiltersOrTransports(prefilters, s, options, jqXHR);
48239
48240                     // If request was aborted inside a prefilter, stop there
48241                     if (state === 2) {
48242                         return jqXHR;
48243                     }
48244
48245                     // We can fire global events as of now if asked to
48246                     // Don't fire events if jQuery.event is undefined in an AMD-usage
48247                     // scenario (#15118)
48248                     fireGlobals = jQuery.event && s.global;
48249
48250                     // Watch for a new set of requests
48251                     if (fireGlobals && jQuery.active++ === 0) {
48252                         jQuery.event.trigger("ajaxStart");
48253                     }
48254
48255                     // Uppercase the type
48256                     s.type = s.type.toUpperCase();
48257
48258                     // Determine if request has content
48259                     s.hasContent = !rnoContent.test(s.type);
48260
48261                     // Save the URL in case we're toying with the If-Modified-Since
48262                     // and/or If-None-Match header later on
48263                     cacheURL = s.url;
48264
48265                     // More options handling for requests with no content
48266                     if (!s.hasContent) {
48267
48268                         // If data is available, append data to url
48269                         if (s.data) {
48270                             cacheURL = (s.url += (rquery.test(cacheURL) ? "&" : "?") + s.data);
48271                             // #9682: remove data so that it's not used in an eventual retry
48272                             delete s.data;
48273                         }
48274
48275                         // Add anti-cache in url if needed
48276                         if (s.cache === false) {
48277                             s.url = rts.test(cacheURL) ?
48278
48279                                 // If there is already a '_' parameter, set its value
48280                                 cacheURL.replace(rts, "$1_=" + nonce++) :
48281
48282                                 // Otherwise add one to the end
48283                                 cacheURL + (rquery.test(cacheURL) ? "&" : "?") + "_=" + nonce++;
48284                         }
48285                     }
48286
48287                     // Set the If-Modified-Since and/or If-None-Match header, if in
48288                     // ifModified mode.
48289                     if (s.ifModified) {
48290                         if (jQuery.lastModified[cacheURL]) {
48291                             jqXHR.setRequestHeader("If-Modified-Since", jQuery.lastModified[cacheURL]);
48292                         }
48293                         if (jQuery.etag[cacheURL]) {
48294                             jqXHR.setRequestHeader("If-None-Match", jQuery.etag[cacheURL]);
48295                         }
48296                     }
48297
48298                     // Set the correct header, if data is being sent
48299                     if (s.data && s.hasContent && s.contentType !== false || options.contentType) {
48300                         jqXHR.setRequestHeader("Content-Type", s.contentType);
48301                     }
48302
48303                     // Set the Accepts header for the server, depending on the dataType
48304                     jqXHR.setRequestHeader(
48305                         "Accept",
48306                         s.dataTypes[0] && s.accepts[s.dataTypes[0]] ?
48307                         s.accepts[s.dataTypes[0]] + (s.dataTypes[0] !== "*" ? ", " + allTypes + "; q=0.01" : "") :
48308                         s.accepts["*"]
48309                     );
48310
48311                     // Check for headers option
48312                     for (i in s.headers) {
48313                         jqXHR.setRequestHeader(i, s.headers[i]);
48314                     }
48315
48316                     // Allow custom headers/mimetypes and early abort
48317                     if (s.beforeSend && (s.beforeSend.call(callbackContext, jqXHR, s) === false || state === 2)) {
48318                         // Abort if not done already and return
48319                         return jqXHR.abort();
48320                     }
48321
48322                     // Aborting is no longer a cancellation
48323                     strAbort = "abort";
48324
48325                     // Install callbacks on deferreds
48326                     for (i in {
48327                             success: 1,
48328                             error: 1,
48329                             complete: 1
48330                         }) {
48331                         jqXHR[i](s[i]);
48332                     }
48333
48334                     // Get transport
48335                     transport = inspectPrefiltersOrTransports(transports, s, options, jqXHR);
48336
48337                     // If no transport, we auto-abort
48338                     if (!transport) {
48339                         done(-1, "No Transport");
48340                     } else {
48341                         jqXHR.readyState = 1;
48342
48343                         // Send global event
48344                         if (fireGlobals) {
48345                             globalEventContext.trigger("ajaxSend", [jqXHR, s]);
48346                         }
48347                         // Timeout
48348                         if (s.async && s.timeout > 0) {
48349                             timeoutTimer = setTimeout(function() {
48350                                 jqXHR.abort("timeout");
48351                             }, s.timeout);
48352                         }
48353
48354                         try {
48355                             state = 1;
48356                             transport.send(requestHeaders, done);
48357                         } catch (e) {
48358                             // Propagate exception as error if not done
48359                             if (state < 2) {
48360                                 done(-1, e);
48361                                 // Simply rethrow otherwise
48362                             } else {
48363                                 throw e;
48364                             }
48365                         }
48366                     }
48367
48368                     // Callback for when everything is done
48369                     function done(status, nativeStatusText, responses, headers) {
48370                         var isSuccess, success, error, response, modified,
48371                             statusText = nativeStatusText;
48372
48373                         // Called once
48374                         if (state === 2) {
48375                             return;
48376                         }
48377
48378                         // State is "done" now
48379                         state = 2;
48380
48381                         // Clear timeout if it exists
48382                         if (timeoutTimer) {
48383                             clearTimeout(timeoutTimer);
48384                         }
48385
48386                         // Dereference transport for early garbage collection
48387                         // (no matter how long the jqXHR object will be used)
48388                         transport = undefined;
48389
48390                         // Cache response headers
48391                         responseHeadersString = headers || "";
48392
48393                         // Set readyState
48394                         jqXHR.readyState = status > 0 ? 4 : 0;
48395
48396                         // Determine if successful
48397                         isSuccess = status >= 200 && status < 300 || status === 304;
48398
48399                         // Get response data
48400                         if (responses) {
48401                             response = ajaxHandleResponses(s, jqXHR, responses);
48402                         }
48403
48404                         // Convert no matter what (that way responseXXX fields are always
48405                         // set)
48406                         response = ajaxConvert(s, response, jqXHR, isSuccess);
48407
48408                         // If successful, handle type chaining
48409                         if (isSuccess) {
48410
48411                             // Set the If-Modified-Since and/or If-None-Match header, if in
48412                             // ifModified mode.
48413                             if (s.ifModified) {
48414                                 modified = jqXHR.getResponseHeader("Last-Modified");
48415                                 if (modified) {
48416                                     jQuery.lastModified[cacheURL] = modified;
48417                                 }
48418                                 modified = jqXHR.getResponseHeader("etag");
48419                                 if (modified) {
48420                                     jQuery.etag[cacheURL] = modified;
48421                                 }
48422                             }
48423
48424                             // if no content
48425                             if (status === 204 || s.type === "HEAD") {
48426                                 statusText = "nocontent";
48427
48428                                 // if not modified
48429                             } else if (status === 304) {
48430                                 statusText = "notmodified";
48431
48432                                 // If we have data, let's convert it
48433                             } else {
48434                                 statusText = response.state;
48435                                 success = response.data;
48436                                 error = response.error;
48437                                 isSuccess = !error;
48438                             }
48439                         } else {
48440                             // Extract error from statusText and normalize for non-aborts
48441                             error = statusText;
48442                             if (status || !statusText) {
48443                                 statusText = "error";
48444                                 if (status < 0) {
48445                                     status = 0;
48446                                 }
48447                             }
48448                         }
48449
48450                         // Set data for the fake xhr object
48451                         jqXHR.status = status;
48452                         jqXHR.statusText = (nativeStatusText || statusText) + "";
48453
48454                         // Success/Error
48455                         if (isSuccess) {
48456                             deferred.resolveWith(callbackContext, [success, statusText, jqXHR]);
48457                         } else {
48458                             deferred.rejectWith(callbackContext, [jqXHR, statusText, error]);
48459                         }
48460
48461                         // Status-dependent callbacks
48462                         jqXHR.statusCode(statusCode);
48463                         statusCode = undefined;
48464
48465                         if (fireGlobals) {
48466                             globalEventContext.trigger(isSuccess ? "ajaxSuccess" : "ajaxError", [jqXHR, s, isSuccess ? success : error]);
48467                         }
48468
48469                         // Complete
48470                         completeDeferred.fireWith(callbackContext, [jqXHR, statusText]);
48471
48472                         if (fireGlobals) {
48473                             globalEventContext.trigger("ajaxComplete", [jqXHR, s]);
48474                             // Handle the global AJAX counter
48475                             if (!(--jQuery.active)) {
48476                                 jQuery.event.trigger("ajaxStop");
48477                             }
48478                         }
48479                     }
48480
48481                     return jqXHR;
48482                 },
48483
48484                 getJSON: function(url, data, callback) {
48485                     return jQuery.get(url, data, callback, "json");
48486                 },
48487
48488                 getScript: function(url, callback) {
48489                     return jQuery.get(url, undefined, callback, "script");
48490                 }
48491             });
48492
48493             jQuery.each(["get", "post"], function(i, method) {
48494                 jQuery[method] = function(url, data, callback, type) {
48495                     // Shift arguments if data argument was omitted
48496                     if (jQuery.isFunction(data)) {
48497                         type = type || callback;
48498                         callback = data;
48499                         data = undefined;
48500                     }
48501
48502                     return jQuery.ajax({
48503                         url: url,
48504                         type: method,
48505                         dataType: type,
48506                         data: data,
48507                         success: callback
48508                     });
48509                 };
48510             });
48511
48512
48513             jQuery._evalUrl = function(url) {
48514                 return jQuery.ajax({
48515                     url: url,
48516                     type: "GET",
48517                     dataType: "script",
48518                     async: false,
48519                     global: false,
48520                     "throws": true
48521                 });
48522             };
48523
48524
48525             jQuery.fn.extend({
48526                 wrapAll: function(html) {
48527                     var wrap;
48528
48529                     if (jQuery.isFunction(html)) {
48530                         return this.each(function(i) {
48531                             jQuery(this).wrapAll(html.call(this, i));
48532                         });
48533                     }
48534
48535                     if (this[0]) {
48536
48537                         // The elements to wrap the target around
48538                         wrap = jQuery(html, this[0].ownerDocument).eq(0).clone(true);
48539
48540                         if (this[0].parentNode) {
48541                             wrap.insertBefore(this[0]);
48542                         }
48543
48544                         wrap.map(function() {
48545                             var elem = this;
48546
48547                             while (elem.firstElementChild) {
48548                                 elem = elem.firstElementChild;
48549                             }
48550
48551                             return elem;
48552                         }).append(this);
48553                     }
48554
48555                     return this;
48556                 },
48557
48558                 wrapInner: function(html) {
48559                     if (jQuery.isFunction(html)) {
48560                         return this.each(function(i) {
48561                             jQuery(this).wrapInner(html.call(this, i));
48562                         });
48563                     }
48564
48565                     return this.each(function() {
48566                         var self = jQuery(this),
48567                             contents = self.contents();
48568
48569                         if (contents.length) {
48570                             contents.wrapAll(html);
48571
48572                         } else {
48573                             self.append(html);
48574                         }
48575                     });
48576                 },
48577
48578                 wrap: function(html) {
48579                     var isFunction = jQuery.isFunction(html);
48580
48581                     return this.each(function(i) {
48582                         jQuery(this).wrapAll(isFunction ? html.call(this, i) : html);
48583                     });
48584                 },
48585
48586                 unwrap: function() {
48587                     return this.parent().each(function() {
48588                         if (!jQuery.nodeName(this, "body")) {
48589                             jQuery(this).replaceWith(this.childNodes);
48590                         }
48591                     }).end();
48592                 }
48593             });
48594
48595
48596             jQuery.expr.filters.hidden = function(elem) {
48597                 // Support: Opera <= 12.12
48598                 // Opera reports offsetWidths and offsetHeights less than zero on some
48599                 // elements
48600                 return elem.offsetWidth <= 0 && elem.offsetHeight <= 0;
48601             };
48602             jQuery.expr.filters.visible = function(elem) {
48603                 return !jQuery.expr.filters.hidden(elem);
48604             };
48605
48606
48607
48608
48609             var r20 = /%20/g,
48610                 rbracket = /\[\]$/,
48611                 rCRLF = /\r?\n/g,
48612                 rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i,
48613                 rsubmittable = /^(?:input|select|textarea|keygen)/i;
48614
48615             function buildParams(prefix, obj, traditional, add) {
48616                 var name;
48617
48618                 if (jQuery.isArray(obj)) {
48619                     // Serialize array item.
48620                     jQuery.each(obj, function(i, v) {
48621                         if (traditional || rbracket.test(prefix)) {
48622                             // Treat each array item as a scalar.
48623                             add(prefix, v);
48624
48625                         } else {
48626                             // Item is non-scalar (array or object), encode its numeric
48627                             // index.
48628                             buildParams(prefix + "[" + (typeof v === "object" ? i : "") + "]", v, traditional, add);
48629                         }
48630                     });
48631
48632                 } else if (!traditional && jQuery.type(obj) === "object") {
48633                     // Serialize object item.
48634                     for (name in obj) {
48635                         buildParams(prefix + "[" + name + "]", obj[name], traditional, add);
48636                     }
48637
48638                 } else {
48639                     // Serialize scalar item.
48640                     add(prefix, obj);
48641                 }
48642             }
48643
48644             // Serialize an array of form elements or a set of
48645             // key/values into a query string
48646             jQuery.param = function(a, traditional) {
48647                 var prefix,
48648                     s = [],
48649                     add = function(key, value) {
48650                         // If value is a function, invoke it and return its value
48651                         value = jQuery.isFunction(value) ? value() : (value == null ? "" : value);
48652                         s[s.length] = encodeURIComponent(key) + "=" + encodeURIComponent(value);
48653                     };
48654
48655                 // Set traditional to true for jQuery <= 1.3.2 behavior.
48656                 if (traditional === undefined) {
48657                     traditional = jQuery.ajaxSettings && jQuery.ajaxSettings.traditional;
48658                 }
48659
48660                 // If an array was passed in, assume that it is an array of form elements.
48661                 if (jQuery.isArray(a) || (a.jquery && !jQuery.isPlainObject(a))) {
48662                     // Serialize the form elements
48663                     jQuery.each(a, function() {
48664                         add(this.name, this.value);
48665                     });
48666
48667                 } else {
48668                     // If traditional, encode the "old" way (the way 1.3.2 or older
48669                     // did it), otherwise encode params recursively.
48670                     for (prefix in a) {
48671                         buildParams(prefix, a[prefix], traditional, add);
48672                     }
48673                 }
48674
48675                 // Return the resulting serialization
48676                 return s.join("&").replace(r20, "+");
48677             };
48678
48679             jQuery.fn.extend({
48680                 serialize: function() {
48681                     return jQuery.param(this.serializeArray());
48682                 },
48683                 serializeArray: function() {
48684                     return this.map(function() {
48685                             // Can add propHook for "elements" to filter or add form elements
48686                             var elements = jQuery.prop(this, "elements");
48687                             return elements ? jQuery.makeArray(elements) : this;
48688                         })
48689                         .filter(function() {
48690                             var type = this.type;
48691
48692                             // Use .is( ":disabled" ) so that fieldset[disabled] works
48693                             return this.name && !jQuery(this).is(":disabled") &&
48694                                 rsubmittable.test(this.nodeName) && !rsubmitterTypes.test(type) &&
48695                                 (this.checked || !rcheckableType.test(type));
48696                         })
48697                         .map(function(i, elem) {
48698                             var val = jQuery(this).val();
48699
48700                             return val == null ?
48701                                 null :
48702                                 jQuery.isArray(val) ?
48703                                 jQuery.map(val, function(val) {
48704                                     return {
48705                                         name: elem.name,
48706                                         value: val.replace(rCRLF, "\r\n")
48707                                     };
48708                                 }) : {
48709                                     name: elem.name,
48710                                     value: val.replace(rCRLF, "\r\n")
48711                                 };
48712                         }).get();
48713                 }
48714             });
48715
48716
48717             jQuery.ajaxSettings.xhr = function() {
48718                 try {
48719                     return new XMLHttpRequest();
48720                 } catch (e) {}
48721             };
48722
48723             var xhrId = 0,
48724                 xhrCallbacks = {},
48725                 xhrSuccessStatus = {
48726                     // file protocol always yields status code 0, assume 200
48727                     0: 200,
48728                     // Support: IE9
48729                     // #1450: sometimes IE returns 1223 when it should be 204
48730                     1223: 204
48731                 },
48732                 xhrSupported = jQuery.ajaxSettings.xhr();
48733
48734             // Support: IE9
48735             // Open requests must be manually aborted on unload (#5280)
48736             // See https://support.microsoft.com/kb/2856746 for more info
48737             if (window.attachEvent) {
48738                 window.attachEvent("onunload", function() {
48739                     for (var key in xhrCallbacks) {
48740                         xhrCallbacks[key]();
48741                     }
48742                 });
48743             }
48744
48745             support.cors = !!xhrSupported && ("withCredentials" in xhrSupported);
48746             support.ajax = xhrSupported = !!xhrSupported;
48747
48748             jQuery.ajaxTransport(function(options) {
48749                 var callback;
48750
48751                 // Cross domain only allowed if supported through XMLHttpRequest
48752                 if (support.cors || xhrSupported && !options.crossDomain) {
48753                     return {
48754                         send: function(headers, complete) {
48755                             var i,
48756                                 xhr = options.xhr(),
48757                                 id = ++xhrId;
48758
48759                             xhr.open(options.type, options.url, options.async, options.username, options.password);
48760
48761                             // Apply custom fields if provided
48762                             if (options.xhrFields) {
48763                                 for (i in options.xhrFields) {
48764                                     xhr[i] = options.xhrFields[i];
48765                                 }
48766                             }
48767
48768                             // Override mime type if needed
48769                             if (options.mimeType && xhr.overrideMimeType) {
48770                                 xhr.overrideMimeType(options.mimeType);
48771                             }
48772
48773                             // X-Requested-With header
48774                             // For cross-domain requests, seeing as conditions for a
48775                             // preflight are
48776                             // akin to a jigsaw puzzle, we simply never set it to be sure.
48777                             // (it can always be set on a per-request basis or even using
48778                             // ajaxSetup)
48779                             // For same-domain requests, won't change header if already
48780                             // provided.
48781                             if (!options.crossDomain && !headers["X-Requested-With"]) {
48782                                 headers["X-Requested-With"] = "XMLHttpRequest";
48783                             }
48784
48785                             // Set headers
48786                             for (i in headers) {
48787                                 xhr.setRequestHeader(i, headers[i]);
48788                             }
48789
48790                             // Callback
48791                             callback = function(type) {
48792                                 return function() {
48793                                     if (callback) {
48794                                         delete xhrCallbacks[id];
48795                                         callback = xhr.onload = xhr.onerror = null;
48796
48797                                         if (type === "abort") {
48798                                             xhr.abort();
48799                                         } else if (type === "error") {
48800                                             complete(
48801                                                 // file: protocol always yields status 0;
48802                                                 // see #8605, #14207
48803                                                 xhr.status,
48804                                                 xhr.statusText
48805                                             );
48806                                         } else {
48807                                             complete(
48808                                                 xhrSuccessStatus[xhr.status] || xhr.status,
48809                                                 xhr.statusText,
48810                                                 // Support: IE9
48811                                                 // Accessing binary-data responseText throws
48812                                                 // an exception
48813                                                 // (#11426)
48814                                                 typeof xhr.responseText === "string" ? {
48815                                                     text: xhr.responseText
48816                                                 } : undefined,
48817                                                 xhr.getAllResponseHeaders()
48818                                             );
48819                                         }
48820                                     }
48821                                 };
48822                             };
48823
48824                             // Listen to events
48825                             xhr.onload = callback();
48826                             xhr.onerror = callback("error");
48827
48828                             // Create the abort callback
48829                             callback = xhrCallbacks[id] = callback("abort");
48830
48831                             try {
48832                                 // Do send the request (this may raise an exception)
48833                                 xhr.send(options.hasContent && options.data || null);
48834                             } catch (e) {
48835                                 // #14683: Only rethrow if this hasn't been notified as an
48836                                 // error yet
48837                                 if (callback) {
48838                                     throw e;
48839                                 }
48840                             }
48841                         },
48842
48843                         abort: function() {
48844                             if (callback) {
48845                                 callback();
48846                             }
48847                         }
48848                     };
48849                 }
48850             });
48851
48852
48853
48854
48855             // Install script dataType
48856             jQuery.ajaxSetup({
48857                 accepts: {
48858                     script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"
48859                 },
48860                 contents: {
48861                     script: /(?:java|ecma)script/
48862                 },
48863                 converters: {
48864                     "text script": function(text) {
48865                         jQuery.globalEval(text);
48866                         return text;
48867                     }
48868                 }
48869             });
48870
48871             // Handle cache's special case and crossDomain
48872             jQuery.ajaxPrefilter("script", function(s) {
48873                 if (s.cache === undefined) {
48874                     s.cache = false;
48875                 }
48876                 if (s.crossDomain) {
48877                     s.type = "GET";
48878                 }
48879             });
48880
48881             // Bind script tag hack transport
48882             jQuery.ajaxTransport("script", function(s) {
48883                 // This transport only deals with cross domain requests
48884                 if (s.crossDomain) {
48885                     var script, callback;
48886                     return {
48887                         send: function(_, complete) {
48888                             script = jQuery("<script>").prop({
48889                                 async: true,
48890                                 charset: s.scriptCharset,
48891                                 src: s.url
48892                             }).on(
48893                                 "load error",
48894                                 callback = function(evt) {
48895                                     script.remove();
48896                                     callback = null;
48897                                     if (evt) {
48898                                         complete(evt.type === "error" ? 404 : 200, evt.type);
48899                                     }
48900                                 }
48901                             );
48902                             document.head.appendChild(script[0]);
48903                         },
48904                         abort: function() {
48905                             if (callback) {
48906                                 callback();
48907                             }
48908                         }
48909                     };
48910                 }
48911             });
48912
48913
48914
48915
48916             var oldCallbacks = [],
48917                 rjsonp = /(=)\?(?=&|$)|\?\?/;
48918
48919             // Default jsonp settings
48920             jQuery.ajaxSetup({
48921                 jsonp: "callback",
48922                 jsonpCallback: function() {
48923                     var callback = oldCallbacks.pop() || (jQuery.expando + "_" + (nonce++));
48924                     this[callback] = true;
48925                     return callback;
48926                 }
48927             });
48928
48929             // Detect, normalize options and install callbacks for jsonp requests
48930             jQuery.ajaxPrefilter("json jsonp", function(s, originalSettings, jqXHR) {
48931
48932                 var callbackName, overwritten, responseContainer,
48933                     jsonProp = s.jsonp !== false && (rjsonp.test(s.url) ?
48934                         "url" :
48935                         typeof s.data === "string" && !(s.contentType || "").indexOf("application/x-www-form-urlencoded") && rjsonp.test(s.data) && "data"
48936                     );
48937
48938                 // Handle iff the expected data type is "jsonp" or we have a parameter to
48939                 // set
48940                 if (jsonProp || s.dataTypes[0] === "jsonp") {
48941
48942                     // Get callback name, remembering preexisting value associated with it
48943                     callbackName = s.jsonpCallback = jQuery.isFunction(s.jsonpCallback) ?
48944                         s.jsonpCallback() :
48945                         s.jsonpCallback;
48946
48947                     // Insert callback into url or form data
48948                     if (jsonProp) {
48949                         s[jsonProp] = s[jsonProp].replace(rjsonp, "$1" + callbackName);
48950                     } else if (s.jsonp !== false) {
48951                         s.url += (rquery.test(s.url) ? "&" : "?") + s.jsonp + "=" + callbackName;
48952                     }
48953
48954                     // Use data converter to retrieve json after script execution
48955                     s.converters["script json"] = function() {
48956                         if (!responseContainer) {
48957                             jQuery.error(callbackName + " was not called");
48958                         }
48959                         return responseContainer[0];
48960                     };
48961
48962                     // force json dataType
48963                     s.dataTypes[0] = "json";
48964
48965                     // Install callback
48966                     overwritten = window[callbackName];
48967                     window[callbackName] = function() {
48968                         responseContainer = arguments;
48969                     };
48970
48971                     // Clean-up function (fires after converters)
48972                     jqXHR.always(function() {
48973                         // Restore preexisting value
48974                         window[callbackName] = overwritten;
48975
48976                         // Save back as free
48977                         if (s[callbackName]) {
48978                             // make sure that re-using the options doesn't screw things
48979                             // around
48980                             s.jsonpCallback = originalSettings.jsonpCallback;
48981
48982                             // save the callback name for future use
48983                             oldCallbacks.push(callbackName);
48984                         }
48985
48986                         // Call if it was a function and we have a response
48987                         if (responseContainer && jQuery.isFunction(overwritten)) {
48988                             overwritten(responseContainer[0]);
48989                         }
48990
48991                         responseContainer = overwritten = undefined;
48992                     });
48993
48994                     // Delegate to script
48995                     return "script";
48996                 }
48997             });
48998
48999
49000
49001
49002             // data: string of html
49003             // context (optional): If specified, the fragment will be created in this
49004             // context, defaults to document
49005             // keepScripts (optional): If true, will include scripts passed in the html
49006             // string
49007             jQuery.parseHTML = function(data, context, keepScripts) {
49008                 if (!data || typeof data !== "string") {
49009                     return null;
49010                 }
49011                 if (typeof context === "boolean") {
49012                     keepScripts = context;
49013                     context = false;
49014                 }
49015                 context = context || document;
49016
49017                 var parsed = rsingleTag.exec(data),
49018                     scripts = !keepScripts && [];
49019
49020                 // Single tag
49021                 if (parsed) {
49022                     return [context.createElement(parsed[1])];
49023                 }
49024
49025                 parsed = jQuery.buildFragment([data], context, scripts);
49026
49027                 if (scripts && scripts.length) {
49028                     jQuery(scripts).remove();
49029                 }
49030
49031                 return jQuery.merge([], parsed.childNodes);
49032             };
49033
49034
49035             // Keep a copy of the old load method
49036             var _load = jQuery.fn.load;
49037
49038             /**
49039              * Load a url into a page
49040              */
49041             jQuery.fn.load = function(url, params, callback) {
49042                 if (typeof url !== "string" && _load) {
49043                     return _load.apply(this, arguments);
49044                 }
49045
49046                 var selector, type, response,
49047                     self = this,
49048                     off = url.indexOf(" ");
49049
49050                 if (off >= 0) {
49051                     selector = jQuery.trim(url.slice(off));
49052                     url = url.slice(0, off);
49053                 }
49054
49055                 // If it's a function
49056                 if (jQuery.isFunction(params)) {
49057
49058                     // We assume that it's the callback
49059                     callback = params;
49060                     params = undefined;
49061
49062                     // Otherwise, build a param string
49063                 } else if (params && typeof params === "object") {
49064                     type = "POST";
49065                 }
49066
49067                 // If we have elements to modify, make the request
49068                 if (self.length > 0) {
49069                     jQuery.ajax({
49070                         url: url,
49071
49072                         // if "type" variable is undefined, then "GET" method will be used
49073                         type: type,
49074                         dataType: "html",
49075                         data: params
49076                     }).done(function(responseText) {
49077
49078                         // Save response for use in complete callback
49079                         response = arguments;
49080
49081                         self.html(selector ?
49082
49083                             // If a selector was specified, locate the right elements in a
49084                             // dummy div
49085                             // Exclude scripts to avoid IE 'Permission Denied' errors
49086                             jQuery("<div>").append(jQuery.parseHTML(responseText)).find(selector) :
49087
49088                             // Otherwise use the full result
49089                             responseText);
49090
49091                     }).complete(callback && function(jqXHR, status) {
49092                         self.each(callback, response || [jqXHR.responseText, status, jqXHR]);
49093                     });
49094                 }
49095
49096                 return this;
49097             };
49098
49099
49100
49101
49102             // Attach a bunch of functions for handling common AJAX events
49103             jQuery.each(["ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend"], function(i, type) {
49104                 jQuery.fn[type] = function(fn) {
49105                     return this.on(type, fn);
49106                 };
49107             });
49108
49109
49110
49111
49112             jQuery.expr.filters.animated = function(elem) {
49113                 return jQuery.grep(jQuery.timers, function(fn) {
49114                     return elem === fn.elem;
49115                 }).length;
49116             };
49117
49118
49119
49120
49121             var docElem = window.document.documentElement;
49122
49123             /**
49124              * Gets a window from an element
49125              */
49126             function getWindow(elem) {
49127                 return jQuery.isWindow(elem) ? elem : elem.nodeType === 9 && elem.defaultView;
49128             }
49129
49130             jQuery.offset = {
49131                 setOffset: function(elem, options, i) {
49132                     var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition,
49133                         position = jQuery.css(elem, "position"),
49134                         curElem = jQuery(elem),
49135                         props = {};
49136
49137                     // Set position first, in-case top/left are set even on static elem
49138                     if (position === "static") {
49139                         elem.style.position = "relative";
49140                     }
49141
49142                     curOffset = curElem.offset();
49143                     curCSSTop = jQuery.css(elem, "top");
49144                     curCSSLeft = jQuery.css(elem, "left");
49145                     calculatePosition = (position === "absolute" || position === "fixed") &&
49146                         (curCSSTop + curCSSLeft).indexOf("auto") > -1;
49147
49148                     // Need to be able to calculate position if either
49149                     // top or left is auto and position is either absolute or fixed
49150                     if (calculatePosition) {
49151                         curPosition = curElem.position();
49152                         curTop = curPosition.top;
49153                         curLeft = curPosition.left;
49154
49155                     } else {
49156                         curTop = parseFloat(curCSSTop) || 0;
49157                         curLeft = parseFloat(curCSSLeft) || 0;
49158                     }
49159
49160                     if (jQuery.isFunction(options)) {
49161                         options = options.call(elem, i, curOffset);
49162                     }
49163
49164                     if (options.top != null) {
49165                         props.top = (options.top - curOffset.top) + curTop;
49166                     }
49167                     if (options.left != null) {
49168                         props.left = (options.left - curOffset.left) + curLeft;
49169                     }
49170
49171                     if ("using" in options) {
49172                         options.using.call(elem, props);
49173
49174                     } else {
49175                         curElem.css(props);
49176                     }
49177                 }
49178             };
49179
49180             jQuery.fn.extend({
49181                 offset: function(options) {
49182                     if (arguments.length) {
49183                         return options === undefined ?
49184                             this :
49185                             this.each(function(i) {
49186                                 jQuery.offset.setOffset(this, options, i);
49187                             });
49188                     }
49189
49190                     var docElem, win,
49191                         elem = this[0],
49192                         box = {
49193                             top: 0,
49194                             left: 0
49195                         },
49196                         doc = elem && elem.ownerDocument;
49197
49198                     if (!doc) {
49199                         return;
49200                     }
49201
49202                     docElem = doc.documentElement;
49203
49204                     // Make sure it's not a disconnected DOM node
49205                     if (!jQuery.contains(docElem, elem)) {
49206                         return box;
49207                     }
49208
49209                     // Support: BlackBerry 5, iOS 3 (original iPhone)
49210                     // If we don't have gBCR, just use 0,0 rather than error
49211                     if (typeof elem.getBoundingClientRect !== strundefined) {
49212                         box = elem.getBoundingClientRect();
49213                     }
49214                     win = getWindow(doc);
49215                     return {
49216                         top: box.top + win.pageYOffset - docElem.clientTop,
49217                         left: box.left + win.pageXOffset - docElem.clientLeft
49218                     };
49219                 },
49220
49221                 position: function() {
49222                     if (!this[0]) {
49223                         return;
49224                     }
49225
49226                     var offsetParent, offset,
49227                         elem = this[0],
49228                         parentOffset = {
49229                             top: 0,
49230                             left: 0
49231                         };
49232
49233                     // Fixed elements are offset from window (parentOffset = {top:0, left:
49234                     // 0}, because it is its only offset parent
49235                     if (jQuery.css(elem, "position") === "fixed") {
49236                         // Assume getBoundingClientRect is there when computed position is
49237                         // fixed
49238                         offset = elem.getBoundingClientRect();
49239
49240                     } else {
49241                         // Get *real* offsetParent
49242                         offsetParent = this.offsetParent();
49243
49244                         // Get correct offsets
49245                         offset = this.offset();
49246                         if (!jQuery.nodeName(offsetParent[0], "html")) {
49247                             parentOffset = offsetParent.offset();
49248                         }
49249
49250                         // Add offsetParent borders
49251                         parentOffset.top += jQuery.css(offsetParent[0], "borderTopWidth", true);
49252                         parentOffset.left += jQuery.css(offsetParent[0], "borderLeftWidth", true);
49253                     }
49254
49255                     // Subtract parent offsets and element margins
49256                     return {
49257                         top: offset.top - parentOffset.top - jQuery.css(elem, "marginTop", true),
49258                         left: offset.left - parentOffset.left - jQuery.css(elem, "marginLeft", true)
49259                     };
49260                 },
49261
49262                 offsetParent: function() {
49263                     return this.map(function() {
49264                         var offsetParent = this.offsetParent || docElem;
49265
49266                         while (offsetParent && (!jQuery.nodeName(offsetParent, "html") && jQuery.css(offsetParent, "position") === "static")) {
49267                             offsetParent = offsetParent.offsetParent;
49268                         }
49269
49270                         return offsetParent || docElem;
49271                     });
49272                 }
49273             });
49274
49275             // Create scrollLeft and scrollTop methods
49276             jQuery.each({
49277                 scrollLeft: "pageXOffset",
49278                 scrollTop: "pageYOffset"
49279             }, function(method, prop) {
49280                 var top = "pageYOffset" === prop;
49281
49282                 jQuery.fn[method] = function(val) {
49283                     return access(this, function(elem, method, val) {
49284                         var win = getWindow(elem);
49285
49286                         if (val === undefined) {
49287                             return win ? win[prop] : elem[method];
49288                         }
49289
49290                         if (win) {
49291                             win.scrollTo(!top ? val : window.pageXOffset,
49292                                 top ? val : window.pageYOffset
49293                             );
49294
49295                         } else {
49296                             elem[method] = val;
49297                         }
49298                     }, method, val, arguments.length, null);
49299                 };
49300             });
49301
49302             // Support: Safari<7+, Chrome<37+
49303             // Add the top/left cssHooks using jQuery.fn.position
49304             // Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084
49305             // Blink bug: https://code.google.com/p/chromium/issues/detail?id=229280
49306             // getComputedStyle returns percent when specified for top/left/bottom/right;
49307             // rather than make the css module depend on the offset module, just check for
49308             // it here
49309             jQuery.each(["top", "left"], function(i, prop) {
49310                 jQuery.cssHooks[prop] = addGetHookIf(support.pixelPosition,
49311                     function(elem, computed) {
49312                         if (computed) {
49313                             computed = curCSS(elem, prop);
49314                             // If curCSS returns percentage, fallback to offset
49315                             return rnumnonpx.test(computed) ?
49316                                 jQuery(elem).position()[prop] + "px" :
49317                                 computed;
49318                         }
49319                     }
49320                 );
49321             });
49322
49323
49324             // Create innerHeight, innerWidth, height, width, outerHeight and outerWidth
49325             // methods
49326             jQuery.each({
49327                 Height: "height",
49328                 Width: "width"
49329             }, function(name, type) {
49330                 jQuery.each({
49331                     padding: "inner" + name,
49332                     content: type,
49333                     "": "outer" + name
49334                 }, function(defaultExtra, funcName) {
49335                     // Margin is only for outerHeight, outerWidth
49336                     jQuery.fn[funcName] = function(margin, value) {
49337                         var chainable = arguments.length && (defaultExtra || typeof margin !== "boolean"),
49338                             extra = defaultExtra || (margin === true || value === true ? "margin" : "border");
49339
49340                         return access(this, function(elem, type, value) {
49341                             var doc;
49342
49343                             if (jQuery.isWindow(elem)) {
49344                                 // As of 5/8/2012 this will yield incorrect results for
49345                                 // Mobile Safari, but there
49346                                 // isn't a whole lot we can do. See pull request at this URL
49347                                 // for discussion:
49348                                 // https://github.com/jquery/jquery/pull/764
49349                                 return elem.document.documentElement["client" + name];
49350                             }
49351
49352                             // Get document width or height
49353                             if (elem.nodeType === 9) {
49354                                 doc = elem.documentElement;
49355
49356                                 // Either scroll[Width/Height] or offset[Width/Height] or
49357                                 // client[Width/Height],
49358                                 // whichever is greatest
49359                                 return Math.max(
49360                                     elem.body["scroll" + name], doc["scroll" + name],
49361                                     elem.body["offset" + name], doc["offset" + name],
49362                                     doc["client" + name]
49363                                 );
49364                             }
49365
49366                             return value === undefined ?
49367                                 // Get width or height on the element, requesting but not
49368                                 // forcing parseFloat
49369                                 jQuery.css(elem, type, extra) :
49370
49371                                 // Set width or height on the element
49372                                 jQuery.style(elem, type, value, extra);
49373                         }, type, chainable ? margin : undefined, chainable, null);
49374                     };
49375                 });
49376             });
49377
49378
49379             // The number of elements contained in the matched element set
49380             jQuery.fn.size = function() {
49381                 return this.length;
49382             };
49383
49384             jQuery.fn.andSelf = jQuery.fn.addBack;
49385
49386
49387
49388
49389             // Register as a named AMD module, since jQuery can be concatenated with other
49390             // files that may use define, but not via a proper concatenation script that
49391             // understands anonymous AMD modules. A named AMD is safest and most robust
49392             // way to register. Lowercase jquery is used because AMD module names are
49393             // derived from file names, and jQuery is normally delivered in a lowercase
49394             // file name. Do this after creating the global so that if an AMD module wants
49395             // to call noConflict to hide this version of jQuery, it will work.
49396
49397             // Note that for maximum portability, libraries that are not jQuery should
49398             // declare themselves as anonymous modules, and avoid setting a global if an
49399             // AMD loader is present. jQuery is a special case. For more information, see
49400             // https://github.com/jrburke/requirejs/wiki/Updating-existing-libraries#wiki-anon
49401
49402             if (typeof define === "function" && define.amd) {
49403                 define("jquery", [], function() {
49404                     return jQuery;
49405                 });
49406             }
49407
49408
49409
49410
49411             var
49412             // Map over jQuery in case of overwrite
49413                 _jQuery = window.jQuery,
49414
49415                 // Map over the $ in case of overwrite
49416                 _$ = window.$;
49417
49418             jQuery.noConflict = function(deep) {
49419                 if (window.$ === jQuery) {
49420                     window.$ = _$;
49421                 }
49422
49423                 if (deep && window.jQuery === jQuery) {
49424                     window.jQuery = _jQuery;
49425                 }
49426
49427                 return jQuery;
49428             };
49429
49430             // Expose jQuery and $ identifiers, even in AMD
49431             // (#7102#comment:10, https://github.com/jquery/jquery/pull/557)
49432             // and CommonJS for browser emulators (#13566)
49433             if (typeof noGlobal === strundefined) {
49434                 window.jQuery = window.$ = jQuery;
49435             }
49436
49437
49438
49439
49440             return jQuery;
49441
49442         }));
49443
49444     }, {}],
49445     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\array\\flatten.js": [function(require, module, exports) {
49446         var baseFlatten = require('../internal/baseFlatten'),
49447             isIterateeCall = require('../internal/isIterateeCall');
49448
49449         /**
49450          * Flattens a nested array. If `isDeep` is `true` the array is recursively
49451          * flattened, otherwise it's only flattened a single level.
49452          * 
49453          * @static
49454          * @memberOf _
49455          * @category Array
49456          * @param {Array}
49457          *            array The array to flatten.
49458          * @param {boolean}
49459          *            [isDeep] Specify a deep flatten.
49460          * @param- {Object} [guard] Enables use as a callback for functions like
49461          *         `_.map`.
49462          * @returns {Array} Returns the new flattened array.
49463          * @example
49464          * 
49465          * _.flatten([1, [2, 3, [4]]]); // => [1, 2, 3, [4]]
49466          *  // using `isDeep` _.flatten([1, [2, 3, [4]]], true); // => [1, 2, 3, 4]
49467          */
49468         function flatten(array, isDeep, guard) {
49469             var length = array ? array.length : 0;
49470             if (guard && isIterateeCall(array, isDeep, guard)) {
49471                 isDeep = false;
49472             }
49473             return length ? baseFlatten(array, isDeep) : [];
49474         }
49475
49476         module.exports = flatten;
49477
49478     }, {
49479         "../internal/baseFlatten": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseFlatten.js",
49480         "../internal/isIterateeCall": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isIterateeCall.js"
49481     }],
49482     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\array\\last.js": [function(require, module, exports) {
49483         /**
49484          * Gets the last element of `array`.
49485          * 
49486          * @static
49487          * @memberOf _
49488          * @category Array
49489          * @param {Array}
49490          *            array The array to query.
49491          * @returns {*} Returns the last element of `array`.
49492          * @example
49493          * 
49494          * _.last([1, 2, 3]); // => 3
49495          */
49496         function last(array) {
49497             var length = array ? array.length : 0;
49498             return length ? array[length - 1] : undefined;
49499         }
49500
49501         module.exports = last;
49502
49503     }, {}],
49504     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\array\\uniq.js": [function(require, module, exports) {
49505         var baseCallback = require('../internal/baseCallback'),
49506             baseUniq = require('../internal/baseUniq'),
49507             isIterateeCall = require('../internal/isIterateeCall'),
49508             sortedUniq = require('../internal/sortedUniq');
49509
49510         /**
49511          * Creates a duplicate-free version of an array, using
49512          * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
49513          * for equality comparisons, in which only the first occurence of each element
49514          * is kept. Providing `true` for `isSorted` performs a faster search algorithm
49515          * for sorted arrays. If an iteratee function is provided it's invoked for each
49516          * element in the array to generate the criterion by which uniqueness is
49517          * computed. The `iteratee` is bound to `thisArg` and invoked with three
49518          * arguments: (value, index, array).
49519          * 
49520          * If a property name is provided for `iteratee` the created `_.property` style
49521          * callback returns the property value of the given element.
49522          * 
49523          * If a value is also provided for `thisArg` the created `_.matchesProperty`
49524          * style callback returns `true` for elements that have a matching property
49525          * value, else `false`.
49526          * 
49527          * If an object is provided for `iteratee` the created `_.matches` style
49528          * callback returns `true` for elements that have the properties of the given
49529          * object, else `false`.
49530          * 
49531          * @static
49532          * @memberOf _
49533          * @alias unique
49534          * @category Array
49535          * @param {Array}
49536          *            array The array to inspect.
49537          * @param {boolean}
49538          *            [isSorted] Specify the array is sorted.
49539          * @param {Function|Object|string}
49540          *            [iteratee] The function invoked per iteration.
49541          * @param {*}
49542          *            [thisArg] The `this` binding of `iteratee`.
49543          * @returns {Array} Returns the new duplicate-value-free array.
49544          * @example
49545          * 
49546          * _.uniq([2, 1, 2]); // => [2, 1]
49547          *  // using `isSorted` _.uniq([1, 1, 2], true); // => [1, 2]
49548          *  // using an iteratee function _.uniq([1, 2.5, 1.5, 2], function(n) { return
49549          * this.floor(n); }, Math); // => [1, 2.5]
49550          *  // using the `_.property` callback shorthand _.uniq([{ 'x': 1 }, { 'x': 2 }, {
49551          * 'x': 1 }], 'x'); // => [{ 'x': 1 }, { 'x': 2 }]
49552          */
49553         function uniq(array, isSorted, iteratee, thisArg) {
49554             var length = array ? array.length : 0;
49555             if (!length) {
49556                 return [];
49557             }
49558             if (isSorted != null && typeof isSorted != 'boolean') {
49559                 thisArg = iteratee;
49560                 iteratee = isIterateeCall(array, isSorted, thisArg) ? undefined : isSorted;
49561                 isSorted = false;
49562             }
49563             iteratee = iteratee == null ? iteratee : baseCallback(iteratee, thisArg, 3);
49564             return (isSorted) ? sortedUniq(array, iteratee) : baseUniq(array, iteratee);
49565         }
49566
49567         module.exports = uniq;
49568
49569     }, {
49570         "../internal/baseCallback": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseCallback.js",
49571         "../internal/baseUniq": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseUniq.js",
49572         "../internal/isIterateeCall": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isIterateeCall.js",
49573         "../internal/sortedUniq": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\sortedUniq.js"
49574     }],
49575     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\array\\unique.js": [function(require, module, exports) {
49576         module.exports = require('./uniq');
49577
49578     }, {
49579         "./uniq": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\array\\uniq.js"
49580     }],
49581     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\chain\\lodash.js": [function(require, module, exports) {
49582         var LazyWrapper = require('../internal/LazyWrapper'),
49583             LodashWrapper = require('../internal/LodashWrapper'),
49584             baseLodash = require('../internal/baseLodash'),
49585             isArray = require('../lang/isArray'),
49586             isObjectLike = require('../internal/isObjectLike'),
49587             wrapperClone = require('../internal/wrapperClone');
49588
49589         /** Used for native method references. */
49590         var objectProto = Object.prototype;
49591
49592         /** Used to check objects for own properties. */
49593         var hasOwnProperty = objectProto.hasOwnProperty;
49594
49595         /**
49596          * Creates a `lodash` object which wraps `value` to enable implicit chaining.
49597          * Methods that operate on and return arrays, collections, and functions can be
49598          * chained together. Methods that retrieve a single value or may return a
49599          * primitive value will automatically end the chain returning the unwrapped
49600          * value. Explicit chaining may be enabled using `_.chain`. The execution of
49601          * chained methods is lazy, that is, execution is deferred until `_#value` is
49602          * implicitly or explicitly called.
49603          * 
49604          * Lazy evaluation allows several methods to support shortcut fusion. Shortcut
49605          * fusion is an optimization strategy which merge iteratee calls; this can help
49606          * to avoid the creation of intermediate data structures and greatly reduce the
49607          * number of iteratee executions.
49608          * 
49609          * Chaining is supported in custom builds as long as the `_#value` method is
49610          * directly or indirectly included in the build.
49611          * 
49612          * In addition to lodash methods, wrappers have `Array` and `String` methods.
49613          * 
49614          * The wrapper `Array` methods are: `concat`, `join`, `pop`, `push`, `reverse`,
49615          * `shift`, `slice`, `sort`, `splice`, and `unshift`
49616          * 
49617          * The wrapper `String` methods are: `replace` and `split`
49618          * 
49619          * The wrapper methods that support shortcut fusion are: `compact`, `drop`,
49620          * `dropRight`, `dropRightWhile`, `dropWhile`, `filter`, `first`, `initial`,
49621          * `last`, `map`, `pluck`, `reject`, `rest`, `reverse`, `slice`, `take`,
49622          * `takeRight`, `takeRightWhile`, `takeWhile`, `toArray`, and `where`
49623          * 
49624          * The chainable wrapper methods are: `after`, `ary`, `assign`, `at`, `before`,
49625          * `bind`, `bindAll`, `bindKey`, `callback`, `chain`, `chunk`, `commit`,
49626          * `compact`, `concat`, `constant`, `countBy`, `create`, `curry`, `debounce`,
49627          * `defaults`, `defaultsDeep`, `defer`, `delay`, `difference`, `drop`,
49628          * `dropRight`, `dropRightWhile`, `dropWhile`, `fill`, `filter`, `flatten`,
49629          * `flattenDeep`, `flow`, `flowRight`, `forEach`, `forEachRight`, `forIn`,
49630          * `forInRight`, `forOwn`, `forOwnRight`, `functions`, `groupBy`, `indexBy`,
49631          * `initial`, `intersection`, `invert`, `invoke`, `keys`, `keysIn`, `map`,
49632          * `mapKeys`, `mapValues`, `matches`, `matchesProperty`, `memoize`, `merge`,
49633          * `method`, `methodOf`, `mixin`, `modArgs`, `negate`, `omit`, `once`, `pairs`,
49634          * `partial`, `partialRight`, `partition`, `pick`, `plant`, `pluck`, `property`,
49635          * `propertyOf`, `pull`, `pullAt`, `push`, `range`, `rearg`, `reject`, `remove`,
49636          * `rest`, `restParam`, `reverse`, `set`, `shuffle`, `slice`, `sort`, `sortBy`,
49637          * `sortByAll`, `sortByOrder`, `splice`, `spread`, `take`, `takeRight`,
49638          * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `times`, `toArray`,
49639          * `toPlainObject`, `transform`, `union`, `uniq`, `unshift`, `unzip`,
49640          * `unzipWith`, `values`, `valuesIn`, `where`, `without`, `wrap`, `xor`, `zip`,
49641          * `zipObject`, `zipWith`
49642          * 
49643          * The wrapper methods that are **not** chainable by default are: `add`,
49644          * `attempt`, `camelCase`, `capitalize`, `ceil`, `clone`, `cloneDeep`, `deburr`,
49645          * `endsWith`, `escape`, `escapeRegExp`, `every`, `find`, `findIndex`,
49646          * `findKey`, `findLast`, `findLastIndex`, `findLastKey`, `findWhere`, `first`,
49647          * `floor`, `get`, `gt`, `gte`, `has`, `identity`, `includes`, `indexOf`,
49648          * `inRange`, `isArguments`, `isArray`, `isBoolean`, `isDate`, `isElement`,
49649          * `isEmpty`, `isEqual`, `isError`, `isFinite` `isFunction`, `isMatch`,
49650          * `isNative`, `isNaN`, `isNull`, `isNumber`, `isObject`, `isPlainObject`,
49651          * `isRegExp`, `isString`, `isUndefined`, `isTypedArray`, `join`, `kebabCase`,
49652          * `last`, `lastIndexOf`, `lt`, `lte`, `max`, `min`, `noConflict`, `noop`,
49653          * `now`, `pad`, `padLeft`, `padRight`, `parseInt`, `pop`, `random`, `reduce`,
49654          * `reduceRight`, `repeat`, `result`, `round`, `runInContext`, `shift`, `size`,
49655          * `snakeCase`, `some`, `sortedIndex`, `sortedLastIndex`, `startCase`,
49656          * `startsWith`, `sum`, `template`, `trim`, `trimLeft`, `trimRight`, `trunc`,
49657          * `unescape`, `uniqueId`, `value`, and `words`
49658          * 
49659          * The wrapper method `sample` will return a wrapped value when `n` is provided,
49660          * otherwise an unwrapped value is returned.
49661          * 
49662          * @name _
49663          * @constructor
49664          * @category Chain
49665          * @param {*}
49666          *            value The value to wrap in a `lodash` instance.
49667          * @returns {Object} Returns the new `lodash` wrapper instance.
49668          * @example
49669          * 
49670          * var wrapped = _([1, 2, 3]);
49671          *  // returns an unwrapped value wrapped.reduce(function(total, n) { return
49672          * total + n; }); // => 6
49673          *  // returns a wrapped value var squares = wrapped.map(function(n) { return n *
49674          * n; });
49675          * 
49676          * _.isArray(squares); // => false
49677          * 
49678          * _.isArray(squares.value()); // => true
49679          */
49680         function lodash(value) {
49681             if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {
49682                 if (value instanceof LodashWrapper) {
49683                     return value;
49684                 }
49685                 if (hasOwnProperty.call(value, '__chain__') && hasOwnProperty.call(value, '__wrapped__')) {
49686                     return wrapperClone(value);
49687                 }
49688             }
49689             return new LodashWrapper(value);
49690         }
49691
49692         // Ensure wrappers are instances of `baseLodash`.
49693         lodash.prototype = baseLodash.prototype;
49694
49695         module.exports = lodash;
49696
49697     }, {
49698         "../internal/LazyWrapper": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\LazyWrapper.js",
49699         "../internal/LodashWrapper": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\LodashWrapper.js",
49700         "../internal/baseLodash": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseLodash.js",
49701         "../internal/isObjectLike": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isObjectLike.js",
49702         "../internal/wrapperClone": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\wrapperClone.js",
49703         "../lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js"
49704     }],
49705     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\every.js": [function(require, module, exports) {
49706         var arrayEvery = require('../internal/arrayEvery'),
49707             baseCallback = require('../internal/baseCallback'),
49708             baseEvery = require('../internal/baseEvery'),
49709             isArray = require('../lang/isArray'),
49710             isIterateeCall = require('../internal/isIterateeCall');
49711
49712         /**
49713          * Checks if `predicate` returns truthy for **all** elements of `collection`.
49714          * The predicate is bound to `thisArg` and invoked with three arguments: (value,
49715          * index|key, collection).
49716          * 
49717          * If a property name is provided for `predicate` the created `_.property` style
49718          * callback returns the property value of the given element.
49719          * 
49720          * If a value is also provided for `thisArg` the created `_.matchesProperty`
49721          * style callback returns `true` for elements that have a matching property
49722          * value, else `false`.
49723          * 
49724          * If an object is provided for `predicate` the created `_.matches` style
49725          * callback returns `true` for elements that have the properties of the given
49726          * object, else `false`.
49727          * 
49728          * @static
49729          * @memberOf _
49730          * @alias all
49731          * @category Collection
49732          * @param {Array|Object|string}
49733          *            collection The collection to iterate over.
49734          * @param {Function|Object|string}
49735          *            [predicate=_.identity] The function invoked per iteration.
49736          * @param {*}
49737          *            [thisArg] The `this` binding of `predicate`.
49738          * @returns {boolean} Returns `true` if all elements pass the predicate check,
49739          *          else `false`.
49740          * @example
49741          * 
49742          * _.every([true, 1, null, 'yes'], Boolean); // => false
49743          * 
49744          * var users = [ { 'user': 'barney', 'active': false }, { 'user': 'fred',
49745          * 'active': false } ];
49746          *  // using the `_.matches` callback shorthand _.every(users, { 'user':
49747          * 'barney', 'active': false }); // => false
49748          *  // using the `_.matchesProperty` callback shorthand _.every(users, 'active',
49749          * false); // => true
49750          *  // using the `_.property` callback shorthand _.every(users, 'active'); // =>
49751          * false
49752          */
49753         function every(collection, predicate, thisArg) {
49754             var func = isArray(collection) ? arrayEvery : baseEvery;
49755             if (thisArg && isIterateeCall(collection, predicate, thisArg)) {
49756                 predicate = undefined;
49757             }
49758             if (typeof predicate != 'function' || thisArg !== undefined) {
49759                 predicate = baseCallback(predicate, thisArg, 3);
49760             }
49761             return func(collection, predicate);
49762         }
49763
49764         module.exports = every;
49765
49766     }, {
49767         "../internal/arrayEvery": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\arrayEvery.js",
49768         "../internal/baseCallback": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseCallback.js",
49769         "../internal/baseEvery": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseEvery.js",
49770         "../internal/isIterateeCall": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isIterateeCall.js",
49771         "../lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js"
49772     }],
49773     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\filter.js": [function(require, module, exports) {
49774         var arrayFilter = require('../internal/arrayFilter'),
49775             baseCallback = require('../internal/baseCallback'),
49776             baseFilter = require('../internal/baseFilter'),
49777             isArray = require('../lang/isArray');
49778
49779         /**
49780          * Iterates over elements of `collection`, returning an array of all elements
49781          * `predicate` returns truthy for. The predicate is bound to `thisArg` and
49782          * invoked with three arguments: (value, index|key, collection).
49783          * 
49784          * If a property name is provided for `predicate` the created `_.property` style
49785          * callback returns the property value of the given element.
49786          * 
49787          * If a value is also provided for `thisArg` the created `_.matchesProperty`
49788          * style callback returns `true` for elements that have a matching property
49789          * value, else `false`.
49790          * 
49791          * If an object is provided for `predicate` the created `_.matches` style
49792          * callback returns `true` for elements that have the properties of the given
49793          * object, else `false`.
49794          * 
49795          * @static
49796          * @memberOf _
49797          * @alias select
49798          * @category Collection
49799          * @param {Array|Object|string}
49800          *            collection The collection to iterate over.
49801          * @param {Function|Object|string}
49802          *            [predicate=_.identity] The function invoked per iteration.
49803          * @param {*}
49804          *            [thisArg] The `this` binding of `predicate`.
49805          * @returns {Array} Returns the new filtered array.
49806          * @example
49807          * 
49808          * _.filter([4, 5, 6], function(n) { return n % 2 == 0; }); // => [4, 6]
49809          * 
49810          * var users = [ { 'user': 'barney', 'age': 36, 'active': true }, { 'user':
49811          * 'fred', 'age': 40, 'active': false } ];
49812          *  // using the `_.matches` callback shorthand _.pluck(_.filter(users, { 'age':
49813          * 36, 'active': true }), 'user'); // => ['barney']
49814          *  // using the `_.matchesProperty` callback shorthand _.pluck(_.filter(users,
49815          * 'active', false), 'user'); // => ['fred']
49816          *  // using the `_.property` callback shorthand _.pluck(_.filter(users,
49817          * 'active'), 'user'); // => ['barney']
49818          */
49819         function filter(collection, predicate, thisArg) {
49820             var func = isArray(collection) ? arrayFilter : baseFilter;
49821             predicate = baseCallback(predicate, thisArg, 3);
49822             return func(collection, predicate);
49823         }
49824
49825         module.exports = filter;
49826
49827     }, {
49828         "../internal/arrayFilter": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\arrayFilter.js",
49829         "../internal/baseCallback": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseCallback.js",
49830         "../internal/baseFilter": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseFilter.js",
49831         "../lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js"
49832     }],
49833     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\find.js": [function(require, module, exports) {
49834         var baseEach = require('../internal/baseEach'),
49835             createFind = require('../internal/createFind');
49836
49837         /**
49838          * Iterates over elements of `collection`, returning the first element
49839          * `predicate` returns truthy for. The predicate is bound to `thisArg` and
49840          * invoked with three arguments: (value, index|key, collection).
49841          * 
49842          * If a property name is provided for `predicate` the created `_.property` style
49843          * callback returns the property value of the given element.
49844          * 
49845          * If a value is also provided for `thisArg` the created `_.matchesProperty`
49846          * style callback returns `true` for elements that have a matching property
49847          * value, else `false`.
49848          * 
49849          * If an object is provided for `predicate` the created `_.matches` style
49850          * callback returns `true` for elements that have the properties of the given
49851          * object, else `false`.
49852          * 
49853          * @static
49854          * @memberOf _
49855          * @alias detect
49856          * @category Collection
49857          * @param {Array|Object|string}
49858          *            collection The collection to search.
49859          * @param {Function|Object|string}
49860          *            [predicate=_.identity] The function invoked per iteration.
49861          * @param {*}
49862          *            [thisArg] The `this` binding of `predicate`.
49863          * @returns {*} Returns the matched element, else `undefined`.
49864          * @example
49865          * 
49866          * var users = [ { 'user': 'barney', 'age': 36, 'active': true }, { 'user':
49867          * 'fred', 'age': 40, 'active': false }, { 'user': 'pebbles', 'age': 1,
49868          * 'active': true } ];
49869          * 
49870          * _.result(_.find(users, function(chr) { return chr.age < 40; }), 'user'); // =>
49871          * 'barney'
49872          *  // using the `_.matches` callback shorthand _.result(_.find(users, { 'age':
49873          * 1, 'active': true }), 'user'); // => 'pebbles'
49874          *  // using the `_.matchesProperty` callback shorthand _.result(_.find(users,
49875          * 'active', false), 'user'); // => 'fred'
49876          *  // using the `_.property` callback shorthand _.result(_.find(users,
49877          * 'active'), 'user'); // => 'barney'
49878          */
49879         var find = createFind(baseEach);
49880
49881         module.exports = find;
49882
49883     }, {
49884         "../internal/baseEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseEach.js",
49885         "../internal/createFind": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createFind.js"
49886     }],
49887     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\forEach.js": [function(require, module, exports) {
49888         var arrayEach = require('../internal/arrayEach'),
49889             baseEach = require('../internal/baseEach'),
49890             createForEach = require('../internal/createForEach');
49891
49892         /**
49893          * Iterates over elements of `collection` invoking `iteratee` for each element.
49894          * The `iteratee` is bound to `thisArg` and invoked with three arguments:
49895          * (value, index|key, collection). Iteratee functions may exit iteration early
49896          * by explicitly returning `false`.
49897          * 
49898          * **Note:** As with other "Collections" methods, objects with a "length"
49899          * property are iterated like arrays. To avoid this behavior `_.forIn` or
49900          * `_.forOwn` may be used for object iteration.
49901          * 
49902          * @static
49903          * @memberOf _
49904          * @alias each
49905          * @category Collection
49906          * @param {Array|Object|string}
49907          *            collection The collection to iterate over.
49908          * @param {Function}
49909          *            [iteratee=_.identity] The function invoked per iteration.
49910          * @param {*}
49911          *            [thisArg] The `this` binding of `iteratee`.
49912          * @returns {Array|Object|string} Returns `collection`.
49913          * @example
49914          * 
49915          * _([1, 2]).forEach(function(n) { console.log(n); }).value(); // => logs each
49916          * value from left to right and returns the array
49917          * 
49918          * _.forEach({ 'a': 1, 'b': 2 }, function(n, key) { console.log(n, key); }); // =>
49919          * logs each value-key pair and returns the object (iteration order is not
49920          * guaranteed)
49921          */
49922         var forEach = createForEach(arrayEach, baseEach);
49923
49924         module.exports = forEach;
49925
49926     }, {
49927         "../internal/arrayEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\arrayEach.js",
49928         "../internal/baseEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseEach.js",
49929         "../internal/createForEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createForEach.js"
49930     }],
49931     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\groupBy.js": [function(require, module, exports) {
49932         var createAggregator = require('../internal/createAggregator');
49933
49934         /** Used for native method references. */
49935         var objectProto = Object.prototype;
49936
49937         /** Used to check objects for own properties. */
49938         var hasOwnProperty = objectProto.hasOwnProperty;
49939
49940         /**
49941          * Creates an object composed of keys generated from the results of running each
49942          * element of `collection` through `iteratee`. The corresponding value of each
49943          * key is an array of the elements responsible for generating the key. The
49944          * `iteratee` is bound to `thisArg` and invoked with three arguments: (value,
49945          * index|key, collection).
49946          * 
49947          * If a property name is provided for `iteratee` the created `_.property` style
49948          * callback returns the property value of the given element.
49949          * 
49950          * If a value is also provided for `thisArg` the created `_.matchesProperty`
49951          * style callback returns `true` for elements that have a matching property
49952          * value, else `false`.
49953          * 
49954          * If an object is provided for `iteratee` the created `_.matches` style
49955          * callback returns `true` for elements that have the properties of the given
49956          * object, else `false`.
49957          * 
49958          * @static
49959          * @memberOf _
49960          * @category Collection
49961          * @param {Array|Object|string}
49962          *            collection The collection to iterate over.
49963          * @param {Function|Object|string}
49964          *            [iteratee=_.identity] The function invoked per iteration.
49965          * @param {*}
49966          *            [thisArg] The `this` binding of `iteratee`.
49967          * @returns {Object} Returns the composed aggregate object.
49968          * @example
49969          * 
49970          * _.groupBy([4.2, 6.1, 6.4], function(n) { return Math.floor(n); }); // => {
49971          * '4': [4.2], '6': [6.1, 6.4] }
49972          * 
49973          * _.groupBy([4.2, 6.1, 6.4], function(n) { return this.floor(n); }, Math); // => {
49974          * '4': [4.2], '6': [6.1, 6.4] }
49975          *  // using the `_.property` callback shorthand _.groupBy(['one', 'two',
49976          * 'three'], 'length'); // => { '3': ['one', 'two'], '5': ['three'] }
49977          */
49978         var groupBy = createAggregator(function(result, value, key) {
49979             if (hasOwnProperty.call(result, key)) {
49980                 result[key].push(value);
49981             } else {
49982                 result[key] = [value];
49983             }
49984         });
49985
49986         module.exports = groupBy;
49987
49988     }, {
49989         "../internal/createAggregator": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createAggregator.js"
49990     }],
49991     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\includes.js": [function(require, module, exports) {
49992         var baseIndexOf = require('../internal/baseIndexOf'),
49993             getLength = require('../internal/getLength'),
49994             isArray = require('../lang/isArray'),
49995             isIterateeCall = require('../internal/isIterateeCall'),
49996             isLength = require('../internal/isLength'),
49997             isString = require('../lang/isString'),
49998             values = require('../object/values');
49999
50000         /*
50001          * Native method references for those with the same name as other `lodash`
50002          * methods.
50003          */
50004         var nativeMax = Math.max;
50005
50006         /**
50007          * Checks if `target` is in `collection` using
50008          * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
50009          * for equality comparisons. If `fromIndex` is negative, it's used as the offset
50010          * from the end of `collection`.
50011          * 
50012          * @static
50013          * @memberOf _
50014          * @alias contains, include
50015          * @category Collection
50016          * @param {Array|Object|string}
50017          *            collection The collection to search.
50018          * @param {*}
50019          *            target The value to search for.
50020          * @param {number}
50021          *            [fromIndex=0] The index to search from.
50022          * @param- {Object} [guard] Enables use as a callback for functions like
50023          *         `_.reduce`.
50024          * @returns {boolean} Returns `true` if a matching element is found, else
50025          *          `false`.
50026          * @example
50027          * 
50028          * _.includes([1, 2, 3], 1); // => true
50029          * 
50030          * _.includes([1, 2, 3], 1, 2); // => false
50031          * 
50032          * _.includes({ 'user': 'fred', 'age': 40 }, 'fred'); // => true
50033          * 
50034          * _.includes('pebbles', 'eb'); // => true
50035          */
50036         function includes(collection, target, fromIndex, guard) {
50037             var length = collection ? getLength(collection) : 0;
50038             if (!isLength(length)) {
50039                 collection = values(collection);
50040                 length = collection.length;
50041             }
50042             if (typeof fromIndex != 'number' || (guard && isIterateeCall(target, fromIndex, guard))) {
50043                 fromIndex = 0;
50044             } else {
50045                 fromIndex = fromIndex < 0 ? nativeMax(length + fromIndex, 0) : (fromIndex || 0);
50046             }
50047             return (typeof collection == 'string' || !isArray(collection) && isString(collection)) ? (fromIndex <= length && collection.indexOf(target, fromIndex) > -1) : (!!length && baseIndexOf(collection, target, fromIndex) > -1);
50048         }
50049
50050         module.exports = includes;
50051
50052     }, {
50053         "../internal/baseIndexOf": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseIndexOf.js",
50054         "../internal/getLength": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\getLength.js",
50055         "../internal/isIterateeCall": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isIterateeCall.js",
50056         "../internal/isLength": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isLength.js",
50057         "../lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js",
50058         "../lang/isString": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isString.js",
50059         "../object/values": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\values.js"
50060     }],
50061     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\map.js": [function(require, module, exports) {
50062         var arrayMap = require('../internal/arrayMap'),
50063             baseCallback = require('../internal/baseCallback'),
50064             baseMap = require('../internal/baseMap'),
50065             isArray = require('../lang/isArray');
50066
50067         /**
50068          * Creates an array of values by running each element in `collection` through
50069          * `iteratee`. The `iteratee` is bound to `thisArg` and invoked with three
50070          * arguments: (value, index|key, collection).
50071          * 
50072          * If a property name is provided for `iteratee` the created `_.property` style
50073          * callback returns the property value of the given element.
50074          * 
50075          * If a value is also provided for `thisArg` the created `_.matchesProperty`
50076          * style callback returns `true` for elements that have a matching property
50077          * value, else `false`.
50078          * 
50079          * If an object is provided for `iteratee` the created `_.matches` style
50080          * callback returns `true` for elements that have the properties of the given
50081          * object, else `false`.
50082          * 
50083          * Many lodash methods are guarded to work as iteratees for methods like
50084          * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
50085          * 
50086          * The guarded methods are: `ary`, `callback`, `chunk`, `clone`, `create`,
50087          * `curry`, `curryRight`, `drop`, `dropRight`, `every`, `fill`, `flatten`,
50088          * `invert`, `max`, `min`, `parseInt`, `slice`, `sortBy`, `take`, `takeRight`,
50089          * `template`, `trim`, `trimLeft`, `trimRight`, `trunc`, `random`, `range`,
50090          * `sample`, `some`, `sum`, `uniq`, and `words`
50091          * 
50092          * @static
50093          * @memberOf _
50094          * @alias collect
50095          * @category Collection
50096          * @param {Array|Object|string}
50097          *            collection The collection to iterate over.
50098          * @param {Function|Object|string}
50099          *            [iteratee=_.identity] The function invoked per iteration.
50100          * @param {*}
50101          *            [thisArg] The `this` binding of `iteratee`.
50102          * @returns {Array} Returns the new mapped array.
50103          * @example
50104          * 
50105          * function timesThree(n) { return n * 3; }
50106          * 
50107          * _.map([1, 2], timesThree); // => [3, 6]
50108          * 
50109          * _.map({ 'a': 1, 'b': 2 }, timesThree); // => [3, 6] (iteration order is not
50110          * guaranteed)
50111          * 
50112          * var users = [ { 'user': 'barney' }, { 'user': 'fred' } ];
50113          *  // using the `_.property` callback shorthand _.map(users, 'user'); // =>
50114          * ['barney', 'fred']
50115          */
50116         function map(collection, iteratee, thisArg) {
50117             var func = isArray(collection) ? arrayMap : baseMap;
50118             iteratee = baseCallback(iteratee, thisArg, 3);
50119             return func(collection, iteratee);
50120         }
50121
50122         module.exports = map;
50123
50124     }, {
50125         "../internal/arrayMap": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\arrayMap.js",
50126         "../internal/baseCallback": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseCallback.js",
50127         "../internal/baseMap": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseMap.js",
50128         "../lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js"
50129     }],
50130     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\reduce.js": [function(require, module, exports) {
50131         var arrayReduce = require('../internal/arrayReduce'),
50132             baseEach = require('../internal/baseEach'),
50133             createReduce = require('../internal/createReduce');
50134
50135         /**
50136          * Reduces `collection` to a value which is the accumulated result of running
50137          * each element in `collection` through `iteratee`, where each successive
50138          * invocation is supplied the return value of the previous. If `accumulator` is
50139          * not provided the first element of `collection` is used as the initial value.
50140          * The `iteratee` is bound to `thisArg` and invoked with four arguments:
50141          * (accumulator, value, index|key, collection).
50142          * 
50143          * Many lodash methods are guarded to work as iteratees for methods like
50144          * `_.reduce`, `_.reduceRight`, and `_.transform`.
50145          * 
50146          * The guarded methods are: `assign`, `defaults`, `defaultsDeep`, `includes`,
50147          * `merge`, `sortByAll`, and `sortByOrder`
50148          * 
50149          * @static
50150          * @memberOf _
50151          * @alias foldl, inject
50152          * @category Collection
50153          * @param {Array|Object|string}
50154          *            collection The collection to iterate over.
50155          * @param {Function}
50156          *            [iteratee=_.identity] The function invoked per iteration.
50157          * @param {*}
50158          *            [accumulator] The initial value.
50159          * @param {*}
50160          *            [thisArg] The `this` binding of `iteratee`.
50161          * @returns {*} Returns the accumulated value.
50162          * @example
50163          * 
50164          * _.reduce([1, 2], function(total, n) { return total + n; }); // => 3
50165          * 
50166          * _.reduce({ 'a': 1, 'b': 2 }, function(result, n, key) { result[key] = n * 3;
50167          * return result; }, {}); // => { 'a': 3, 'b': 6 } (iteration order is not
50168          * guaranteed)
50169          */
50170         var reduce = createReduce(arrayReduce, baseEach);
50171
50172         module.exports = reduce;
50173
50174     }, {
50175         "../internal/arrayReduce": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\arrayReduce.js",
50176         "../internal/baseEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseEach.js",
50177         "../internal/createReduce": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createReduce.js"
50178     }],
50179     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\size.js": [function(require, module, exports) {
50180         var getLength = require('../internal/getLength'),
50181             isLength = require('../internal/isLength'),
50182             keys = require('../object/keys');
50183
50184         /**
50185          * Gets the size of `collection` by returning its length for array-like values
50186          * or the number of own enumerable properties for objects.
50187          * 
50188          * @static
50189          * @memberOf _
50190          * @category Collection
50191          * @param {Array|Object|string}
50192          *            collection The collection to inspect.
50193          * @returns {number} Returns the size of `collection`.
50194          * @example
50195          * 
50196          * _.size([1, 2, 3]); // => 3
50197          * 
50198          * _.size({ 'a': 1, 'b': 2 }); // => 2
50199          * 
50200          * _.size('pebbles'); // => 7
50201          */
50202         function size(collection) {
50203             var length = collection ? getLength(collection) : 0;
50204             return isLength(length) ? length : keys(collection).length;
50205         }
50206
50207         module.exports = size;
50208
50209     }, {
50210         "../internal/getLength": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\getLength.js",
50211         "../internal/isLength": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isLength.js",
50212         "../object/keys": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\keys.js"
50213     }],
50214     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\some.js": [function(require, module, exports) {
50215         var arraySome = require('../internal/arraySome'),
50216             baseCallback = require('../internal/baseCallback'),
50217             baseSome = require('../internal/baseSome'),
50218             isArray = require('../lang/isArray'),
50219             isIterateeCall = require('../internal/isIterateeCall');
50220
50221         /**
50222          * Checks if `predicate` returns truthy for **any** element of `collection`. The
50223          * function returns as soon as it finds a passing value and does not iterate
50224          * over the entire collection. The predicate is bound to `thisArg` and invoked
50225          * with three arguments: (value, index|key, collection).
50226          * 
50227          * If a property name is provided for `predicate` the created `_.property` style
50228          * callback returns the property value of the given element.
50229          * 
50230          * If a value is also provided for `thisArg` the created `_.matchesProperty`
50231          * style callback returns `true` for elements that have a matching property
50232          * value, else `false`.
50233          * 
50234          * If an object is provided for `predicate` the created `_.matches` style
50235          * callback returns `true` for elements that have the properties of the given
50236          * object, else `false`.
50237          * 
50238          * @static
50239          * @memberOf _
50240          * @alias any
50241          * @category Collection
50242          * @param {Array|Object|string}
50243          *            collection The collection to iterate over.
50244          * @param {Function|Object|string}
50245          *            [predicate=_.identity] The function invoked per iteration.
50246          * @param {*}
50247          *            [thisArg] The `this` binding of `predicate`.
50248          * @returns {boolean} Returns `true` if any element passes the predicate check,
50249          *          else `false`.
50250          * @example
50251          * 
50252          * _.some([null, 0, 'yes', false], Boolean); // => true
50253          * 
50254          * var users = [ { 'user': 'barney', 'active': true }, { 'user': 'fred',
50255          * 'active': false } ];
50256          *  // using the `_.matches` callback shorthand _.some(users, { 'user':
50257          * 'barney', 'active': false }); // => false
50258          *  // using the `_.matchesProperty` callback shorthand _.some(users, 'active',
50259          * false); // => true
50260          *  // using the `_.property` callback shorthand _.some(users, 'active'); // =>
50261          * true
50262          */
50263         function some(collection, predicate, thisArg) {
50264             var func = isArray(collection) ? arraySome : baseSome;
50265             if (thisArg && isIterateeCall(collection, predicate, thisArg)) {
50266                 predicate = undefined;
50267             }
50268             if (typeof predicate != 'function' || thisArg !== undefined) {
50269                 predicate = baseCallback(predicate, thisArg, 3);
50270             }
50271             return func(collection, predicate);
50272         }
50273
50274         module.exports = some;
50275
50276     }, {
50277         "../internal/arraySome": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\arraySome.js",
50278         "../internal/baseCallback": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseCallback.js",
50279         "../internal/baseSome": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseSome.js",
50280         "../internal/isIterateeCall": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isIterateeCall.js",
50281         "../lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js"
50282     }],
50283     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\collection\\sortBy.js": [function(require, module, exports) {
50284         var baseCallback = require('../internal/baseCallback'),
50285             baseMap = require('../internal/baseMap'),
50286             baseSortBy = require('../internal/baseSortBy'),
50287             compareAscending = require('../internal/compareAscending'),
50288             isIterateeCall = require('../internal/isIterateeCall');
50289
50290         /**
50291          * Creates an array of elements, sorted in ascending order by the results of
50292          * running each element in a collection through `iteratee`. This method performs
50293          * a stable sort, that is, it preserves the original sort order of equal
50294          * elements. The `iteratee` is bound to `thisArg` and invoked with three
50295          * arguments: (value, index|key, collection).
50296          * 
50297          * If a property name is provided for `iteratee` the created `_.property` style
50298          * callback returns the property value of the given element.
50299          * 
50300          * If a value is also provided for `thisArg` the created `_.matchesProperty`
50301          * style callback returns `true` for elements that have a matching property
50302          * value, else `false`.
50303          * 
50304          * If an object is provided for `iteratee` the created `_.matches` style
50305          * callback returns `true` for elements that have the properties of the given
50306          * object, else `false`.
50307          * 
50308          * @static
50309          * @memberOf _
50310          * @category Collection
50311          * @param {Array|Object|string}
50312          *            collection The collection to iterate over.
50313          * @param {Function|Object|string}
50314          *            [iteratee=_.identity] The function invoked per iteration.
50315          * @param {*}
50316          *            [thisArg] The `this` binding of `iteratee`.
50317          * @returns {Array} Returns the new sorted array.
50318          * @example
50319          * 
50320          * _.sortBy([1, 2, 3], function(n) { return Math.sin(n); }); // => [3, 1, 2]
50321          * 
50322          * _.sortBy([1, 2, 3], function(n) { return this.sin(n); }, Math); // => [3, 1,
50323          * 2]
50324          * 
50325          * var users = [ { 'user': 'fred' }, { 'user': 'pebbles' }, { 'user': 'barney' } ];
50326          *  // using the `_.property` callback shorthand _.pluck(_.sortBy(users,
50327          * 'user'), 'user'); // => ['barney', 'fred', 'pebbles']
50328          */
50329         function sortBy(collection, iteratee, thisArg) {
50330             if (collection == null) {
50331                 return [];
50332             }
50333             if (thisArg && isIterateeCall(collection, iteratee, thisArg)) {
50334                 iteratee = undefined;
50335             }
50336             var index = -1;
50337             iteratee = baseCallback(iteratee, thisArg, 3);
50338
50339             var result = baseMap(collection, function(value, key, collection) {
50340                 return {
50341                     'criteria': iteratee(value, key, collection),
50342                     'index': ++index,
50343                     'value': value
50344                 };
50345             });
50346             return baseSortBy(result, compareAscending);
50347         }
50348
50349         module.exports = sortBy;
50350
50351     }, {
50352         "../internal/baseCallback": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseCallback.js",
50353         "../internal/baseMap": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseMap.js",
50354         "../internal/baseSortBy": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseSortBy.js",
50355         "../internal/compareAscending": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\compareAscending.js",
50356         "../internal/isIterateeCall": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isIterateeCall.js"
50357     }],
50358     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\date\\now.js": [function(require, module, exports) {
50359         var getNative = require('../internal/getNative');
50360
50361         /*
50362          * Native method references for those with the same name as other `lodash`
50363          * methods.
50364          */
50365         var nativeNow = getNative(Date, 'now');
50366
50367         /**
50368          * Gets the number of milliseconds that have elapsed since the Unix epoch (1
50369          * January 1970 00:00:00 UTC).
50370          * 
50371          * @static
50372          * @memberOf _
50373          * @category Date
50374          * @example
50375          * 
50376          * _.defer(function(stamp) { console.log(_.now() - stamp); }, _.now()); // =>
50377          * logs the number of milliseconds it took for the deferred function to be
50378          * invoked
50379          */
50380         var now = nativeNow || function() {
50381             return new Date().getTime();
50382         };
50383
50384         module.exports = now;
50385
50386     }, {
50387         "../internal/getNative": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\getNative.js"
50388     }],
50389     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\function\\bind.js": [function(require, module, exports) {
50390         var createWrapper = require('../internal/createWrapper'),
50391             replaceHolders = require('../internal/replaceHolders'),
50392             restParam = require('./restParam');
50393
50394         /** Used to compose bitmasks for wrapper metadata. */
50395         var BIND_FLAG = 1,
50396             PARTIAL_FLAG = 32;
50397
50398         /**
50399          * Creates a function that invokes `func` with the `this` binding of `thisArg`
50400          * and prepends any additional `_.bind` arguments to those provided to the bound
50401          * function.
50402          * 
50403          * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,
50404          * may be used as a placeholder for partially applied arguments.
50405          * 
50406          * **Note:** Unlike native `Function#bind` this method does not set the "length"
50407          * property of bound functions.
50408          * 
50409          * @static
50410          * @memberOf _
50411          * @category Function
50412          * @param {Function}
50413          *            func The function to bind.
50414          * @param {*}
50415          *            thisArg The `this` binding of `func`.
50416          * @param {...*}
50417          *            [partials] The arguments to be partially applied.
50418          * @returns {Function} Returns the new bound function.
50419          * @example
50420          * 
50421          * var greet = function(greeting, punctuation) { return greeting + ' ' +
50422          * this.user + punctuation; };
50423          * 
50424          * var object = { 'user': 'fred' };
50425          * 
50426          * var bound = _.bind(greet, object, 'hi'); bound('!'); // => 'hi fred!'
50427          *  // using placeholders var bound = _.bind(greet, object, _, '!');
50428          * bound('hi'); // => 'hi fred!'
50429          */
50430         var bind = restParam(function(func, thisArg, partials) {
50431             var bitmask = BIND_FLAG;
50432             if (partials.length) {
50433                 var holders = replaceHolders(partials, bind.placeholder);
50434                 bitmask |= PARTIAL_FLAG;
50435             }
50436             return createWrapper(func, bitmask, thisArg, partials, holders);
50437         });
50438
50439         // Assign default placeholders.
50440         bind.placeholder = {};
50441
50442         module.exports = bind;
50443
50444     }, {
50445         "../internal/createWrapper": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createWrapper.js",
50446         "../internal/replaceHolders": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\replaceHolders.js",
50447         "./restParam": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\function\\restParam.js"
50448     }],
50449     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\function\\debounce.js": [function(require, module, exports) {
50450         var isObject = require('../lang/isObject'),
50451             now = require('../date/now');
50452
50453         /** Used as the `TypeError` message for "Functions" methods. */
50454         var FUNC_ERROR_TEXT = 'Expected a function';
50455
50456         /*
50457          * Native method references for those with the same name as other `lodash`
50458          * methods.
50459          */
50460         var nativeMax = Math.max;
50461
50462         /**
50463          * Creates a debounced function that delays invoking `func` until after `wait`
50464          * milliseconds have elapsed since the last time the debounced function was
50465          * invoked. The debounced function comes with a `cancel` method to cancel
50466          * delayed invocations. Provide an options object to indicate that `func` should
50467          * be invoked on the leading and/or trailing edge of the `wait` timeout.
50468          * Subsequent calls to the debounced function return the result of the last
50469          * `func` invocation.
50470          * 
50471          * **Note:** If `leading` and `trailing` options are `true`, `func` is invoked
50472          * on the trailing edge of the timeout only if the the debounced function is
50473          * invoked more than once during the `wait` timeout.
50474          * 
50475          * See [David Corbacho's
50476          * article](http://drupalmotion.com/article/debounce-and-throttle-visual-explanation)
50477          * for details over the differences between `_.debounce` and `_.throttle`.
50478          * 
50479          * @static
50480          * @memberOf _
50481          * @category Function
50482          * @param {Function}
50483          *            func The function to debounce.
50484          * @param {number}
50485          *            [wait=0] The number of milliseconds to delay.
50486          * @param {Object}
50487          *            [options] The options object.
50488          * @param {boolean}
50489          *            [options.leading=false] Specify invoking on the leading edge of
50490          *            the timeout.
50491          * @param {number}
50492          *            [options.maxWait] The maximum time `func` is allowed to be delayed
50493          *            before it's invoked.
50494          * @param {boolean}
50495          *            [options.trailing=true] Specify invoking on the trailing edge of
50496          *            the timeout.
50497          * @returns {Function} Returns the new debounced function.
50498          * @example
50499          *  // avoid costly calculations while the window size is in flux
50500          * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
50501          *  // invoke `sendMail` when the click event is fired, debouncing subsequent
50502          * calls jQuery('#postbox').on('click', _.debounce(sendMail, 300, { 'leading':
50503          * true, 'trailing': false }));
50504          *  // ensure `batchLog` is invoked once after 1 second of debounced calls var
50505          * source = new EventSource('/stream'); jQuery(source).on('message',
50506          * _.debounce(batchLog, 250, { 'maxWait': 1000 }));
50507          *  // cancel a debounced call var todoChanges = _.debounce(batchLog, 1000);
50508          * Object.observe(models.todo, todoChanges);
50509          * 
50510          * Object.observe(models, function(changes) { if (_.find(changes, { 'user':
50511          * 'todo', 'type': 'delete'})) { todoChanges.cancel(); } }, ['delete']);
50512          *  // ...at some point `models.todo` is changed models.todo.completed = true;
50513          *  // ...before 1 second has passed `models.todo` is deleted // which cancels
50514          * the debounced `todoChanges` call delete models.todo;
50515          */
50516         function debounce(func, wait, options) {
50517             var args,
50518                 maxTimeoutId,
50519                 result,
50520                 stamp,
50521                 thisArg,
50522                 timeoutId,
50523                 trailingCall,
50524                 lastCalled = 0,
50525                 maxWait = false,
50526                 trailing = true;
50527
50528             if (typeof func != 'function') {
50529                 throw new TypeError(FUNC_ERROR_TEXT);
50530             }
50531             wait = wait < 0 ? 0 : (+wait || 0);
50532             if (options === true) {
50533                 var leading = true;
50534                 trailing = false;
50535             } else if (isObject(options)) {
50536                 leading = !!options.leading;
50537                 maxWait = 'maxWait' in options && nativeMax(+options.maxWait || 0, wait);
50538                 trailing = 'trailing' in options ? !!options.trailing : trailing;
50539             }
50540
50541             function cancel() {
50542                 if (timeoutId) {
50543                     clearTimeout(timeoutId);
50544                 }
50545                 if (maxTimeoutId) {
50546                     clearTimeout(maxTimeoutId);
50547                 }
50548                 lastCalled = 0;
50549                 maxTimeoutId = timeoutId = trailingCall = undefined;
50550             }
50551
50552             function complete(isCalled, id) {
50553                 if (id) {
50554                     clearTimeout(id);
50555                 }
50556                 maxTimeoutId = timeoutId = trailingCall = undefined;
50557                 if (isCalled) {
50558                     lastCalled = now();
50559                     result = func.apply(thisArg, args);
50560                     if (!timeoutId && !maxTimeoutId) {
50561                         args = thisArg = undefined;
50562                     }
50563                 }
50564             }
50565
50566             function delayed() {
50567                 var remaining = wait - (now() - stamp);
50568                 if (remaining <= 0 || remaining > wait) {
50569                     complete(trailingCall, maxTimeoutId);
50570                 } else {
50571                     timeoutId = setTimeout(delayed, remaining);
50572                 }
50573             }
50574
50575             function maxDelayed() {
50576                 complete(trailing, timeoutId);
50577             }
50578
50579             function debounced() {
50580                 args = arguments;
50581                 stamp = now();
50582                 thisArg = this;
50583                 trailingCall = trailing && (timeoutId || !leading);
50584
50585                 if (maxWait === false) {
50586                     var leadingCall = leading && !timeoutId;
50587                 } else {
50588                     if (!maxTimeoutId && !leading) {
50589                         lastCalled = stamp;
50590                     }
50591                     var remaining = maxWait - (stamp - lastCalled),
50592                         isCalled = remaining <= 0 || remaining > maxWait;
50593
50594                     if (isCalled) {
50595                         if (maxTimeoutId) {
50596                             maxTimeoutId = clearTimeout(maxTimeoutId);
50597                         }
50598                         lastCalled = stamp;
50599                         result = func.apply(thisArg, args);
50600                     } else if (!maxTimeoutId) {
50601                         maxTimeoutId = setTimeout(maxDelayed, remaining);
50602                     }
50603                 }
50604                 if (isCalled && timeoutId) {
50605                     timeoutId = clearTimeout(timeoutId);
50606                 } else if (!timeoutId && wait !== maxWait) {
50607                     timeoutId = setTimeout(delayed, wait);
50608                 }
50609                 if (leadingCall) {
50610                     isCalled = true;
50611                     result = func.apply(thisArg, args);
50612                 }
50613                 if (isCalled && !timeoutId && !maxTimeoutId) {
50614                     args = thisArg = undefined;
50615                 }
50616                 return result;
50617             }
50618             debounced.cancel = cancel;
50619             return debounced;
50620         }
50621
50622         module.exports = debounce;
50623
50624     }, {
50625         "../date/now": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\date\\now.js",
50626         "../lang/isObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isObject.js"
50627     }],
50628     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\function\\defer.js": [function(require, module, exports) {
50629         var baseDelay = require('../internal/baseDelay'),
50630             restParam = require('./restParam');
50631
50632         /**
50633          * Defers invoking the `func` until the current call stack has cleared. Any
50634          * additional arguments are provided to `func` when it's invoked.
50635          * 
50636          * @static
50637          * @memberOf _
50638          * @category Function
50639          * @param {Function}
50640          *            func The function to defer.
50641          * @param {...*}
50642          *            [args] The arguments to invoke the function with.
50643          * @returns {number} Returns the timer id.
50644          * @example
50645          * 
50646          * _.defer(function(text) { console.log(text); }, 'deferred'); // logs
50647          * 'deferred' after one or more milliseconds
50648          */
50649         var defer = restParam(function(func, args) {
50650             return baseDelay(func, 1, args);
50651         });
50652
50653         module.exports = defer;
50654
50655     }, {
50656         "../internal/baseDelay": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseDelay.js",
50657         "./restParam": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\function\\restParam.js"
50658     }],
50659     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\function\\restParam.js": [function(require, module, exports) {
50660         /** Used as the `TypeError` message for "Functions" methods. */
50661         var FUNC_ERROR_TEXT = 'Expected a function';
50662
50663         /*
50664          * Native method references for those with the same name as other `lodash`
50665          * methods.
50666          */
50667         var nativeMax = Math.max;
50668
50669         /**
50670          * Creates a function that invokes `func` with the `this` binding of the created
50671          * function and arguments from `start` and beyond provided as an array.
50672          * 
50673          * **Note:** This method is based on the [rest
50674          * parameter](https://developer.mozilla.org/Web/JavaScript/Reference/Functions/rest_parameters).
50675          * 
50676          * @static
50677          * @memberOf _
50678          * @category Function
50679          * @param {Function}
50680          *            func The function to apply a rest parameter to.
50681          * @param {number}
50682          *            [start=func.length-1] The start position of the rest parameter.
50683          * @returns {Function} Returns the new function.
50684          * @example
50685          * 
50686          * var say = _.restParam(function(what, names) { return what + ' ' +
50687          * _.initial(names).join(', ') + (_.size(names) > 1 ? ', & ' : '') +
50688          * _.last(names); });
50689          * 
50690          * say('hello', 'fred', 'barney', 'pebbles'); // => 'hello fred, barney, &
50691          * pebbles'
50692          */
50693         function restParam(func, start) {
50694             if (typeof func != 'function') {
50695                 throw new TypeError(FUNC_ERROR_TEXT);
50696             }
50697             start = nativeMax(start === undefined ? (func.length - 1) : (+start || 0), 0);
50698             return function() {
50699                 var args = arguments,
50700                     index = -1,
50701                     length = nativeMax(args.length - start, 0),
50702                     rest = Array(length);
50703
50704                 while (++index < length) {
50705                     rest[index] = args[start + index];
50706                 }
50707                 switch (start) {
50708                     case 0:
50709                         return func.call(this, rest);
50710                     case 1:
50711                         return func.call(this, args[0], rest);
50712                     case 2:
50713                         return func.call(this, args[0], args[1], rest);
50714                 }
50715                 var otherArgs = Array(start + 1);
50716                 index = -1;
50717                 while (++index < start) {
50718                     otherArgs[index] = args[index];
50719                 }
50720                 otherArgs[start] = rest;
50721                 return func.apply(this, otherArgs);
50722             };
50723         }
50724
50725         module.exports = restParam;
50726
50727     }, {}],
50728     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\index.js": [function(require, module, exports) {
50729         (function(global) {
50730             /**
50731              * @license lodash 3.10.1 (Custom Build) <https://lodash.com/> Build: `lodash
50732              *          modern -d -o ./index.js` Copyright 2012-2015 The Dojo Foundation
50733              *          <http://dojofoundation.org/> Based on Underscore.js 1.8.3
50734              *          <http://underscorejs.org/LICENSE> Copyright 2009-2015 Jeremy
50735              *          Ashkenas, DocumentCloud and Investigative Reporters & Editors
50736              *          Available under MIT license <https://lodash.com/license>
50737              */
50738             ;
50739             (function() {
50740
50741                 /** Used as a safe reference for `undefined` in pre-ES5 environments. */
50742                 var undefined;
50743
50744                 /** Used as the semantic version number. */
50745                 var VERSION = '3.10.1';
50746
50747                 /** Used to compose bitmasks for wrapper metadata. */
50748                 var BIND_FLAG = 1,
50749                     BIND_KEY_FLAG = 2,
50750                     CURRY_BOUND_FLAG = 4,
50751                     CURRY_FLAG = 8,
50752                     CURRY_RIGHT_FLAG = 16,
50753                     PARTIAL_FLAG = 32,
50754                     PARTIAL_RIGHT_FLAG = 64,
50755                     ARY_FLAG = 128,
50756                     REARG_FLAG = 256;
50757
50758                 /** Used as default options for `_.trunc`. */
50759                 var DEFAULT_TRUNC_LENGTH = 30,
50760                     DEFAULT_TRUNC_OMISSION = '...';
50761
50762                 /** Used to detect when a function becomes hot. */
50763                 var HOT_COUNT = 150,
50764                     HOT_SPAN = 16;
50765
50766                 /** Used as the size to enable large array optimizations. */
50767                 var LARGE_ARRAY_SIZE = 200;
50768
50769                 /** Used to indicate the type of lazy iteratees. */
50770                 var LAZY_FILTER_FLAG = 1,
50771                     LAZY_MAP_FLAG = 2;
50772
50773                 /** Used as the `TypeError` message for "Functions" methods. */
50774                 var FUNC_ERROR_TEXT = 'Expected a function';
50775
50776                 /** Used as the internal argument placeholder. */
50777                 var PLACEHOLDER = '__lodash_placeholder__';
50778
50779                 /** `Object#toString` result references. */
50780                 var argsTag = '[object Arguments]',
50781                     arrayTag = '[object Array]',
50782                     boolTag = '[object Boolean]',
50783                     dateTag = '[object Date]',
50784                     errorTag = '[object Error]',
50785                     funcTag = '[object Function]',
50786                     mapTag = '[object Map]',
50787                     numberTag = '[object Number]',
50788                     objectTag = '[object Object]',
50789                     regexpTag = '[object RegExp]',
50790                     setTag = '[object Set]',
50791                     stringTag = '[object String]',
50792                     weakMapTag = '[object WeakMap]';
50793
50794                 var arrayBufferTag = '[object ArrayBuffer]',
50795                     float32Tag = '[object Float32Array]',
50796                     float64Tag = '[object Float64Array]',
50797                     int8Tag = '[object Int8Array]',
50798                     int16Tag = '[object Int16Array]',
50799                     int32Tag = '[object Int32Array]',
50800                     uint8Tag = '[object Uint8Array]',
50801                     uint8ClampedTag = '[object Uint8ClampedArray]',
50802                     uint16Tag = '[object Uint16Array]',
50803                     uint32Tag = '[object Uint32Array]';
50804
50805                 /** Used to match empty string literals in compiled template source. */
50806                 var reEmptyStringLeading = /\b__p \+= '';/g,
50807                     reEmptyStringMiddle = /\b(__p \+=) '' \+/g,
50808                     reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;
50809
50810                 /** Used to match HTML entities and HTML characters. */
50811                 var reEscapedHtml = /&(?:amp|lt|gt|quot|#39|#96);/g,
50812                     reUnescapedHtml = /[&<>"'`]/g,
50813                     reHasEscapedHtml = RegExp(reEscapedHtml.source),
50814                     reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
50815
50816                 /** Used to match template delimiters. */
50817                 var reEscape = /<%-([\s\S]+?)%>/g,
50818                     reEvaluate = /<%([\s\S]+?)%>/g,
50819                     reInterpolate = /<%=([\s\S]+?)%>/g;
50820
50821                 /** Used to match property names within property paths. */
50822                 var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\n\\]|\\.)*?\1)\]/,
50823                     reIsPlainProp = /^\w*$/,
50824                     rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\n\\]|\\.)*?)\2)\]/g;
50825
50826                 /**
50827                  * Used to match `RegExp` [syntax
50828                  * characters](http://ecma-international.org/ecma-262/6.0/#sec-patterns) and
50829                  * those outlined by
50830                  * [`EscapeRegExpPattern`](http://ecma-international.org/ecma-262/6.0/#sec-escaperegexppattern).
50831                  */
50832                 var reRegExpChars = /^[:!,]|[\\^$.*+?()[\]{}|\/]|(^[0-9a-fA-Fnrtuvx])|([\n\r\u2028\u2029])/g,
50833                     reHasRegExpChars = RegExp(reRegExpChars.source);
50834
50835                 /**
50836                  * Used to match [combining diacritical
50837                  * marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).
50838                  */
50839                 var reComboMark = /[\u0300-\u036f\ufe20-\ufe23]/g;
50840
50841                 /** Used to match backslashes in property paths. */
50842                 var reEscapeChar = /\\(\\)?/g;
50843
50844                 /**
50845                  * Used to match [ES template
50846                  * delimiters](http://ecma-international.org/ecma-262/6.0/#sec-template-literal-lexical-components).
50847                  */
50848                 var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
50849
50850                 /** Used to match `RegExp` flags from their coerced string values. */
50851                 var reFlags = /\w*$/;
50852
50853                 /** Used to detect hexadecimal string values. */
50854                 var reHasHexPrefix = /^0[xX]/;
50855
50856                 /** Used to detect host constructors (Safari > 5). */
50857                 var reIsHostCtor = /^\[object .+?Constructor\]$/;
50858
50859                 /** Used to detect unsigned integer values. */
50860                 var reIsUint = /^\d+$/;
50861
50862                 /**
50863                  * Used to match latin-1 supplementary letters (excluding mathematical
50864                  * operators).
50865                  */
50866                 var reLatin1 = /[\xc0-\xd6\xd8-\xde\xdf-\xf6\xf8-\xff]/g;
50867
50868                 /** Used to ensure capturing order of template delimiters. */
50869                 var reNoMatch = /($^)/;
50870
50871                 /** Used to match unescaped characters in compiled string literals. */
50872                 var reUnescapedString = /['\n\r\u2028\u2029\\]/g;
50873
50874                 /** Used to match words to create compound words. */
50875                 var reWords = (function() {
50876                     var upper = '[A-Z\\xc0-\\xd6\\xd8-\\xde]',
50877                         lower = '[a-z\\xdf-\\xf6\\xf8-\\xff]+';
50878
50879                     return RegExp(upper + '+(?=' + upper + lower + ')|' + upper + '?' + lower + '|' + upper + '+|[0-9]+', 'g');
50880                 }());
50881
50882                 /** Used to assign default `context` object properties. */
50883                 var contextProps = [
50884                     'Array', 'ArrayBuffer', 'Date', 'Error', 'Float32Array', 'Float64Array',
50885                     'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Math', 'Number',
50886                     'Object', 'RegExp', 'Set', 'String', '_', 'clearTimeout', 'isFinite',
50887                     'parseFloat', 'parseInt', 'setTimeout', 'TypeError', 'Uint8Array',
50888                     'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap'
50889                 ];
50890
50891                 /** Used to make template sourceURLs easier to identify. */
50892                 var templateCounter = -1;
50893
50894                 /** Used to identify `toStringTag` values of typed arrays. */
50895                 var typedArrayTags = {};
50896                 typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
50897                     typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
50898                     typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
50899                     typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
50900                     typedArrayTags[uint32Tag] = true;
50901                 typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
50902                     typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
50903                     typedArrayTags[dateTag] = typedArrayTags[errorTag] =
50904                     typedArrayTags[funcTag] = typedArrayTags[mapTag] =
50905                     typedArrayTags[numberTag] = typedArrayTags[objectTag] =
50906                     typedArrayTags[regexpTag] = typedArrayTags[setTag] =
50907                     typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false;
50908
50909                 /** Used to identify `toStringTag` values supported by `_.clone`. */
50910                 var cloneableTags = {};
50911                 cloneableTags[argsTag] = cloneableTags[arrayTag] =
50912                     cloneableTags[arrayBufferTag] = cloneableTags[boolTag] =
50913                     cloneableTags[dateTag] = cloneableTags[float32Tag] =
50914                     cloneableTags[float64Tag] = cloneableTags[int8Tag] =
50915                     cloneableTags[int16Tag] = cloneableTags[int32Tag] =
50916                     cloneableTags[numberTag] = cloneableTags[objectTag] =
50917                     cloneableTags[regexpTag] = cloneableTags[stringTag] =
50918                     cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
50919                     cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
50920                 cloneableTags[errorTag] = cloneableTags[funcTag] =
50921                     cloneableTags[mapTag] = cloneableTags[setTag] =
50922                     cloneableTags[weakMapTag] = false;
50923
50924                 /** Used to map latin-1 supplementary letters to basic latin letters. */
50925                 var deburredLetters = {
50926                     '\xc0': 'A',
50927                     '\xc1': 'A',
50928                     '\xc2': 'A',
50929                     '\xc3': 'A',
50930                     '\xc4': 'A',
50931                     '\xc5': 'A',
50932                     '\xe0': 'a',
50933                     '\xe1': 'a',
50934                     '\xe2': 'a',
50935                     '\xe3': 'a',
50936                     '\xe4': 'a',
50937                     '\xe5': 'a',
50938                     '\xc7': 'C',
50939                     '\xe7': 'c',
50940                     '\xd0': 'D',
50941                     '\xf0': 'd',
50942                     '\xc8': 'E',
50943                     '\xc9': 'E',
50944                     '\xca': 'E',
50945                     '\xcb': 'E',
50946                     '\xe8': 'e',
50947                     '\xe9': 'e',
50948                     '\xea': 'e',
50949                     '\xeb': 'e',
50950                     '\xcC': 'I',
50951                     '\xcd': 'I',
50952                     '\xce': 'I',
50953                     '\xcf': 'I',
50954                     '\xeC': 'i',
50955                     '\xed': 'i',
50956                     '\xee': 'i',
50957                     '\xef': 'i',
50958                     '\xd1': 'N',
50959                     '\xf1': 'n',
50960                     '\xd2': 'O',
50961                     '\xd3': 'O',
50962                     '\xd4': 'O',
50963                     '\xd5': 'O',
50964                     '\xd6': 'O',
50965                     '\xd8': 'O',
50966                     '\xf2': 'o',
50967                     '\xf3': 'o',
50968                     '\xf4': 'o',
50969                     '\xf5': 'o',
50970                     '\xf6': 'o',
50971                     '\xf8': 'o',
50972                     '\xd9': 'U',
50973                     '\xda': 'U',
50974                     '\xdb': 'U',
50975                     '\xdc': 'U',
50976                     '\xf9': 'u',
50977                     '\xfa': 'u',
50978                     '\xfb': 'u',
50979                     '\xfc': 'u',
50980                     '\xdd': 'Y',
50981                     '\xfd': 'y',
50982                     '\xff': 'y',
50983                     '\xc6': 'Ae',
50984                     '\xe6': 'ae',
50985                     '\xde': 'Th',
50986                     '\xfe': 'th',
50987                     '\xdf': 'ss'
50988                 };
50989
50990                 /** Used to map characters to HTML entities. */
50991                 var htmlEscapes = {
50992                     '&': '&amp;',
50993                     '<': '&lt;',
50994                     '>': '&gt;',
50995                     '"': '&quot;',
50996                     "'": '&#39;',
50997                     '`': '&#96;'
50998                 };
50999
51000                 /** Used to map HTML entities to characters. */
51001                 var htmlUnescapes = {
51002                     '&amp;': '&',
51003                     '&lt;': '<',
51004                     '&gt;': '>',
51005                     '&quot;': '"',
51006                     '&#39;': "'",
51007                     '&#96;': '`'
51008                 };
51009
51010                 /** Used to determine if values are of the language type `Object`. */
51011                 var objectTypes = {
51012                     'function': true,
51013                     'object': true
51014                 };
51015
51016                 /** Used to escape characters for inclusion in compiled regexes. */
51017                 var regexpEscapes = {
51018                     '0': 'x30',
51019                     '1': 'x31',
51020                     '2': 'x32',
51021                     '3': 'x33',
51022                     '4': 'x34',
51023                     '5': 'x35',
51024                     '6': 'x36',
51025                     '7': 'x37',
51026                     '8': 'x38',
51027                     '9': 'x39',
51028                     'A': 'x41',
51029                     'B': 'x42',
51030                     'C': 'x43',
51031                     'D': 'x44',
51032                     'E': 'x45',
51033                     'F': 'x46',
51034                     'a': 'x61',
51035                     'b': 'x62',
51036                     'c': 'x63',
51037                     'd': 'x64',
51038                     'e': 'x65',
51039                     'f': 'x66',
51040                     'n': 'x6e',
51041                     'r': 'x72',
51042                     't': 'x74',
51043                     'u': 'x75',
51044                     'v': 'x76',
51045                     'x': 'x78'
51046                 };
51047
51048                 /** Used to escape characters for inclusion in compiled string literals. */
51049                 var stringEscapes = {
51050                     '\\': '\\',
51051                     "'": "'",
51052                     '\n': 'n',
51053                     '\r': 'r',
51054                     '\u2028': 'u2028',
51055                     '\u2029': 'u2029'
51056                 };
51057
51058                 /** Detect free variable `exports`. */
51059                 var freeExports = objectTypes[typeof exports] && exports && !exports.nodeType && exports;
51060
51061                 /** Detect free variable `module`. */
51062                 var freeModule = objectTypes[typeof module] && module && !module.nodeType && module;
51063
51064                 /** Detect free variable `global` from Node.js. */
51065                 var freeGlobal = freeExports && freeModule && typeof global == 'object' && global && global.Object && global;
51066
51067                 /** Detect free variable `self`. */
51068                 var freeSelf = objectTypes[typeof self] && self && self.Object && self;
51069
51070                 /** Detect free variable `window`. */
51071                 var freeWindow = objectTypes[typeof window] && window && window.Object && window;
51072
51073                 /** Detect the popular CommonJS extension `module.exports`. */
51074                 var moduleExports = freeModule && freeModule.exports === freeExports && freeExports;
51075
51076                 /**
51077                  * Used as a reference to the global object.
51078                  * 
51079                  * The `this` value is used if it's the global object to avoid
51080                  * Greasemonkey's restricted `window` object, otherwise the `window` object
51081                  * is used.
51082                  */
51083                 var root = freeGlobal || ((freeWindow !== (this && this.window)) && freeWindow) || freeSelf || this;
51084
51085                 /*--------------------------------------------------------------------------*/
51086
51087                 /**
51088                  * The base implementation of `compareAscending` which compares values and
51089                  * sorts them in ascending order without guaranteeing a stable sort.
51090                  * 
51091                  * @private
51092                  * @param {*}
51093                  *            value The value to compare.
51094                  * @param {*}
51095                  *            other The other value to compare.
51096                  * @returns {number} Returns the sort order indicator for `value`.
51097                  */
51098                 function baseCompareAscending(value, other) {
51099                     if (value !== other) {
51100                         var valIsNull = value === null,
51101                             valIsUndef = value === undefined,
51102                             valIsReflexive = value === value;
51103
51104                         var othIsNull = other === null,
51105                             othIsUndef = other === undefined,
51106                             othIsReflexive = other === other;
51107
51108                         if ((value > other && !othIsNull) || !valIsReflexive ||
51109                             (valIsNull && !othIsUndef && othIsReflexive) ||
51110                             (valIsUndef && othIsReflexive)) {
51111                             return 1;
51112                         }
51113                         if ((value < other && !valIsNull) || !othIsReflexive ||
51114                             (othIsNull && !valIsUndef && valIsReflexive) ||
51115                             (othIsUndef && valIsReflexive)) {
51116                             return -1;
51117                         }
51118                     }
51119                     return 0;
51120                 }
51121
51122                 /**
51123                  * The base implementation of `_.findIndex` and `_.findLastIndex` without
51124                  * support for callback shorthands and `this` binding.
51125                  * 
51126                  * @private
51127                  * @param {Array}
51128                  *            array The array to search.
51129                  * @param {Function}
51130                  *            predicate The function invoked per iteration.
51131                  * @param {boolean}
51132                  *            [fromRight] Specify iterating from right to left.
51133                  * @returns {number} Returns the index of the matched value, else `-1`.
51134                  */
51135                 function baseFindIndex(array, predicate, fromRight) {
51136                     var length = array.length,
51137                         index = fromRight ? length : -1;
51138
51139                     while ((fromRight ? index-- : ++index < length)) {
51140                         if (predicate(array[index], index, array)) {
51141                             return index;
51142                         }
51143                     }
51144                     return -1;
51145                 }
51146
51147                 /**
51148                  * The base implementation of `_.indexOf` without support for binary
51149                  * searches.
51150                  * 
51151                  * @private
51152                  * @param {Array}
51153                  *            array The array to search.
51154                  * @param {*}
51155                  *            value The value to search for.
51156                  * @param {number}
51157                  *            fromIndex The index to search from.
51158                  * @returns {number} Returns the index of the matched value, else `-1`.
51159                  */
51160                 function baseIndexOf(array, value, fromIndex) {
51161                     if (value !== value) {
51162                         return indexOfNaN(array, fromIndex);
51163                     }
51164                     var index = fromIndex - 1,
51165                         length = array.length;
51166
51167                     while (++index < length) {
51168                         if (array[index] === value) {
51169                             return index;
51170                         }
51171                     }
51172                     return -1;
51173                 }
51174
51175                 /**
51176                  * The base implementation of `_.isFunction` without support for
51177                  * environments with incorrect `typeof` results.
51178                  * 
51179                  * @private
51180                  * @param {*}
51181                  *            value The value to check.
51182                  * @returns {boolean} Returns `true` if `value` is correctly classified,
51183                  *          else `false`.
51184                  */
51185                 function baseIsFunction(value) {
51186                     // Avoid a Chakra JIT bug in compatibility modes of IE 11.
51187                     // See https://github.com/jashkenas/underscore/issues/1621 for more details.
51188                     return typeof value == 'function' || false;
51189                 }
51190
51191                 /**
51192                  * Converts `value` to a string if it's not one. An empty string is returned
51193                  * for `null` or `undefined` values.
51194                  * 
51195                  * @private
51196                  * @param {*}
51197                  *            value The value to process.
51198                  * @returns {string} Returns the string.
51199                  */
51200                 function baseToString(value) {
51201                     return value == null ? '' : (value + '');
51202                 }
51203
51204                 /**
51205                  * Used by `_.trim` and `_.trimLeft` to get the index of the first character
51206                  * of `string` that is not found in `chars`.
51207                  * 
51208                  * @private
51209                  * @param {string}
51210                  *            string The string to inspect.
51211                  * @param {string}
51212                  *            chars The characters to find.
51213                  * @returns {number} Returns the index of the first character not found in
51214                  *          `chars`.
51215                  */
51216                 function charsLeftIndex(string, chars) {
51217                     var index = -1,
51218                         length = string.length;
51219
51220                     while (++index < length && chars.indexOf(string.charAt(index)) > -1) {}
51221                     return index;
51222                 }
51223
51224                 /**
51225                  * Used by `_.trim` and `_.trimRight` to get the index of the last character
51226                  * of `string` that is not found in `chars`.
51227                  * 
51228                  * @private
51229                  * @param {string}
51230                  *            string The string to inspect.
51231                  * @param {string}
51232                  *            chars The characters to find.
51233                  * @returns {number} Returns the index of the last character not found in
51234                  *          `chars`.
51235                  */
51236                 function charsRightIndex(string, chars) {
51237                     var index = string.length;
51238
51239                     while (index-- && chars.indexOf(string.charAt(index)) > -1) {}
51240                     return index;
51241                 }
51242
51243                 /**
51244                  * Used by `_.sortBy` to compare transformed elements of a collection and
51245                  * stable sort them in ascending order.
51246                  * 
51247                  * @private
51248                  * @param {Object}
51249                  *            object The object to compare.
51250                  * @param {Object}
51251                  *            other The other object to compare.
51252                  * @returns {number} Returns the sort order indicator for `object`.
51253                  */
51254                 function compareAscending(object, other) {
51255                     return baseCompareAscending(object.criteria, other.criteria) || (object.index - other.index);
51256                 }
51257
51258                 /**
51259                  * Used by `_.sortByOrder` to compare multiple properties of a value to
51260                  * another and stable sort them.
51261                  * 
51262                  * If `orders` is unspecified, all valuess are sorted in ascending order.
51263                  * Otherwise, a value is sorted in ascending order if its corresponding
51264                  * order is "asc", and descending if "desc".
51265                  * 
51266                  * @private
51267                  * @param {Object}
51268                  *            object The object to compare.
51269                  * @param {Object}
51270                  *            other The other object to compare.
51271                  * @param {boolean[]}
51272                  *            orders The order to sort by for each property.
51273                  * @returns {number} Returns the sort order indicator for `object`.
51274                  */
51275                 function compareMultiple(object, other, orders) {
51276                     var index = -1,
51277                         objCriteria = object.criteria,
51278                         othCriteria = other.criteria,
51279                         length = objCriteria.length,
51280                         ordersLength = orders.length;
51281
51282                     while (++index < length) {
51283                         var result = baseCompareAscending(objCriteria[index], othCriteria[index]);
51284                         if (result) {
51285                             if (index >= ordersLength) {
51286                                 return result;
51287                             }
51288                             var order = orders[index];
51289                             return result * ((order === 'asc' || order === true) ? 1 : -1);
51290                         }
51291                     }
51292                     // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications
51293                     // that causes it, under certain circumstances, to provide the same value
51294                     // for
51295                     // `object` and `other`. See
51296                     // https://github.com/jashkenas/underscore/pull/1247
51297                     // for more details.
51298                     //
51299                     // This also ensures a stable sort in V8 and other engines.
51300                     // See https://code.google.com/p/v8/issues/detail?id=90 for more details.
51301                     return object.index - other.index;
51302                 }
51303
51304                 /**
51305                  * Used by `_.deburr` to convert latin-1 supplementary letters to basic
51306                  * latin letters.
51307                  * 
51308                  * @private
51309                  * @param {string}
51310                  *            letter The matched letter to deburr.
51311                  * @returns {string} Returns the deburred letter.
51312                  */
51313                 function deburrLetter(letter) {
51314                     return deburredLetters[letter];
51315                 }
51316
51317                 /**
51318                  * Used by `_.escape` to convert characters to HTML entities.
51319                  * 
51320                  * @private
51321                  * @param {string}
51322                  *            chr The matched character to escape.
51323                  * @returns {string} Returns the escaped character.
51324                  */
51325                 function escapeHtmlChar(chr) {
51326                     return htmlEscapes[chr];
51327                 }
51328
51329                 /**
51330                  * Used by `_.escapeRegExp` to escape characters for inclusion in compiled
51331                  * regexes.
51332                  * 
51333                  * @private
51334                  * @param {string}
51335                  *            chr The matched character to escape.
51336                  * @param {string}
51337                  *            leadingChar The capture group for a leading character.
51338                  * @param {string}
51339                  *            whitespaceChar The capture group for a whitespace character.
51340                  * @returns {string} Returns the escaped character.
51341                  */
51342                 function escapeRegExpChar(chr, leadingChar, whitespaceChar) {
51343                     if (leadingChar) {
51344                         chr = regexpEscapes[chr];
51345                     } else if (whitespaceChar) {
51346                         chr = stringEscapes[chr];
51347                     }
51348                     return '\\' + chr;
51349                 }
51350
51351                 /**
51352                  * Used by `_.template` to escape characters for inclusion in compiled
51353                  * string literals.
51354                  * 
51355                  * @private
51356                  * @param {string}
51357                  *            chr The matched character to escape.
51358                  * @returns {string} Returns the escaped character.
51359                  */
51360                 function escapeStringChar(chr) {
51361                     return '\\' + stringEscapes[chr];
51362                 }
51363
51364                 /**
51365                  * Gets the index at which the first occurrence of `NaN` is found in
51366                  * `array`.
51367                  * 
51368                  * @private
51369                  * @param {Array}
51370                  *            array The array to search.
51371                  * @param {number}
51372                  *            fromIndex The index to search from.
51373                  * @param {boolean}
51374                  *            [fromRight] Specify iterating from right to left.
51375                  * @returns {number} Returns the index of the matched `NaN`, else `-1`.
51376                  */
51377                 function indexOfNaN(array, fromIndex, fromRight) {
51378                     var length = array.length,
51379                         index = fromIndex + (fromRight ? 0 : -1);
51380
51381                     while ((fromRight ? index-- : ++index < length)) {
51382                         var other = array[index];
51383                         if (other !== other) {
51384                             return index;
51385                         }
51386                     }
51387                     return -1;
51388                 }
51389
51390                 /**
51391                  * Checks if `value` is object-like.
51392                  * 
51393                  * @private
51394                  * @param {*}
51395                  *            value The value to check.
51396                  * @returns {boolean} Returns `true` if `value` is object-like, else
51397                  *          `false`.
51398                  */
51399                 function isObjectLike(value) {
51400                     return !!value && typeof value == 'object';
51401                 }
51402
51403                 /**
51404                  * Used by `trimmedLeftIndex` and `trimmedRightIndex` to determine if a
51405                  * character code is whitespace.
51406                  * 
51407                  * @private
51408                  * @param {number}
51409                  *            charCode The character code to inspect.
51410                  * @returns {boolean} Returns `true` if `charCode` is whitespace, else
51411                  *          `false`.
51412                  */
51413                 function isSpace(charCode) {
51414                     return ((charCode <= 160 && (charCode >= 9 && charCode <= 13) || charCode == 32 || charCode == 160) || charCode == 5760 || charCode == 6158 ||
51415                         (charCode >= 8192 && (charCode <= 8202 || charCode == 8232 || charCode == 8233 || charCode == 8239 || charCode == 8287 || charCode == 12288 || charCode == 65279)));
51416                 }
51417
51418                 /**
51419                  * Replaces all `placeholder` elements in `array` with an internal
51420                  * placeholder and returns an array of their indexes.
51421                  * 
51422                  * @private
51423                  * @param {Array}
51424                  *            array The array to modify.
51425                  * @param {*}
51426                  *            placeholder The placeholder to replace.
51427                  * @returns {Array} Returns the new array of placeholder indexes.
51428                  */
51429                 function replaceHolders(array, placeholder) {
51430                     var index = -1,
51431                         length = array.length,
51432                         resIndex = -1,
51433                         result = [];
51434
51435                     while (++index < length) {
51436                         if (array[index] === placeholder) {
51437                             array[index] = PLACEHOLDER;
51438                             result[++resIndex] = index;
51439                         }
51440                     }
51441                     return result;
51442                 }
51443
51444                 /**
51445                  * An implementation of `_.uniq` optimized for sorted arrays without support
51446                  * for callback shorthands and `this` binding.
51447                  * 
51448                  * @private
51449                  * @param {Array}
51450                  *            array The array to inspect.
51451                  * @param {Function}
51452                  *            [iteratee] The function invoked per iteration.
51453                  * @returns {Array} Returns the new duplicate-value-free array.
51454                  */
51455                 function sortedUniq(array, iteratee) {
51456                     var seen,
51457                         index = -1,
51458                         length = array.length,
51459                         resIndex = -1,
51460                         result = [];
51461
51462                     while (++index < length) {
51463                         var value = array[index],
51464                             computed = iteratee ? iteratee(value, index, array) : value;
51465
51466                         if (!index || seen !== computed) {
51467                             seen = computed;
51468                             result[++resIndex] = value;
51469                         }
51470                     }
51471                     return result;
51472                 }
51473
51474                 /**
51475                  * Used by `_.trim` and `_.trimLeft` to get the index of the first
51476                  * non-whitespace character of `string`.
51477                  * 
51478                  * @private
51479                  * @param {string}
51480                  *            string The string to inspect.
51481                  * @returns {number} Returns the index of the first non-whitespace
51482                  *          character.
51483                  */
51484                 function trimmedLeftIndex(string) {
51485                     var index = -1,
51486                         length = string.length;
51487
51488                     while (++index < length && isSpace(string.charCodeAt(index))) {}
51489                     return index;
51490                 }
51491
51492                 /**
51493                  * Used by `_.trim` and `_.trimRight` to get the index of the last
51494                  * non-whitespace character of `string`.
51495                  * 
51496                  * @private
51497                  * @param {string}
51498                  *            string The string to inspect.
51499                  * @returns {number} Returns the index of the last non-whitespace character.
51500                  */
51501                 function trimmedRightIndex(string) {
51502                     var index = string.length;
51503
51504                     while (index-- && isSpace(string.charCodeAt(index))) {}
51505                     return index;
51506                 }
51507
51508                 /**
51509                  * Used by `_.unescape` to convert HTML entities to characters.
51510                  * 
51511                  * @private
51512                  * @param {string}
51513                  *            chr The matched character to unescape.
51514                  * @returns {string} Returns the unescaped character.
51515                  */
51516                 function unescapeHtmlChar(chr) {
51517                     return htmlUnescapes[chr];
51518                 }
51519
51520                 /*--------------------------------------------------------------------------*/
51521
51522                 /**
51523                  * Create a new pristine `lodash` function using the given `context` object.
51524                  * 
51525                  * @static
51526                  * @memberOf _
51527                  * @category Utility
51528                  * @param {Object}
51529                  *            [context=root] The context object.
51530                  * @returns {Function} Returns a new `lodash` function.
51531                  * @example
51532                  * 
51533                  * _.mixin({ 'foo': _.constant('foo') });
51534                  * 
51535                  * var lodash = _.runInContext(); lodash.mixin({ 'bar':
51536                  * lodash.constant('bar') });
51537                  * 
51538                  * _.isFunction(_.foo); // => true _.isFunction(_.bar); // => false
51539                  * 
51540                  * lodash.isFunction(lodash.foo); // => false lodash.isFunction(lodash.bar); // =>
51541                  * true
51542                  *  // using `context` to mock `Date#getTime` use in `_.now` var mock =
51543                  * _.runInContext({ 'Date': function() { return { 'getTime': getTimeMock }; }
51544                  * });
51545                  *  // or creating a suped-up `defer` in Node.js var defer =
51546                  * _.runInContext({ 'setTimeout': setImmediate }).defer;
51547                  */
51548                 function runInContext(context) {
51549                     // Avoid issues with some ES3 environments that attempt to use values, named
51550                     // after built-in constructors like `Object`, for the creation of literals.
51551                     // ES5 clears this up by stating that literals must use built-in
51552                     // constructors.
51553                     // See https://es5.github.io/#x11.1.5 for more details.
51554                     context = context ? _.defaults(root.Object(), context, _.pick(root, contextProps)) : root;
51555
51556                     /** Native constructor references. */
51557                     var Array = context.Array,
51558                         Date = context.Date,
51559                         Error = context.Error,
51560                         Function = context.Function,
51561                         Math = context.Math,
51562                         Number = context.Number,
51563                         Object = context.Object,
51564                         RegExp = context.RegExp,
51565                         String = context.String,
51566                         TypeError = context.TypeError;
51567
51568                     /** Used for native method references. */
51569                     var arrayProto = Array.prototype,
51570                         objectProto = Object.prototype,
51571                         stringProto = String.prototype;
51572
51573                     /** Used to resolve the decompiled source of functions. */
51574                     var fnToString = Function.prototype.toString;
51575
51576                     /** Used to check objects for own properties. */
51577                     var hasOwnProperty = objectProto.hasOwnProperty;
51578
51579                     /** Used to generate unique IDs. */
51580                     var idCounter = 0;
51581
51582                     /**
51583                      * Used to resolve the
51584                      * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
51585                      * of values.
51586                      */
51587                     var objToString = objectProto.toString;
51588
51589                     /** Used to restore the original `_` reference in `_.noConflict`. */
51590                     var oldDash = root._;
51591
51592                     /** Used to detect if a method is native. */
51593                     var reIsNative = RegExp('^' +
51594                         fnToString.call(hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g, '\\$&')
51595                         .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
51596                     );
51597
51598                     /** Native method references. */
51599                     var ArrayBuffer = context.ArrayBuffer,
51600                         clearTimeout = context.clearTimeout,
51601                         parseFloat = context.parseFloat,
51602                         pow = Math.pow,
51603                         propertyIsEnumerable = objectProto.propertyIsEnumerable,
51604                         Set = getNative(context, 'Set'),
51605                         setTimeout = context.setTimeout,
51606                         splice = arrayProto.splice,
51607                         Uint8Array = context.Uint8Array,
51608                         WeakMap = getNative(context, 'WeakMap');
51609
51610                     /*
51611                      * Native method references for those with the same name as other `lodash`
51612                      * methods.
51613                      */
51614                     var nativeCeil = Math.ceil,
51615                         nativeCreate = getNative(Object, 'create'),
51616                         nativeFloor = Math.floor,
51617                         nativeIsArray = getNative(Array, 'isArray'),
51618                         nativeIsFinite = context.isFinite,
51619                         nativeKeys = getNative(Object, 'keys'),
51620                         nativeMax = Math.max,
51621                         nativeMin = Math.min,
51622                         nativeNow = getNative(Date, 'now'),
51623                         nativeParseInt = context.parseInt,
51624                         nativeRandom = Math.random;
51625
51626                     /** Used as references for `-Infinity` and `Infinity`. */
51627                     var NEGATIVE_INFINITY = Number.NEGATIVE_INFINITY,
51628                         POSITIVE_INFINITY = Number.POSITIVE_INFINITY;
51629
51630                     /** Used as references for the maximum length and index of an array. */
51631                     var MAX_ARRAY_LENGTH = 4294967295,
51632                         MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1,
51633                         HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;
51634
51635                     /**
51636                      * Used as the [maximum
51637                      * length](http://ecma-international.org/ecma-262/6.0/#sec-number.max_safe_integer)
51638                      * of an array-like value.
51639                      */
51640                     var MAX_SAFE_INTEGER = 9007199254740991;
51641
51642                     /** Used to store function metadata. */
51643                     var metaMap = WeakMap && new WeakMap;
51644
51645                     /** Used to lookup unminified function names. */
51646                     var realNames = {};
51647
51648                     /*------------------------------------------------------------------------*/
51649
51650                     /**
51651                      * Creates a `lodash` object which wraps `value` to enable implicit
51652                      * chaining. Methods that operate on and return arrays, collections, and
51653                      * functions can be chained together. Methods that retrieve a single value
51654                      * or may return a primitive value will automatically end the chain
51655                      * returning the unwrapped value. Explicit chaining may be enabled using
51656                      * `_.chain`. The execution of chained methods is lazy, that is, execution
51657                      * is deferred until `_#value` is implicitly or explicitly called.
51658                      * 
51659                      * Lazy evaluation allows several methods to support shortcut fusion.
51660                      * Shortcut fusion is an optimization strategy which merge iteratee calls;
51661                      * this can help to avoid the creation of intermediate data structures and
51662                      * greatly reduce the number of iteratee executions.
51663                      * 
51664                      * Chaining is supported in custom builds as long as the `_#value` method is
51665                      * directly or indirectly included in the build.
51666                      * 
51667                      * In addition to lodash methods, wrappers have `Array` and `String`
51668                      * methods.
51669                      * 
51670                      * The wrapper `Array` methods are: `concat`, `join`, `pop`, `push`,
51671                      * `reverse`, `shift`, `slice`, `sort`, `splice`, and `unshift`
51672                      * 
51673                      * The wrapper `String` methods are: `replace` and `split`
51674                      * 
51675                      * The wrapper methods that support shortcut fusion are: `compact`, `drop`,
51676                      * `dropRight`, `dropRightWhile`, `dropWhile`, `filter`, `first`, `initial`,
51677                      * `last`, `map`, `pluck`, `reject`, `rest`, `reverse`, `slice`, `take`,
51678                      * `takeRight`, `takeRightWhile`, `takeWhile`, `toArray`, and `where`
51679                      * 
51680                      * The chainable wrapper methods are: `after`, `ary`, `assign`, `at`,
51681                      * `before`, `bind`, `bindAll`, `bindKey`, `callback`, `chain`, `chunk`,
51682                      * `commit`, `compact`, `concat`, `constant`, `countBy`, `create`, `curry`,
51683                      * `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`, `difference`,
51684                      * `drop`, `dropRight`, `dropRightWhile`, `dropWhile`, `fill`, `filter`,
51685                      * `flatten`, `flattenDeep`, `flow`, `flowRight`, `forEach`, `forEachRight`,
51686                      * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `functions`, `groupBy`,
51687                      * `indexBy`, `initial`, `intersection`, `invert`, `invoke`, `keys`,
51688                      * `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`,
51689                      * `memoize`, `merge`, `method`, `methodOf`, `mixin`, `modArgs`, `negate`,
51690                      * `omit`, `once`, `pairs`, `partial`, `partialRight`, `partition`, `pick`,
51691                      * `plant`, `pluck`, `property`, `propertyOf`, `pull`, `pullAt`, `push`,
51692                      * `range`, `rearg`, `reject`, `remove`, `rest`, `restParam`, `reverse`,
51693                      * `set`, `shuffle`, `slice`, `sort`, `sortBy`, `sortByAll`, `sortByOrder`,
51694                      * `splice`, `spread`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`,
51695                      * `tap`, `throttle`, `thru`, `times`, `toArray`, `toPlainObject`,
51696                      * `transform`, `union`, `uniq`, `unshift`, `unzip`, `unzipWith`, `values`,
51697                      * `valuesIn`, `where`, `without`, `wrap`, `xor`, `zip`, `zipObject`,
51698                      * `zipWith`
51699                      * 
51700                      * The wrapper methods that are **not** chainable by default are: `add`,
51701                      * `attempt`, `camelCase`, `capitalize`, `ceil`, `clone`, `cloneDeep`,
51702                      * `deburr`, `endsWith`, `escape`, `escapeRegExp`, `every`, `find`,
51703                      * `findIndex`, `findKey`, `findLast`, `findLastIndex`, `findLastKey`,
51704                      * `findWhere`, `first`, `floor`, `get`, `gt`, `gte`, `has`, `identity`,
51705                      * `includes`, `indexOf`, `inRange`, `isArguments`, `isArray`, `isBoolean`,
51706                      * `isDate`, `isElement`, `isEmpty`, `isEqual`, `isError`, `isFinite`
51707                      * `isFunction`, `isMatch`, `isNative`, `isNaN`, `isNull`, `isNumber`,
51708                      * `isObject`, `isPlainObject`, `isRegExp`, `isString`, `isUndefined`,
51709                      * `isTypedArray`, `join`, `kebabCase`, `last`, `lastIndexOf`, `lt`, `lte`,
51710                      * `max`, `min`, `noConflict`, `noop`, `now`, `pad`, `padLeft`, `padRight`,
51711                      * `parseInt`, `pop`, `random`, `reduce`, `reduceRight`, `repeat`, `result`,
51712                      * `round`, `runInContext`, `shift`, `size`, `snakeCase`, `some`,
51713                      * `sortedIndex`, `sortedLastIndex`, `startCase`, `startsWith`, `sum`,
51714                      * `template`, `trim`, `trimLeft`, `trimRight`, `trunc`, `unescape`,
51715                      * `uniqueId`, `value`, and `words`
51716                      * 
51717                      * The wrapper method `sample` will return a wrapped value when `n` is
51718                      * provided, otherwise an unwrapped value is returned.
51719                      * 
51720                      * @name _
51721                      * @constructor
51722                      * @category Chain
51723                      * @param {*}
51724                      *            value The value to wrap in a `lodash` instance.
51725                      * @returns {Object} Returns the new `lodash` wrapper instance.
51726                      * @example
51727                      * 
51728                      * var wrapped = _([1, 2, 3]);
51729                      *  // returns an unwrapped value wrapped.reduce(function(total, n) { return
51730                      * total + n; }); // => 6
51731                      *  // returns a wrapped value var squares = wrapped.map(function(n) {
51732                      * return n * n; });
51733                      * 
51734                      * _.isArray(squares); // => false
51735                      * 
51736                      * _.isArray(squares.value()); // => true
51737                      */
51738                     function lodash(value) {
51739                         if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {
51740                             if (value instanceof LodashWrapper) {
51741                                 return value;
51742                             }
51743                             if (hasOwnProperty.call(value, '__chain__') && hasOwnProperty.call(value, '__wrapped__')) {
51744                                 return wrapperClone(value);
51745                             }
51746                         }
51747                         return new LodashWrapper(value);
51748                     }
51749
51750                     /**
51751                      * The function whose prototype all chaining wrappers inherit from.
51752                      * 
51753                      * @private
51754                      */
51755                     function baseLodash() {
51756                         // No operation performed.
51757                     }
51758
51759                     /**
51760                      * The base constructor for creating `lodash` wrapper objects.
51761                      * 
51762                      * @private
51763                      * @param {*}
51764                      *            value The value to wrap.
51765                      * @param {boolean}
51766                      *            [chainAll] Enable chaining for all wrapper methods.
51767                      * @param {Array}
51768                      *            [actions=[]] Actions to peform to resolve the unwrapped value.
51769                      */
51770                     function LodashWrapper(value, chainAll, actions) {
51771                         this.__wrapped__ = value;
51772                         this.__actions__ = actions || [];
51773                         this.__chain__ = !!chainAll;
51774                     }
51775
51776                     /**
51777                      * An object environment feature flags.
51778                      * 
51779                      * @static
51780                      * @memberOf _
51781                      * @type Object
51782                      */
51783                     var support = lodash.support = {};
51784
51785                     /**
51786                      * By default, the template delimiters used by lodash are like those in
51787                      * embedded Ruby (ERB). Change the following template settings to use
51788                      * alternative delimiters.
51789                      * 
51790                      * @static
51791                      * @memberOf _
51792                      * @type Object
51793                      */
51794                     lodash.templateSettings = {
51795
51796                         /**
51797                          * Used to detect `data` property values to be HTML-escaped.
51798                          * 
51799                          * @memberOf _.templateSettings
51800                          * @type RegExp
51801                          */
51802                         'escape': reEscape,
51803
51804                         /**
51805                          * Used to detect code to be evaluated.
51806                          * 
51807                          * @memberOf _.templateSettings
51808                          * @type RegExp
51809                          */
51810                         'evaluate': reEvaluate,
51811
51812                         /**
51813                          * Used to detect `data` property values to inject.
51814                          * 
51815                          * @memberOf _.templateSettings
51816                          * @type RegExp
51817                          */
51818                         'interpolate': reInterpolate,
51819
51820                         /**
51821                          * Used to reference the data object in the template text.
51822                          * 
51823                          * @memberOf _.templateSettings
51824                          * @type string
51825                          */
51826                         'variable': '',
51827
51828                         /**
51829                          * Used to import variables into the compiled template.
51830                          * 
51831                          * @memberOf _.templateSettings
51832                          * @type Object
51833                          */
51834                         'imports': {
51835
51836                             /**
51837                              * A reference to the `lodash` function.
51838                              * 
51839                              * @memberOf _.templateSettings.imports
51840                              * @type Function
51841                              */
51842                             '_': lodash
51843                         }
51844                     };
51845
51846                     /*------------------------------------------------------------------------*/
51847
51848                     /**
51849                      * Creates a lazy wrapper object which wraps `value` to enable lazy
51850                      * evaluation.
51851                      * 
51852                      * @private
51853                      * @param {*}
51854                      *            value The value to wrap.
51855                      */
51856                     function LazyWrapper(value) {
51857                         this.__wrapped__ = value;
51858                         this.__actions__ = [];
51859                         this.__dir__ = 1;
51860                         this.__filtered__ = false;
51861                         this.__iteratees__ = [];
51862                         this.__takeCount__ = POSITIVE_INFINITY;
51863                         this.__views__ = [];
51864                     }
51865
51866                     /**
51867                      * Creates a clone of the lazy wrapper object.
51868                      * 
51869                      * @private
51870                      * @name clone
51871                      * @memberOf LazyWrapper
51872                      * @returns {Object} Returns the cloned `LazyWrapper` object.
51873                      */
51874                     function lazyClone() {
51875                         var result = new LazyWrapper(this.__wrapped__);
51876                         result.__actions__ = arrayCopy(this.__actions__);
51877                         result.__dir__ = this.__dir__;
51878                         result.__filtered__ = this.__filtered__;
51879                         result.__iteratees__ = arrayCopy(this.__iteratees__);
51880                         result.__takeCount__ = this.__takeCount__;
51881                         result.__views__ = arrayCopy(this.__views__);
51882                         return result;
51883                     }
51884
51885                     /**
51886                      * Reverses the direction of lazy iteration.
51887                      * 
51888                      * @private
51889                      * @name reverse
51890                      * @memberOf LazyWrapper
51891                      * @returns {Object} Returns the new reversed `LazyWrapper` object.
51892                      */
51893                     function lazyReverse() {
51894                         if (this.__filtered__) {
51895                             var result = new LazyWrapper(this);
51896                             result.__dir__ = -1;
51897                             result.__filtered__ = true;
51898                         } else {
51899                             result = this.clone();
51900                             result.__dir__ *= -1;
51901                         }
51902                         return result;
51903                     }
51904
51905                     /**
51906                      * Extracts the unwrapped value from its lazy wrapper.
51907                      * 
51908                      * @private
51909                      * @name value
51910                      * @memberOf LazyWrapper
51911                      * @returns {*} Returns the unwrapped value.
51912                      */
51913                     function lazyValue() {
51914                         var array = this.__wrapped__.value(),
51915                             dir = this.__dir__,
51916                             isArr = isArray(array),
51917                             isRight = dir < 0,
51918                             arrLength = isArr ? array.length : 0,
51919                             view = getView(0, arrLength, this.__views__),
51920                             start = view.start,
51921                             end = view.end,
51922                             length = end - start,
51923                             index = isRight ? end : (start - 1),
51924                             iteratees = this.__iteratees__,
51925                             iterLength = iteratees.length,
51926                             resIndex = 0,
51927                             takeCount = nativeMin(length, this.__takeCount__);
51928
51929                         if (!isArr || arrLength < LARGE_ARRAY_SIZE || (arrLength == length && takeCount == length)) {
51930                             return baseWrapperValue((isRight && isArr) ? array.reverse() : array, this.__actions__);
51931                         }
51932                         var result = [];
51933
51934                         outer:
51935                             while (length-- && resIndex < takeCount) {
51936                                 index += dir;
51937
51938                                 var iterIndex = -1,
51939                                     value = array[index];
51940
51941                                 while (++iterIndex < iterLength) {
51942                                     var data = iteratees[iterIndex],
51943                                         iteratee = data.iteratee,
51944                                         type = data.type,
51945                                         computed = iteratee(value);
51946
51947                                     if (type == LAZY_MAP_FLAG) {
51948                                         value = computed;
51949                                     } else if (!computed) {
51950                                         if (type == LAZY_FILTER_FLAG) {
51951                                             continue outer;
51952                                         } else {
51953                                             break outer;
51954                                         }
51955                                     }
51956                                 }
51957                                 result[resIndex++] = value;
51958                             }
51959                         return result;
51960                     }
51961
51962                     /*------------------------------------------------------------------------*/
51963
51964                     /**
51965                      * Creates a cache object to store key/value pairs.
51966                      * 
51967                      * @private
51968                      * @static
51969                      * @name Cache
51970                      * @memberOf _.memoize
51971                      */
51972                     function MapCache() {
51973                         this.__data__ = {};
51974                     }
51975
51976                     /**
51977                      * Removes `key` and its value from the cache.
51978                      * 
51979                      * @private
51980                      * @name delete
51981                      * @memberOf _.memoize.Cache
51982                      * @param {string}
51983                      *            key The key of the value to remove.
51984                      * @returns {boolean} Returns `true` if the entry was removed successfully,
51985                      *          else `false`.
51986                      */
51987                     function mapDelete(key) {
51988                         return this.has(key) && delete this.__data__[key];
51989                     }
51990
51991                     /**
51992                      * Gets the cached value for `key`.
51993                      * 
51994                      * @private
51995                      * @name get
51996                      * @memberOf _.memoize.Cache
51997                      * @param {string}
51998                      *            key The key of the value to get.
51999                      * @returns {*} Returns the cached value.
52000                      */
52001                     function mapGet(key) {
52002                         return key == '__proto__' ? undefined : this.__data__[key];
52003                     }
52004
52005                     /**
52006                      * Checks if a cached value for `key` exists.
52007                      * 
52008                      * @private
52009                      * @name has
52010                      * @memberOf _.memoize.Cache
52011                      * @param {string}
52012                      *            key The key of the entry to check.
52013                      * @returns {boolean} Returns `true` if an entry for `key` exists, else
52014                      *          `false`.
52015                      */
52016                     function mapHas(key) {
52017                         return key != '__proto__' && hasOwnProperty.call(this.__data__, key);
52018                     }
52019
52020                     /**
52021                      * Sets `value` to `key` of the cache.
52022                      * 
52023                      * @private
52024                      * @name set
52025                      * @memberOf _.memoize.Cache
52026                      * @param {string}
52027                      *            key The key of the value to cache.
52028                      * @param {*}
52029                      *            value The value to cache.
52030                      * @returns {Object} Returns the cache object.
52031                      */
52032                     function mapSet(key, value) {
52033                         if (key != '__proto__') {
52034                             this.__data__[key] = value;
52035                         }
52036                         return this;
52037                     }
52038
52039                     /*------------------------------------------------------------------------*/
52040
52041                     /**
52042                      * 
52043                      * Creates a cache object to store unique values.
52044                      * 
52045                      * @private
52046                      * @param {Array}
52047                      *            [values] The values to cache.
52048                      */
52049                     function SetCache(values) {
52050                         var length = values ? values.length : 0;
52051
52052                         this.data = {
52053                             'hash': nativeCreate(null),
52054                             'set': new Set
52055                         };
52056                         while (length--) {
52057                             this.push(values[length]);
52058                         }
52059                     }
52060
52061                     /**
52062                      * Checks if `value` is in `cache` mimicking the return signature of
52063                      * `_.indexOf` by returning `0` if the value is found, else `-1`.
52064                      * 
52065                      * @private
52066                      * @param {Object}
52067                      *            cache The cache to search.
52068                      * @param {*}
52069                      *            value The value to search for.
52070                      * @returns {number} Returns `0` if `value` is found, else `-1`.
52071                      */
52072                     function cacheIndexOf(cache, value) {
52073                         var data = cache.data,
52074                             result = (typeof value == 'string' || isObject(value)) ? data.set.has(value) : data.hash[value];
52075
52076                         return result ? 0 : -1;
52077                     }
52078
52079                     /**
52080                      * Adds `value` to the cache.
52081                      * 
52082                      * @private
52083                      * @name push
52084                      * @memberOf SetCache
52085                      * @param {*}
52086                      *            value The value to cache.
52087                      */
52088                     function cachePush(value) {
52089                         var data = this.data;
52090                         if (typeof value == 'string' || isObject(value)) {
52091                             data.set.add(value);
52092                         } else {
52093                             data.hash[value] = true;
52094                         }
52095                     }
52096
52097                     /*------------------------------------------------------------------------*/
52098
52099                     /**
52100                      * Creates a new array joining `array` with `other`.
52101                      * 
52102                      * @private
52103                      * @param {Array}
52104                      *            array The array to join.
52105                      * @param {Array}
52106                      *            other The other array to join.
52107                      * @returns {Array} Returns the new concatenated array.
52108                      */
52109                     function arrayConcat(array, other) {
52110                         var index = -1,
52111                             length = array.length,
52112                             othIndex = -1,
52113                             othLength = other.length,
52114                             result = Array(length + othLength);
52115
52116                         while (++index < length) {
52117                             result[index] = array[index];
52118                         }
52119                         while (++othIndex < othLength) {
52120                             result[index++] = other[othIndex];
52121                         }
52122                         return result;
52123                     }
52124
52125                     /**
52126                      * Copies the values of `source` to `array`.
52127                      * 
52128                      * @private
52129                      * @param {Array}
52130                      *            source The array to copy values from.
52131                      * @param {Array}
52132                      *            [array=[]] The array to copy values to.
52133                      * @returns {Array} Returns `array`.
52134                      */
52135                     function arrayCopy(source, array) {
52136                         var index = -1,
52137                             length = source.length;
52138
52139                         array || (array = Array(length));
52140                         while (++index < length) {
52141                             array[index] = source[index];
52142                         }
52143                         return array;
52144                     }
52145
52146                     /**
52147                      * A specialized version of `_.forEach` for arrays without support for
52148                      * callback shorthands and `this` binding.
52149                      * 
52150                      * @private
52151                      * @param {Array}
52152                      *            array The array to iterate over.
52153                      * @param {Function}
52154                      *            iteratee The function invoked per iteration.
52155                      * @returns {Array} Returns `array`.
52156                      */
52157                     function arrayEach(array, iteratee) {
52158                         var index = -1,
52159                             length = array.length;
52160
52161                         while (++index < length) {
52162                             if (iteratee(array[index], index, array) === false) {
52163                                 break;
52164                             }
52165                         }
52166                         return array;
52167                     }
52168
52169                     /**
52170                      * A specialized version of `_.forEachRight` for arrays without support for
52171                      * callback shorthands and `this` binding.
52172                      * 
52173                      * @private
52174                      * @param {Array}
52175                      *            array The array to iterate over.
52176                      * @param {Function}
52177                      *            iteratee The function invoked per iteration.
52178                      * @returns {Array} Returns `array`.
52179                      */
52180                     function arrayEachRight(array, iteratee) {
52181                         var length = array.length;
52182
52183                         while (length--) {
52184                             if (iteratee(array[length], length, array) === false) {
52185                                 break;
52186                             }
52187                         }
52188                         return array;
52189                     }
52190
52191                     /**
52192                      * A specialized version of `_.every` for arrays without support for
52193                      * callback shorthands and `this` binding.
52194                      * 
52195                      * @private
52196                      * @param {Array}
52197                      *            array The array to iterate over.
52198                      * @param {Function}
52199                      *            predicate The function invoked per iteration.
52200                      * @returns {boolean} Returns `true` if all elements pass the predicate
52201                      *          check, else `false`.
52202                      */
52203                     function arrayEvery(array, predicate) {
52204                         var index = -1,
52205                             length = array.length;
52206
52207                         while (++index < length) {
52208                             if (!predicate(array[index], index, array)) {
52209                                 return false;
52210                             }
52211                         }
52212                         return true;
52213                     }
52214
52215                     /**
52216                      * A specialized version of `baseExtremum` for arrays which invokes
52217                      * `iteratee` with one argument: (value).
52218                      * 
52219                      * @private
52220                      * @param {Array}
52221                      *            array The array to iterate over.
52222                      * @param {Function}
52223                      *            iteratee The function invoked per iteration.
52224                      * @param {Function}
52225                      *            comparator The function used to compare values.
52226                      * @param {*}
52227                      *            exValue The initial extremum value.
52228                      * @returns {*} Returns the extremum value.
52229                      */
52230                     function arrayExtremum(array, iteratee, comparator, exValue) {
52231                         var index = -1,
52232                             length = array.length,
52233                             computed = exValue,
52234                             result = computed;
52235
52236                         while (++index < length) {
52237                             var value = array[index],
52238                                 current = +iteratee(value);
52239
52240                             if (comparator(current, computed)) {
52241                                 computed = current;
52242                                 result = value;
52243                             }
52244                         }
52245                         return result;
52246                     }
52247
52248                     /**
52249                      * A specialized version of `_.filter` for arrays without support for
52250                      * callback shorthands and `this` binding.
52251                      * 
52252                      * @private
52253                      * @param {Array}
52254                      *            array The array to iterate over.
52255                      * @param {Function}
52256                      *            predicate The function invoked per iteration.
52257                      * @returns {Array} Returns the new filtered array.
52258                      */
52259                     function arrayFilter(array, predicate) {
52260                         var index = -1,
52261                             length = array.length,
52262                             resIndex = -1,
52263                             result = [];
52264
52265                         while (++index < length) {
52266                             var value = array[index];
52267                             if (predicate(value, index, array)) {
52268                                 result[++resIndex] = value;
52269                             }
52270                         }
52271                         return result;
52272                     }
52273
52274                     /**
52275                      * A specialized version of `_.map` for arrays without support for callback
52276                      * shorthands and `this` binding.
52277                      * 
52278                      * @private
52279                      * @param {Array}
52280                      *            array The array to iterate over.
52281                      * @param {Function}
52282                      *            iteratee The function invoked per iteration.
52283                      * @returns {Array} Returns the new mapped array.
52284                      */
52285                     function arrayMap(array, iteratee) {
52286                         var index = -1,
52287                             length = array.length,
52288                             result = Array(length);
52289
52290                         while (++index < length) {
52291                             result[index] = iteratee(array[index], index, array);
52292                         }
52293                         return result;
52294                     }
52295
52296                     /**
52297                      * Appends the elements of `values` to `array`.
52298                      * 
52299                      * @private
52300                      * @param {Array}
52301                      *            array The array to modify.
52302                      * @param {Array}
52303                      *            values The values to append.
52304                      * @returns {Array} Returns `array`.
52305                      */
52306                     function arrayPush(array, values) {
52307                         var index = -1,
52308                             length = values.length,
52309                             offset = array.length;
52310
52311                         while (++index < length) {
52312                             array[offset + index] = values[index];
52313                         }
52314                         return array;
52315                     }
52316
52317                     /**
52318                      * A specialized version of `_.reduce` for arrays without support for
52319                      * callback shorthands and `this` binding.
52320                      * 
52321                      * @private
52322                      * @param {Array}
52323                      *            array The array to iterate over.
52324                      * @param {Function}
52325                      *            iteratee The function invoked per iteration.
52326                      * @param {*}
52327                      *            [accumulator] The initial value.
52328                      * @param {boolean}
52329                      *            [initFromArray] Specify using the first element of `array` as
52330                      *            the initial value.
52331                      * @returns {*} Returns the accumulated value.
52332                      */
52333                     function arrayReduce(array, iteratee, accumulator, initFromArray) {
52334                         var index = -1,
52335                             length = array.length;
52336
52337                         if (initFromArray && length) {
52338                             accumulator = array[++index];
52339                         }
52340                         while (++index < length) {
52341                             accumulator = iteratee(accumulator, array[index], index, array);
52342                         }
52343                         return accumulator;
52344                     }
52345
52346                     /**
52347                      * A specialized version of `_.reduceRight` for arrays without support for
52348                      * callback shorthands and `this` binding.
52349                      * 
52350                      * @private
52351                      * @param {Array}
52352                      *            array The array to iterate over.
52353                      * @param {Function}
52354                      *            iteratee The function invoked per iteration.
52355                      * @param {*}
52356                      *            [accumulator] The initial value.
52357                      * @param {boolean}
52358                      *            [initFromArray] Specify using the last element of `array` as
52359                      *            the initial value.
52360                      * @returns {*} Returns the accumulated value.
52361                      */
52362                     function arrayReduceRight(array, iteratee, accumulator, initFromArray) {
52363                         var length = array.length;
52364                         if (initFromArray && length) {
52365                             accumulator = array[--length];
52366                         }
52367                         while (length--) {
52368                             accumulator = iteratee(accumulator, array[length], length, array);
52369                         }
52370                         return accumulator;
52371                     }
52372
52373                     /**
52374                      * A specialized version of `_.some` for arrays without support for callback
52375                      * shorthands and `this` binding.
52376                      * 
52377                      * @private
52378                      * @param {Array}
52379                      *            array The array to iterate over.
52380                      * @param {Function}
52381                      *            predicate The function invoked per iteration.
52382                      * @returns {boolean} Returns `true` if any element passes the predicate
52383                      *          check, else `false`.
52384                      */
52385                     function arraySome(array, predicate) {
52386                         var index = -1,
52387                             length = array.length;
52388
52389                         while (++index < length) {
52390                             if (predicate(array[index], index, array)) {
52391                                 return true;
52392                             }
52393                         }
52394                         return false;
52395                     }
52396
52397                     /**
52398                      * A specialized version of `_.sum` for arrays without support for callback
52399                      * shorthands and `this` binding..
52400                      * 
52401                      * @private
52402                      * @param {Array}
52403                      *            array The array to iterate over.
52404                      * @param {Function}
52405                      *            iteratee The function invoked per iteration.
52406                      * @returns {number} Returns the sum.
52407                      */
52408                     function arraySum(array, iteratee) {
52409                         var length = array.length,
52410                             result = 0;
52411
52412                         while (length--) {
52413                             result += +iteratee(array[length]) || 0;
52414                         }
52415                         return result;
52416                     }
52417
52418                     /**
52419                      * Used by `_.defaults` to customize its `_.assign` use.
52420                      * 
52421                      * @private
52422                      * @param {*}
52423                      *            objectValue The destination object property value.
52424                      * @param {*}
52425                      *            sourceValue The source object property value.
52426                      * @returns {*} Returns the value to assign to the destination object.
52427                      */
52428                     function assignDefaults(objectValue, sourceValue) {
52429                         return objectValue === undefined ? sourceValue : objectValue;
52430                     }
52431
52432                     /**
52433                      * Used by `_.template` to customize its `_.assign` use.
52434                      * 
52435                      * **Note:** This function is like `assignDefaults` except that it ignores
52436                      * inherited property values when checking if a property is `undefined`.
52437                      * 
52438                      * @private
52439                      * @param {*}
52440                      *            objectValue The destination object property value.
52441                      * @param {*}
52442                      *            sourceValue The source object property value.
52443                      * @param {string}
52444                      *            key The key associated with the object and source values.
52445                      * @param {Object}
52446                      *            object The destination object.
52447                      * @returns {*} Returns the value to assign to the destination object.
52448                      */
52449                     function assignOwnDefaults(objectValue, sourceValue, key, object) {
52450                         return (objectValue === undefined || !hasOwnProperty.call(object, key)) ? sourceValue : objectValue;
52451                     }
52452
52453                     /**
52454                      * A specialized version of `_.assign` for customizing assigned values
52455                      * without support for argument juggling, multiple sources, and `this`
52456                      * binding `customizer` functions.
52457                      * 
52458                      * @private
52459                      * @param {Object}
52460                      *            object The destination object.
52461                      * @param {Object}
52462                      *            source The source object.
52463                      * @param {Function}
52464                      *            customizer The function to customize assigned values.
52465                      * @returns {Object} Returns `object`.
52466                      */
52467                     function assignWith(object, source, customizer) {
52468                         var index = -1,
52469                             props = keys(source),
52470                             length = props.length;
52471
52472                         while (++index < length) {
52473                             var key = props[index],
52474                                 value = object[key],
52475                                 result = customizer(value, source[key], key, object, source);
52476
52477                             if ((result === result ? (result !== value) : (value === value)) ||
52478                                 (value === undefined && !(key in object))) {
52479                                 object[key] = result;
52480                             }
52481                         }
52482                         return object;
52483                     }
52484
52485                     /**
52486                      * The base implementation of `_.assign` without support for argument
52487                      * juggling, multiple sources, and `customizer` functions.
52488                      * 
52489                      * @private
52490                      * @param {Object}
52491                      *            object The destination object.
52492                      * @param {Object}
52493                      *            source The source object.
52494                      * @returns {Object} Returns `object`.
52495                      */
52496                     function baseAssign(object, source) {
52497                         return source == null ? object : baseCopy(source, keys(source), object);
52498                     }
52499
52500                     /**
52501                      * The base implementation of `_.at` without support for string collections
52502                      * and individual key arguments.
52503                      * 
52504                      * @private
52505                      * @param {Array|Object}
52506                      *            collection The collection to iterate over.
52507                      * @param {number[]|string[]}
52508                      *            props The property names or indexes of elements to pick.
52509                      * @returns {Array} Returns the new array of picked elements.
52510                      */
52511                     function baseAt(collection, props) {
52512                         var index = -1,
52513                             isNil = collection == null,
52514                             isArr = !isNil && isArrayLike(collection),
52515                             length = isArr ? collection.length : 0,
52516                             propsLength = props.length,
52517                             result = Array(propsLength);
52518
52519                         while (++index < propsLength) {
52520                             var key = props[index];
52521                             if (isArr) {
52522                                 result[index] = isIndex(key, length) ? collection[key] : undefined;
52523                             } else {
52524                                 result[index] = isNil ? undefined : collection[key];
52525                             }
52526                         }
52527                         return result;
52528                     }
52529
52530                     /**
52531                      * Copies properties of `source` to `object`.
52532                      * 
52533                      * @private
52534                      * @param {Object}
52535                      *            source The object to copy properties from.
52536                      * @param {Array}
52537                      *            props The property names to copy.
52538                      * @param {Object}
52539                      *            [object={}] The object to copy properties to.
52540                      * @returns {Object} Returns `object`.
52541                      */
52542                     function baseCopy(source, props, object) {
52543                         object || (object = {});
52544
52545                         var index = -1,
52546                             length = props.length;
52547
52548                         while (++index < length) {
52549                             var key = props[index];
52550                             object[key] = source[key];
52551                         }
52552                         return object;
52553                     }
52554
52555                     /**
52556                      * The base implementation of `_.callback` which supports specifying the
52557                      * number of arguments to provide to `func`.
52558                      * 
52559                      * @private
52560                      * @param {*}
52561                      *            [func=_.identity] The value to convert to a callback.
52562                      * @param {*}
52563                      *            [thisArg] The `this` binding of `func`.
52564                      * @param {number}
52565                      *            [argCount] The number of arguments to provide to `func`.
52566                      * @returns {Function} Returns the callback.
52567                      */
52568                     function baseCallback(func, thisArg, argCount) {
52569                         var type = typeof func;
52570                         if (type == 'function') {
52571                             return thisArg === undefined ? func : bindCallback(func, thisArg, argCount);
52572                         }
52573                         if (func == null) {
52574                             return identity;
52575                         }
52576                         if (type == 'object') {
52577                             return baseMatches(func);
52578                         }
52579                         return thisArg === undefined ? property(func) : baseMatchesProperty(func, thisArg);
52580                     }
52581
52582                     /**
52583                      * The base implementation of `_.clone` without support for argument
52584                      * juggling and `this` binding `customizer` functions.
52585                      * 
52586                      * @private
52587                      * @param {*}
52588                      *            value The value to clone.
52589                      * @param {boolean}
52590                      *            [isDeep] Specify a deep clone.
52591                      * @param {Function}
52592                      *            [customizer] The function to customize cloning values.
52593                      * @param {string}
52594                      *            [key] The key of `value`.
52595                      * @param {Object}
52596                      *            [object] The object `value` belongs to.
52597                      * @param {Array}
52598                      *            [stackA=[]] Tracks traversed source objects.
52599                      * @param {Array}
52600                      *            [stackB=[]] Associates clones with source counterparts.
52601                      * @returns {*} Returns the cloned value.
52602                      */
52603                     function baseClone(value, isDeep, customizer, key, object, stackA, stackB) {
52604                         var result;
52605                         if (customizer) {
52606                             result = object ? customizer(value, key, object) : customizer(value);
52607                         }
52608                         if (result !== undefined) {
52609                             return result;
52610                         }
52611                         if (!isObject(value)) {
52612                             return value;
52613                         }
52614                         var isArr = isArray(value);
52615                         if (isArr) {
52616                             result = initCloneArray(value);
52617                             if (!isDeep) {
52618                                 return arrayCopy(value, result);
52619                             }
52620                         } else {
52621                             var tag = objToString.call(value),
52622                                 isFunc = tag == funcTag;
52623
52624                             if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
52625                                 result = initCloneObject(isFunc ? {} : value);
52626                                 if (!isDeep) {
52627                                     return baseAssign(result, value);
52628                                 }
52629                             } else {
52630                                 return cloneableTags[tag] ? initCloneByTag(value, tag, isDeep) : (object ? value : {});
52631                             }
52632                         }
52633                         // Check for circular references and return its corresponding clone.
52634                         stackA || (stackA = []);
52635                         stackB || (stackB = []);
52636
52637                         var length = stackA.length;
52638                         while (length--) {
52639                             if (stackA[length] == value) {
52640                                 return stackB[length];
52641                             }
52642                         }
52643                         // Add the source value to the stack of traversed objects and associate
52644                         // it with its clone.
52645                         stackA.push(value);
52646                         stackB.push(result);
52647
52648                         // Recursively populate clone (susceptible to call stack limits).
52649                         (isArr ? arrayEach : baseForOwn)(value, function(subValue, key) {
52650                             result[key] = baseClone(subValue, isDeep, customizer, key, value, stackA, stackB);
52651                         });
52652                         return result;
52653                     }
52654
52655                     /**
52656                      * The base implementation of `_.create` without support for assigning
52657                      * properties to the created object.
52658                      * 
52659                      * @private
52660                      * @param {Object}
52661                      *            prototype The object to inherit from.
52662                      * @returns {Object} Returns the new object.
52663                      */
52664                     var baseCreate = (function() {
52665                         function object() {}
52666                         return function(prototype) {
52667                             if (isObject(prototype)) {
52668                                 object.prototype = prototype;
52669                                 var result = new object;
52670                                 object.prototype = undefined;
52671                             }
52672                             return result || {};
52673                         };
52674                     }());
52675
52676                     /**
52677                      * The base implementation of `_.delay` and `_.defer` which accepts an index
52678                      * of where to slice the arguments to provide to `func`.
52679                      * 
52680                      * @private
52681                      * @param {Function}
52682                      *            func The function to delay.
52683                      * @param {number}
52684                      *            wait The number of milliseconds to delay invocation.
52685                      * @param {Object}
52686                      *            args The arguments provide to `func`.
52687                      * @returns {number} Returns the timer id.
52688                      */
52689                     function baseDelay(func, wait, args) {
52690                         if (typeof func != 'function') {
52691                             throw new TypeError(FUNC_ERROR_TEXT);
52692                         }
52693                         return setTimeout(function() {
52694                             func.apply(undefined, args);
52695                         }, wait);
52696                     }
52697
52698                     /**
52699                      * The base implementation of `_.difference` which accepts a single array of
52700                      * values to exclude.
52701                      * 
52702                      * @private
52703                      * @param {Array}
52704                      *            array The array to inspect.
52705                      * @param {Array}
52706                      *            values The values to exclude.
52707                      * @returns {Array} Returns the new array of filtered values.
52708                      */
52709                     function baseDifference(array, values) {
52710                         var length = array ? array.length : 0,
52711                             result = [];
52712
52713                         if (!length) {
52714                             return result;
52715                         }
52716                         var index = -1,
52717                             indexOf = getIndexOf(),
52718                             isCommon = indexOf == baseIndexOf,
52719                             cache = (isCommon && values.length >= LARGE_ARRAY_SIZE) ? createCache(values) : null,
52720                             valuesLength = values.length;
52721
52722                         if (cache) {
52723                             indexOf = cacheIndexOf;
52724                             isCommon = false;
52725                             values = cache;
52726                         }
52727                         outer:
52728                             while (++index < length) {
52729                                 var value = array[index];
52730
52731                                 if (isCommon && value === value) {
52732                                     var valuesIndex = valuesLength;
52733                                     while (valuesIndex--) {
52734                                         if (values[valuesIndex] === value) {
52735                                             continue outer;
52736                                         }
52737                                     }
52738                                     result.push(value);
52739                                 } else if (indexOf(values, value, 0) < 0) {
52740                                     result.push(value);
52741                                 }
52742                             }
52743                         return result;
52744                     }
52745
52746                     /**
52747                      * The base implementation of `_.forEach` without support for callback
52748                      * shorthands and `this` binding.
52749                      * 
52750                      * @private
52751                      * @param {Array|Object|string}
52752                      *            collection The collection to iterate over.
52753                      * @param {Function}
52754                      *            iteratee The function invoked per iteration.
52755                      * @returns {Array|Object|string} Returns `collection`.
52756                      */
52757                     var baseEach = createBaseEach(baseForOwn);
52758
52759                     /**
52760                      * The base implementation of `_.forEachRight` without support for callback
52761                      * shorthands and `this` binding.
52762                      * 
52763                      * @private
52764                      * @param {Array|Object|string}
52765                      *            collection The collection to iterate over.
52766                      * @param {Function}
52767                      *            iteratee The function invoked per iteration.
52768                      * @returns {Array|Object|string} Returns `collection`.
52769                      */
52770                     var baseEachRight = createBaseEach(baseForOwnRight, true);
52771
52772                     /**
52773                      * The base implementation of `_.every` without support for callback
52774                      * shorthands and `this` binding.
52775                      * 
52776                      * @private
52777                      * @param {Array|Object|string}
52778                      *            collection The collection to iterate over.
52779                      * @param {Function}
52780                      *            predicate The function invoked per iteration.
52781                      * @returns {boolean} Returns `true` if all elements pass the predicate
52782                      *          check, else `false`
52783                      */
52784                     function baseEvery(collection, predicate) {
52785                         var result = true;
52786                         baseEach(collection, function(value, index, collection) {
52787                             result = !!predicate(value, index, collection);
52788                             return result;
52789                         });
52790                         return result;
52791                     }
52792
52793                     /**
52794                      * Gets the extremum value of `collection` invoking `iteratee` for each
52795                      * value in `collection` to generate the criterion by which the value is
52796                      * ranked. The `iteratee` is invoked with three arguments: (value,
52797                      * index|key, collection).
52798                      * 
52799                      * @private
52800                      * @param {Array|Object|string}
52801                      *            collection The collection to iterate over.
52802                      * @param {Function}
52803                      *            iteratee The function invoked per iteration.
52804                      * @param {Function}
52805                      *            comparator The function used to compare values.
52806                      * @param {*}
52807                      *            exValue The initial extremum value.
52808                      * @returns {*} Returns the extremum value.
52809                      */
52810                     function baseExtremum(collection, iteratee, comparator, exValue) {
52811                         var computed = exValue,
52812                             result = computed;
52813
52814                         baseEach(collection, function(value, index, collection) {
52815                             var current = +iteratee(value, index, collection);
52816                             if (comparator(current, computed) || (current === exValue && current === result)) {
52817                                 computed = current;
52818                                 result = value;
52819                             }
52820                         });
52821                         return result;
52822                     }
52823
52824                     /**
52825                      * The base implementation of `_.fill` without an iteratee call guard.
52826                      * 
52827                      * @private
52828                      * @param {Array}
52829                      *            array The array to fill.
52830                      * @param {*}
52831                      *            value The value to fill `array` with.
52832                      * @param {number}
52833                      *            [start=0] The start position.
52834                      * @param {number}
52835                      *            [end=array.length] The end position.
52836                      * @returns {Array} Returns `array`.
52837                      */
52838                     function baseFill(array, value, start, end) {
52839                         var length = array.length;
52840
52841                         start = start == null ? 0 : (+start || 0);
52842                         if (start < 0) {
52843                             start = -start > length ? 0 : (length + start);
52844                         }
52845                         end = (end === undefined || end > length) ? length : (+end || 0);
52846                         if (end < 0) {
52847                             end += length;
52848                         }
52849                         length = start > end ? 0 : (end >>> 0);
52850                         start >>>= 0;
52851
52852                         while (start < length) {
52853                             array[start++] = value;
52854                         }
52855                         return array;
52856                     }
52857
52858                     /**
52859                      * The base implementation of `_.filter` without support for callback
52860                      * shorthands and `this` binding.
52861                      * 
52862                      * @private
52863                      * @param {Array|Object|string}
52864                      *            collection The collection to iterate over.
52865                      * @param {Function}
52866                      *            predicate The function invoked per iteration.
52867                      * @returns {Array} Returns the new filtered array.
52868                      */
52869                     function baseFilter(collection, predicate) {
52870                         var result = [];
52871                         baseEach(collection, function(value, index, collection) {
52872                             if (predicate(value, index, collection)) {
52873                                 result.push(value);
52874                             }
52875                         });
52876                         return result;
52877                     }
52878
52879                     /**
52880                      * The base implementation of `_.find`, `_.findLast`, `_.findKey`, and
52881                      * `_.findLastKey`, without support for callback shorthands and `this`
52882                      * binding, which iterates over `collection` using the provided `eachFunc`.
52883                      * 
52884                      * @private
52885                      * @param {Array|Object|string}
52886                      *            collection The collection to search.
52887                      * @param {Function}
52888                      *            predicate The function invoked per iteration.
52889                      * @param {Function}
52890                      *            eachFunc The function to iterate over `collection`.
52891                      * @param {boolean}
52892                      *            [retKey] Specify returning the key of the found element
52893                      *            instead of the element itself.
52894                      * @returns {*} Returns the found element or its key, else `undefined`.
52895                      */
52896                     function baseFind(collection, predicate, eachFunc, retKey) {
52897                         var result;
52898                         eachFunc(collection, function(value, key, collection) {
52899                             if (predicate(value, key, collection)) {
52900                                 result = retKey ? key : value;
52901                                 return false;
52902                             }
52903                         });
52904                         return result;
52905                     }
52906
52907                     /**
52908                      * The base implementation of `_.flatten` with added support for restricting
52909                      * flattening and specifying the start index.
52910                      * 
52911                      * @private
52912                      * @param {Array}
52913                      *            array The array to flatten.
52914                      * @param {boolean}
52915                      *            [isDeep] Specify a deep flatten.
52916                      * @param {boolean}
52917                      *            [isStrict] Restrict flattening to arrays-like objects.
52918                      * @param {Array}
52919                      *            [result=[]] The initial result value.
52920                      * @returns {Array} Returns the new flattened array.
52921                      */
52922                     function baseFlatten(array, isDeep, isStrict, result) {
52923                         result || (result = []);
52924
52925                         var index = -1,
52926                             length = array.length;
52927
52928                         while (++index < length) {
52929                             var value = array[index];
52930                             if (isObjectLike(value) && isArrayLike(value) &&
52931                                 (isStrict || isArray(value) || isArguments(value))) {
52932                                 if (isDeep) {
52933                                     // Recursively flatten arrays (susceptible to call stack limits).
52934                                     baseFlatten(value, isDeep, isStrict, result);
52935                                 } else {
52936                                     arrayPush(result, value);
52937                                 }
52938                             } else if (!isStrict) {
52939                                 result[result.length] = value;
52940                             }
52941                         }
52942                         return result;
52943                     }
52944
52945                     /**
52946                      * The base implementation of `baseForIn` and `baseForOwn` which iterates
52947                      * over `object` properties returned by `keysFunc` invoking `iteratee` for
52948                      * each property. Iteratee functions may exit iteration early by explicitly
52949                      * returning `false`.
52950                      * 
52951                      * @private
52952                      * @param {Object}
52953                      *            object The object to iterate over.
52954                      * @param {Function}
52955                      *            iteratee The function invoked per iteration.
52956                      * @param {Function}
52957                      *            keysFunc The function to get the keys of `object`.
52958                      * @returns {Object} Returns `object`.
52959                      */
52960                     var baseFor = createBaseFor();
52961
52962                     /**
52963                      * This function is like `baseFor` except that it iterates over properties
52964                      * in the opposite order.
52965                      * 
52966                      * @private
52967                      * @param {Object}
52968                      *            object The object to iterate over.
52969                      * @param {Function}
52970                      *            iteratee The function invoked per iteration.
52971                      * @param {Function}
52972                      *            keysFunc The function to get the keys of `object`.
52973                      * @returns {Object} Returns `object`.
52974                      */
52975                     var baseForRight = createBaseFor(true);
52976
52977                     /**
52978                      * The base implementation of `_.forIn` without support for callback
52979                      * shorthands and `this` binding.
52980                      * 
52981                      * @private
52982                      * @param {Object}
52983                      *            object The object to iterate over.
52984                      * @param {Function}
52985                      *            iteratee The function invoked per iteration.
52986                      * @returns {Object} Returns `object`.
52987                      */
52988                     function baseForIn(object, iteratee) {
52989                         return baseFor(object, iteratee, keysIn);
52990                     }
52991
52992                     /**
52993                      * The base implementation of `_.forOwn` without support for callback
52994                      * shorthands and `this` binding.
52995                      * 
52996                      * @private
52997                      * @param {Object}
52998                      *            object The object to iterate over.
52999                      * @param {Function}
53000                      *            iteratee The function invoked per iteration.
53001                      * @returns {Object} Returns `object`.
53002                      */
53003                     function baseForOwn(object, iteratee) {
53004                         return baseFor(object, iteratee, keys);
53005                     }
53006
53007                     /**
53008                      * The base implementation of `_.forOwnRight` without support for callback
53009                      * shorthands and `this` binding.
53010                      * 
53011                      * @private
53012                      * @param {Object}
53013                      *            object The object to iterate over.
53014                      * @param {Function}
53015                      *            iteratee The function invoked per iteration.
53016                      * @returns {Object} Returns `object`.
53017                      */
53018                     function baseForOwnRight(object, iteratee) {
53019                         return baseForRight(object, iteratee, keys);
53020                     }
53021
53022                     /**
53023                      * The base implementation of `_.functions` which creates an array of
53024                      * `object` function property names filtered from those provided.
53025                      * 
53026                      * @private
53027                      * @param {Object}
53028                      *            object The object to inspect.
53029                      * @param {Array}
53030                      *            props The property names to filter.
53031                      * @returns {Array} Returns the new array of filtered property names.
53032                      */
53033                     function baseFunctions(object, props) {
53034                         var index = -1,
53035                             length = props.length,
53036                             resIndex = -1,
53037                             result = [];
53038
53039                         while (++index < length) {
53040                             var key = props[index];
53041                             if (isFunction(object[key])) {
53042                                 result[++resIndex] = key;
53043                             }
53044                         }
53045                         return result;
53046                     }
53047
53048                     /**
53049                      * The base implementation of `get` without support for string paths and
53050                      * default values.
53051                      * 
53052                      * @private
53053                      * @param {Object}
53054                      *            object The object to query.
53055                      * @param {Array}
53056                      *            path The path of the property to get.
53057                      * @param {string}
53058                      *            [pathKey] The key representation of path.
53059                      * @returns {*} Returns the resolved value.
53060                      */
53061                     function baseGet(object, path, pathKey) {
53062                         if (object == null) {
53063                             return;
53064                         }
53065                         if (pathKey !== undefined && pathKey in toObject(object)) {
53066                             path = [pathKey];
53067                         }
53068                         var index = 0,
53069                             length = path.length;
53070
53071                         while (object != null && index < length) {
53072                             object = object[path[index++]];
53073                         }
53074                         return (index && index == length) ? object : undefined;
53075                     }
53076
53077                     /**
53078                      * The base implementation of `_.isEqual` without support for `this` binding
53079                      * `customizer` functions.
53080                      * 
53081                      * @private
53082                      * @param {*}
53083                      *            value The value to compare.
53084                      * @param {*}
53085                      *            other The other value to compare.
53086                      * @param {Function}
53087                      *            [customizer] The function to customize comparing values.
53088                      * @param {boolean}
53089                      *            [isLoose] Specify performing partial comparisons.
53090                      * @param {Array}
53091                      *            [stackA] Tracks traversed `value` objects.
53092                      * @param {Array}
53093                      *            [stackB] Tracks traversed `other` objects.
53094                      * @returns {boolean} Returns `true` if the values are equivalent, else
53095                      *          `false`.
53096                      */
53097                     function baseIsEqual(value, other, customizer, isLoose, stackA, stackB) {
53098                         if (value === other) {
53099                             return true;
53100                         }
53101                         if (value == null || other == null || (!isObject(value) && !isObjectLike(other))) {
53102                             return value !== value && other !== other;
53103                         }
53104                         return baseIsEqualDeep(value, other, baseIsEqual, customizer, isLoose, stackA, stackB);
53105                     }
53106
53107                     /**
53108                      * A specialized version of `baseIsEqual` for arrays and objects which
53109                      * performs deep comparisons and tracks traversed objects enabling objects
53110                      * with circular references to be compared.
53111                      * 
53112                      * @private
53113                      * @param {Object}
53114                      *            object The object to compare.
53115                      * @param {Object}
53116                      *            other The other object to compare.
53117                      * @param {Function}
53118                      *            equalFunc The function to determine equivalents of values.
53119                      * @param {Function}
53120                      *            [customizer] The function to customize comparing objects.
53121                      * @param {boolean}
53122                      *            [isLoose] Specify performing partial comparisons.
53123                      * @param {Array}
53124                      *            [stackA=[]] Tracks traversed `value` objects.
53125                      * @param {Array}
53126                      *            [stackB=[]] Tracks traversed `other` objects.
53127                      * @returns {boolean} Returns `true` if the objects are equivalent, else
53128                      *          `false`.
53129                      */
53130                     function baseIsEqualDeep(object, other, equalFunc, customizer, isLoose, stackA, stackB) {
53131                         var objIsArr = isArray(object),
53132                             othIsArr = isArray(other),
53133                             objTag = arrayTag,
53134                             othTag = arrayTag;
53135
53136                         if (!objIsArr) {
53137                             objTag = objToString.call(object);
53138                             if (objTag == argsTag) {
53139                                 objTag = objectTag;
53140                             } else if (objTag != objectTag) {
53141                                 objIsArr = isTypedArray(object);
53142                             }
53143                         }
53144                         if (!othIsArr) {
53145                             othTag = objToString.call(other);
53146                             if (othTag == argsTag) {
53147                                 othTag = objectTag;
53148                             } else if (othTag != objectTag) {
53149                                 othIsArr = isTypedArray(other);
53150                             }
53151                         }
53152                         var objIsObj = objTag == objectTag,
53153                             othIsObj = othTag == objectTag,
53154                             isSameTag = objTag == othTag;
53155
53156                         if (isSameTag && !(objIsArr || objIsObj)) {
53157                             return equalByTag(object, other, objTag);
53158                         }
53159                         if (!isLoose) {
53160                             var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
53161                                 othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
53162
53163                             if (objIsWrapped || othIsWrapped) {
53164                                 return equalFunc(objIsWrapped ? object.value() : object, othIsWrapped ? other.value() : other, customizer, isLoose, stackA, stackB);
53165                             }
53166                         }
53167                         if (!isSameTag) {
53168                             return false;
53169                         }
53170                         // Assume cyclic values are equal.
53171                         // For more information on detecting circular references see
53172                         // https://es5.github.io/#JO.
53173                         stackA || (stackA = []);
53174                         stackB || (stackB = []);
53175
53176                         var length = stackA.length;
53177                         while (length--) {
53178                             if (stackA[length] == object) {
53179                                 return stackB[length] == other;
53180                             }
53181                         }
53182                         // Add `object` and `other` to the stack of traversed objects.
53183                         stackA.push(object);
53184                         stackB.push(other);
53185
53186                         var result = (objIsArr ? equalArrays : equalObjects)(object, other, equalFunc, customizer, isLoose, stackA, stackB);
53187
53188                         stackA.pop();
53189                         stackB.pop();
53190
53191                         return result;
53192                     }
53193
53194                     /**
53195                      * The base implementation of `_.isMatch` without support for callback
53196                      * shorthands and `this` binding.
53197                      * 
53198                      * @private
53199                      * @param {Object}
53200                      *            object The object to inspect.
53201                      * @param {Array}
53202                      *            matchData The propery names, values, and compare flags to
53203                      *            match.
53204                      * @param {Function}
53205                      *            [customizer] The function to customize comparing objects.
53206                      * @returns {boolean} Returns `true` if `object` is a match, else `false`.
53207                      */
53208                     function baseIsMatch(object, matchData, customizer) {
53209                         var index = matchData.length,
53210                             length = index,
53211                             noCustomizer = !customizer;
53212
53213                         if (object == null) {
53214                             return !length;
53215                         }
53216                         object = toObject(object);
53217                         while (index--) {
53218                             var data = matchData[index];
53219                             if ((noCustomizer && data[2]) ? data[1] !== object[data[0]] : !(data[0] in object)) {
53220                                 return false;
53221                             }
53222                         }
53223                         while (++index < length) {
53224                             data = matchData[index];
53225                             var key = data[0],
53226                                 objValue = object[key],
53227                                 srcValue = data[1];
53228
53229                             if (noCustomizer && data[2]) {
53230                                 if (objValue === undefined && !(key in object)) {
53231                                     return false;
53232                                 }
53233                             } else {
53234                                 var result = customizer ? customizer(objValue, srcValue, key) : undefined;
53235                                 if (!(result === undefined ? baseIsEqual(srcValue, objValue, customizer, true) : result)) {
53236                                     return false;
53237                                 }
53238                             }
53239                         }
53240                         return true;
53241                     }
53242
53243                     /**
53244                      * The base implementation of `_.map` without support for callback
53245                      * shorthands and `this` binding.
53246                      * 
53247                      * @private
53248                      * @param {Array|Object|string}
53249                      *            collection The collection to iterate over.
53250                      * @param {Function}
53251                      *            iteratee The function invoked per iteration.
53252                      * @returns {Array} Returns the new mapped array.
53253                      */
53254                     function baseMap(collection, iteratee) {
53255                         var index = -1,
53256                             result = isArrayLike(collection) ? Array(collection.length) : [];
53257
53258                         baseEach(collection, function(value, key, collection) {
53259                             result[++index] = iteratee(value, key, collection);
53260                         });
53261                         return result;
53262                     }
53263
53264                     /**
53265                      * The base implementation of `_.matches` which does not clone `source`.
53266                      * 
53267                      * @private
53268                      * @param {Object}
53269                      *            source The object of property values to match.
53270                      * @returns {Function} Returns the new function.
53271                      */
53272                     function baseMatches(source) {
53273                         var matchData = getMatchData(source);
53274                         if (matchData.length == 1 && matchData[0][2]) {
53275                             var key = matchData[0][0],
53276                                 value = matchData[0][1];
53277
53278                             return function(object) {
53279                                 if (object == null) {
53280                                     return false;
53281                                 }
53282                                 return object[key] === value && (value !== undefined || (key in toObject(object)));
53283                             };
53284                         }
53285                         return function(object) {
53286                             return baseIsMatch(object, matchData);
53287                         };
53288                     }
53289
53290                     /**
53291                      * The base implementation of `_.matchesProperty` which does not clone
53292                      * `srcValue`.
53293                      * 
53294                      * @private
53295                      * @param {string}
53296                      *            path The path of the property to get.
53297                      * @param {*}
53298                      *            srcValue The value to compare.
53299                      * @returns {Function} Returns the new function.
53300                      */
53301                     function baseMatchesProperty(path, srcValue) {
53302                         var isArr = isArray(path),
53303                             isCommon = isKey(path) && isStrictComparable(srcValue),
53304                             pathKey = (path + '');
53305
53306                         path = toPath(path);
53307                         return function(object) {
53308                             if (object == null) {
53309                                 return false;
53310                             }
53311                             var key = pathKey;
53312                             object = toObject(object);
53313                             if ((isArr || !isCommon) && !(key in object)) {
53314                                 object = path.length == 1 ? object : baseGet(object, baseSlice(path, 0, -1));
53315                                 if (object == null) {
53316                                     return false;
53317                                 }
53318                                 key = last(path);
53319                                 object = toObject(object);
53320                             }
53321                             return object[key] === srcValue ? (srcValue !== undefined || (key in object)) : baseIsEqual(srcValue, object[key], undefined, true);
53322                         };
53323                     }
53324
53325                     /**
53326                      * The base implementation of `_.merge` without support for argument
53327                      * juggling, multiple sources, and `this` binding `customizer` functions.
53328                      * 
53329                      * @private
53330                      * @param {Object}
53331                      *            object The destination object.
53332                      * @param {Object}
53333                      *            source The source object.
53334                      * @param {Function}
53335                      *            [customizer] The function to customize merged values.
53336                      * @param {Array}
53337                      *            [stackA=[]] Tracks traversed source objects.
53338                      * @param {Array}
53339                      *            [stackB=[]] Associates values with source counterparts.
53340                      * @returns {Object} Returns `object`.
53341                      */
53342                     function baseMerge(object, source, customizer, stackA, stackB) {
53343                         if (!isObject(object)) {
53344                             return object;
53345                         }
53346                         var isSrcArr = isArrayLike(source) && (isArray(source) || isTypedArray(source)),
53347                             props = isSrcArr ? undefined : keys(source);
53348
53349                         arrayEach(props || source, function(srcValue, key) {
53350                             if (props) {
53351                                 key = srcValue;
53352                                 srcValue = source[key];
53353                             }
53354                             if (isObjectLike(srcValue)) {
53355                                 stackA || (stackA = []);
53356                                 stackB || (stackB = []);
53357                                 baseMergeDeep(object, source, key, baseMerge, customizer, stackA, stackB);
53358                             } else {
53359                                 var value = object[key],
53360                                     result = customizer ? customizer(value, srcValue, key, object, source) : undefined,
53361                                     isCommon = result === undefined;
53362
53363                                 if (isCommon) {
53364                                     result = srcValue;
53365                                 }
53366                                 if ((result !== undefined || (isSrcArr && !(key in object))) &&
53367                                     (isCommon || (result === result ? (result !== value) : (value === value)))) {
53368                                     object[key] = result;
53369                                 }
53370                             }
53371                         });
53372                         return object;
53373                     }
53374
53375                     /**
53376                      * A specialized version of `baseMerge` for arrays and objects which
53377                      * performs deep merges and tracks traversed objects enabling objects with
53378                      * circular references to be merged.
53379                      * 
53380                      * @private
53381                      * @param {Object}
53382                      *            object The destination object.
53383                      * @param {Object}
53384                      *            source The source object.
53385                      * @param {string}
53386                      *            key The key of the value to merge.
53387                      * @param {Function}
53388                      *            mergeFunc The function to merge values.
53389                      * @param {Function}
53390                      *            [customizer] The function to customize merged values.
53391                      * @param {Array}
53392                      *            [stackA=[]] Tracks traversed source objects.
53393                      * @param {Array}
53394                      *            [stackB=[]] Associates values with source counterparts.
53395                      * @returns {boolean} Returns `true` if the objects are equivalent, else
53396                      *          `false`.
53397                      */
53398                     function baseMergeDeep(object, source, key, mergeFunc, customizer, stackA, stackB) {
53399                         var length = stackA.length,
53400                             srcValue = source[key];
53401
53402                         while (length--) {
53403                             if (stackA[length] == srcValue) {
53404                                 object[key] = stackB[length];
53405                                 return;
53406                             }
53407                         }
53408                         var value = object[key],
53409                             result = customizer ? customizer(value, srcValue, key, object, source) : undefined,
53410                             isCommon = result === undefined;
53411
53412                         if (isCommon) {
53413                             result = srcValue;
53414                             if (isArrayLike(srcValue) && (isArray(srcValue) || isTypedArray(srcValue))) {
53415                                 result = isArray(value) ? value : (isArrayLike(value) ? arrayCopy(value) : []);
53416                             } else if (isPlainObject(srcValue) || isArguments(srcValue)) {
53417                                 result = isArguments(value) ? toPlainObject(value) : (isPlainObject(value) ? value : {});
53418                             } else {
53419                                 isCommon = false;
53420                             }
53421                         }
53422                         // Add the source value to the stack of traversed objects and associate
53423                         // it with its merged value.
53424                         stackA.push(srcValue);
53425                         stackB.push(result);
53426
53427                         if (isCommon) {
53428                             // Recursively merge objects and arrays (susceptible to call stack
53429                             // limits).
53430                             object[key] = mergeFunc(result, srcValue, customizer, stackA, stackB);
53431                         } else if (result === result ? (result !== value) : (value === value)) {
53432                             object[key] = result;
53433                         }
53434                     }
53435
53436                     /**
53437                      * The base implementation of `_.property` without support for deep paths.
53438                      * 
53439                      * @private
53440                      * @param {string}
53441                      *            key The key of the property to get.
53442                      * @returns {Function} Returns the new function.
53443                      */
53444                     function baseProperty(key) {
53445                         return function(object) {
53446                             return object == null ? undefined : object[key];
53447                         };
53448                     }
53449
53450                     /**
53451                      * A specialized version of `baseProperty` which supports deep paths.
53452                      * 
53453                      * @private
53454                      * @param {Array|string}
53455                      *            path The path of the property to get.
53456                      * @returns {Function} Returns the new function.
53457                      */
53458                     function basePropertyDeep(path) {
53459                         var pathKey = (path + '');
53460                         path = toPath(path);
53461                         return function(object) {
53462                             return baseGet(object, path, pathKey);
53463                         };
53464                     }
53465
53466                     /**
53467                      * The base implementation of `_.pullAt` without support for individual
53468                      * index arguments and capturing the removed elements.
53469                      * 
53470                      * @private
53471                      * @param {Array}
53472                      *            array The array to modify.
53473                      * @param {number[]}
53474                      *            indexes The indexes of elements to remove.
53475                      * @returns {Array} Returns `array`.
53476                      */
53477                     function basePullAt(array, indexes) {
53478                         var length = array ? indexes.length : 0;
53479                         while (length--) {
53480                             var index = indexes[length];
53481                             if (index != previous && isIndex(index)) {
53482                                 var previous = index;
53483                                 splice.call(array, index, 1);
53484                             }
53485                         }
53486                         return array;
53487                     }
53488
53489                     /**
53490                      * The base implementation of `_.random` without support for argument
53491                      * juggling and returning floating-point numbers.
53492                      * 
53493                      * @private
53494                      * @param {number}
53495                      *            min The minimum possible value.
53496                      * @param {number}
53497                      *            max The maximum possible value.
53498                      * @returns {number} Returns the random number.
53499                      */
53500                     function baseRandom(min, max) {
53501                         return min + nativeFloor(nativeRandom() * (max - min + 1));
53502                     }
53503
53504                     /**
53505                      * The base implementation of `_.reduce` and `_.reduceRight` without support
53506                      * for callback shorthands and `this` binding, which iterates over
53507                      * `collection` using the provided `eachFunc`.
53508                      * 
53509                      * @private
53510                      * @param {Array|Object|string}
53511                      *            collection The collection to iterate over.
53512                      * @param {Function}
53513                      *            iteratee The function invoked per iteration.
53514                      * @param {*}
53515                      *            accumulator The initial value.
53516                      * @param {boolean}
53517                      *            initFromCollection Specify using the first or last element of
53518                      *            `collection` as the initial value.
53519                      * @param {Function}
53520                      *            eachFunc The function to iterate over `collection`.
53521                      * @returns {*} Returns the accumulated value.
53522                      */
53523                     function baseReduce(collection, iteratee, accumulator, initFromCollection, eachFunc) {
53524                         eachFunc(collection, function(value, index, collection) {
53525                             accumulator = initFromCollection ? (initFromCollection = false, value) : iteratee(accumulator, value, index, collection);
53526                         });
53527                         return accumulator;
53528                     }
53529
53530                     /**
53531                      * The base implementation of `setData` without support for hot loop
53532                      * detection.
53533                      * 
53534                      * @private
53535                      * @param {Function}
53536                      *            func The function to associate metadata with.
53537                      * @param {*}
53538                      *            data The metadata.
53539                      * @returns {Function} Returns `func`.
53540                      */
53541                     var baseSetData = !metaMap ? identity : function(func, data) {
53542                         metaMap.set(func, data);
53543                         return func;
53544                     };
53545
53546                     /**
53547                      * The base implementation of `_.slice` without an iteratee call guard.
53548                      * 
53549                      * @private
53550                      * @param {Array}
53551                      *            array The array to slice.
53552                      * @param {number}
53553                      *            [start=0] The start position.
53554                      * @param {number}
53555                      *            [end=array.length] The end position.
53556                      * @returns {Array} Returns the slice of `array`.
53557                      */
53558                     function baseSlice(array, start, end) {
53559                         var index = -1,
53560                             length = array.length;
53561
53562                         start = start == null ? 0 : (+start || 0);
53563                         if (start < 0) {
53564                             start = -start > length ? 0 : (length + start);
53565                         }
53566                         end = (end === undefined || end > length) ? length : (+end || 0);
53567                         if (end < 0) {
53568                             end += length;
53569                         }
53570                         length = start > end ? 0 : ((end - start) >>> 0);
53571                         start >>>= 0;
53572
53573                         var result = Array(length);
53574                         while (++index < length) {
53575                             result[index] = array[index + start];
53576                         }
53577                         return result;
53578                     }
53579
53580                     /**
53581                      * The base implementation of `_.some` without support for callback
53582                      * shorthands and `this` binding.
53583                      * 
53584                      * @private
53585                      * @param {Array|Object|string}
53586                      *            collection The collection to iterate over.
53587                      * @param {Function}
53588                      *            predicate The function invoked per iteration.
53589                      * @returns {boolean} Returns `true` if any element passes the predicate
53590                      *          check, else `false`.
53591                      */
53592                     function baseSome(collection, predicate) {
53593                         var result;
53594
53595                         baseEach(collection, function(value, index, collection) {
53596                             result = predicate(value, index, collection);
53597                             return !result;
53598                         });
53599                         return !!result;
53600                     }
53601
53602                     /**
53603                      * The base implementation of `_.sortBy` which uses `comparer` to define the
53604                      * sort order of `array` and replaces criteria objects with their
53605                      * corresponding values.
53606                      * 
53607                      * @private
53608                      * @param {Array}
53609                      *            array The array to sort.
53610                      * @param {Function}
53611                      *            comparer The function to define sort order.
53612                      * @returns {Array} Returns `array`.
53613                      */
53614                     function baseSortBy(array, comparer) {
53615                         var length = array.length;
53616
53617                         array.sort(comparer);
53618                         while (length--) {
53619                             array[length] = array[length].value;
53620                         }
53621                         return array;
53622                     }
53623
53624                     /**
53625                      * The base implementation of `_.sortByOrder` without param guards.
53626                      * 
53627                      * @private
53628                      * @param {Array|Object|string}
53629                      *            collection The collection to iterate over.
53630                      * @param {Function[]|Object[]|string[]}
53631                      *            iteratees The iteratees to sort by.
53632                      * @param {boolean[]}
53633                      *            orders The sort orders of `iteratees`.
53634                      * @returns {Array} Returns the new sorted array.
53635                      */
53636                     function baseSortByOrder(collection, iteratees, orders) {
53637                         var callback = getCallback(),
53638                             index = -1;
53639
53640                         iteratees = arrayMap(iteratees, function(iteratee) {
53641                             return callback(iteratee);
53642                         });
53643
53644                         var result = baseMap(collection, function(value) {
53645                             var criteria = arrayMap(iteratees, function(iteratee) {
53646                                 return iteratee(value);
53647                             });
53648                             return {
53649                                 'criteria': criteria,
53650                                 'index': ++index,
53651                                 'value': value
53652                             };
53653                         });
53654
53655                         return baseSortBy(result, function(object, other) {
53656                             return compareMultiple(object, other, orders);
53657                         });
53658                     }
53659
53660                     /**
53661                      * The base implementation of `_.sum` without support for callback
53662                      * shorthands and `this` binding.
53663                      * 
53664                      * @private
53665                      * @param {Array|Object|string}
53666                      *            collection The collection to iterate over.
53667                      * @param {Function}
53668                      *            iteratee The function invoked per iteration.
53669                      * @returns {number} Returns the sum.
53670                      */
53671                     function baseSum(collection, iteratee) {
53672                         var result = 0;
53673                         baseEach(collection, function(value, index, collection) {
53674                             result += +iteratee(value, index, collection) || 0;
53675                         });
53676                         return result;
53677                     }
53678
53679                     /**
53680                      * The base implementation of `_.uniq` without support for callback
53681                      * shorthands and `this` binding.
53682                      * 
53683                      * @private
53684                      * @param {Array}
53685                      *            array The array to inspect.
53686                      * @param {Function}
53687                      *            [iteratee] The function invoked per iteration.
53688                      * @returns {Array} Returns the new duplicate-value-free array.
53689                      */
53690                     function baseUniq(array, iteratee) {
53691                         var index = -1,
53692                             indexOf = getIndexOf(),
53693                             length = array.length,
53694                             isCommon = indexOf == baseIndexOf,
53695                             isLarge = isCommon && length >= LARGE_ARRAY_SIZE,
53696                             seen = isLarge ? createCache() : null,
53697                             result = [];
53698
53699                         if (seen) {
53700                             indexOf = cacheIndexOf;
53701                             isCommon = false;
53702                         } else {
53703                             isLarge = false;
53704                             seen = iteratee ? [] : result;
53705                         }
53706                         outer:
53707                             while (++index < length) {
53708                                 var value = array[index],
53709                                     computed = iteratee ? iteratee(value, index, array) : value;
53710
53711                                 if (isCommon && value === value) {
53712                                     var seenIndex = seen.length;
53713                                     while (seenIndex--) {
53714                                         if (seen[seenIndex] === computed) {
53715                                             continue outer;
53716                                         }
53717                                     }
53718                                     if (iteratee) {
53719                                         seen.push(computed);
53720                                     }
53721                                     result.push(value);
53722                                 } else if (indexOf(seen, computed, 0) < 0) {
53723                                     if (iteratee || isLarge) {
53724                                         seen.push(computed);
53725                                     }
53726                                     result.push(value);
53727                                 }
53728                             }
53729                         return result;
53730                     }
53731
53732                     /**
53733                      * The base implementation of `_.values` and `_.valuesIn` which creates an
53734                      * array of `object` property values corresponding to the property names of
53735                      * `props`.
53736                      * 
53737                      * @private
53738                      * @param {Object}
53739                      *            object The object to query.
53740                      * @param {Array}
53741                      *            props The property names to get values for.
53742                      * @returns {Object} Returns the array of property values.
53743                      */
53744                     function baseValues(object, props) {
53745                         var index = -1,
53746                             length = props.length,
53747                             result = Array(length);
53748
53749                         while (++index < length) {
53750                             result[index] = object[props[index]];
53751                         }
53752                         return result;
53753                     }
53754
53755                     /**
53756                      * The base implementation of `_.dropRightWhile`, `_.dropWhile`,
53757                      * `_.takeRightWhile`, and `_.takeWhile` without support for callback
53758                      * shorthands and `this` binding.
53759                      * 
53760                      * @private
53761                      * @param {Array}
53762                      *            array The array to query.
53763                      * @param {Function}
53764                      *            predicate The function invoked per iteration.
53765                      * @param {boolean}
53766                      *            [isDrop] Specify dropping elements instead of taking them.
53767                      * @param {boolean}
53768                      *            [fromRight] Specify iterating from right to left.
53769                      * @returns {Array} Returns the slice of `array`.
53770                      */
53771                     function baseWhile(array, predicate, isDrop, fromRight) {
53772                         var length = array.length,
53773                             index = fromRight ? length : -1;
53774
53775                         while ((fromRight ? index-- : ++index < length) && predicate(array[index], index, array)) {}
53776                         return isDrop ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length)) : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index));
53777                     }
53778
53779                     /**
53780                      * The base implementation of `wrapperValue` which returns the result of
53781                      * performing a sequence of actions on the unwrapped `value`, where each
53782                      * successive action is supplied the return value of the previous.
53783                      * 
53784                      * @private
53785                      * @param {*}
53786                      *            value The unwrapped value.
53787                      * @param {Array}
53788                      *            actions Actions to peform to resolve the unwrapped value.
53789                      * @returns {*} Returns the resolved value.
53790                      */
53791                     function baseWrapperValue(value, actions) {
53792                         var result = value;
53793                         if (result instanceof LazyWrapper) {
53794                             result = result.value();
53795                         }
53796                         var index = -1,
53797                             length = actions.length;
53798
53799                         while (++index < length) {
53800                             var action = actions[index];
53801                             result = action.func.apply(action.thisArg, arrayPush([result], action.args));
53802                         }
53803                         return result;
53804                     }
53805
53806                     /**
53807                      * Performs a binary search of `array` to determine the index at which
53808                      * `value` should be inserted into `array` in order to maintain its sort
53809                      * order.
53810                      * 
53811                      * @private
53812                      * @param {Array}
53813                      *            array The sorted array to inspect.
53814                      * @param {*}
53815                      *            value The value to evaluate.
53816                      * @param {boolean}
53817                      *            [retHighest] Specify returning the highest qualified index.
53818                      * @returns {number} Returns the index at which `value` should be inserted
53819                      *          into `array`.
53820                      */
53821                     function binaryIndex(array, value, retHighest) {
53822                         var low = 0,
53823                             high = array ? array.length : low;
53824
53825                         if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) {
53826                             while (low < high) {
53827                                 var mid = (low + high) >>> 1,
53828                                     computed = array[mid];
53829
53830                                 if ((retHighest ? (computed <= value) : (computed < value)) && computed !== null) {
53831                                     low = mid + 1;
53832                                 } else {
53833                                     high = mid;
53834                                 }
53835                             }
53836                             return high;
53837                         }
53838                         return binaryIndexBy(array, value, identity, retHighest);
53839                     }
53840
53841                     /**
53842                      * This function is like `binaryIndex` except that it invokes `iteratee` for
53843                      * `value` and each element of `array` to compute their sort ranking. The
53844                      * iteratee is invoked with one argument; (value).
53845                      * 
53846                      * @private
53847                      * @param {Array}
53848                      *            array The sorted array to inspect.
53849                      * @param {*}
53850                      *            value The value to evaluate.
53851                      * @param {Function}
53852                      *            iteratee The function invoked per iteration.
53853                      * @param {boolean}
53854                      *            [retHighest] Specify returning the highest qualified index.
53855                      * @returns {number} Returns the index at which `value` should be inserted
53856                      *          into `array`.
53857                      */
53858                     function binaryIndexBy(array, value, iteratee, retHighest) {
53859                         value = iteratee(value);
53860
53861                         var low = 0,
53862                             high = array ? array.length : 0,
53863                             valIsNaN = value !== value,
53864                             valIsNull = value === null,
53865                             valIsUndef = value === undefined;
53866
53867                         while (low < high) {
53868                             var mid = nativeFloor((low + high) / 2),
53869                                 computed = iteratee(array[mid]),
53870                                 isDef = computed !== undefined,
53871                                 isReflexive = computed === computed;
53872
53873                             if (valIsNaN) {
53874                                 var setLow = isReflexive || retHighest;
53875                             } else if (valIsNull) {
53876                                 setLow = isReflexive && isDef && (retHighest || computed != null);
53877                             } else if (valIsUndef) {
53878                                 setLow = isReflexive && (retHighest || isDef);
53879                             } else if (computed == null) {
53880                                 setLow = false;
53881                             } else {
53882                                 setLow = retHighest ? (computed <= value) : (computed < value);
53883                             }
53884                             if (setLow) {
53885                                 low = mid + 1;
53886                             } else {
53887                                 high = mid;
53888                             }
53889                         }
53890                         return nativeMin(high, MAX_ARRAY_INDEX);
53891                     }
53892
53893                     /**
53894                      * A specialized version of `baseCallback` which only supports `this`
53895                      * binding and specifying the number of arguments to provide to `func`.
53896                      * 
53897                      * @private
53898                      * @param {Function}
53899                      *            func The function to bind.
53900                      * @param {*}
53901                      *            thisArg The `this` binding of `func`.
53902                      * @param {number}
53903                      *            [argCount] The number of arguments to provide to `func`.
53904                      * @returns {Function} Returns the callback.
53905                      */
53906                     function bindCallback(func, thisArg, argCount) {
53907                         if (typeof func != 'function') {
53908                             return identity;
53909                         }
53910                         if (thisArg === undefined) {
53911                             return func;
53912                         }
53913                         switch (argCount) {
53914                             case 1:
53915                                 return function(value) {
53916                                     return func.call(thisArg, value);
53917                                 };
53918                             case 3:
53919                                 return function(value, index, collection) {
53920                                     return func.call(thisArg, value, index, collection);
53921                                 };
53922                             case 4:
53923                                 return function(accumulator, value, index, collection) {
53924                                     return func.call(thisArg, accumulator, value, index, collection);
53925                                 };
53926                             case 5:
53927                                 return function(value, other, key, object, source) {
53928                                     return func.call(thisArg, value, other, key, object, source);
53929                                 };
53930                         }
53931                         return function() {
53932                             return func.apply(thisArg, arguments);
53933                         };
53934                     }
53935
53936                     /**
53937                      * Creates a clone of the given array buffer.
53938                      * 
53939                      * @private
53940                      * @param {ArrayBuffer}
53941                      *            buffer The array buffer to clone.
53942                      * @returns {ArrayBuffer} Returns the cloned array buffer.
53943                      */
53944                     function bufferClone(buffer) {
53945                         var result = new ArrayBuffer(buffer.byteLength),
53946                             view = new Uint8Array(result);
53947
53948                         view.set(new Uint8Array(buffer));
53949                         return result;
53950                     }
53951
53952                     /**
53953                      * Creates an array that is the composition of partially applied arguments,
53954                      * placeholders, and provided arguments into a single array of arguments.
53955                      * 
53956                      * @private
53957                      * @param {Array|Object}
53958                      *            args The provided arguments.
53959                      * @param {Array}
53960                      *            partials The arguments to prepend to those provided.
53961                      * @param {Array}
53962                      *            holders The `partials` placeholder indexes.
53963                      * @returns {Array} Returns the new array of composed arguments.
53964                      */
53965                     function composeArgs(args, partials, holders) {
53966                         var holdersLength = holders.length,
53967                             argsIndex = -1,
53968                             argsLength = nativeMax(args.length - holdersLength, 0),
53969                             leftIndex = -1,
53970                             leftLength = partials.length,
53971                             result = Array(leftLength + argsLength);
53972
53973                         while (++leftIndex < leftLength) {
53974                             result[leftIndex] = partials[leftIndex];
53975                         }
53976                         while (++argsIndex < holdersLength) {
53977                             result[holders[argsIndex]] = args[argsIndex];
53978                         }
53979                         while (argsLength--) {
53980                             result[leftIndex++] = args[argsIndex++];
53981                         }
53982                         return result;
53983                     }
53984
53985                     /**
53986                      * This function is like `composeArgs` except that the arguments composition
53987                      * is tailored for `_.partialRight`.
53988                      * 
53989                      * @private
53990                      * @param {Array|Object}
53991                      *            args The provided arguments.
53992                      * @param {Array}
53993                      *            partials The arguments to append to those provided.
53994                      * @param {Array}
53995                      *            holders The `partials` placeholder indexes.
53996                      * @returns {Array} Returns the new array of composed arguments.
53997                      */
53998                     function composeArgsRight(args, partials, holders) {
53999                         var holdersIndex = -1,
54000                             holdersLength = holders.length,
54001                             argsIndex = -1,
54002                             argsLength = nativeMax(args.length - holdersLength, 0),
54003                             rightIndex = -1,
54004                             rightLength = partials.length,
54005                             result = Array(argsLength + rightLength);
54006
54007                         while (++argsIndex < argsLength) {
54008                             result[argsIndex] = args[argsIndex];
54009                         }
54010                         var offset = argsIndex;
54011                         while (++rightIndex < rightLength) {
54012                             result[offset + rightIndex] = partials[rightIndex];
54013                         }
54014                         while (++holdersIndex < holdersLength) {
54015                             result[offset + holders[holdersIndex]] = args[argsIndex++];
54016                         }
54017                         return result;
54018                     }
54019
54020                     /**
54021                      * Creates a `_.countBy`, `_.groupBy`, `_.indexBy`, or `_.partition`
54022                      * function.
54023                      * 
54024                      * @private
54025                      * @param {Function}
54026                      *            setter The function to set keys and values of the accumulator
54027                      *            object.
54028                      * @param {Function}
54029                      *            [initializer] The function to initialize the accumulator
54030                      *            object.
54031                      * @returns {Function} Returns the new aggregator function.
54032                      */
54033                     function createAggregator(setter, initializer) {
54034                         return function(collection, iteratee, thisArg) {
54035                             var result = initializer ? initializer() : {};
54036                             iteratee = getCallback(iteratee, thisArg, 3);
54037
54038                             if (isArray(collection)) {
54039                                 var index = -1,
54040                                     length = collection.length;
54041
54042                                 while (++index < length) {
54043                                     var value = collection[index];
54044                                     setter(result, value, iteratee(value, index, collection), collection);
54045                                 }
54046                             } else {
54047                                 baseEach(collection, function(value, key, collection) {
54048                                     setter(result, value, iteratee(value, key, collection), collection);
54049                                 });
54050                             }
54051                             return result;
54052                         };
54053                     }
54054
54055                     /**
54056                      * Creates a `_.assign`, `_.defaults`, or `_.merge` function.
54057                      * 
54058                      * @private
54059                      * @param {Function}
54060                      *            assigner The function to assign values.
54061                      * @returns {Function} Returns the new assigner function.
54062                      */
54063                     function createAssigner(assigner) {
54064                         return restParam(function(object, sources) {
54065                             var index = -1,
54066                                 length = object == null ? 0 : sources.length,
54067                                 customizer = length > 2 ? sources[length - 2] : undefined,
54068                                 guard = length > 2 ? sources[2] : undefined,
54069                                 thisArg = length > 1 ? sources[length - 1] : undefined;
54070
54071                             if (typeof customizer == 'function') {
54072                                 customizer = bindCallback(customizer, thisArg, 5);
54073                                 length -= 2;
54074                             } else {
54075                                 customizer = typeof thisArg == 'function' ? thisArg : undefined;
54076                                 length -= (customizer ? 1 : 0);
54077                             }
54078                             if (guard && isIterateeCall(sources[0], sources[1], guard)) {
54079                                 customizer = length < 3 ? undefined : customizer;
54080                                 length = 1;
54081                             }
54082                             while (++index < length) {
54083                                 var source = sources[index];
54084                                 if (source) {
54085                                     assigner(object, source, customizer);
54086                                 }
54087                             }
54088                             return object;
54089                         });
54090                     }
54091
54092                     /**
54093                      * Creates a `baseEach` or `baseEachRight` function.
54094                      * 
54095                      * @private
54096                      * @param {Function}
54097                      *            eachFunc The function to iterate over a collection.
54098                      * @param {boolean}
54099                      *            [fromRight] Specify iterating from right to left.
54100                      * @returns {Function} Returns the new base function.
54101                      */
54102                     function createBaseEach(eachFunc, fromRight) {
54103                         return function(collection, iteratee) {
54104                             var length = collection ? getLength(collection) : 0;
54105                             if (!isLength(length)) {
54106                                 return eachFunc(collection, iteratee);
54107                             }
54108                             var index = fromRight ? length : -1,
54109                                 iterable = toObject(collection);
54110
54111                             while ((fromRight ? index-- : ++index < length)) {
54112                                 if (iteratee(iterable[index], index, iterable) === false) {
54113                                     break;
54114                                 }
54115                             }
54116                             return collection;
54117                         };
54118                     }
54119
54120                     /**
54121                      * Creates a base function for `_.forIn` or `_.forInRight`.
54122                      * 
54123                      * @private
54124                      * @param {boolean}
54125                      *            [fromRight] Specify iterating from right to left.
54126                      * @returns {Function} Returns the new base function.
54127                      */
54128                     function createBaseFor(fromRight) {
54129                         return function(object, iteratee, keysFunc) {
54130                             var iterable = toObject(object),
54131                                 props = keysFunc(object),
54132                                 length = props.length,
54133                                 index = fromRight ? length : -1;
54134
54135                             while ((fromRight ? index-- : ++index < length)) {
54136                                 var key = props[index];
54137                                 if (iteratee(iterable[key], key, iterable) === false) {
54138                                     break;
54139                                 }
54140                             }
54141                             return object;
54142                         };
54143                     }
54144
54145                     /**
54146                      * Creates a function that wraps `func` and invokes it with the `this`
54147                      * binding of `thisArg`.
54148                      * 
54149                      * @private
54150                      * @param {Function}
54151                      *            func The function to bind.
54152                      * @param {*}
54153                      *            [thisArg] The `this` binding of `func`.
54154                      * @returns {Function} Returns the new bound function.
54155                      */
54156                     function createBindWrapper(func, thisArg) {
54157                         var Ctor = createCtorWrapper(func);
54158
54159                         function wrapper() {
54160                             var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
54161                             return fn.apply(thisArg, arguments);
54162                         }
54163                         return wrapper;
54164                     }
54165
54166                     /**
54167                      * Creates a `Set` cache object to optimize linear searches of large arrays.
54168                      * 
54169                      * @private
54170                      * @param {Array}
54171                      *            [values] The values to cache.
54172                      * @returns {null|Object} Returns the new cache object if `Set` is
54173                      *          supported, else `null`.
54174                      */
54175                     function createCache(values) {
54176                         return (nativeCreate && Set) ? new SetCache(values) : null;
54177                     }
54178
54179                     /**
54180                      * Creates a function that produces compound words out of the words in a
54181                      * given string.
54182                      * 
54183                      * @private
54184                      * @param {Function}
54185                      *            callback The function to combine each word.
54186                      * @returns {Function} Returns the new compounder function.
54187                      */
54188                     function createCompounder(callback) {
54189                         return function(string) {
54190                             var index = -1,
54191                                 array = words(deburr(string)),
54192                                 length = array.length,
54193                                 result = '';
54194
54195                             while (++index < length) {
54196                                 result = callback(result, array[index], index);
54197                             }
54198                             return result;
54199                         };
54200                     }
54201
54202                     /**
54203                      * Creates a function that produces an instance of `Ctor` regardless of
54204                      * whether it was invoked as part of a `new` expression or by `call` or
54205                      * `apply`.
54206                      * 
54207                      * @private
54208                      * @param {Function}
54209                      *            Ctor The constructor to wrap.
54210                      * @returns {Function} Returns the new wrapped function.
54211                      */
54212                     function createCtorWrapper(Ctor) {
54213                         return function() {
54214                             // Use a `switch` statement to work with class constructors.
54215                             // See
54216                             // http://ecma-international.org/ecma-262/6.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist
54217                             // for more details.
54218                             var args = arguments;
54219                             switch (args.length) {
54220                                 case 0:
54221                                     return new Ctor;
54222                                 case 1:
54223                                     return new Ctor(args[0]);
54224                                 case 2:
54225                                     return new Ctor(args[0], args[1]);
54226                                 case 3:
54227                                     return new Ctor(args[0], args[1], args[2]);
54228                                 case 4:
54229                                     return new Ctor(args[0], args[1], args[2], args[3]);
54230                                 case 5:
54231                                     return new Ctor(args[0], args[1], args[2], args[3], args[4]);
54232                                 case 6:
54233                                     return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);
54234                                 case 7:
54235                                     return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
54236                             }
54237                             var thisBinding = baseCreate(Ctor.prototype),
54238                                 result = Ctor.apply(thisBinding, args);
54239
54240                             // Mimic the constructor's `return` behavior.
54241                             // See https://es5.github.io/#x13.2.2 for more details.
54242                             return isObject(result) ? result : thisBinding;
54243                         };
54244                     }
54245
54246                     /**
54247                      * Creates a `_.curry` or `_.curryRight` function.
54248                      * 
54249                      * @private
54250                      * @param {boolean}
54251                      *            flag The curry bit flag.
54252                      * @returns {Function} Returns the new curry function.
54253                      */
54254                     function createCurry(flag) {
54255                         function curryFunc(func, arity, guard) {
54256                             if (guard && isIterateeCall(func, arity, guard)) {
54257                                 arity = undefined;
54258                             }
54259                             var result = createWrapper(func, flag, undefined, undefined, undefined, undefined, undefined, arity);
54260                             result.placeholder = curryFunc.placeholder;
54261                             return result;
54262                         }
54263                         return curryFunc;
54264                     }
54265
54266                     /**
54267                      * Creates a `_.defaults` or `_.defaultsDeep` function.
54268                      * 
54269                      * @private
54270                      * @param {Function}
54271                      *            assigner The function to assign values.
54272                      * @param {Function}
54273                      *            customizer The function to customize assigned values.
54274                      * @returns {Function} Returns the new defaults function.
54275                      */
54276                     function createDefaults(assigner, customizer) {
54277                         return restParam(function(args) {
54278                             var object = args[0];
54279                             if (object == null) {
54280                                 return object;
54281                             }
54282                             args.push(customizer);
54283                             return assigner.apply(undefined, args);
54284                         });
54285                     }
54286
54287                     /**
54288                      * Creates a `_.max` or `_.min` function.
54289                      * 
54290                      * @private
54291                      * @param {Function}
54292                      *            comparator The function used to compare values.
54293                      * @param {*}
54294                      *            exValue The initial extremum value.
54295                      * @returns {Function} Returns the new extremum function.
54296                      */
54297                     function createExtremum(comparator, exValue) {
54298                         return function(collection, iteratee, thisArg) {
54299                             if (thisArg && isIterateeCall(collection, iteratee, thisArg)) {
54300                                 iteratee = undefined;
54301                             }
54302                             iteratee = getCallback(iteratee, thisArg, 3);
54303                             if (iteratee.length == 1) {
54304                                 collection = isArray(collection) ? collection : toIterable(collection);
54305                                 var result = arrayExtremum(collection, iteratee, comparator, exValue);
54306                                 if (!(collection.length && result === exValue)) {
54307                                     return result;
54308                                 }
54309                             }
54310                             return baseExtremum(collection, iteratee, comparator, exValue);
54311                         };
54312                     }
54313
54314                     /**
54315                      * Creates a `_.find` or `_.findLast` function.
54316                      * 
54317                      * @private
54318                      * @param {Function}
54319                      *            eachFunc The function to iterate over a collection.
54320                      * @param {boolean}
54321                      *            [fromRight] Specify iterating from right to left.
54322                      * @returns {Function} Returns the new find function.
54323                      */
54324                     function createFind(eachFunc, fromRight) {
54325                         return function(collection, predicate, thisArg) {
54326                             predicate = getCallback(predicate, thisArg, 3);
54327                             if (isArray(collection)) {
54328                                 var index = baseFindIndex(collection, predicate, fromRight);
54329                                 return index > -1 ? collection[index] : undefined;
54330                             }
54331                             return baseFind(collection, predicate, eachFunc);
54332                         };
54333                     }
54334
54335                     /**
54336                      * Creates a `_.findIndex` or `_.findLastIndex` function.
54337                      * 
54338                      * @private
54339                      * @param {boolean}
54340                      *            [fromRight] Specify iterating from right to left.
54341                      * @returns {Function} Returns the new find function.
54342                      */
54343                     function createFindIndex(fromRight) {
54344                         return function(array, predicate, thisArg) {
54345                             if (!(array && array.length)) {
54346                                 return -1;
54347                             }
54348                             predicate = getCallback(predicate, thisArg, 3);
54349                             return baseFindIndex(array, predicate, fromRight);
54350                         };
54351                     }
54352
54353                     /**
54354                      * Creates a `_.findKey` or `_.findLastKey` function.
54355                      * 
54356                      * @private
54357                      * @param {Function}
54358                      *            objectFunc The function to iterate over an object.
54359                      * @returns {Function} Returns the new find function.
54360                      */
54361                     function createFindKey(objectFunc) {
54362                         return function(object, predicate, thisArg) {
54363                             predicate = getCallback(predicate, thisArg, 3);
54364                             return baseFind(object, predicate, objectFunc, true);
54365                         };
54366                     }
54367
54368                     /**
54369                      * Creates a `_.flow` or `_.flowRight` function.
54370                      * 
54371                      * @private
54372                      * @param {boolean}
54373                      *            [fromRight] Specify iterating from right to left.
54374                      * @returns {Function} Returns the new flow function.
54375                      */
54376                     function createFlow(fromRight) {
54377                         return function() {
54378                             var wrapper,
54379                                 length = arguments.length,
54380                                 index = fromRight ? length : -1,
54381                                 leftIndex = 0,
54382                                 funcs = Array(length);
54383
54384                             while ((fromRight ? index-- : ++index < length)) {
54385                                 var func = funcs[leftIndex++] = arguments[index];
54386                                 if (typeof func != 'function') {
54387                                     throw new TypeError(FUNC_ERROR_TEXT);
54388                                 }
54389                                 if (!wrapper && LodashWrapper.prototype.thru && getFuncName(func) == 'wrapper') {
54390                                     wrapper = new LodashWrapper([], true);
54391                                 }
54392                             }
54393                             index = wrapper ? -1 : length;
54394                             while (++index < length) {
54395                                 func = funcs[index];
54396
54397                                 var funcName = getFuncName(func),
54398                                     data = funcName == 'wrapper' ? getData(func) : undefined;
54399
54400                                 if (data && isLaziable(data[0]) && data[1] == (ARY_FLAG | CURRY_FLAG | PARTIAL_FLAG | REARG_FLAG) && !data[4].length && data[9] == 1) {
54401                                     wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);
54402                                 } else {
54403                                     wrapper = (func.length == 1 && isLaziable(func)) ? wrapper[funcName]() : wrapper.thru(func);
54404                                 }
54405                             }
54406                             return function() {
54407                                 var args = arguments,
54408                                     value = args[0];
54409
54410                                 if (wrapper && args.length == 1 && isArray(value) && value.length >= LARGE_ARRAY_SIZE) {
54411                                     return wrapper.plant(value).value();
54412                                 }
54413                                 var index = 0,
54414                                     result = length ? funcs[index].apply(this, args) : value;
54415
54416                                 while (++index < length) {
54417                                     result = funcs[index].call(this, result);
54418                                 }
54419                                 return result;
54420                             };
54421                         };
54422                     }
54423
54424                     /**
54425                      * Creates a function for `_.forEach` or `_.forEachRight`.
54426                      * 
54427                      * @private
54428                      * @param {Function}
54429                      *            arrayFunc The function to iterate over an array.
54430                      * @param {Function}
54431                      *            eachFunc The function to iterate over a collection.
54432                      * @returns {Function} Returns the new each function.
54433                      */
54434                     function createForEach(arrayFunc, eachFunc) {
54435                         return function(collection, iteratee, thisArg) {
54436                             return (typeof iteratee == 'function' && thisArg === undefined && isArray(collection)) ? arrayFunc(collection, iteratee) : eachFunc(collection, bindCallback(iteratee, thisArg, 3));
54437                         };
54438                     }
54439
54440                     /**
54441                      * Creates a function for `_.forIn` or `_.forInRight`.
54442                      * 
54443                      * @private
54444                      * @param {Function}
54445                      *            objectFunc The function to iterate over an object.
54446                      * @returns {Function} Returns the new each function.
54447                      */
54448                     function createForIn(objectFunc) {
54449                         return function(object, iteratee, thisArg) {
54450                             if (typeof iteratee != 'function' || thisArg !== undefined) {
54451                                 iteratee = bindCallback(iteratee, thisArg, 3);
54452                             }
54453                             return objectFunc(object, iteratee, keysIn);
54454                         };
54455                     }
54456
54457                     /**
54458                      * Creates a function for `_.forOwn` or `_.forOwnRight`.
54459                      * 
54460                      * @private
54461                      * @param {Function}
54462                      *            objectFunc The function to iterate over an object.
54463                      * @returns {Function} Returns the new each function.
54464                      */
54465                     function createForOwn(objectFunc) {
54466                         return function(object, iteratee, thisArg) {
54467                             if (typeof iteratee != 'function' || thisArg !== undefined) {
54468                                 iteratee = bindCallback(iteratee, thisArg, 3);
54469                             }
54470                             return objectFunc(object, iteratee);
54471                         };
54472                     }
54473
54474                     /**
54475                      * Creates a function for `_.mapKeys` or `_.mapValues`.
54476                      * 
54477                      * @private
54478                      * @param {boolean}
54479                      *            [isMapKeys] Specify mapping keys instead of values.
54480                      * @returns {Function} Returns the new map function.
54481                      */
54482                     function createObjectMapper(isMapKeys) {
54483                         return function(object, iteratee, thisArg) {
54484                             var result = {};
54485                             iteratee = getCallback(iteratee, thisArg, 3);
54486
54487                             baseForOwn(object, function(value, key, object) {
54488                                 var mapped = iteratee(value, key, object);
54489                                 key = isMapKeys ? mapped : key;
54490                                 value = isMapKeys ? value : mapped;
54491                                 result[key] = value;
54492                             });
54493                             return result;
54494                         };
54495                     }
54496
54497                     /**
54498                      * Creates a function for `_.padLeft` or `_.padRight`.
54499                      * 
54500                      * @private
54501                      * @param {boolean}
54502                      *            [fromRight] Specify padding from the right.
54503                      * @returns {Function} Returns the new pad function.
54504                      */
54505                     function createPadDir(fromRight) {
54506                         return function(string, length, chars) {
54507                             string = baseToString(string);
54508                             return (fromRight ? string : '') + createPadding(string, length, chars) + (fromRight ? '' : string);
54509                         };
54510                     }
54511
54512                     /**
54513                      * Creates a `_.partial` or `_.partialRight` function.
54514                      * 
54515                      * @private
54516                      * @param {boolean}
54517                      *            flag The partial bit flag.
54518                      * @returns {Function} Returns the new partial function.
54519                      */
54520                     function createPartial(flag) {
54521                         var partialFunc = restParam(function(func, partials) {
54522                             var holders = replaceHolders(partials, partialFunc.placeholder);
54523                             return createWrapper(func, flag, undefined, partials, holders);
54524                         });
54525                         return partialFunc;
54526                     }
54527
54528                     /**
54529                      * Creates a function for `_.reduce` or `_.reduceRight`.
54530                      * 
54531                      * @private
54532                      * @param {Function}
54533                      *            arrayFunc The function to iterate over an array.
54534                      * @param {Function}
54535                      *            eachFunc The function to iterate over a collection.
54536                      * @returns {Function} Returns the new each function.
54537                      */
54538                     function createReduce(arrayFunc, eachFunc) {
54539                         return function(collection, iteratee, accumulator, thisArg) {
54540                             var initFromArray = arguments.length < 3;
54541                             return (typeof iteratee == 'function' && thisArg === undefined && isArray(collection)) ? arrayFunc(collection, iteratee, accumulator, initFromArray) : baseReduce(collection, getCallback(iteratee, thisArg, 4), accumulator, initFromArray, eachFunc);
54542                         };
54543                     }
54544
54545                     /**
54546                      * Creates a function that wraps `func` and invokes it with optional `this`
54547                      * binding of, partial application, and currying.
54548                      * 
54549                      * @private
54550                      * @param {Function|string}
54551                      *            func The function or method name to reference.
54552                      * @param {number}
54553                      *            bitmask The bitmask of flags. See `createWrapper` for more
54554                      *            details.
54555                      * @param {*}
54556                      *            [thisArg] The `this` binding of `func`.
54557                      * @param {Array}
54558                      *            [partials] The arguments to prepend to those provided to the
54559                      *            new function.
54560                      * @param {Array}
54561                      *            [holders] The `partials` placeholder indexes.
54562                      * @param {Array}
54563                      *            [partialsRight] The arguments to append to those provided to
54564                      *            the new function.
54565                      * @param {Array}
54566                      *            [holdersRight] The `partialsRight` placeholder indexes.
54567                      * @param {Array}
54568                      *            [argPos] The argument positions of the new function.
54569                      * @param {number}
54570                      *            [ary] The arity cap of `func`.
54571                      * @param {number}
54572                      *            [arity] The arity of `func`.
54573                      * @returns {Function} Returns the new wrapped function.
54574                      */
54575                     function createHybridWrapper(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {
54576                         var isAry = bitmask & ARY_FLAG,
54577                             isBind = bitmask & BIND_FLAG,
54578                             isBindKey = bitmask & BIND_KEY_FLAG,
54579                             isCurry = bitmask & CURRY_FLAG,
54580                             isCurryBound = bitmask & CURRY_BOUND_FLAG,
54581                             isCurryRight = bitmask & CURRY_RIGHT_FLAG,
54582                             Ctor = isBindKey ? undefined : createCtorWrapper(func);
54583
54584                         function wrapper() {
54585                             // Avoid `arguments` object use disqualifying optimizations by
54586                             // converting it to an array before providing it to other functions.
54587                             var length = arguments.length,
54588                                 index = length,
54589                                 args = Array(length);
54590
54591                             while (index--) {
54592                                 args[index] = arguments[index];
54593                             }
54594                             if (partials) {
54595                                 args = composeArgs(args, partials, holders);
54596                             }
54597                             if (partialsRight) {
54598                                 args = composeArgsRight(args, partialsRight, holdersRight);
54599                             }
54600                             if (isCurry || isCurryRight) {
54601                                 var placeholder = wrapper.placeholder,
54602                                     argsHolders = replaceHolders(args, placeholder);
54603
54604                                 length -= argsHolders.length;
54605                                 if (length < arity) {
54606                                     var newArgPos = argPos ? arrayCopy(argPos) : undefined,
54607                                         newArity = nativeMax(arity - length, 0),
54608                                         newsHolders = isCurry ? argsHolders : undefined,
54609                                         newHoldersRight = isCurry ? undefined : argsHolders,
54610                                         newPartials = isCurry ? args : undefined,
54611                                         newPartialsRight = isCurry ? undefined : args;
54612
54613                                     bitmask |= (isCurry ? PARTIAL_FLAG : PARTIAL_RIGHT_FLAG);
54614                                     bitmask &= ~(isCurry ? PARTIAL_RIGHT_FLAG : PARTIAL_FLAG);
54615
54616                                     if (!isCurryBound) {
54617                                         bitmask &= ~(BIND_FLAG | BIND_KEY_FLAG);
54618                                     }
54619                                     var newData = [func, bitmask, thisArg, newPartials, newsHolders, newPartialsRight, newHoldersRight, newArgPos, ary, newArity],
54620                                         result = createHybridWrapper.apply(undefined, newData);
54621
54622                                     if (isLaziable(func)) {
54623                                         setData(result, newData);
54624                                     }
54625                                     result.placeholder = placeholder;
54626                                     return result;
54627                                 }
54628                             }
54629                             var thisBinding = isBind ? thisArg : this,
54630                                 fn = isBindKey ? thisBinding[func] : func;
54631
54632                             if (argPos) {
54633                                 args = reorder(args, argPos);
54634                             }
54635                             if (isAry && ary < args.length) {
54636                                 args.length = ary;
54637                             }
54638                             if (this && this !== root && this instanceof wrapper) {
54639                                 fn = Ctor || createCtorWrapper(func);
54640                             }
54641                             return fn.apply(thisBinding, args);
54642                         }
54643                         return wrapper;
54644                     }
54645
54646                     /**
54647                      * Creates the padding required for `string` based on the given `length`.
54648                      * The `chars` string is truncated if the number of characters exceeds
54649                      * `length`.
54650                      * 
54651                      * @private
54652                      * @param {string}
54653                      *            string The string to create padding for.
54654                      * @param {number}
54655                      *            [length=0] The padding length.
54656                      * @param {string}
54657                      *            [chars=' '] The string used as padding.
54658                      * @returns {string} Returns the pad for `string`.
54659                      */
54660                     function createPadding(string, length, chars) {
54661                         var strLength = string.length;
54662                         length = +length;
54663
54664                         if (strLength >= length || !nativeIsFinite(length)) {
54665                             return '';
54666                         }
54667                         var padLength = length - strLength;
54668                         chars = chars == null ? ' ' : (chars + '');
54669                         return repeat(chars, nativeCeil(padLength / chars.length)).slice(0, padLength);
54670                     }
54671
54672                     /**
54673                      * Creates a function that wraps `func` and invokes it with the optional
54674                      * `this` binding of `thisArg` and the `partials` prepended to those
54675                      * provided to the wrapper.
54676                      * 
54677                      * @private
54678                      * @param {Function}
54679                      *            func The function to partially apply arguments to.
54680                      * @param {number}
54681                      *            bitmask The bitmask of flags. See `createWrapper` for more
54682                      *            details.
54683                      * @param {*}
54684                      *            thisArg The `this` binding of `func`.
54685                      * @param {Array}
54686                      *            partials The arguments to prepend to those provided to the new
54687                      *            function.
54688                      * @returns {Function} Returns the new bound function.
54689                      */
54690                     function createPartialWrapper(func, bitmask, thisArg, partials) {
54691                         var isBind = bitmask & BIND_FLAG,
54692                             Ctor = createCtorWrapper(func);
54693
54694                         function wrapper() {
54695                             // Avoid `arguments` object use disqualifying optimizations by
54696                             // converting it to an array before providing it `func`.
54697                             var argsIndex = -1,
54698                                 argsLength = arguments.length,
54699                                 leftIndex = -1,
54700                                 leftLength = partials.length,
54701                                 args = Array(leftLength + argsLength);
54702
54703                             while (++leftIndex < leftLength) {
54704                                 args[leftIndex] = partials[leftIndex];
54705                             }
54706                             while (argsLength--) {
54707                                 args[leftIndex++] = arguments[++argsIndex];
54708                             }
54709                             var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
54710                             return fn.apply(isBind ? thisArg : this, args);
54711                         }
54712                         return wrapper;
54713                     }
54714
54715                     /**
54716                      * Creates a `_.ceil`, `_.floor`, or `_.round` function.
54717                      * 
54718                      * @private
54719                      * @param {string}
54720                      *            methodName The name of the `Math` method to use when rounding.
54721                      * @returns {Function} Returns the new round function.
54722                      */
54723                     function createRound(methodName) {
54724                         var func = Math[methodName];
54725                         return function(number, precision) {
54726                             precision = precision === undefined ? 0 : (+precision || 0);
54727                             if (precision) {
54728                                 precision = pow(10, precision);
54729                                 return func(number * precision) / precision;
54730                             }
54731                             return func(number);
54732                         };
54733                     }
54734
54735                     /**
54736                      * Creates a `_.sortedIndex` or `_.sortedLastIndex` function.
54737                      * 
54738                      * @private
54739                      * @param {boolean}
54740                      *            [retHighest] Specify returning the highest qualified index.
54741                      * @returns {Function} Returns the new index function.
54742                      */
54743                     function createSortedIndex(retHighest) {
54744                         return function(array, value, iteratee, thisArg) {
54745                             var callback = getCallback(iteratee);
54746                             return (iteratee == null && callback === baseCallback) ? binaryIndex(array, value, retHighest) : binaryIndexBy(array, value, callback(iteratee, thisArg, 1), retHighest);
54747                         };
54748                     }
54749
54750                     /**
54751                      * Creates a function that either curries or invokes `func` with optional
54752                      * `this` binding and partially applied arguments.
54753                      * 
54754                      * @private
54755                      * @param {Function|string}
54756                      *            func The function or method name to reference.
54757                      * @param {number}
54758                      *            bitmask The bitmask of flags. The bitmask may be composed of
54759                      *            the following flags: 1 - `_.bind` 2 - `_.bindKey` 4 -
54760                      *            `_.curry` or `_.curryRight` of a bound function 8 - `_.curry`
54761                      *            16 - `_.curryRight` 32 - `_.partial` 64 - `_.partialRight` 128 -
54762                      *            `_.rearg` 256 - `_.ary`
54763                      * @param {*}
54764                      *            [thisArg] The `this` binding of `func`.
54765                      * @param {Array}
54766                      *            [partials] The arguments to be partially applied.
54767                      * @param {Array}
54768                      *            [holders] The `partials` placeholder indexes.
54769                      * @param {Array}
54770                      *            [argPos] The argument positions of the new function.
54771                      * @param {number}
54772                      *            [ary] The arity cap of `func`.
54773                      * @param {number}
54774                      *            [arity] The arity of `func`.
54775                      * @returns {Function} Returns the new wrapped function.
54776                      */
54777                     function createWrapper(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {
54778                         var isBindKey = bitmask & BIND_KEY_FLAG;
54779                         if (!isBindKey && typeof func != 'function') {
54780                             throw new TypeError(FUNC_ERROR_TEXT);
54781                         }
54782                         var length = partials ? partials.length : 0;
54783                         if (!length) {
54784                             bitmask &= ~(PARTIAL_FLAG | PARTIAL_RIGHT_FLAG);
54785                             partials = holders = undefined;
54786                         }
54787                         length -= (holders ? holders.length : 0);
54788                         if (bitmask & PARTIAL_RIGHT_FLAG) {
54789                             var partialsRight = partials,
54790                                 holdersRight = holders;
54791
54792                             partials = holders = undefined;
54793                         }
54794                         var data = isBindKey ? undefined : getData(func),
54795                             newData = [func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity];
54796
54797                         if (data) {
54798                             mergeData(newData, data);
54799                             bitmask = newData[1];
54800                             arity = newData[9];
54801                         }
54802                         newData[9] = arity == null ? (isBindKey ? 0 : func.length) : (nativeMax(arity - length, 0) || 0);
54803
54804                         if (bitmask == BIND_FLAG) {
54805                             var result = createBindWrapper(newData[0], newData[2]);
54806                         } else if ((bitmask == PARTIAL_FLAG || bitmask == (BIND_FLAG | PARTIAL_FLAG)) && !newData[4].length) {
54807                             result = createPartialWrapper.apply(undefined, newData);
54808                         } else {
54809                             result = createHybridWrapper.apply(undefined, newData);
54810                         }
54811                         var setter = data ? baseSetData : setData;
54812                         return setter(result, newData);
54813                     }
54814
54815                     /**
54816                      * A specialized version of `baseIsEqualDeep` for arrays with support for
54817                      * partial deep comparisons.
54818                      * 
54819                      * @private
54820                      * @param {Array}
54821                      *            array The array to compare.
54822                      * @param {Array}
54823                      *            other The other array to compare.
54824                      * @param {Function}
54825                      *            equalFunc The function to determine equivalents of values.
54826                      * @param {Function}
54827                      *            [customizer] The function to customize comparing arrays.
54828                      * @param {boolean}
54829                      *            [isLoose] Specify performing partial comparisons.
54830                      * @param {Array}
54831                      *            [stackA] Tracks traversed `value` objects.
54832                      * @param {Array}
54833                      *            [stackB] Tracks traversed `other` objects.
54834                      * @returns {boolean} Returns `true` if the arrays are equivalent, else
54835                      *          `false`.
54836                      */
54837                     function equalArrays(array, other, equalFunc, customizer, isLoose, stackA, stackB) {
54838                         var index = -1,
54839                             arrLength = array.length,
54840                             othLength = other.length;
54841
54842                         if (arrLength != othLength && !(isLoose && othLength > arrLength)) {
54843                             return false;
54844                         }
54845                         // Ignore non-index properties.
54846                         while (++index < arrLength) {
54847                             var arrValue = array[index],
54848                                 othValue = other[index],
54849                                 result = customizer ? customizer(isLoose ? othValue : arrValue, isLoose ? arrValue : othValue, index) : undefined;
54850
54851                             if (result !== undefined) {
54852                                 if (result) {
54853                                     continue;
54854                                 }
54855                                 return false;
54856                             }
54857                             // Recursively compare arrays (susceptible to call stack limits).
54858                             if (isLoose) {
54859                                 if (!arraySome(other, function(othValue) {
54860                                         return arrValue === othValue || equalFunc(arrValue, othValue, customizer, isLoose, stackA, stackB);
54861                                     })) {
54862                                     return false;
54863                                 }
54864                             } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, customizer, isLoose, stackA, stackB))) {
54865                                 return false;
54866                             }
54867                         }
54868                         return true;
54869                     }
54870
54871                     /**
54872                      * A specialized version of `baseIsEqualDeep` for comparing objects of the
54873                      * same `toStringTag`.
54874                      * 
54875                      * **Note:** This function only supports comparing values with tags of
54876                      * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
54877                      * 
54878                      * @private
54879                      * @param {Object}
54880                      *            object The object to compare.
54881                      * @param {Object}
54882                      *            other The other object to compare.
54883                      * @param {string}
54884                      *            tag The `toStringTag` of the objects to compare.
54885                      * @returns {boolean} Returns `true` if the objects are equivalent, else
54886                      *          `false`.
54887                      */
54888                     function equalByTag(object, other, tag) {
54889                         switch (tag) {
54890                             case boolTag:
54891                             case dateTag:
54892                                 // Coerce dates and booleans to numbers, dates to milliseconds and
54893                                 // booleans
54894                                 // to `1` or `0` treating invalid dates coerced to `NaN` as not
54895                                 // equal.
54896                                 return +object == +other;
54897
54898                             case errorTag:
54899                                 return object.name == other.name && object.message == other.message;
54900
54901                             case numberTag:
54902                                 // Treat `NaN` vs. `NaN` as equal.
54903                                 return (object != +object) ? other != +other : object == +other;
54904
54905                             case regexpTag:
54906                             case stringTag:
54907                                 // Coerce regexes to strings and treat strings primitives and string
54908                                 // objects as equal. See https://es5.github.io/#x15.10.6.4 for more
54909                                 // details.
54910                                 return object == (other + '');
54911                         }
54912                         return false;
54913                     }
54914
54915                     /**
54916                      * A specialized version of `baseIsEqualDeep` for objects with support for
54917                      * partial deep comparisons.
54918                      * 
54919                      * @private
54920                      * @param {Object}
54921                      *            object The object to compare.
54922                      * @param {Object}
54923                      *            other The other object to compare.
54924                      * @param {Function}
54925                      *            equalFunc The function to determine equivalents of values.
54926                      * @param {Function}
54927                      *            [customizer] The function to customize comparing values.
54928                      * @param {boolean}
54929                      *            [isLoose] Specify performing partial comparisons.
54930                      * @param {Array}
54931                      *            [stackA] Tracks traversed `value` objects.
54932                      * @param {Array}
54933                      *            [stackB] Tracks traversed `other` objects.
54934                      * @returns {boolean} Returns `true` if the objects are equivalent, else
54935                      *          `false`.
54936                      */
54937                     function equalObjects(object, other, equalFunc, customizer, isLoose, stackA, stackB) {
54938                         var objProps = keys(object),
54939                             objLength = objProps.length,
54940                             othProps = keys(other),
54941                             othLength = othProps.length;
54942
54943                         if (objLength != othLength && !isLoose) {
54944                             return false;
54945                         }
54946                         var index = objLength;
54947                         while (index--) {
54948                             var key = objProps[index];
54949                             if (!(isLoose ? key in other : hasOwnProperty.call(other, key))) {
54950                                 return false;
54951                             }
54952                         }
54953                         var skipCtor = isLoose;
54954                         while (++index < objLength) {
54955                             key = objProps[index];
54956                             var objValue = object[key],
54957                                 othValue = other[key],
54958                                 result = customizer ? customizer(isLoose ? othValue : objValue, isLoose ? objValue : othValue, key) : undefined;
54959
54960                             // Recursively compare objects (susceptible to call stack limits).
54961                             if (!(result === undefined ? equalFunc(objValue, othValue, customizer, isLoose, stackA, stackB) : result)) {
54962                                 return false;
54963                             }
54964                             skipCtor || (skipCtor = key == 'constructor');
54965                         }
54966                         if (!skipCtor) {
54967                             var objCtor = object.constructor,
54968                                 othCtor = other.constructor;
54969
54970                             // Non `Object` object instances with different constructors are not
54971                             // equal.
54972                             if (objCtor != othCtor &&
54973                                 ('constructor' in object && 'constructor' in other) &&
54974                                 !(typeof objCtor == 'function' && objCtor instanceof objCtor &&
54975                                     typeof othCtor == 'function' && othCtor instanceof othCtor)) {
54976                                 return false;
54977                             }
54978                         }
54979                         return true;
54980                     }
54981
54982                     /**
54983                      * Gets the appropriate "callback" function. If the `_.callback` method is
54984                      * customized this function returns the custom method, otherwise it returns
54985                      * the `baseCallback` function. If arguments are provided the chosen
54986                      * function is invoked with them and its result is returned.
54987                      * 
54988                      * @private
54989                      * @returns {Function} Returns the chosen function or its result.
54990                      */
54991                     function getCallback(func, thisArg, argCount) {
54992                         var result = lodash.callback || callback;
54993                         result = result === callback ? baseCallback : result;
54994                         return argCount ? result(func, thisArg, argCount) : result;
54995                     }
54996
54997                     /**
54998                      * Gets metadata for `func`.
54999                      * 
55000                      * @private
55001                      * @param {Function}
55002                      *            func The function to query.
55003                      * @returns {*} Returns the metadata for `func`.
55004                      */
55005                     var getData = !metaMap ? noop : function(func) {
55006                         return metaMap.get(func);
55007                     };
55008
55009                     /**
55010                      * Gets the name of `func`.
55011                      * 
55012                      * @private
55013                      * @param {Function}
55014                      *            func The function to query.
55015                      * @returns {string} Returns the function name.
55016                      */
55017                     function getFuncName(func) {
55018                         var result = func.name,
55019                             array = realNames[result],
55020                             length = array ? array.length : 0;
55021
55022                         while (length--) {
55023                             var data = array[length],
55024                                 otherFunc = data.func;
55025                             if (otherFunc == null || otherFunc == func) {
55026                                 return data.name;
55027                             }
55028                         }
55029                         return result;
55030                     }
55031
55032                     /**
55033                      * Gets the appropriate "indexOf" function. If the `_.indexOf` method is
55034                      * customized this function returns the custom method, otherwise it returns
55035                      * the `baseIndexOf` function. If arguments are provided the chosen function
55036                      * is invoked with them and its result is returned.
55037                      * 
55038                      * @private
55039                      * @returns {Function|number} Returns the chosen function or its result.
55040                      */
55041                     function getIndexOf(collection, target, fromIndex) {
55042                         var result = lodash.indexOf || indexOf;
55043                         result = result === indexOf ? baseIndexOf : result;
55044                         return collection ? result(collection, target, fromIndex) : result;
55045                     }
55046
55047                     /**
55048                      * Gets the "length" property value of `object`.
55049                      * 
55050                      * **Note:** This function is used to avoid a [JIT
55051                      * bug](https://bugs.webkit.org/show_bug.cgi?id=142792) that affects Safari
55052                      * on at least iOS 8.1-8.3 ARM64.
55053                      * 
55054                      * @private
55055                      * @param {Object}
55056                      *            object The object to query.
55057                      * @returns {*} Returns the "length" value.
55058                      */
55059                     var getLength = baseProperty('length');
55060
55061                     /**
55062                      * Gets the propery names, values, and compare flags of `object`.
55063                      * 
55064                      * @private
55065                      * @param {Object}
55066                      *            object The object to query.
55067                      * @returns {Array} Returns the match data of `object`.
55068                      */
55069                     function getMatchData(object) {
55070                         var result = pairs(object),
55071                             length = result.length;
55072
55073                         while (length--) {
55074                             result[length][2] = isStrictComparable(result[length][1]);
55075                         }
55076                         return result;
55077                     }
55078
55079                     /**
55080                      * Gets the native function at `key` of `object`.
55081                      * 
55082                      * @private
55083                      * @param {Object}
55084                      *            object The object to query.
55085                      * @param {string}
55086                      *            key The key of the method to get.
55087                      * @returns {*} Returns the function if it's native, else `undefined`.
55088                      */
55089                     function getNative(object, key) {
55090                         var value = object == null ? undefined : object[key];
55091                         return isNative(value) ? value : undefined;
55092                     }
55093
55094                     /**
55095                      * Gets the view, applying any `transforms` to the `start` and `end`
55096                      * positions.
55097                      * 
55098                      * @private
55099                      * @param {number}
55100                      *            start The start of the view.
55101                      * @param {number}
55102                      *            end The end of the view.
55103                      * @param {Array}
55104                      *            transforms The transformations to apply to the view.
55105                      * @returns {Object} Returns an object containing the `start` and `end`
55106                      *          positions of the view.
55107                      */
55108                     function getView(start, end, transforms) {
55109                         var index = -1,
55110                             length = transforms.length;
55111
55112                         while (++index < length) {
55113                             var data = transforms[index],
55114                                 size = data.size;
55115
55116                             switch (data.type) {
55117                                 case 'drop':
55118                                     start += size;
55119                                     break;
55120                                 case 'dropRight':
55121                                     end -= size;
55122                                     break;
55123                                 case 'take':
55124                                     end = nativeMin(end, start + size);
55125                                     break;
55126                                 case 'takeRight':
55127                                     start = nativeMax(start, end - size);
55128                                     break;
55129                             }
55130                         }
55131                         return {
55132                             'start': start,
55133                             'end': end
55134                         };
55135                     }
55136
55137                     /**
55138                      * Initializes an array clone.
55139                      * 
55140                      * @private
55141                      * @param {Array}
55142                      *            array The array to clone.
55143                      * @returns {Array} Returns the initialized clone.
55144                      */
55145                     function initCloneArray(array) {
55146                         var length = array.length,
55147                             result = new array.constructor(length);
55148
55149                         // Add array properties assigned by `RegExp#exec`.
55150                         if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
55151                             result.index = array.index;
55152                             result.input = array.input;
55153                         }
55154                         return result;
55155                     }
55156
55157                     /**
55158                      * Initializes an object clone.
55159                      * 
55160                      * @private
55161                      * @param {Object}
55162                      *            object The object to clone.
55163                      * @returns {Object} Returns the initialized clone.
55164                      */
55165                     function initCloneObject(object) {
55166                         var Ctor = object.constructor;
55167                         if (!(typeof Ctor == 'function' && Ctor instanceof Ctor)) {
55168                             Ctor = Object;
55169                         }
55170                         return new Ctor;
55171                     }
55172
55173                     /**
55174                      * Initializes an object clone based on its `toStringTag`.
55175                      * 
55176                      * **Note:** This function only supports cloning values with tags of
55177                      * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
55178                      * 
55179                      * @private
55180                      * @param {Object}
55181                      *            object The object to clone.
55182                      * @param {string}
55183                      *            tag The `toStringTag` of the object to clone.
55184                      * @param {boolean}
55185                      *            [isDeep] Specify a deep clone.
55186                      * @returns {Object} Returns the initialized clone.
55187                      */
55188                     function initCloneByTag(object, tag, isDeep) {
55189                         var Ctor = object.constructor;
55190                         switch (tag) {
55191                             case arrayBufferTag:
55192                                 return bufferClone(object);
55193
55194                             case boolTag:
55195                             case dateTag:
55196                                 return new Ctor(+object);
55197
55198                             case float32Tag:
55199                             case float64Tag:
55200                             case int8Tag:
55201                             case int16Tag:
55202                             case int32Tag:
55203                             case uint8Tag:
55204                             case uint8ClampedTag:
55205                             case uint16Tag:
55206                             case uint32Tag:
55207                                 var buffer = object.buffer;
55208                                 return new Ctor(isDeep ? bufferClone(buffer) : buffer, object.byteOffset, object.length);
55209
55210                             case numberTag:
55211                             case stringTag:
55212                                 return new Ctor(object);
55213
55214                             case regexpTag:
55215                                 var result = new Ctor(object.source, reFlags.exec(object));
55216                                 result.lastIndex = object.lastIndex;
55217                         }
55218                         return result;
55219                     }
55220
55221                     /**
55222                      * Invokes the method at `path` on `object`.
55223                      * 
55224                      * @private
55225                      * @param {Object}
55226                      *            object The object to query.
55227                      * @param {Array|string}
55228                      *            path The path of the method to invoke.
55229                      * @param {Array}
55230                      *            args The arguments to invoke the method with.
55231                      * @returns {*} Returns the result of the invoked method.
55232                      */
55233                     function invokePath(object, path, args) {
55234                         if (object != null && !isKey(path, object)) {
55235                             path = toPath(path);
55236                             object = path.length == 1 ? object : baseGet(object, baseSlice(path, 0, -1));
55237                             path = last(path);
55238                         }
55239                         var func = object == null ? object : object[path];
55240                         return func == null ? undefined : func.apply(object, args);
55241                     }
55242
55243                     /**
55244                      * Checks if `value` is array-like.
55245                      * 
55246                      * @private
55247                      * @param {*}
55248                      *            value The value to check.
55249                      * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
55250                      */
55251                     function isArrayLike(value) {
55252                         return value != null && isLength(getLength(value));
55253                     }
55254
55255                     /**
55256                      * Checks if `value` is a valid array-like index.
55257                      * 
55258                      * @private
55259                      * @param {*}
55260                      *            value The value to check.
55261                      * @param {number}
55262                      *            [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
55263                      * @returns {boolean} Returns `true` if `value` is a valid index, else
55264                      *          `false`.
55265                      */
55266                     function isIndex(value, length) {
55267                         value = (typeof value == 'number' || reIsUint.test(value)) ? +value : -1;
55268                         length = length == null ? MAX_SAFE_INTEGER : length;
55269                         return value > -1 && value % 1 == 0 && value < length;
55270                     }
55271
55272                     /**
55273                      * Checks if the provided arguments are from an iteratee call.
55274                      * 
55275                      * @private
55276                      * @param {*}
55277                      *            value The potential iteratee value argument.
55278                      * @param {*}
55279                      *            index The potential iteratee index or key argument.
55280                      * @param {*}
55281                      *            object The potential iteratee object argument.
55282                      * @returns {boolean} Returns `true` if the arguments are from an iteratee
55283                      *          call, else `false`.
55284                      */
55285                     function isIterateeCall(value, index, object) {
55286                         if (!isObject(object)) {
55287                             return false;
55288                         }
55289                         var type = typeof index;
55290                         if (type == 'number' ? (isArrayLike(object) && isIndex(index, object.length)) : (type == 'string' && index in object)) {
55291                             var other = object[index];
55292                             return value === value ? (value === other) : (other !== other);
55293                         }
55294                         return false;
55295                     }
55296
55297                     /**
55298                      * Checks if `value` is a property name and not a property path.
55299                      * 
55300                      * @private
55301                      * @param {*}
55302                      *            value The value to check.
55303                      * @param {Object}
55304                      *            [object] The object to query keys on.
55305                      * @returns {boolean} Returns `true` if `value` is a property name, else
55306                      *          `false`.
55307                      */
55308                     function isKey(value, object) {
55309                         var type = typeof value;
55310                         if ((type == 'string' && reIsPlainProp.test(value)) || type == 'number') {
55311                             return true;
55312                         }
55313                         if (isArray(value)) {
55314                             return false;
55315                         }
55316                         var result = !reIsDeepProp.test(value);
55317                         return result || (object != null && value in toObject(object));
55318                     }
55319
55320                     /**
55321                      * Checks if `func` has a lazy counterpart.
55322                      * 
55323                      * @private
55324                      * @param {Function}
55325                      *            func The function to check.
55326                      * @returns {boolean} Returns `true` if `func` has a lazy counterpart, else
55327                      *          `false`.
55328                      */
55329                     function isLaziable(func) {
55330                         var funcName = getFuncName(func);
55331                         if (!(funcName in LazyWrapper.prototype)) {
55332                             return false;
55333                         }
55334                         var other = lodash[funcName];
55335                         if (func === other) {
55336                             return true;
55337                         }
55338                         var data = getData(other);
55339                         return !!data && func === data[0];
55340                     }
55341
55342                     /**
55343                      * Checks if `value` is a valid array-like length.
55344                      * 
55345                      * **Note:** This function is based on
55346                      * [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength).
55347                      * 
55348                      * @private
55349                      * @param {*}
55350                      *            value The value to check.
55351                      * @returns {boolean} Returns `true` if `value` is a valid length, else
55352                      *          `false`.
55353                      */
55354                     function isLength(value) {
55355                         return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
55356                     }
55357
55358                     /**
55359                      * Checks if `value` is suitable for strict equality comparisons, i.e.
55360                      * `===`.
55361                      * 
55362                      * @private
55363                      * @param {*}
55364                      *            value The value to check.
55365                      * @returns {boolean} Returns `true` if `value` if suitable for strict
55366                      *          equality comparisons, else `false`.
55367                      */
55368                     function isStrictComparable(value) {
55369                         return value === value && !isObject(value);
55370                     }
55371
55372                     /**
55373                      * Merges the function metadata of `source` into `data`.
55374                      * 
55375                      * Merging metadata reduces the number of wrappers required to invoke a
55376                      * function. This is possible because methods like `_.bind`, `_.curry`, and
55377                      * `_.partial` may be applied regardless of execution order. Methods like
55378                      * `_.ary` and `_.rearg` augment function arguments, making the order in
55379                      * which they are executed important, preventing the merging of metadata.
55380                      * However, we make an exception for a safe common case where curried
55381                      * functions have `_.ary` and or `_.rearg` applied.
55382                      * 
55383                      * @private
55384                      * @param {Array}
55385                      *            data The destination metadata.
55386                      * @param {Array}
55387                      *            source The source metadata.
55388                      * @returns {Array} Returns `data`.
55389                      */
55390                     function mergeData(data, source) {
55391                         var bitmask = data[1],
55392                             srcBitmask = source[1],
55393                             newBitmask = bitmask | srcBitmask,
55394                             isCommon = newBitmask < ARY_FLAG;
55395
55396                         var isCombo =
55397                             (srcBitmask == ARY_FLAG && bitmask == CURRY_FLAG) ||
55398                             (srcBitmask == ARY_FLAG && bitmask == REARG_FLAG && data[7].length <= source[8]) ||
55399                             (srcBitmask == (ARY_FLAG | REARG_FLAG) && bitmask == CURRY_FLAG);
55400
55401                         // Exit early if metadata can't be merged.
55402                         if (!(isCommon || isCombo)) {
55403                             return data;
55404                         }
55405                         // Use source `thisArg` if available.
55406                         if (srcBitmask & BIND_FLAG) {
55407                             data[2] = source[2];
55408                             // Set when currying a bound function.
55409                             newBitmask |= (bitmask & BIND_FLAG) ? 0 : CURRY_BOUND_FLAG;
55410                         }
55411                         // Compose partial arguments.
55412                         var value = source[3];
55413                         if (value) {
55414                             var partials = data[3];
55415                             data[3] = partials ? composeArgs(partials, value, source[4]) : arrayCopy(value);
55416                             data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : arrayCopy(source[4]);
55417                         }
55418                         // Compose partial right arguments.
55419                         value = source[5];
55420                         if (value) {
55421                             partials = data[5];
55422                             data[5] = partials ? composeArgsRight(partials, value, source[6]) : arrayCopy(value);
55423                             data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : arrayCopy(source[6]);
55424                         }
55425                         // Use source `argPos` if available.
55426                         value = source[7];
55427                         if (value) {
55428                             data[7] = arrayCopy(value);
55429                         }
55430                         // Use source `ary` if it's smaller.
55431                         if (srcBitmask & ARY_FLAG) {
55432                             data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);
55433                         }
55434                         // Use source `arity` if one is not provided.
55435                         if (data[9] == null) {
55436                             data[9] = source[9];
55437                         }
55438                         // Use source `func` and merge bitmasks.
55439                         data[0] = source[0];
55440                         data[1] = newBitmask;
55441
55442                         return data;
55443                     }
55444
55445                     /**
55446                      * Used by `_.defaultsDeep` to customize its `_.merge` use.
55447                      * 
55448                      * @private
55449                      * @param {*}
55450                      *            objectValue The destination object property value.
55451                      * @param {*}
55452                      *            sourceValue The source object property value.
55453                      * @returns {*} Returns the value to assign to the destination object.
55454                      */
55455                     function mergeDefaults(objectValue, sourceValue) {
55456                         return objectValue === undefined ? sourceValue : merge(objectValue, sourceValue, mergeDefaults);
55457                     }
55458
55459                     /**
55460                      * A specialized version of `_.pick` which picks `object` properties
55461                      * specified by `props`.
55462                      * 
55463                      * @private
55464                      * @param {Object}
55465                      *            object The source object.
55466                      * @param {string[]}
55467                      *            props The property names to pick.
55468                      * @returns {Object} Returns the new object.
55469                      */
55470                     function pickByArray(object, props) {
55471                         object = toObject(object);
55472
55473                         var index = -1,
55474                             length = props.length,
55475                             result = {};
55476
55477                         while (++index < length) {
55478                             var key = props[index];
55479                             if (key in object) {
55480                                 result[key] = object[key];
55481                             }
55482                         }
55483                         return result;
55484                     }
55485
55486                     /**
55487                      * A specialized version of `_.pick` which picks `object` properties
55488                      * `predicate` returns truthy for.
55489                      * 
55490                      * @private
55491                      * @param {Object}
55492                      *            object The source object.
55493                      * @param {Function}
55494                      *            predicate The function invoked per iteration.
55495                      * @returns {Object} Returns the new object.
55496                      */
55497                     function pickByCallback(object, predicate) {
55498                         var result = {};
55499                         baseForIn(object, function(value, key, object) {
55500                             if (predicate(value, key, object)) {
55501                                 result[key] = value;
55502                             }
55503                         });
55504                         return result;
55505                     }
55506
55507                     /**
55508                      * Reorder `array` according to the specified indexes where the element at
55509                      * the first index is assigned as the first element, the element at the
55510                      * second index is assigned as the second element, and so on.
55511                      * 
55512                      * @private
55513                      * @param {Array}
55514                      *            array The array to reorder.
55515                      * @param {Array}
55516                      *            indexes The arranged array indexes.
55517                      * @returns {Array} Returns `array`.
55518                      */
55519                     function reorder(array, indexes) {
55520                         var arrLength = array.length,
55521                             length = nativeMin(indexes.length, arrLength),
55522                             oldArray = arrayCopy(array);
55523
55524                         while (length--) {
55525                             var index = indexes[length];
55526                             array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;
55527                         }
55528                         return array;
55529                     }
55530
55531                     /**
55532                      * Sets metadata for `func`.
55533                      * 
55534                      * **Note:** If this function becomes hot, i.e. is invoked a lot in a short
55535                      * period of time, it will trip its breaker and transition to an identity
55536                      * function to avoid garbage collection pauses in V8. See [V8 issue
55537                      * 2070](https://code.google.com/p/v8/issues/detail?id=2070) for more
55538                      * details.
55539                      * 
55540                      * @private
55541                      * @param {Function}
55542                      *            func The function to associate metadata with.
55543                      * @param {*}
55544                      *            data The metadata.
55545                      * @returns {Function} Returns `func`.
55546                      */
55547                     var setData = (function() {
55548                         var count = 0,
55549                             lastCalled = 0;
55550
55551                         return function(key, value) {
55552                             var stamp = now(),
55553                                 remaining = HOT_SPAN - (stamp - lastCalled);
55554
55555                             lastCalled = stamp;
55556                             if (remaining > 0) {
55557                                 if (++count >= HOT_COUNT) {
55558                                     return key;
55559                                 }
55560                             } else {
55561                                 count = 0;
55562                             }
55563                             return baseSetData(key, value);
55564                         };
55565                     }());
55566
55567                     /**
55568                      * A fallback implementation of `Object.keys` which creates an array of the
55569                      * own enumerable property names of `object`.
55570                      * 
55571                      * @private
55572                      * @param {Object}
55573                      *            object The object to query.
55574                      * @returns {Array} Returns the array of property names.
55575                      */
55576                     function shimKeys(object) {
55577                         var props = keysIn(object),
55578                             propsLength = props.length,
55579                             length = propsLength && object.length;
55580
55581                         var allowIndexes = !!length && isLength(length) &&
55582                             (isArray(object) || isArguments(object));
55583
55584                         var index = -1,
55585                             result = [];
55586
55587                         while (++index < propsLength) {
55588                             var key = props[index];
55589                             if ((allowIndexes && isIndex(key, length)) || hasOwnProperty.call(object, key)) {
55590                                 result.push(key);
55591                             }
55592                         }
55593                         return result;
55594                     }
55595
55596                     /**
55597                      * Converts `value` to an array-like object if it's not one.
55598                      * 
55599                      * @private
55600                      * @param {*}
55601                      *            value The value to process.
55602                      * @returns {Array|Object} Returns the array-like object.
55603                      */
55604                     function toIterable(value) {
55605                         if (value == null) {
55606                             return [];
55607                         }
55608                         if (!isArrayLike(value)) {
55609                             return values(value);
55610                         }
55611                         return isObject(value) ? value : Object(value);
55612                     }
55613
55614                     /**
55615                      * Converts `value` to an object if it's not one.
55616                      * 
55617                      * @private
55618                      * @param {*}
55619                      *            value The value to process.
55620                      * @returns {Object} Returns the object.
55621                      */
55622                     function toObject(value) {
55623                         return isObject(value) ? value : Object(value);
55624                     }
55625
55626                     /**
55627                      * Converts `value` to property path array if it's not one.
55628                      * 
55629                      * @private
55630                      * @param {*}
55631                      *            value The value to process.
55632                      * @returns {Array} Returns the property path array.
55633                      */
55634                     function toPath(value) {
55635                         if (isArray(value)) {
55636                             return value;
55637                         }
55638                         var result = [];
55639                         baseToString(value).replace(rePropName, function(match, number, quote, string) {
55640                             result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));
55641                         });
55642                         return result;
55643                     }
55644
55645                     /**
55646                      * Creates a clone of `wrapper`.
55647                      * 
55648                      * @private
55649                      * @param {Object}
55650                      *            wrapper The wrapper to clone.
55651                      * @returns {Object} Returns the cloned wrapper.
55652                      */
55653                     function wrapperClone(wrapper) {
55654                         return wrapper instanceof LazyWrapper ? wrapper.clone() : new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__, arrayCopy(wrapper.__actions__));
55655                     }
55656
55657                     /*------------------------------------------------------------------------*/
55658
55659                     /**
55660                      * Creates an array of elements split into groups the length of `size`. If
55661                      * `collection` can't be split evenly, the final chunk will be the remaining
55662                      * elements.
55663                      * 
55664                      * @static
55665                      * @memberOf _
55666                      * @category Array
55667                      * @param {Array}
55668                      *            array The array to process.
55669                      * @param {number}
55670                      *            [size=1] The length of each chunk.
55671                      * @param- {Object} [guard] Enables use as a callback for functions like
55672                      *         `_.map`.
55673                      * @returns {Array} Returns the new array containing chunks.
55674                      * @example
55675                      * 
55676                      * _.chunk(['a', 'b', 'c', 'd'], 2); // => [['a', 'b'], ['c', 'd']]
55677                      * 
55678                      * _.chunk(['a', 'b', 'c', 'd'], 3); // => [['a', 'b', 'c'], ['d']]
55679                      */
55680                     function chunk(array, size, guard) {
55681                         if (guard ? isIterateeCall(array, size, guard) : size == null) {
55682                             size = 1;
55683                         } else {
55684                             size = nativeMax(nativeFloor(size) || 1, 1);
55685                         }
55686                         var index = 0,
55687                             length = array ? array.length : 0,
55688                             resIndex = -1,
55689                             result = Array(nativeCeil(length / size));
55690
55691                         while (index < length) {
55692                             result[++resIndex] = baseSlice(array, index, (index += size));
55693                         }
55694                         return result;
55695                     }
55696
55697                     /**
55698                      * Creates an array with all falsey values removed. The values `false`,
55699                      * `null`, `0`, `""`, `undefined`, and `NaN` are falsey.
55700                      * 
55701                      * @static
55702                      * @memberOf _
55703                      * @category Array
55704                      * @param {Array}
55705                      *            array The array to compact.
55706                      * @returns {Array} Returns the new array of filtered values.
55707                      * @example
55708                      * 
55709                      * _.compact([0, 1, false, 2, '', 3]); // => [1, 2, 3]
55710                      */
55711                     function compact(array) {
55712                         var index = -1,
55713                             length = array ? array.length : 0,
55714                             resIndex = -1,
55715                             result = [];
55716
55717                         while (++index < length) {
55718                             var value = array[index];
55719                             if (value) {
55720                                 result[++resIndex] = value;
55721                             }
55722                         }
55723                         return result;
55724                     }
55725
55726                     /**
55727                      * Creates an array of unique `array` values not included in the other
55728                      * provided arrays using
55729                      * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
55730                      * for equality comparisons.
55731                      * 
55732                      * @static
55733                      * @memberOf _
55734                      * @category Array
55735                      * @param {Array}
55736                      *            array The array to inspect.
55737                      * @param {...Array}
55738                      *            [values] The arrays of values to exclude.
55739                      * @returns {Array} Returns the new array of filtered values.
55740                      * @example
55741                      * 
55742                      * _.difference([1, 2, 3], [4, 2]); // => [1, 3]
55743                      */
55744                     var difference = restParam(function(array, values) {
55745                         return (isObjectLike(array) && isArrayLike(array)) ? baseDifference(array, baseFlatten(values, false, true)) : [];
55746                     });
55747
55748                     /**
55749                      * Creates a slice of `array` with `n` elements dropped from the beginning.
55750                      * 
55751                      * @static
55752                      * @memberOf _
55753                      * @category Array
55754                      * @param {Array}
55755                      *            array The array to query.
55756                      * @param {number}
55757                      *            [n=1] The number of elements to drop.
55758                      * @param- {Object} [guard] Enables use as a callback for functions like
55759                      *         `_.map`.
55760                      * @returns {Array} Returns the slice of `array`.
55761                      * @example
55762                      * 
55763                      * _.drop([1, 2, 3]); // => [2, 3]
55764                      * 
55765                      * _.drop([1, 2, 3], 2); // => [3]
55766                      * 
55767                      * _.drop([1, 2, 3], 5); // => []
55768                      * 
55769                      * _.drop([1, 2, 3], 0); // => [1, 2, 3]
55770                      */
55771                     function drop(array, n, guard) {
55772                         var length = array ? array.length : 0;
55773                         if (!length) {
55774                             return [];
55775                         }
55776                         if (guard ? isIterateeCall(array, n, guard) : n == null) {
55777                             n = 1;
55778                         }
55779                         return baseSlice(array, n < 0 ? 0 : n);
55780                     }
55781
55782                     /**
55783                      * Creates a slice of `array` with `n` elements dropped from the end.
55784                      * 
55785                      * @static
55786                      * @memberOf _
55787                      * @category Array
55788                      * @param {Array}
55789                      *            array The array to query.
55790                      * @param {number}
55791                      *            [n=1] The number of elements to drop.
55792                      * @param- {Object} [guard] Enables use as a callback for functions like
55793                      *         `_.map`.
55794                      * @returns {Array} Returns the slice of `array`.
55795                      * @example
55796                      * 
55797                      * _.dropRight([1, 2, 3]); // => [1, 2]
55798                      * 
55799                      * _.dropRight([1, 2, 3], 2); // => [1]
55800                      * 
55801                      * _.dropRight([1, 2, 3], 5); // => []
55802                      * 
55803                      * _.dropRight([1, 2, 3], 0); // => [1, 2, 3]
55804                      */
55805                     function dropRight(array, n, guard) {
55806                         var length = array ? array.length : 0;
55807                         if (!length) {
55808                             return [];
55809                         }
55810                         if (guard ? isIterateeCall(array, n, guard) : n == null) {
55811                             n = 1;
55812                         }
55813                         n = length - (+n || 0);
55814                         return baseSlice(array, 0, n < 0 ? 0 : n);
55815                     }
55816
55817                     /**
55818                      * Creates a slice of `array` excluding elements dropped from the end.
55819                      * Elements are dropped until `predicate` returns falsey. The predicate is
55820                      * bound to `thisArg` and invoked with three arguments: (value, index,
55821                      * array).
55822                      * 
55823                      * If a property name is provided for `predicate` the created `_.property`
55824                      * style callback returns the property value of the given element.
55825                      * 
55826                      * If a value is also provided for `thisArg` the created `_.matchesProperty`
55827                      * style callback returns `true` for elements that have a matching property
55828                      * value, else `false`.
55829                      * 
55830                      * If an object is provided for `predicate` the created `_.matches` style
55831                      * callback returns `true` for elements that match the properties of the
55832                      * given object, else `false`.
55833                      * 
55834                      * @static
55835                      * @memberOf _
55836                      * @category Array
55837                      * @param {Array}
55838                      *            array The array to query.
55839                      * @param {Function|Object|string}
55840                      *            [predicate=_.identity] The function invoked per iteration.
55841                      * @param {*}
55842                      *            [thisArg] The `this` binding of `predicate`.
55843                      * @returns {Array} Returns the slice of `array`.
55844                      * @example
55845                      * 
55846                      * _.dropRightWhile([1, 2, 3], function(n) { return n > 1; }); // => [1]
55847                      * 
55848                      * var users = [ { 'user': 'barney', 'active': true }, { 'user': 'fred',
55849                      * 'active': false }, { 'user': 'pebbles', 'active': false } ];
55850                      *  // using the `_.matches` callback shorthand
55851                      * _.pluck(_.dropRightWhile(users, { 'user': 'pebbles', 'active': false }),
55852                      * 'user'); // => ['barney', 'fred']
55853                      *  // using the `_.matchesProperty` callback shorthand
55854                      * _.pluck(_.dropRightWhile(users, 'active', false), 'user'); // =>
55855                      * ['barney']
55856                      *  // using the `_.property` callback shorthand
55857                      * _.pluck(_.dropRightWhile(users, 'active'), 'user'); // => ['barney',
55858                      * 'fred', 'pebbles']
55859                      */
55860                     function dropRightWhile(array, predicate, thisArg) {
55861                         return (array && array.length) ? baseWhile(array, getCallback(predicate, thisArg, 3), true, true) : [];
55862                     }
55863
55864                     /**
55865                      * Creates a slice of `array` excluding elements dropped from the beginning.
55866                      * Elements are dropped until `predicate` returns falsey. The predicate is
55867                      * bound to `thisArg` and invoked with three arguments: (value, index,
55868                      * array).
55869                      * 
55870                      * If a property name is provided for `predicate` the created `_.property`
55871                      * style callback returns the property value of the given element.
55872                      * 
55873                      * If a value is also provided for `thisArg` the created `_.matchesProperty`
55874                      * style callback returns `true` for elements that have a matching property
55875                      * value, else `false`.
55876                      * 
55877                      * If an object is provided for `predicate` the created `_.matches` style
55878                      * callback returns `true` for elements that have the properties of the
55879                      * given object, else `false`.
55880                      * 
55881                      * @static
55882                      * @memberOf _
55883                      * @category Array
55884                      * @param {Array}
55885                      *            array The array to query.
55886                      * @param {Function|Object|string}
55887                      *            [predicate=_.identity] The function invoked per iteration.
55888                      * @param {*}
55889                      *            [thisArg] The `this` binding of `predicate`.
55890                      * @returns {Array} Returns the slice of `array`.
55891                      * @example
55892                      * 
55893                      * _.dropWhile([1, 2, 3], function(n) { return n < 3; }); // => [3]
55894                      * 
55895                      * var users = [ { 'user': 'barney', 'active': false }, { 'user': 'fred',
55896                      * 'active': false }, { 'user': 'pebbles', 'active': true } ];
55897                      *  // using the `_.matches` callback shorthand _.pluck(_.dropWhile(users, {
55898                      * 'user': 'barney', 'active': false }), 'user'); // => ['fred', 'pebbles']
55899                      *  // using the `_.matchesProperty` callback shorthand
55900                      * _.pluck(_.dropWhile(users, 'active', false), 'user'); // => ['pebbles']
55901                      *  // using the `_.property` callback shorthand _.pluck(_.dropWhile(users,
55902                      * 'active'), 'user'); // => ['barney', 'fred', 'pebbles']
55903                      */
55904                     function dropWhile(array, predicate, thisArg) {
55905                         return (array && array.length) ? baseWhile(array, getCallback(predicate, thisArg, 3), true) : [];
55906                     }
55907
55908                     /**
55909                      * Fills elements of `array` with `value` from `start` up to, but not
55910                      * including, `end`.
55911                      * 
55912                      * **Note:** This method mutates `array`.
55913                      * 
55914                      * @static
55915                      * @memberOf _
55916                      * @category Array
55917                      * @param {Array}
55918                      *            array The array to fill.
55919                      * @param {*}
55920                      *            value The value to fill `array` with.
55921                      * @param {number}
55922                      *            [start=0] The start position.
55923                      * @param {number}
55924                      *            [end=array.length] The end position.
55925                      * @returns {Array} Returns `array`.
55926                      * @example
55927                      * 
55928                      * var array = [1, 2, 3];
55929                      * 
55930                      * _.fill(array, 'a'); console.log(array); // => ['a', 'a', 'a']
55931                      * 
55932                      * _.fill(Array(3), 2); // => [2, 2, 2]
55933                      * 
55934                      * _.fill([4, 6, 8], '*', 1, 2); // => [4, '*', 8]
55935                      */
55936                     function fill(array, value, start, end) {
55937                         var length = array ? array.length : 0;
55938                         if (!length) {
55939                             return [];
55940                         }
55941                         if (start && typeof start != 'number' && isIterateeCall(array, value, start)) {
55942                             start = 0;
55943                             end = length;
55944                         }
55945                         return baseFill(array, value, start, end);
55946                     }
55947
55948                     /**
55949                      * This method is like `_.find` except that it returns the index of the
55950                      * first element `predicate` returns truthy for instead of the element
55951                      * itself.
55952                      * 
55953                      * If a property name is provided for `predicate` the created `_.property`
55954                      * style callback returns the property value of the given element.
55955                      * 
55956                      * If a value is also provided for `thisArg` the created `_.matchesProperty`
55957                      * style callback returns `true` for elements that have a matching property
55958                      * value, else `false`.
55959                      * 
55960                      * If an object is provided for `predicate` the created `_.matches` style
55961                      * callback returns `true` for elements that have the properties of the
55962                      * given object, else `false`.
55963                      * 
55964                      * @static
55965                      * @memberOf _
55966                      * @category Array
55967                      * @param {Array}
55968                      *            array The array to search.
55969                      * @param {Function|Object|string}
55970                      *            [predicate=_.identity] The function invoked per iteration.
55971                      * @param {*}
55972                      *            [thisArg] The `this` binding of `predicate`.
55973                      * @returns {number} Returns the index of the found element, else `-1`.
55974                      * @example
55975                      * 
55976                      * var users = [ { 'user': 'barney', 'active': false }, { 'user': 'fred',
55977                      * 'active': false }, { 'user': 'pebbles', 'active': true } ];
55978                      * 
55979                      * _.findIndex(users, function(chr) { return chr.user == 'barney'; }); // =>
55980                      * 0
55981                      *  // using the `_.matches` callback shorthand _.findIndex(users, { 'user':
55982                      * 'fred', 'active': false }); // => 1
55983                      *  // using the `_.matchesProperty` callback shorthand _.findIndex(users,
55984                      * 'active', false); // => 0
55985                      *  // using the `_.property` callback shorthand _.findIndex(users,
55986                      * 'active'); // => 2
55987                      */
55988                     var findIndex = createFindIndex();
55989
55990                     /**
55991                      * This method is like `_.findIndex` except that it iterates over elements
55992                      * of `collection` from right to left.
55993                      * 
55994                      * If a property name is provided for `predicate` the created `_.property`
55995                      * style callback returns the property value of the given element.
55996                      * 
55997                      * If a value is also provided for `thisArg` the created `_.matchesProperty`
55998                      * style callback returns `true` for elements that have a matching property
55999                      * value, else `false`.
56000                      * 
56001                      * If an object is provided for `predicate` the created `_.matches` style
56002                      * callback returns `true` for elements that have the properties of the
56003                      * given object, else `false`.
56004                      * 
56005                      * @static
56006                      * @memberOf _
56007                      * @category Array
56008                      * @param {Array}
56009                      *            array The array to search.
56010                      * @param {Function|Object|string}
56011                      *            [predicate=_.identity] The function invoked per iteration.
56012                      * @param {*}
56013                      *            [thisArg] The `this` binding of `predicate`.
56014                      * @returns {number} Returns the index of the found element, else `-1`.
56015                      * @example
56016                      * 
56017                      * var users = [ { 'user': 'barney', 'active': true }, { 'user': 'fred',
56018                      * 'active': false }, { 'user': 'pebbles', 'active': false } ];
56019                      * 
56020                      * _.findLastIndex(users, function(chr) { return chr.user == 'pebbles'; }); // =>
56021                      * 2
56022                      *  // using the `_.matches` callback shorthand _.findLastIndex(users, {
56023                      * 'user': 'barney', 'active': true }); // => 0
56024                      *  // using the `_.matchesProperty` callback shorthand
56025                      * _.findLastIndex(users, 'active', false); // => 2
56026                      *  // using the `_.property` callback shorthand _.findLastIndex(users,
56027                      * 'active'); // => 0
56028                      */
56029                     var findLastIndex = createFindIndex(true);
56030
56031                     /**
56032                      * Gets the first element of `array`.
56033                      * 
56034                      * @static
56035                      * @memberOf _
56036                      * @alias head
56037                      * @category Array
56038                      * @param {Array}
56039                      *            array The array to query.
56040                      * @returns {*} Returns the first element of `array`.
56041                      * @example
56042                      * 
56043                      * _.first([1, 2, 3]); // => 1
56044                      * 
56045                      * _.first([]); // => undefined
56046                      */
56047                     function first(array) {
56048                         return array ? array[0] : undefined;
56049                     }
56050
56051                     /**
56052                      * Flattens a nested array. If `isDeep` is `true` the array is recursively
56053                      * flattened, otherwise it is only flattened a single level.
56054                      * 
56055                      * @static
56056                      * @memberOf _
56057                      * @category Array
56058                      * @param {Array}
56059                      *            array The array to flatten.
56060                      * @param {boolean}
56061                      *            [isDeep] Specify a deep flatten.
56062                      * @param- {Object} [guard] Enables use as a callback for functions like
56063                      *         `_.map`.
56064                      * @returns {Array} Returns the new flattened array.
56065                      * @example
56066                      * 
56067                      * _.flatten([1, [2, 3, [4]]]); // => [1, 2, 3, [4]]
56068                      *  // using `isDeep` _.flatten([1, [2, 3, [4]]], true); // => [1, 2, 3, 4]
56069                      */
56070                     function flatten(array, isDeep, guard) {
56071                         var length = array ? array.length : 0;
56072                         if (guard && isIterateeCall(array, isDeep, guard)) {
56073                             isDeep = false;
56074                         }
56075                         return length ? baseFlatten(array, isDeep) : [];
56076                     }
56077
56078                     /**
56079                      * Recursively flattens a nested array.
56080                      * 
56081                      * @static
56082                      * @memberOf _
56083                      * @category Array
56084                      * @param {Array}
56085                      *            array The array to recursively flatten.
56086                      * @returns {Array} Returns the new flattened array.
56087                      * @example
56088                      * 
56089                      * _.flattenDeep([1, [2, 3, [4]]]); // => [1, 2, 3, 4]
56090                      */
56091                     function flattenDeep(array) {
56092                         var length = array ? array.length : 0;
56093                         return length ? baseFlatten(array, true) : [];
56094                     }
56095
56096                     /**
56097                      * Gets the index at which the first occurrence of `value` is found in
56098                      * `array` using
56099                      * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
56100                      * for equality comparisons. If `fromIndex` is negative, it is used as the
56101                      * offset from the end of `array`. If `array` is sorted providing `true` for
56102                      * `fromIndex` performs a faster binary search.
56103                      * 
56104                      * @static
56105                      * @memberOf _
56106                      * @category Array
56107                      * @param {Array}
56108                      *            array The array to search.
56109                      * @param {*}
56110                      *            value The value to search for.
56111                      * @param {boolean|number}
56112                      *            [fromIndex=0] The index to search from or `true` to perform a
56113                      *            binary search on a sorted array.
56114                      * @returns {number} Returns the index of the matched value, else `-1`.
56115                      * @example
56116                      * 
56117                      * _.indexOf([1, 2, 1, 2], 2); // => 1
56118                      *  // using `fromIndex` _.indexOf([1, 2, 1, 2], 2, 2); // => 3
56119                      *  // performing a binary search _.indexOf([1, 1, 2, 2], 2, true); // => 2
56120                      */
56121                     function indexOf(array, value, fromIndex) {
56122                         var length = array ? array.length : 0;
56123                         if (!length) {
56124                             return -1;
56125                         }
56126                         if (typeof fromIndex == 'number') {
56127                             fromIndex = fromIndex < 0 ? nativeMax(length + fromIndex, 0) : fromIndex;
56128                         } else if (fromIndex) {
56129                             var index = binaryIndex(array, value);
56130                             if (index < length &&
56131                                 (value === value ? (value === array[index]) : (array[index] !== array[index]))) {
56132                                 return index;
56133                             }
56134                             return -1;
56135                         }
56136                         return baseIndexOf(array, value, fromIndex || 0);
56137                     }
56138
56139                     /**
56140                      * Gets all but the last element of `array`.
56141                      * 
56142                      * @static
56143                      * @memberOf _
56144                      * @category Array
56145                      * @param {Array}
56146                      *            array The array to query.
56147                      * @returns {Array} Returns the slice of `array`.
56148                      * @example
56149                      * 
56150                      * _.initial([1, 2, 3]); // => [1, 2]
56151                      */
56152                     function initial(array) {
56153                         return dropRight(array, 1);
56154                     }
56155
56156                     /**
56157                      * Creates an array of unique values that are included in all of the
56158                      * provided arrays using
56159                      * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
56160                      * for equality comparisons.
56161                      * 
56162                      * @static
56163                      * @memberOf _
56164                      * @category Array
56165                      * @param {...Array}
56166                      *            [arrays] The arrays to inspect.
56167                      * @returns {Array} Returns the new array of shared values.
56168                      * @example _.intersection([1, 2], [4, 2], [2, 1]); // => [2]
56169                      */
56170                     var intersection = restParam(function(arrays) {
56171                         var othLength = arrays.length,
56172                             othIndex = othLength,
56173                             caches = Array(length),
56174                             indexOf = getIndexOf(),
56175                             isCommon = indexOf == baseIndexOf,
56176                             result = [];
56177
56178                         while (othIndex--) {
56179                             var value = arrays[othIndex] = isArrayLike(value = arrays[othIndex]) ? value : [];
56180                             caches[othIndex] = (isCommon && value.length >= 120) ? createCache(othIndex && value) : null;
56181                         }
56182                         var array = arrays[0],
56183                             index = -1,
56184                             length = array ? array.length : 0,
56185                             seen = caches[0];
56186
56187                         outer:
56188                             while (++index < length) {
56189                                 value = array[index];
56190                                 if ((seen ? cacheIndexOf(seen, value) : indexOf(result, value, 0)) < 0) {
56191                                     var othIndex = othLength;
56192                                     while (--othIndex) {
56193                                         var cache = caches[othIndex];
56194                                         if ((cache ? cacheIndexOf(cache, value) : indexOf(arrays[othIndex], value, 0)) < 0) {
56195                                             continue outer;
56196                                         }
56197                                     }
56198                                     if (seen) {
56199                                         seen.push(value);
56200                                     }
56201                                     result.push(value);
56202                                 }
56203                             }
56204                         return result;
56205                     });
56206
56207                     /**
56208                      * Gets the last element of `array`.
56209                      * 
56210                      * @static
56211                      * @memberOf _
56212                      * @category Array
56213                      * @param {Array}
56214                      *            array The array to query.
56215                      * @returns {*} Returns the last element of `array`.
56216                      * @example
56217                      * 
56218                      * _.last([1, 2, 3]); // => 3
56219                      */
56220                     function last(array) {
56221                         var length = array ? array.length : 0;
56222                         return length ? array[length - 1] : undefined;
56223                     }
56224
56225                     /**
56226                      * This method is like `_.indexOf` except that it iterates over elements of
56227                      * `array` from right to left.
56228                      * 
56229                      * @static
56230                      * @memberOf _
56231                      * @category Array
56232                      * @param {Array}
56233                      *            array The array to search.
56234                      * @param {*}
56235                      *            value The value to search for.
56236                      * @param {boolean|number}
56237                      *            [fromIndex=array.length-1] The index to search from or `true`
56238                      *            to perform a binary search on a sorted array.
56239                      * @returns {number} Returns the index of the matched value, else `-1`.
56240                      * @example
56241                      * 
56242                      * _.lastIndexOf([1, 2, 1, 2], 2); // => 3
56243                      *  // using `fromIndex` _.lastIndexOf([1, 2, 1, 2], 2, 2); // => 1
56244                      *  // performing a binary search _.lastIndexOf([1, 1, 2, 2], 2, true); // =>
56245                      * 3
56246                      */
56247                     function lastIndexOf(array, value, fromIndex) {
56248                         var length = array ? array.length : 0;
56249                         if (!length) {
56250                             return -1;
56251                         }
56252                         var index = length;
56253                         if (typeof fromIndex == 'number') {
56254                             index = (fromIndex < 0 ? nativeMax(length + fromIndex, 0) : nativeMin(fromIndex || 0, length - 1)) + 1;
56255                         } else if (fromIndex) {
56256                             index = binaryIndex(array, value, true) - 1;
56257                             var other = array[index];
56258                             if (value === value ? (value === other) : (other !== other)) {
56259                                 return index;
56260                             }
56261                             return -1;
56262                         }
56263                         if (value !== value) {
56264                             return indexOfNaN(array, index, true);
56265                         }
56266                         while (index--) {
56267                             if (array[index] === value) {
56268                                 return index;
56269                             }
56270                         }
56271                         return -1;
56272                     }
56273
56274                     /**
56275                      * Removes all provided values from `array` using
56276                      * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
56277                      * for equality comparisons.
56278                      * 
56279                      * **Note:** Unlike `_.without`, this method mutates `array`.
56280                      * 
56281                      * @static
56282                      * @memberOf _
56283                      * @category Array
56284                      * @param {Array}
56285                      *            array The array to modify.
56286                      * @param {...*}
56287                      *            [values] The values to remove.
56288                      * @returns {Array} Returns `array`.
56289                      * @example
56290                      * 
56291                      * var array = [1, 2, 3, 1, 2, 3];
56292                      * 
56293                      * _.pull(array, 2, 3); console.log(array); // => [1, 1]
56294                      */
56295                     function pull() {
56296                         var args = arguments,
56297                             array = args[0];
56298
56299                         if (!(array && array.length)) {
56300                             return array;
56301                         }
56302                         var index = 0,
56303                             indexOf = getIndexOf(),
56304                             length = args.length;
56305
56306                         while (++index < length) {
56307                             var fromIndex = 0,
56308                                 value = args[index];
56309
56310                             while ((fromIndex = indexOf(array, value, fromIndex)) > -1) {
56311                                 splice.call(array, fromIndex, 1);
56312                             }
56313                         }
56314                         return array;
56315                     }
56316
56317                     /**
56318                      * Removes elements from `array` corresponding to the given indexes and
56319                      * returns an array of the removed elements. Indexes may be specified as an
56320                      * array of indexes or as individual arguments.
56321                      * 
56322                      * **Note:** Unlike `_.at`, this method mutates `array`.
56323                      * 
56324                      * @static
56325                      * @memberOf _
56326                      * @category Array
56327                      * @param {Array}
56328                      *            array The array to modify.
56329                      * @param {...(number|number[])}
56330                      *            [indexes] The indexes of elements to remove, specified as
56331                      *            individual indexes or arrays of indexes.
56332                      * @returns {Array} Returns the new array of removed elements.
56333                      * @example
56334                      * 
56335                      * var array = [5, 10, 15, 20]; var evens = _.pullAt(array, 1, 3);
56336                      * 
56337                      * console.log(array); // => [5, 15]
56338                      * 
56339                      * console.log(evens); // => [10, 20]
56340                      */
56341                     var pullAt = restParam(function(array, indexes) {
56342                         indexes = baseFlatten(indexes);
56343
56344                         var result = baseAt(array, indexes);
56345                         basePullAt(array, indexes.sort(baseCompareAscending));
56346                         return result;
56347                     });
56348
56349                     /**
56350                      * Removes all elements from `array` that `predicate` returns truthy for and
56351                      * returns an array of the removed elements. The predicate is bound to
56352                      * `thisArg` and invoked with three arguments: (value, index, array).
56353                      * 
56354                      * If a property name is provided for `predicate` the created `_.property`
56355                      * style callback returns the property value of the given element.
56356                      * 
56357                      * If a value is also provided for `thisArg` the created `_.matchesProperty`
56358                      * style callback returns `true` for elements that have a matching property
56359                      * value, else `false`.
56360                      * 
56361                      * If an object is provided for `predicate` the created `_.matches` style
56362                      * callback returns `true` for elements that have the properties of the
56363                      * given object, else `false`.
56364                      * 
56365                      * **Note:** Unlike `_.filter`, this method mutates `array`.
56366                      * 
56367                      * @static
56368                      * @memberOf _
56369                      * @category Array
56370                      * @param {Array}
56371                      *            array The array to modify.
56372                      * @param {Function|Object|string}
56373                      *            [predicate=_.identity] The function invoked per iteration.
56374                      * @param {*}
56375                      *            [thisArg] The `this` binding of `predicate`.
56376                      * @returns {Array} Returns the new array of removed elements.
56377                      * @example
56378                      * 
56379                      * var array = [1, 2, 3, 4]; var evens = _.remove(array, function(n) {
56380                      * return n % 2 == 0; });
56381                      * 
56382                      * console.log(array); // => [1, 3]
56383                      * 
56384                      * console.log(evens); // => [2, 4]
56385                      */
56386                     function remove(array, predicate, thisArg) {
56387                         var result = [];
56388                         if (!(array && array.length)) {
56389                             return result;
56390                         }
56391                         var index = -1,
56392                             indexes = [],
56393                             length = array.length;
56394
56395                         predicate = getCallback(predicate, thisArg, 3);
56396                         while (++index < length) {
56397                             var value = array[index];
56398                             if (predicate(value, index, array)) {
56399                                 result.push(value);
56400                                 indexes.push(index);
56401                             }
56402                         }
56403                         basePullAt(array, indexes);
56404                         return result;
56405                     }
56406
56407                     /**
56408                      * Gets all but the first element of `array`.
56409                      * 
56410                      * @static
56411                      * @memberOf _
56412                      * @alias tail
56413                      * @category Array
56414                      * @param {Array}
56415                      *            array The array to query.
56416                      * @returns {Array} Returns the slice of `array`.
56417                      * @example
56418                      * 
56419                      * _.rest([1, 2, 3]); // => [2, 3]
56420                      */
56421                     function rest(array) {
56422                         return drop(array, 1);
56423                     }
56424
56425                     /**
56426                      * Creates a slice of `array` from `start` up to, but not including, `end`.
56427                      * 
56428                      * **Note:** This method is used instead of `Array#slice` to support node
56429                      * lists in IE < 9 and to ensure dense arrays are returned.
56430                      * 
56431                      * @static
56432                      * @memberOf _
56433                      * @category Array
56434                      * @param {Array}
56435                      *            array The array to slice.
56436                      * @param {number}
56437                      *            [start=0] The start position.
56438                      * @param {number}
56439                      *            [end=array.length] The end position.
56440                      * @returns {Array} Returns the slice of `array`.
56441                      */
56442                     function slice(array, start, end) {
56443                         var length = array ? array.length : 0;
56444                         if (!length) {
56445                             return [];
56446                         }
56447                         if (end && typeof end != 'number' && isIterateeCall(array, start, end)) {
56448                             start = 0;
56449                             end = length;
56450                         }
56451                         return baseSlice(array, start, end);
56452                     }
56453
56454                     /**
56455                      * Uses a binary search to determine the lowest index at which `value`
56456                      * should be inserted into `array` in order to maintain its sort order. If
56457                      * an iteratee function is provided it is invoked for `value` and each
56458                      * element of `array` to compute their sort ranking. The iteratee is bound
56459                      * to `thisArg` and invoked with one argument; (value).
56460                      * 
56461                      * If a property name is provided for `iteratee` the created `_.property`
56462                      * style callback returns the property value of the given element.
56463                      * 
56464                      * If a value is also provided for `thisArg` the created `_.matchesProperty`
56465                      * style callback returns `true` for elements that have a matching property
56466                      * value, else `false`.
56467                      * 
56468                      * If an object is provided for `iteratee` the created `_.matches` style
56469                      * callback returns `true` for elements that have the properties of the
56470                      * given object, else `false`.
56471                      * 
56472                      * @static
56473                      * @memberOf _
56474                      * @category Array
56475                      * @param {Array}
56476                      *            array The sorted array to inspect.
56477                      * @param {*}
56478                      *            value The value to evaluate.
56479                      * @param {Function|Object|string}
56480                      *            [iteratee=_.identity] The function invoked per iteration.
56481                      * @param {*}
56482                      *            [thisArg] The `this` binding of `iteratee`.
56483                      * @returns {number} Returns the index at which `value` should be inserted
56484                      *          into `array`.
56485                      * @example
56486                      * 
56487                      * _.sortedIndex([30, 50], 40); // => 1
56488                      * 
56489                      * _.sortedIndex([4, 4, 5, 5], 5); // => 2
56490                      * 
56491                      * var dict = { 'data': { 'thirty': 30, 'forty': 40, 'fifty': 50 } };
56492                      *  // using an iteratee function _.sortedIndex(['thirty', 'fifty'],
56493                      * 'forty', function(word) { return this.data[word]; }, dict); // => 1
56494                      *  // using the `_.property` callback shorthand _.sortedIndex([{ 'x': 30 }, {
56495                      * 'x': 50 }], { 'x': 40 }, 'x'); // => 1
56496                      */
56497                     var sortedIndex = createSortedIndex();
56498
56499                     /**
56500                      * This method is like `_.sortedIndex` except that it returns the highest
56501                      * index at which `value` should be inserted into `array` in order to
56502                      * maintain its sort order.
56503                      * 
56504                      * @static
56505                      * @memberOf _
56506                      * @category Array
56507                      * @param {Array}
56508                      *            array The sorted array to inspect.
56509                      * @param {*}
56510                      *            value The value to evaluate.
56511                      * @param {Function|Object|string}
56512                      *            [iteratee=_.identity] The function invoked per iteration.
56513                      * @param {*}
56514                      *            [thisArg] The `this` binding of `iteratee`.
56515                      * @returns {number} Returns the index at which `value` should be inserted
56516                      *          into `array`.
56517                      * @example
56518                      * 
56519                      * _.sortedLastIndex([4, 4, 5, 5], 5); // => 4
56520                      */
56521                     var sortedLastIndex = createSortedIndex(true);
56522
56523                     /**
56524                      * Creates a slice of `array` with `n` elements taken from the beginning.
56525                      * 
56526                      * @static
56527                      * @memberOf _
56528                      * @category Array
56529                      * @param {Array}
56530                      *            array The array to query.
56531                      * @param {number}
56532                      *            [n=1] The number of elements to take.
56533                      * @param- {Object} [guard] Enables use as a callback for functions like
56534                      *         `_.map`.
56535                      * @returns {Array} Returns the slice of `array`.
56536                      * @example
56537                      * 
56538                      * _.take([1, 2, 3]); // => [1]
56539                      * 
56540                      * _.take([1, 2, 3], 2); // => [1, 2]
56541                      * 
56542                      * _.take([1, 2, 3], 5); // => [1, 2, 3]
56543                      * 
56544                      * _.take([1, 2, 3], 0); // => []
56545                      */
56546                     function take(array, n, guard) {
56547                         var length = array ? array.length : 0;
56548                         if (!length) {
56549                             return [];
56550                         }
56551                         if (guard ? isIterateeCall(array, n, guard) : n == null) {
56552                             n = 1;
56553                         }
56554                         return baseSlice(array, 0, n < 0 ? 0 : n);
56555                     }
56556
56557                     /**
56558                      * Creates a slice of `array` with `n` elements taken from the end.
56559                      * 
56560                      * @static
56561                      * @memberOf _
56562                      * @category Array
56563                      * @param {Array}
56564                      *            array The array to query.
56565                      * @param {number}
56566                      *            [n=1] The number of elements to take.
56567                      * @param- {Object} [guard] Enables use as a callback for functions like
56568                      *         `_.map`.
56569                      * @returns {Array} Returns the slice of `array`.
56570                      * @example
56571                      * 
56572                      * _.takeRight([1, 2, 3]); // => [3]
56573                      * 
56574                      * _.takeRight([1, 2, 3], 2); // => [2, 3]
56575                      * 
56576                      * _.takeRight([1, 2, 3], 5); // => [1, 2, 3]
56577                      * 
56578                      * _.takeRight([1, 2, 3], 0); // => []
56579                      */
56580                     function takeRight(array, n, guard) {
56581                         var length = array ? array.length : 0;
56582                         if (!length) {
56583                             return [];
56584                         }
56585                         if (guard ? isIterateeCall(array, n, guard) : n == null) {
56586                             n = 1;
56587                         }
56588                         n = length - (+n || 0);
56589                         return baseSlice(array, n < 0 ? 0 : n);
56590                     }
56591
56592                     /**
56593                      * Creates a slice of `array` with elements taken from the end. Elements are
56594                      * taken until `predicate` returns falsey. The predicate is bound to
56595                      * `thisArg` and invoked with three arguments: (value, index, array).
56596                      * 
56597                      * If a property name is provided for `predicate` the created `_.property`
56598                      * style callback returns the property value of the given element.
56599                      * 
56600                      * If a value is also provided for `thisArg` the created `_.matchesProperty`
56601                      * style callback returns `true` for elements that have a matching property
56602                      * value, else `false`.
56603                      * 
56604                      * If an object is provided for `predicate` the created `_.matches` style
56605                      * callback returns `true` for elements that have the properties of the
56606                      * given object, else `false`.
56607                      * 
56608                      * @static
56609                      * @memberOf _
56610                      * @category Array
56611                      * @param {Array}
56612                      *            array The array to query.
56613                      * @param {Function|Object|string}
56614                      *            [predicate=_.identity] The function invoked per iteration.
56615                      * @param {*}
56616                      *            [thisArg] The `this` binding of `predicate`.
56617                      * @returns {Array} Returns the slice of `array`.
56618                      * @example
56619                      * 
56620                      * _.takeRightWhile([1, 2, 3], function(n) { return n > 1; }); // => [2, 3]
56621                      * 
56622                      * var users = [ { 'user': 'barney', 'active': true }, { 'user': 'fred',
56623                      * 'active': false }, { 'user': 'pebbles', 'active': false } ];
56624                      *  // using the `_.matches` callback shorthand
56625                      * _.pluck(_.takeRightWhile(users, { 'user': 'pebbles', 'active': false }),
56626                      * 'user'); // => ['pebbles']
56627                      *  // using the `_.matchesProperty` callback shorthand
56628                      * _.pluck(_.takeRightWhile(users, 'active', false), 'user'); // => ['fred',
56629                      * 'pebbles']
56630                      *  // using the `_.property` callback shorthand
56631                      * _.pluck(_.takeRightWhile(users, 'active'), 'user'); // => []
56632                      */
56633                     function takeRightWhile(array, predicate, thisArg) {
56634                         return (array && array.length) ? baseWhile(array, getCallback(predicate, thisArg, 3), false, true) : [];
56635                     }
56636
56637                     /**
56638                      * Creates a slice of `array` with elements taken from the beginning.
56639                      * Elements are taken until `predicate` returns falsey. The predicate is
56640                      * bound to `thisArg` and invoked with three arguments: (value, index,
56641                      * array).
56642                      * 
56643                      * If a property name is provided for `predicate` the created `_.property`
56644                      * style callback returns the property value of the given element.
56645                      * 
56646                      * If a value is also provided for `thisArg` the created `_.matchesProperty`
56647                      * style callback returns `true` for elements that have a matching property
56648                      * value, else `false`.
56649                      * 
56650                      * If an object is provided for `predicate` the created `_.matches` style
56651                      * callback returns `true` for elements that have the properties of the
56652                      * given object, else `false`.
56653                      * 
56654                      * @static
56655                      * @memberOf _
56656                      * @category Array
56657                      * @param {Array}
56658                      *            array The array to query.
56659                      * @param {Function|Object|string}
56660                      *            [predicate=_.identity] The function invoked per iteration.
56661                      * @param {*}
56662                      *            [thisArg] The `this` binding of `predicate`.
56663                      * @returns {Array} Returns the slice of `array`.
56664                      * @example
56665                      * 
56666                      * _.takeWhile([1, 2, 3], function(n) { return n < 3; }); // => [1, 2]
56667                      * 
56668                      * var users = [ { 'user': 'barney', 'active': false }, { 'user': 'fred',
56669                      * 'active': false}, { 'user': 'pebbles', 'active': true } ];
56670                      *  // using the `_.matches` callback shorthand _.pluck(_.takeWhile(users, {
56671                      * 'user': 'barney', 'active': false }), 'user'); // => ['barney']
56672                      *  // using the `_.matchesProperty` callback shorthand
56673                      * _.pluck(_.takeWhile(users, 'active', false), 'user'); // => ['barney',
56674                      * 'fred']
56675                      *  // using the `_.property` callback shorthand _.pluck(_.takeWhile(users,
56676                      * 'active'), 'user'); // => []
56677                      */
56678                     function takeWhile(array, predicate, thisArg) {
56679                         return (array && array.length) ? baseWhile(array, getCallback(predicate, thisArg, 3)) : [];
56680                     }
56681
56682                     /**
56683                      * Creates an array of unique values, in order, from all of the provided
56684                      * arrays using
56685                      * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
56686                      * for equality comparisons.
56687                      * 
56688                      * @static
56689                      * @memberOf _
56690                      * @category Array
56691                      * @param {...Array}
56692                      *            [arrays] The arrays to inspect.
56693                      * @returns {Array} Returns the new array of combined values.
56694                      * @example
56695                      * 
56696                      * _.union([1, 2], [4, 2], [2, 1]); // => [1, 2, 4]
56697                      */
56698                     var union = restParam(function(arrays) {
56699                         return baseUniq(baseFlatten(arrays, false, true));
56700                     });
56701
56702                     /**
56703                      * Creates a duplicate-free version of an array, using
56704                      * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
56705                      * for equality comparisons, in which only the first occurence of each
56706                      * element is kept. Providing `true` for `isSorted` performs a faster search
56707                      * algorithm for sorted arrays. If an iteratee function is provided it is
56708                      * invoked for each element in the array to generate the criterion by which
56709                      * uniqueness is computed. The `iteratee` is bound to `thisArg` and invoked
56710                      * with three arguments: (value, index, array).
56711                      * 
56712                      * If a property name is provided for `iteratee` the created `_.property`
56713                      * style callback returns the property value of the given element.
56714                      * 
56715                      * If a value is also provided for `thisArg` the created `_.matchesProperty`
56716                      * style callback returns `true` for elements that have a matching property
56717                      * value, else `false`.
56718                      * 
56719                      * If an object is provided for `iteratee` the created `_.matches` style
56720                      * callback returns `true` for elements that have the properties of the
56721                      * given object, else `false`.
56722                      * 
56723                      * @static
56724                      * @memberOf _
56725                      * @alias unique
56726                      * @category Array
56727                      * @param {Array}
56728                      *            array The array to inspect.
56729                      * @param {boolean}
56730                      *            [isSorted] Specify the array is sorted.
56731                      * @param {Function|Object|string}
56732                      *            [iteratee] The function invoked per iteration.
56733                      * @param {*}
56734                      *            [thisArg] The `this` binding of `iteratee`.
56735                      * @returns {Array} Returns the new duplicate-value-free array.
56736                      * @example
56737                      * 
56738                      * _.uniq([2, 1, 2]); // => [2, 1]
56739                      *  // using `isSorted` _.uniq([1, 1, 2], true); // => [1, 2]
56740                      *  // using an iteratee function _.uniq([1, 2.5, 1.5, 2], function(n) {
56741                      * return this.floor(n); }, Math); // => [1, 2.5]
56742                      *  // using the `_.property` callback shorthand _.uniq([{ 'x': 1 }, { 'x':
56743                      * 2 }, { 'x': 1 }], 'x'); // => [{ 'x': 1 }, { 'x': 2 }]
56744                      */
56745                     function uniq(array, isSorted, iteratee, thisArg) {
56746                         var length = array ? array.length : 0;
56747                         if (!length) {
56748                             return [];
56749                         }
56750                         if (isSorted != null && typeof isSorted != 'boolean') {
56751                             thisArg = iteratee;
56752                             iteratee = isIterateeCall(array, isSorted, thisArg) ? undefined : isSorted;
56753                             isSorted = false;
56754                         }
56755                         var callback = getCallback();
56756                         if (!(iteratee == null && callback === baseCallback)) {
56757                             iteratee = callback(iteratee, thisArg, 3);
56758                         }
56759                         return (isSorted && getIndexOf() == baseIndexOf) ? sortedUniq(array, iteratee) : baseUniq(array, iteratee);
56760                     }
56761
56762                     /**
56763                      * This method is like `_.zip` except that it accepts an array of grouped
56764                      * elements and creates an array regrouping the elements to their pre-zip
56765                      * configuration.
56766                      * 
56767                      * @static
56768                      * @memberOf _
56769                      * @category Array
56770                      * @param {Array}
56771                      *            array The array of grouped elements to process.
56772                      * @returns {Array} Returns the new array of regrouped elements.
56773                      * @example
56774                      * 
56775                      * var zipped = _.zip(['fred', 'barney'], [30, 40], [true, false]); // =>
56776                      * [['fred', 30, true], ['barney', 40, false]]
56777                      * 
56778                      * _.unzip(zipped); // => [['fred', 'barney'], [30, 40], [true, false]]
56779                      */
56780                     function unzip(array) {
56781                         if (!(array && array.length)) {
56782                             return [];
56783                         }
56784                         var index = -1,
56785                             length = 0;
56786
56787                         array = arrayFilter(array, function(group) {
56788                             if (isArrayLike(group)) {
56789                                 length = nativeMax(group.length, length);
56790                                 return true;
56791                             }
56792                         });
56793                         var result = Array(length);
56794                         while (++index < length) {
56795                             result[index] = arrayMap(array, baseProperty(index));
56796                         }
56797                         return result;
56798                     }
56799
56800                     /**
56801                      * This method is like `_.unzip` except that it accepts an iteratee to
56802                      * specify how regrouped values should be combined. The `iteratee` is bound
56803                      * to `thisArg` and invoked with four arguments: (accumulator, value, index,
56804                      * group).
56805                      * 
56806                      * @static
56807                      * @memberOf _
56808                      * @category Array
56809                      * @param {Array}
56810                      *            array The array of grouped elements to process.
56811                      * @param {Function}
56812                      *            [iteratee] The function to combine regrouped values.
56813                      * @param {*}
56814                      *            [thisArg] The `this` binding of `iteratee`.
56815                      * @returns {Array} Returns the new array of regrouped elements.
56816                      * @example
56817                      * 
56818                      * var zipped = _.zip([1, 2], [10, 20], [100, 200]); // => [[1, 10, 100],
56819                      * [2, 20, 200]]
56820                      * 
56821                      * _.unzipWith(zipped, _.add); // => [3, 30, 300]
56822                      */
56823                     function unzipWith(array, iteratee, thisArg) {
56824                         var length = array ? array.length : 0;
56825                         if (!length) {
56826                             return [];
56827                         }
56828                         var result = unzip(array);
56829                         if (iteratee == null) {
56830                             return result;
56831                         }
56832                         iteratee = bindCallback(iteratee, thisArg, 4);
56833                         return arrayMap(result, function(group) {
56834                             return arrayReduce(group, iteratee, undefined, true);
56835                         });
56836                     }
56837
56838                     /**
56839                      * Creates an array excluding all provided values using
56840                      * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
56841                      * for equality comparisons.
56842                      * 
56843                      * @static
56844                      * @memberOf _
56845                      * @category Array
56846                      * @param {Array}
56847                      *            array The array to filter.
56848                      * @param {...*}
56849                      *            [values] The values to exclude.
56850                      * @returns {Array} Returns the new array of filtered values.
56851                      * @example
56852                      * 
56853                      * _.without([1, 2, 1, 3], 1, 2); // => [3]
56854                      */
56855                     var without = restParam(function(array, values) {
56856                         return isArrayLike(array) ? baseDifference(array, values) : [];
56857                     });
56858
56859                     /**
56860                      * Creates an array of unique values that is the [symmetric
56861                      * difference](https://en.wikipedia.org/wiki/Symmetric_difference) of the
56862                      * provided arrays.
56863                      * 
56864                      * @static
56865                      * @memberOf _
56866                      * @category Array
56867                      * @param {...Array}
56868                      *            [arrays] The arrays to inspect.
56869                      * @returns {Array} Returns the new array of values.
56870                      * @example
56871                      * 
56872                      * _.xor([1, 2], [4, 2]); // => [1, 4]
56873                      */
56874                     function xor() {
56875                         var index = -1,
56876                             length = arguments.length;
56877
56878                         while (++index < length) {
56879                             var array = arguments[index];
56880                             if (isArrayLike(array)) {
56881                                 var result = result ? arrayPush(baseDifference(result, array), baseDifference(array, result)) : array;
56882                             }
56883                         }
56884                         return result ? baseUniq(result) : [];
56885                     }
56886
56887                     /**
56888                      * Creates an array of grouped elements, the first of which contains the
56889                      * first elements of the given arrays, the second of which contains the
56890                      * second elements of the given arrays, and so on.
56891                      * 
56892                      * @static
56893                      * @memberOf _
56894                      * @category Array
56895                      * @param {...Array}
56896                      *            [arrays] The arrays to process.
56897                      * @returns {Array} Returns the new array of grouped elements.
56898                      * @example
56899                      * 
56900                      * _.zip(['fred', 'barney'], [30, 40], [true, false]); // => [['fred', 30,
56901                      * true], ['barney', 40, false]]
56902                      */
56903                     var zip = restParam(unzip);
56904
56905                     /**
56906                      * The inverse of `_.pairs`; this method returns an object composed from
56907                      * arrays of property names and values. Provide either a single two
56908                      * dimensional array, e.g. `[[key1, value1], [key2, value2]]` or two arrays,
56909                      * one of property names and one of corresponding values.
56910                      * 
56911                      * @static
56912                      * @memberOf _
56913                      * @alias object
56914                      * @category Array
56915                      * @param {Array}
56916                      *            props The property names.
56917                      * @param {Array}
56918                      *            [values=[]] The property values.
56919                      * @returns {Object} Returns the new object.
56920                      * @example
56921                      * 
56922                      * _.zipObject([['fred', 30], ['barney', 40]]); // => { 'fred': 30,
56923                      * 'barney': 40 }
56924                      * 
56925                      * _.zipObject(['fred', 'barney'], [30, 40]); // => { 'fred': 30, 'barney':
56926                      * 40 }
56927                      */
56928                     function zipObject(props, values) {
56929                         var index = -1,
56930                             length = props ? props.length : 0,
56931                             result = {};
56932
56933                         if (length && !values && !isArray(props[0])) {
56934                             values = [];
56935                         }
56936                         while (++index < length) {
56937                             var key = props[index];
56938                             if (values) {
56939                                 result[key] = values[index];
56940                             } else if (key) {
56941                                 result[key[0]] = key[1];
56942                             }
56943                         }
56944                         return result;
56945                     }
56946
56947                     /**
56948                      * This method is like `_.zip` except that it accepts an iteratee to specify
56949                      * how grouped values should be combined. The `iteratee` is bound to
56950                      * `thisArg` and invoked with four arguments: (accumulator, value, index,
56951                      * group).
56952                      * 
56953                      * @static
56954                      * @memberOf _
56955                      * @category Array
56956                      * @param {...Array}
56957                      *            [arrays] The arrays to process.
56958                      * @param {Function}
56959                      *            [iteratee] The function to combine grouped values.
56960                      * @param {*}
56961                      *            [thisArg] The `this` binding of `iteratee`.
56962                      * @returns {Array} Returns the new array of grouped elements.
56963                      * @example
56964                      * 
56965                      * _.zipWith([1, 2], [10, 20], [100, 200], _.add); // => [111, 222]
56966                      */
56967                     var zipWith = restParam(function(arrays) {
56968                         var length = arrays.length,
56969                             iteratee = length > 2 ? arrays[length - 2] : undefined,
56970                             thisArg = length > 1 ? arrays[length - 1] : undefined;
56971
56972                         if (length > 2 && typeof iteratee == 'function') {
56973                             length -= 2;
56974                         } else {
56975                             iteratee = (length > 1 && typeof thisArg == 'function') ? (--length, thisArg) : undefined;
56976                             thisArg = undefined;
56977                         }
56978                         arrays.length = length;
56979                         return unzipWith(arrays, iteratee, thisArg);
56980                     });
56981
56982                     /*------------------------------------------------------------------------*/
56983
56984                     /**
56985                      * Creates a `lodash` object that wraps `value` with explicit method
56986                      * chaining enabled.
56987                      * 
56988                      * @static
56989                      * @memberOf _
56990                      * @category Chain
56991                      * @param {*}
56992                      *            value The value to wrap.
56993                      * @returns {Object} Returns the new `lodash` wrapper instance.
56994                      * @example
56995                      * 
56996                      * var users = [ { 'user': 'barney', 'age': 36 }, { 'user': 'fred', 'age':
56997                      * 40 }, { 'user': 'pebbles', 'age': 1 } ];
56998                      * 
56999                      * var youngest = _.chain(users) .sortBy('age') .map(function(chr) { return
57000                      * chr.user + ' is ' + chr.age; }) .first() .value(); // => 'pebbles is 1'
57001                      */
57002                     function chain(value) {
57003                         var result = lodash(value);
57004                         result.__chain__ = true;
57005                         return result;
57006                     }
57007
57008                     /**
57009                      * This method invokes `interceptor` and returns `value`. The interceptor is
57010                      * bound to `thisArg` and invoked with one argument; (value). The purpose of
57011                      * this method is to "tap into" a method chain in order to perform
57012                      * operations on intermediate results within the chain.
57013                      * 
57014                      * @static
57015                      * @memberOf _
57016                      * @category Chain
57017                      * @param {*}
57018                      *            value The value to provide to `interceptor`.
57019                      * @param {Function}
57020                      *            interceptor The function to invoke.
57021                      * @param {*}
57022                      *            [thisArg] The `this` binding of `interceptor`.
57023                      * @returns {*} Returns `value`.
57024                      * @example
57025                      * 
57026                      * _([1, 2, 3]) .tap(function(array) { array.pop(); }) .reverse() .value(); // =>
57027                      * [2, 1]
57028                      */
57029                     function tap(value, interceptor, thisArg) {
57030                         interceptor.call(thisArg, value);
57031                         return value;
57032                     }
57033
57034                     /**
57035                      * This method is like `_.tap` except that it returns the result of
57036                      * `interceptor`.
57037                      * 
57038                      * @static
57039                      * @memberOf _
57040                      * @category Chain
57041                      * @param {*}
57042                      *            value The value to provide to `interceptor`.
57043                      * @param {Function}
57044                      *            interceptor The function to invoke.
57045                      * @param {*}
57046                      *            [thisArg] The `this` binding of `interceptor`.
57047                      * @returns {*} Returns the result of `interceptor`.
57048                      * @example
57049                      * 
57050                      * _(' abc ') .chain() .trim() .thru(function(value) { return [value]; })
57051                      * .value(); // => ['abc']
57052                      */
57053                     function thru(value, interceptor, thisArg) {
57054                         return interceptor.call(thisArg, value);
57055                     }
57056
57057                     /**
57058                      * Enables explicit method chaining on the wrapper object.
57059                      * 
57060                      * @name chain
57061                      * @memberOf _
57062                      * @category Chain
57063                      * @returns {Object} Returns the new `lodash` wrapper instance.
57064                      * @example
57065                      * 
57066                      * var users = [ { 'user': 'barney', 'age': 36 }, { 'user': 'fred', 'age':
57067                      * 40 } ];
57068                      *  // without explicit chaining _(users).first(); // => { 'user': 'barney',
57069                      * 'age': 36 }
57070                      *  // with explicit chaining _(users).chain() .first() .pick('user')
57071                      * .value(); // => { 'user': 'barney' }
57072                      */
57073                     function wrapperChain() {
57074                         return chain(this);
57075                     }
57076
57077                     /**
57078                      * Executes the chained sequence and returns the wrapped result.
57079                      * 
57080                      * @name commit
57081                      * @memberOf _
57082                      * @category Chain
57083                      * @returns {Object} Returns the new `lodash` wrapper instance.
57084                      * @example
57085                      * 
57086                      * var array = [1, 2]; var wrapped = _(array).push(3);
57087                      * 
57088                      * console.log(array); // => [1, 2]
57089                      * 
57090                      * wrapped = wrapped.commit(); console.log(array); // => [1, 2, 3]
57091                      * 
57092                      * wrapped.last(); // => 3
57093                      * 
57094                      * console.log(array); // => [1, 2, 3]
57095                      */
57096                     function wrapperCommit() {
57097                         return new LodashWrapper(this.value(), this.__chain__);
57098                     }
57099
57100                     /**
57101                      * Creates a new array joining a wrapped array with any additional arrays
57102                      * and/or values.
57103                      * 
57104                      * @name concat
57105                      * @memberOf _
57106                      * @category Chain
57107                      * @param {...*}
57108                      *            [values] The values to concatenate.
57109                      * @returns {Array} Returns the new concatenated array.
57110                      * @example
57111                      * 
57112                      * var array = [1]; var wrapped = _(array).concat(2, [3], [[4]]);
57113                      * 
57114                      * console.log(wrapped.value()); // => [1, 2, 3, [4]]
57115                      * 
57116                      * console.log(array); // => [1]
57117                      */
57118                     var wrapperConcat = restParam(function(values) {
57119                         values = baseFlatten(values);
57120                         return this.thru(function(array) {
57121                             return arrayConcat(isArray(array) ? array : [toObject(array)], values);
57122                         });
57123                     });
57124
57125                     /**
57126                      * Creates a clone of the chained sequence planting `value` as the wrapped
57127                      * value.
57128                      * 
57129                      * @name plant
57130                      * @memberOf _
57131                      * @category Chain
57132                      * @returns {Object} Returns the new `lodash` wrapper instance.
57133                      * @example
57134                      * 
57135                      * var array = [1, 2]; var wrapped = _(array).map(function(value) { return
57136                      * Math.pow(value, 2); });
57137                      * 
57138                      * var other = [3, 4]; var otherWrapped = wrapped.plant(other);
57139                      * 
57140                      * otherWrapped.value(); // => [9, 16]
57141                      * 
57142                      * wrapped.value(); // => [1, 4]
57143                      */
57144                     function wrapperPlant(value) {
57145                         var result,
57146                             parent = this;
57147
57148                         while (parent instanceof baseLodash) {
57149                             var clone = wrapperClone(parent);
57150                             if (result) {
57151                                 previous.__wrapped__ = clone;
57152                             } else {
57153                                 result = clone;
57154                             }
57155                             var previous = clone;
57156                             parent = parent.__wrapped__;
57157                         }
57158                         previous.__wrapped__ = value;
57159                         return result;
57160                     }
57161
57162                     /**
57163                      * Reverses the wrapped array so the first element becomes the last, the
57164                      * second element becomes the second to last, and so on.
57165                      * 
57166                      * **Note:** This method mutates the wrapped array.
57167                      * 
57168                      * @name reverse
57169                      * @memberOf _
57170                      * @category Chain
57171                      * @returns {Object} Returns the new reversed `lodash` wrapper instance.
57172                      * @example
57173                      * 
57174                      * var array = [1, 2, 3];
57175                      * 
57176                      * _(array).reverse().value() // => [3, 2, 1]
57177                      * 
57178                      * console.log(array); // => [3, 2, 1]
57179                      */
57180                     function wrapperReverse() {
57181                         var value = this.__wrapped__;
57182
57183                         var interceptor = function(value) {
57184                             return (wrapped && wrapped.__dir__ < 0) ? value : value.reverse();
57185                         };
57186                         if (value instanceof LazyWrapper) {
57187                             var wrapped = value;
57188                             if (this.__actions__.length) {
57189                                 wrapped = new LazyWrapper(this);
57190                             }
57191                             wrapped = wrapped.reverse();
57192                             wrapped.__actions__.push({
57193                                 'func': thru,
57194                                 'args': [interceptor],
57195                                 'thisArg': undefined
57196                             });
57197                             return new LodashWrapper(wrapped, this.__chain__);
57198                         }
57199                         return this.thru(interceptor);
57200                     }
57201
57202                     /**
57203                      * Produces the result of coercing the unwrapped value to a string.
57204                      * 
57205                      * @name toString
57206                      * @memberOf _
57207                      * @category Chain
57208                      * @returns {string} Returns the coerced string value.
57209                      * @example
57210                      * 
57211                      * _([1, 2, 3]).toString(); // => '1,2,3'
57212                      */
57213                     function wrapperToString() {
57214                         return (this.value() + '');
57215                     }
57216
57217                     /**
57218                      * Executes the chained sequence to extract the unwrapped value.
57219                      * 
57220                      * @name value
57221                      * @memberOf _
57222                      * @alias run, toJSON, valueOf
57223                      * @category Chain
57224                      * @returns {*} Returns the resolved unwrapped value.
57225                      * @example
57226                      * 
57227                      * _([1, 2, 3]).value(); // => [1, 2, 3]
57228                      */
57229                     function wrapperValue() {
57230                         return baseWrapperValue(this.__wrapped__, this.__actions__);
57231                     }
57232
57233                     /*------------------------------------------------------------------------*/
57234
57235                     /**
57236                      * Creates an array of elements corresponding to the given keys, or indexes,
57237                      * of `collection`. Keys may be specified as individual arguments or as
57238                      * arrays of keys.
57239                      * 
57240                      * @static
57241                      * @memberOf _
57242                      * @category Collection
57243                      * @param {Array|Object|string}
57244                      *            collection The collection to iterate over.
57245                      * @param {...(number|number[]|string|string[])}
57246                      *            [props] The property names or indexes of elements to pick,
57247                      *            specified individually or in arrays.
57248                      * @returns {Array} Returns the new array of picked elements.
57249                      * @example
57250                      * 
57251                      * _.at(['a', 'b', 'c'], [0, 2]); // => ['a', 'c']
57252                      * 
57253                      * _.at(['barney', 'fred', 'pebbles'], 0, 2); // => ['barney', 'pebbles']
57254                      */
57255                     var at = restParam(function(collection, props) {
57256                         return baseAt(collection, baseFlatten(props));
57257                     });
57258
57259                     /**
57260                      * Creates an object composed of keys generated from the results of running
57261                      * each element of `collection` through `iteratee`. The corresponding value
57262                      * of each key is the number of times the key was returned by `iteratee`.
57263                      * The `iteratee` is bound to `thisArg` and invoked with three arguments:
57264                      * (value, index|key, collection).
57265                      * 
57266                      * If a property name is provided for `iteratee` the created `_.property`
57267                      * style callback returns the property value of the given element.
57268                      * 
57269                      * If a value is also provided for `thisArg` the created `_.matchesProperty`
57270                      * style callback returns `true` for elements that have a matching property
57271                      * value, else `false`.
57272                      * 
57273                      * If an object is provided for `iteratee` the created `_.matches` style
57274                      * callback returns `true` for elements that have the properties of the
57275                      * given object, else `false`.
57276                      * 
57277                      * @static
57278                      * @memberOf _
57279                      * @category Collection
57280                      * @param {Array|Object|string}
57281                      *            collection The collection to iterate over.
57282                      * @param {Function|Object|string}
57283                      *            [iteratee=_.identity] The function invoked per iteration.
57284                      * @param {*}
57285                      *            [thisArg] The `this` binding of `iteratee`.
57286                      * @returns {Object} Returns the composed aggregate object.
57287                      * @example
57288                      * 
57289                      * _.countBy([4.3, 6.1, 6.4], function(n) { return Math.floor(n); }); // => {
57290                      * '4': 1, '6': 2 }
57291                      * 
57292                      * _.countBy([4.3, 6.1, 6.4], function(n) { return this.floor(n); }, Math); // => {
57293                      * '4': 1, '6': 2 }
57294                      * 
57295                      * _.countBy(['one', 'two', 'three'], 'length'); // => { '3': 2, '5': 1 }
57296                      */
57297                     var countBy = createAggregator(function(result, value, key) {
57298                         hasOwnProperty.call(result, key) ? ++result[key] : (result[key] = 1);
57299                     });
57300
57301                     /**
57302                      * Checks if `predicate` returns truthy for **all** elements of
57303                      * `collection`. The predicate is bound to `thisArg` and invoked with three
57304                      * arguments: (value, index|key, collection).
57305                      * 
57306                      * If a property name is provided for `predicate` the created `_.property`
57307                      * style callback returns the property value of the given element.
57308                      * 
57309                      * If a value is also provided for `thisArg` the created `_.matchesProperty`
57310                      * style callback returns `true` for elements that have a matching property
57311                      * value, else `false`.
57312                      * 
57313                      * If an object is provided for `predicate` the created `_.matches` style
57314                      * callback returns `true` for elements that have the properties of the
57315                      * given object, else `false`.
57316                      * 
57317                      * @static
57318                      * @memberOf _
57319                      * @alias all
57320                      * @category Collection
57321                      * @param {Array|Object|string}
57322                      *            collection The collection to iterate over.
57323                      * @param {Function|Object|string}
57324                      *            [predicate=_.identity] The function invoked per iteration.
57325                      * @param {*}
57326                      *            [thisArg] The `this` binding of `predicate`.
57327                      * @returns {boolean} Returns `true` if all elements pass the predicate
57328                      *          check, else `false`.
57329                      * @example
57330                      * 
57331                      * _.every([true, 1, null, 'yes'], Boolean); // => false
57332                      * 
57333                      * var users = [ { 'user': 'barney', 'active': false }, { 'user': 'fred',
57334                      * 'active': false } ];
57335                      *  // using the `_.matches` callback shorthand _.every(users, { 'user':
57336                      * 'barney', 'active': false }); // => false
57337                      *  // using the `_.matchesProperty` callback shorthand _.every(users,
57338                      * 'active', false); // => true
57339                      *  // using the `_.property` callback shorthand _.every(users, 'active'); // =>
57340                      * false
57341                      */
57342                     function every(collection, predicate, thisArg) {
57343                         var func = isArray(collection) ? arrayEvery : baseEvery;
57344                         if (thisArg && isIterateeCall(collection, predicate, thisArg)) {
57345                             predicate = undefined;
57346                         }
57347                         if (typeof predicate != 'function' || thisArg !== undefined) {
57348                             predicate = getCallback(predicate, thisArg, 3);
57349                         }
57350                         return func(collection, predicate);
57351                     }
57352
57353                     /**
57354                      * Iterates over elements of `collection`, returning an array of all
57355                      * elements `predicate` returns truthy for. The predicate is bound to
57356                      * `thisArg` and invoked with three arguments: (value, index|key,
57357                      * collection).
57358                      * 
57359                      * If a property name is provided for `predicate` the created `_.property`
57360                      * style callback returns the property value of the given element.
57361                      * 
57362                      * If a value is also provided for `thisArg` the created `_.matchesProperty`
57363                      * style callback returns `true` for elements that have a matching property
57364                      * value, else `false`.
57365                      * 
57366                      * If an object is provided for `predicate` the created `_.matches` style
57367                      * callback returns `true` for elements that have the properties of the
57368                      * given object, else `false`.
57369                      * 
57370                      * @static
57371                      * @memberOf _
57372                      * @alias select
57373                      * @category Collection
57374                      * @param {Array|Object|string}
57375                      *            collection The collection to iterate over.
57376                      * @param {Function|Object|string}
57377                      *            [predicate=_.identity] The function invoked per iteration.
57378                      * @param {*}
57379                      *            [thisArg] The `this` binding of `predicate`.
57380                      * @returns {Array} Returns the new filtered array.
57381                      * @example
57382                      * 
57383                      * _.filter([4, 5, 6], function(n) { return n % 2 == 0; }); // => [4, 6]
57384                      * 
57385                      * var users = [ { 'user': 'barney', 'age': 36, 'active': true }, { 'user':
57386                      * 'fred', 'age': 40, 'active': false } ];
57387                      *  // using the `_.matches` callback shorthand _.pluck(_.filter(users, {
57388                      * 'age': 36, 'active': true }), 'user'); // => ['barney']
57389                      *  // using the `_.matchesProperty` callback shorthand
57390                      * _.pluck(_.filter(users, 'active', false), 'user'); // => ['fred']
57391                      *  // using the `_.property` callback shorthand _.pluck(_.filter(users,
57392                      * 'active'), 'user'); // => ['barney']
57393                      */
57394                     function filter(collection, predicate, thisArg) {
57395                         var func = isArray(collection) ? arrayFilter : baseFilter;
57396                         predicate = getCallback(predicate, thisArg, 3);
57397                         return func(collection, predicate);
57398                     }
57399
57400                     /**
57401                      * Iterates over elements of `collection`, returning the first element
57402                      * `predicate` returns truthy for. The predicate is bound to `thisArg` and
57403                      * invoked with three arguments: (value, index|key, collection).
57404                      * 
57405                      * If a property name is provided for `predicate` the created `_.property`
57406                      * style callback returns the property value of the given element.
57407                      * 
57408                      * If a value is also provided for `thisArg` the created `_.matchesProperty`
57409                      * style callback returns `true` for elements that have a matching property
57410                      * value, else `false`.
57411                      * 
57412                      * If an object is provided for `predicate` the created `_.matches` style
57413                      * callback returns `true` for elements that have the properties of the
57414                      * given object, else `false`.
57415                      * 
57416                      * @static
57417                      * @memberOf _
57418                      * @alias detect
57419                      * @category Collection
57420                      * @param {Array|Object|string}
57421                      *            collection The collection to search.
57422                      * @param {Function|Object|string}
57423                      *            [predicate=_.identity] The function invoked per iteration.
57424                      * @param {*}
57425                      *            [thisArg] The `this` binding of `predicate`.
57426                      * @returns {*} Returns the matched element, else `undefined`.
57427                      * @example
57428                      * 
57429                      * var users = [ { 'user': 'barney', 'age': 36, 'active': true }, { 'user':
57430                      * 'fred', 'age': 40, 'active': false }, { 'user': 'pebbles', 'age': 1,
57431                      * 'active': true } ];
57432                      * 
57433                      * _.result(_.find(users, function(chr) { return chr.age < 40; }), 'user'); // =>
57434                      * 'barney'
57435                      *  // using the `_.matches` callback shorthand _.result(_.find(users, {
57436                      * 'age': 1, 'active': true }), 'user'); // => 'pebbles'
57437                      *  // using the `_.matchesProperty` callback shorthand
57438                      * _.result(_.find(users, 'active', false), 'user'); // => 'fred'
57439                      *  // using the `_.property` callback shorthand _.result(_.find(users,
57440                      * 'active'), 'user'); // => 'barney'
57441                      */
57442                     var find = createFind(baseEach);
57443
57444                     /**
57445                      * This method is like `_.find` except that it iterates over elements of
57446                      * `collection` from right to left.
57447                      * 
57448                      * @static
57449                      * @memberOf _
57450                      * @category Collection
57451                      * @param {Array|Object|string}
57452                      *            collection The collection to search.
57453                      * @param {Function|Object|string}
57454                      *            [predicate=_.identity] The function invoked per iteration.
57455                      * @param {*}
57456                      *            [thisArg] The `this` binding of `predicate`.
57457                      * @returns {*} Returns the matched element, else `undefined`.
57458                      * @example
57459                      * 
57460                      * _.findLast([1, 2, 3, 4], function(n) { return n % 2 == 1; }); // => 3
57461                      */
57462                     var findLast = createFind(baseEachRight, true);
57463
57464                     /**
57465                      * Performs a deep comparison between each element in `collection` and the
57466                      * source object, returning the first element that has equivalent property
57467                      * values.
57468                      * 
57469                      * **Note:** This method supports comparing arrays, booleans, `Date`
57470                      * objects, numbers, `Object` objects, regexes, and strings. Objects are
57471                      * compared by their own, not inherited, enumerable properties. For
57472                      * comparing a single own or inherited property value see
57473                      * `_.matchesProperty`.
57474                      * 
57475                      * @static
57476                      * @memberOf _
57477                      * @category Collection
57478                      * @param {Array|Object|string}
57479                      *            collection The collection to search.
57480                      * @param {Object}
57481                      *            source The object of property values to match.
57482                      * @returns {*} Returns the matched element, else `undefined`.
57483                      * @example
57484                      * 
57485                      * var users = [ { 'user': 'barney', 'age': 36, 'active': true }, { 'user':
57486                      * 'fred', 'age': 40, 'active': false } ];
57487                      * 
57488                      * _.result(_.findWhere(users, { 'age': 36, 'active': true }), 'user'); // =>
57489                      * 'barney'
57490                      * 
57491                      * _.result(_.findWhere(users, { 'age': 40, 'active': false }), 'user'); // =>
57492                      * 'fred'
57493                      */
57494                     function findWhere(collection, source) {
57495                         return find(collection, baseMatches(source));
57496                     }
57497
57498                     /**
57499                      * Iterates over elements of `collection` invoking `iteratee` for each
57500                      * element. The `iteratee` is bound to `thisArg` and invoked with three
57501                      * arguments: (value, index|key, collection). Iteratee functions may exit
57502                      * iteration early by explicitly returning `false`.
57503                      * 
57504                      * **Note:** As with other "Collections" methods, objects with a "length"
57505                      * property are iterated like arrays. To avoid this behavior `_.forIn` or
57506                      * `_.forOwn` may be used for object iteration.
57507                      * 
57508                      * @static
57509                      * @memberOf _
57510                      * @alias each
57511                      * @category Collection
57512                      * @param {Array|Object|string}
57513                      *            collection The collection to iterate over.
57514                      * @param {Function}
57515                      *            [iteratee=_.identity] The function invoked per iteration.
57516                      * @param {*}
57517                      *            [thisArg] The `this` binding of `iteratee`.
57518                      * @returns {Array|Object|string} Returns `collection`.
57519                      * @example
57520                      * 
57521                      * _([1, 2]).forEach(function(n) { console.log(n); }).value(); // => logs
57522                      * each value from left to right and returns the array
57523                      * 
57524                      * _.forEach({ 'a': 1, 'b': 2 }, function(n, key) { console.log(n, key); }); // =>
57525                      * logs each value-key pair and returns the object (iteration order is not
57526                      * guaranteed)
57527                      */
57528                     var forEach = createForEach(arrayEach, baseEach);
57529
57530                     /**
57531                      * This method is like `_.forEach` except that it iterates over elements of
57532                      * `collection` from right to left.
57533                      * 
57534                      * @static
57535                      * @memberOf _
57536                      * @alias eachRight
57537                      * @category Collection
57538                      * @param {Array|Object|string}
57539                      *            collection The collection to iterate over.
57540                      * @param {Function}
57541                      *            [iteratee=_.identity] The function invoked per iteration.
57542                      * @param {*}
57543                      *            [thisArg] The `this` binding of `iteratee`.
57544                      * @returns {Array|Object|string} Returns `collection`.
57545                      * @example
57546                      * 
57547                      * _([1, 2]).forEachRight(function(n) { console.log(n); }).value(); // =>
57548                      * logs each value from right to left and returns the array
57549                      */
57550                     var forEachRight = createForEach(arrayEachRight, baseEachRight);
57551
57552                     /**
57553                      * Creates an object composed of keys generated from the results of running
57554                      * each element of `collection` through `iteratee`. The corresponding value
57555                      * of each key is an array of the elements responsible for generating the
57556                      * key. The `iteratee` is bound to `thisArg` and invoked with three
57557                      * arguments: (value, index|key, collection).
57558                      * 
57559                      * If a property name is provided for `iteratee` the created `_.property`
57560                      * style callback returns the property value of the given element.
57561                      * 
57562                      * If a value is also provided for `thisArg` the created `_.matchesProperty`
57563                      * style callback returns `true` for elements that have a matching property
57564                      * value, else `false`.
57565                      * 
57566                      * If an object is provided for `iteratee` the created `_.matches` style
57567                      * callback returns `true` for elements that have the properties of the
57568                      * given object, else `false`.
57569                      * 
57570                      * @static
57571                      * @memberOf _
57572                      * @category Collection
57573                      * @param {Array|Object|string}
57574                      *            collection The collection to iterate over.
57575                      * @param {Function|Object|string}
57576                      *            [iteratee=_.identity] The function invoked per iteration.
57577                      * @param {*}
57578                      *            [thisArg] The `this` binding of `iteratee`.
57579                      * @returns {Object} Returns the composed aggregate object.
57580                      * @example
57581                      * 
57582                      * _.groupBy([4.2, 6.1, 6.4], function(n) { return Math.floor(n); }); // => {
57583                      * '4': [4.2], '6': [6.1, 6.4] }
57584                      * 
57585                      * _.groupBy([4.2, 6.1, 6.4], function(n) { return this.floor(n); }, Math); // => {
57586                      * '4': [4.2], '6': [6.1, 6.4] }
57587                      *  // using the `_.property` callback shorthand _.groupBy(['one', 'two',
57588                      * 'three'], 'length'); // => { '3': ['one', 'two'], '5': ['three'] }
57589                      */
57590                     var groupBy = createAggregator(function(result, value, key) {
57591                         if (hasOwnProperty.call(result, key)) {
57592                             result[key].push(value);
57593                         } else {
57594                             result[key] = [value];
57595                         }
57596                     });
57597
57598                     /**
57599                      * Checks if `value` is in `collection` using
57600                      * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
57601                      * for equality comparisons. If `fromIndex` is negative, it is used as the
57602                      * offset from the end of `collection`.
57603                      * 
57604                      * @static
57605                      * @memberOf _
57606                      * @alias contains, include
57607                      * @category Collection
57608                      * @param {Array|Object|string}
57609                      *            collection The collection to search.
57610                      * @param {*}
57611                      *            target The value to search for.
57612                      * @param {number}
57613                      *            [fromIndex=0] The index to search from.
57614                      * @param- {Object} [guard] Enables use as a callback for functions like
57615                      *         `_.reduce`.
57616                      * @returns {boolean} Returns `true` if a matching element is found, else
57617                      *          `false`.
57618                      * @example
57619                      * 
57620                      * _.includes([1, 2, 3], 1); // => true
57621                      * 
57622                      * _.includes([1, 2, 3], 1, 2); // => false
57623                      * 
57624                      * _.includes({ 'user': 'fred', 'age': 40 }, 'fred'); // => true
57625                      * 
57626                      * _.includes('pebbles', 'eb'); // => true
57627                      */
57628                     function includes(collection, target, fromIndex, guard) {
57629                         var length = collection ? getLength(collection) : 0;
57630                         if (!isLength(length)) {
57631                             collection = values(collection);
57632                             length = collection.length;
57633                         }
57634                         if (typeof fromIndex != 'number' || (guard && isIterateeCall(target, fromIndex, guard))) {
57635                             fromIndex = 0;
57636                         } else {
57637                             fromIndex = fromIndex < 0 ? nativeMax(length + fromIndex, 0) : (fromIndex || 0);
57638                         }
57639                         return (typeof collection == 'string' || !isArray(collection) && isString(collection)) ? (fromIndex <= length && collection.indexOf(target, fromIndex) > -1) : (!!length && getIndexOf(collection, target, fromIndex) > -1);
57640                     }
57641
57642                     /**
57643                      * Creates an object composed of keys generated from the results of running
57644                      * each element of `collection` through `iteratee`. The corresponding value
57645                      * of each key is the last element responsible for generating the key. The
57646                      * iteratee function is bound to `thisArg` and invoked with three arguments:
57647                      * (value, index|key, collection).
57648                      * 
57649                      * If a property name is provided for `iteratee` the created `_.property`
57650                      * style callback returns the property value of the given element.
57651                      * 
57652                      * If a value is also provided for `thisArg` the created `_.matchesProperty`
57653                      * style callback returns `true` for elements that have a matching property
57654                      * value, else `false`.
57655                      * 
57656                      * If an object is provided for `iteratee` the created `_.matches` style
57657                      * callback returns `true` for elements that have the properties of the
57658                      * given object, else `false`.
57659                      * 
57660                      * @static
57661                      * @memberOf _
57662                      * @category Collection
57663                      * @param {Array|Object|string}
57664                      *            collection The collection to iterate over.
57665                      * @param {Function|Object|string}
57666                      *            [iteratee=_.identity] The function invoked per iteration.
57667                      * @param {*}
57668                      *            [thisArg] The `this` binding of `iteratee`.
57669                      * @returns {Object} Returns the composed aggregate object.
57670                      * @example
57671                      * 
57672                      * var keyData = [ { 'dir': 'left', 'code': 97 }, { 'dir': 'right', 'code':
57673                      * 100 } ];
57674                      * 
57675                      * _.indexBy(keyData, 'dir'); // => { 'left': { 'dir': 'left', 'code': 97 },
57676                      * 'right': { 'dir': 'right', 'code': 100 } }
57677                      * 
57678                      * _.indexBy(keyData, function(object) { return
57679                      * String.fromCharCode(object.code); }); // => { 'a': { 'dir': 'left',
57680                      * 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }
57681                      * 
57682                      * _.indexBy(keyData, function(object) { return
57683                      * this.fromCharCode(object.code); }, String); // => { 'a': { 'dir': 'left',
57684                      * 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }
57685                      */
57686                     var indexBy = createAggregator(function(result, value, key) {
57687                         result[key] = value;
57688                     });
57689
57690                     /**
57691                      * Invokes the method at `path` of each element in `collection`, returning
57692                      * an array of the results of each invoked method. Any additional arguments
57693                      * are provided to each invoked method. If `methodName` is a function it is
57694                      * invoked for, and `this` bound to, each element in `collection`.
57695                      * 
57696                      * @static
57697                      * @memberOf _
57698                      * @category Collection
57699                      * @param {Array|Object|string}
57700                      *            collection The collection to iterate over.
57701                      * @param {Array|Function|string}
57702                      *            path The path of the method to invoke or the function invoked
57703                      *            per iteration.
57704                      * @param {...*}
57705                      *            [args] The arguments to invoke the method with.
57706                      * @returns {Array} Returns the array of results.
57707                      * @example
57708                      * 
57709                      * _.invoke([[5, 1, 7], [3, 2, 1]], 'sort'); // => [[1, 5, 7], [1, 2, 3]]
57710                      * 
57711                      * _.invoke([123, 456], String.prototype.split, ''); // => [['1', '2', '3'],
57712                      * ['4', '5', '6']]
57713                      */
57714                     var invoke = restParam(function(collection, path, args) {
57715                         var index = -1,
57716                             isFunc = typeof path == 'function',
57717                             isProp = isKey(path),
57718                             result = isArrayLike(collection) ? Array(collection.length) : [];
57719
57720                         baseEach(collection, function(value) {
57721                             var func = isFunc ? path : ((isProp && value != null) ? value[path] : undefined);
57722                             result[++index] = func ? func.apply(value, args) : invokePath(value, path, args);
57723                         });
57724                         return result;
57725                     });
57726
57727                     /**
57728                      * Creates an array of values by running each element in `collection`
57729                      * through `iteratee`. The `iteratee` is bound to `thisArg` and invoked with
57730                      * three arguments: (value, index|key, collection).
57731                      * 
57732                      * If a property name is provided for `iteratee` the created `_.property`
57733                      * style callback returns the property value of the given element.
57734                      * 
57735                      * If a value is also provided for `thisArg` the created `_.matchesProperty`
57736                      * style callback returns `true` for elements that have a matching property
57737                      * value, else `false`.
57738                      * 
57739                      * If an object is provided for `iteratee` the created `_.matches` style
57740                      * callback returns `true` for elements that have the properties of the
57741                      * given object, else `false`.
57742                      * 
57743                      * Many lodash methods are guarded to work as iteratees for methods like
57744                      * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
57745                      * 
57746                      * The guarded methods are: `ary`, `callback`, `chunk`, `clone`, `create`,
57747                      * `curry`, `curryRight`, `drop`, `dropRight`, `every`, `fill`, `flatten`,
57748                      * `invert`, `max`, `min`, `parseInt`, `slice`, `sortBy`, `take`,
57749                      * `takeRight`, `template`, `trim`, `trimLeft`, `trimRight`, `trunc`,
57750                      * `random`, `range`, `sample`, `some`, `sum`, `uniq`, and `words`
57751                      * 
57752                      * @static
57753                      * @memberOf _
57754                      * @alias collect
57755                      * @category Collection
57756                      * @param {Array|Object|string}
57757                      *            collection The collection to iterate over.
57758                      * @param {Function|Object|string}
57759                      *            [iteratee=_.identity] The function invoked per iteration.
57760                      * @param {*}
57761                      *            [thisArg] The `this` binding of `iteratee`.
57762                      * @returns {Array} Returns the new mapped array.
57763                      * @example
57764                      * 
57765                      * function timesThree(n) { return n * 3; }
57766                      * 
57767                      * _.map([1, 2], timesThree); // => [3, 6]
57768                      * 
57769                      * _.map({ 'a': 1, 'b': 2 }, timesThree); // => [3, 6] (iteration order is
57770                      * not guaranteed)
57771                      * 
57772                      * var users = [ { 'user': 'barney' }, { 'user': 'fred' } ];
57773                      *  // using the `_.property` callback shorthand _.map(users, 'user'); // =>
57774                      * ['barney', 'fred']
57775                      */
57776                     function map(collection, iteratee, thisArg) {
57777                         var func = isArray(collection) ? arrayMap : baseMap;
57778                         iteratee = getCallback(iteratee, thisArg, 3);
57779                         return func(collection, iteratee);
57780                     }
57781
57782                     /**
57783                      * Creates an array of elements split into two groups, the first of which
57784                      * contains elements `predicate` returns truthy for, while the second of
57785                      * which contains elements `predicate` returns falsey for. The predicate is
57786                      * bound to `thisArg` and invoked with three arguments: (value, index|key,
57787                      * collection).
57788                      * 
57789                      * If a property name is provided for `predicate` the created `_.property`
57790                      * style callback returns the property value of the given element.
57791                      * 
57792                      * If a value is also provided for `thisArg` the created `_.matchesProperty`
57793                      * style callback returns `true` for elements that have a matching property
57794                      * value, else `false`.
57795                      * 
57796                      * If an object is provided for `predicate` the created `_.matches` style
57797                      * callback returns `true` for elements that have the properties of the
57798                      * given object, else `false`.
57799                      * 
57800                      * @static
57801                      * @memberOf _
57802                      * @category Collection
57803                      * @param {Array|Object|string}
57804                      *            collection The collection to iterate over.
57805                      * @param {Function|Object|string}
57806                      *            [predicate=_.identity] The function invoked per iteration.
57807                      * @param {*}
57808                      *            [thisArg] The `this` binding of `predicate`.
57809                      * @returns {Array} Returns the array of grouped elements.
57810                      * @example
57811                      * 
57812                      * _.partition([1, 2, 3], function(n) { return n % 2; }); // => [[1, 3],
57813                      * [2]]
57814                      * 
57815                      * _.partition([1.2, 2.3, 3.4], function(n) { return this.floor(n) % 2; },
57816                      * Math); // => [[1.2, 3.4], [2.3]]
57817                      * 
57818                      * var users = [ { 'user': 'barney', 'age': 36, 'active': false }, { 'user':
57819                      * 'fred', 'age': 40, 'active': true }, { 'user': 'pebbles', 'age': 1,
57820                      * 'active': false } ];
57821                      * 
57822                      * var mapper = function(array) { return _.pluck(array, 'user'); };
57823                      *  // using the `_.matches` callback shorthand _.map(_.partition(users, {
57824                      * 'age': 1, 'active': false }), mapper); // => [['pebbles'], ['barney',
57825                      * 'fred']]
57826                      *  // using the `_.matchesProperty` callback shorthand
57827                      * _.map(_.partition(users, 'active', false), mapper); // => [['barney',
57828                      * 'pebbles'], ['fred']]
57829                      *  // using the `_.property` callback shorthand _.map(_.partition(users,
57830                      * 'active'), mapper); // => [['fred'], ['barney', 'pebbles']]
57831                      */
57832                     var partition = createAggregator(function(result, value, key) {
57833                         result[key ? 0 : 1].push(value);
57834                     }, function() {
57835                         return [
57836                             [],
57837                             []
57838                         ];
57839                     });
57840
57841                     /**
57842                      * Gets the property value of `path` from all elements in `collection`.
57843                      * 
57844                      * @static
57845                      * @memberOf _
57846                      * @category Collection
57847                      * @param {Array|Object|string}
57848                      *            collection The collection to iterate over.
57849                      * @param {Array|string}
57850                      *            path The path of the property to pluck.
57851                      * @returns {Array} Returns the property values.
57852                      * @example
57853                      * 
57854                      * var users = [ { 'user': 'barney', 'age': 36 }, { 'user': 'fred', 'age':
57855                      * 40 } ];
57856                      * 
57857                      * _.pluck(users, 'user'); // => ['barney', 'fred']
57858                      * 
57859                      * var userIndex = _.indexBy(users, 'user'); _.pluck(userIndex, 'age'); // =>
57860                      * [36, 40] (iteration order is not guaranteed)
57861                      */
57862                     function pluck(collection, path) {
57863                         return map(collection, property(path));
57864                     }
57865
57866                     /**
57867                      * Reduces `collection` to a value which is the accumulated result of
57868                      * running each element in `collection` through `iteratee`, where each
57869                      * successive invocation is supplied the return value of the previous. If
57870                      * `accumulator` is not provided the first element of `collection` is used
57871                      * as the initial value. The `iteratee` is bound to `thisArg` and invoked
57872                      * with four arguments: (accumulator, value, index|key, collection).
57873                      * 
57874                      * Many lodash methods are guarded to work as iteratees for methods like
57875                      * `_.reduce`, `_.reduceRight`, and `_.transform`.
57876                      * 
57877                      * The guarded methods are: `assign`, `defaults`, `defaultsDeep`,
57878                      * `includes`, `merge`, `sortByAll`, and `sortByOrder`
57879                      * 
57880                      * @static
57881                      * @memberOf _
57882                      * @alias foldl, inject
57883                      * @category Collection
57884                      * @param {Array|Object|string}
57885                      *            collection The collection to iterate over.
57886                      * @param {Function}
57887                      *            [iteratee=_.identity] The function invoked per iteration.
57888                      * @param {*}
57889                      *            [accumulator] The initial value.
57890                      * @param {*}
57891                      *            [thisArg] The `this` binding of `iteratee`.
57892                      * @returns {*} Returns the accumulated value.
57893                      * @example
57894                      * 
57895                      * _.reduce([1, 2], function(total, n) { return total + n; }); // => 3
57896                      * 
57897                      * _.reduce({ 'a': 1, 'b': 2 }, function(result, n, key) { result[key] = n *
57898                      * 3; return result; }, {}); // => { 'a': 3, 'b': 6 } (iteration order is
57899                      * not guaranteed)
57900                      */
57901                     var reduce = createReduce(arrayReduce, baseEach);
57902
57903                     /**
57904                      * This method is like `_.reduce` except that it iterates over elements of
57905                      * `collection` from right to left.
57906                      * 
57907                      * @static
57908                      * @memberOf _
57909                      * @alias foldr
57910                      * @category Collection
57911                      * @param {Array|Object|string}
57912                      *            collection The collection to iterate over.
57913                      * @param {Function}
57914                      *            [iteratee=_.identity] The function invoked per iteration.
57915                      * @param {*}
57916                      *            [accumulator] The initial value.
57917                      * @param {*}
57918                      *            [thisArg] The `this` binding of `iteratee`.
57919                      * @returns {*} Returns the accumulated value.
57920                      * @example
57921                      * 
57922                      * var array = [[0, 1], [2, 3], [4, 5]];
57923                      * 
57924                      * _.reduceRight(array, function(flattened, other) { return
57925                      * flattened.concat(other); }, []); // => [4, 5, 2, 3, 0, 1]
57926                      */
57927                     var reduceRight = createReduce(arrayReduceRight, baseEachRight);
57928
57929                     /**
57930                      * The opposite of `_.filter`; this method returns the elements of
57931                      * `collection` that `predicate` does **not** return truthy for.
57932                      * 
57933                      * @static
57934                      * @memberOf _
57935                      * @category Collection
57936                      * @param {Array|Object|string}
57937                      *            collection The collection to iterate over.
57938                      * @param {Function|Object|string}
57939                      *            [predicate=_.identity] The function invoked per iteration.
57940                      * @param {*}
57941                      *            [thisArg] The `this` binding of `predicate`.
57942                      * @returns {Array} Returns the new filtered array.
57943                      * @example
57944                      * 
57945                      * _.reject([1, 2, 3, 4], function(n) { return n % 2 == 0; }); // => [1, 3]
57946                      * 
57947                      * var users = [ { 'user': 'barney', 'age': 36, 'active': false }, { 'user':
57948                      * 'fred', 'age': 40, 'active': true } ];
57949                      *  // using the `_.matches` callback shorthand _.pluck(_.reject(users, {
57950                      * 'age': 40, 'active': true }), 'user'); // => ['barney']
57951                      *  // using the `_.matchesProperty` callback shorthand
57952                      * _.pluck(_.reject(users, 'active', false), 'user'); // => ['fred']
57953                      *  // using the `_.property` callback shorthand _.pluck(_.reject(users,
57954                      * 'active'), 'user'); // => ['barney']
57955                      */
57956                     function reject(collection, predicate, thisArg) {
57957                         var func = isArray(collection) ? arrayFilter : baseFilter;
57958                         predicate = getCallback(predicate, thisArg, 3);
57959                         return func(collection, function(value, index, collection) {
57960                             return !predicate(value, index, collection);
57961                         });
57962                     }
57963
57964                     /**
57965                      * Gets a random element or `n` random elements from a collection.
57966                      * 
57967                      * @static
57968                      * @memberOf _
57969                      * @category Collection
57970                      * @param {Array|Object|string}
57971                      *            collection The collection to sample.
57972                      * @param {number}
57973                      *            [n] The number of elements to sample.
57974                      * @param- {Object} [guard] Enables use as a callback for functions like
57975                      *         `_.map`.
57976                      * @returns {*} Returns the random sample(s).
57977                      * @example
57978                      * 
57979                      * _.sample([1, 2, 3, 4]); // => 2
57980                      * 
57981                      * _.sample([1, 2, 3, 4], 2); // => [3, 1]
57982                      */
57983                     function sample(collection, n, guard) {
57984                         if (guard ? isIterateeCall(collection, n, guard) : n == null) {
57985                             collection = toIterable(collection);
57986                             var length = collection.length;
57987                             return length > 0 ? collection[baseRandom(0, length - 1)] : undefined;
57988                         }
57989                         var index = -1,
57990                             result = toArray(collection),
57991                             length = result.length,
57992                             lastIndex = length - 1;
57993
57994                         n = nativeMin(n < 0 ? 0 : (+n || 0), length);
57995                         while (++index < n) {
57996                             var rand = baseRandom(index, lastIndex),
57997                                 value = result[rand];
57998
57999                             result[rand] = result[index];
58000                             result[index] = value;
58001                         }
58002                         result.length = n;
58003                         return result;
58004                     }
58005
58006                     /**
58007                      * Creates an array of shuffled values, using a version of the [Fisher-Yates
58008                      * shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).
58009                      * 
58010                      * @static
58011                      * @memberOf _
58012                      * @category Collection
58013                      * @param {Array|Object|string}
58014                      *            collection The collection to shuffle.
58015                      * @returns {Array} Returns the new shuffled array.
58016                      * @example
58017                      * 
58018                      * _.shuffle([1, 2, 3, 4]); // => [4, 1, 3, 2]
58019                      */
58020                     function shuffle(collection) {
58021                         return sample(collection, POSITIVE_INFINITY);
58022                     }
58023
58024                     /**
58025                      * Gets the size of `collection` by returning its length for array-like
58026                      * values or the number of own enumerable properties for objects.
58027                      * 
58028                      * @static
58029                      * @memberOf _
58030                      * @category Collection
58031                      * @param {Array|Object|string}
58032                      *            collection The collection to inspect.
58033                      * @returns {number} Returns the size of `collection`.
58034                      * @example
58035                      * 
58036                      * _.size([1, 2, 3]); // => 3
58037                      * 
58038                      * _.size({ 'a': 1, 'b': 2 }); // => 2
58039                      * 
58040                      * _.size('pebbles'); // => 7
58041                      */
58042                     function size(collection) {
58043                         var length = collection ? getLength(collection) : 0;
58044                         return isLength(length) ? length : keys(collection).length;
58045                     }
58046
58047                     /**
58048                      * Checks if `predicate` returns truthy for **any** element of `collection`.
58049                      * The function returns as soon as it finds a passing value and does not
58050                      * iterate over the entire collection. The predicate is bound to `thisArg`
58051                      * and invoked with three arguments: (value, index|key, collection).
58052                      * 
58053                      * If a property name is provided for `predicate` the created `_.property`
58054                      * style callback returns the property value of the given element.
58055                      * 
58056                      * If a value is also provided for `thisArg` the created `_.matchesProperty`
58057                      * style callback returns `true` for elements that have a matching property
58058                      * value, else `false`.
58059                      * 
58060                      * If an object is provided for `predicate` the created `_.matches` style
58061                      * callback returns `true` for elements that have the properties of the
58062                      * given object, else `false`.
58063                      * 
58064                      * @static
58065                      * @memberOf _
58066                      * @alias any
58067                      * @category Collection
58068                      * @param {Array|Object|string}
58069                      *            collection The collection to iterate over.
58070                      * @param {Function|Object|string}
58071                      *            [predicate=_.identity] The function invoked per iteration.
58072                      * @param {*}
58073                      *            [thisArg] The `this` binding of `predicate`.
58074                      * @returns {boolean} Returns `true` if any element passes the predicate
58075                      *          check, else `false`.
58076                      * @example
58077                      * 
58078                      * _.some([null, 0, 'yes', false], Boolean); // => true
58079                      * 
58080                      * var users = [ { 'user': 'barney', 'active': true }, { 'user': 'fred',
58081                      * 'active': false } ];
58082                      *  // using the `_.matches` callback shorthand _.some(users, { 'user':
58083                      * 'barney', 'active': false }); // => false
58084                      *  // using the `_.matchesProperty` callback shorthand _.some(users,
58085                      * 'active', false); // => true
58086                      *  // using the `_.property` callback shorthand _.some(users, 'active'); // =>
58087                      * true
58088                      */
58089                     function some(collection, predicate, thisArg) {
58090                         var func = isArray(collection) ? arraySome : baseSome;
58091                         if (thisArg && isIterateeCall(collection, predicate, thisArg)) {
58092                             predicate = undefined;
58093                         }
58094                         if (typeof predicate != 'function' || thisArg !== undefined) {
58095                             predicate = getCallback(predicate, thisArg, 3);
58096                         }
58097                         return func(collection, predicate);
58098                     }
58099
58100                     /**
58101                      * Creates an array of elements, sorted in ascending order by the results of
58102                      * running each element in a collection through `iteratee`. This method
58103                      * performs a stable sort, that is, it preserves the original sort order of
58104                      * equal elements. The `iteratee` is bound to `thisArg` and invoked with
58105                      * three arguments: (value, index|key, collection).
58106                      * 
58107                      * If a property name is provided for `iteratee` the created `_.property`
58108                      * style callback returns the property value of the given element.
58109                      * 
58110                      * If a value is also provided for `thisArg` the created `_.matchesProperty`
58111                      * style callback returns `true` for elements that have a matching property
58112                      * value, else `false`.
58113                      * 
58114                      * If an object is provided for `iteratee` the created `_.matches` style
58115                      * callback returns `true` for elements that have the properties of the
58116                      * given object, else `false`.
58117                      * 
58118                      * @static
58119                      * @memberOf _
58120                      * @category Collection
58121                      * @param {Array|Object|string}
58122                      *            collection The collection to iterate over.
58123                      * @param {Function|Object|string}
58124                      *            [iteratee=_.identity] The function invoked per iteration.
58125                      * @param {*}
58126                      *            [thisArg] The `this` binding of `iteratee`.
58127                      * @returns {Array} Returns the new sorted array.
58128                      * @example
58129                      * 
58130                      * _.sortBy([1, 2, 3], function(n) { return Math.sin(n); }); // => [3, 1, 2]
58131                      * 
58132                      * _.sortBy([1, 2, 3], function(n) { return this.sin(n); }, Math); // => [3,
58133                      * 1, 2]
58134                      * 
58135                      * var users = [ { 'user': 'fred' }, { 'user': 'pebbles' }, { 'user':
58136                      * 'barney' } ];
58137                      *  // using the `_.property` callback shorthand _.pluck(_.sortBy(users,
58138                      * 'user'), 'user'); // => ['barney', 'fred', 'pebbles']
58139                      */
58140                     function sortBy(collection, iteratee, thisArg) {
58141                         if (collection == null) {
58142                             return [];
58143                         }
58144                         if (thisArg && isIterateeCall(collection, iteratee, thisArg)) {
58145                             iteratee = undefined;
58146                         }
58147                         var index = -1;
58148                         iteratee = getCallback(iteratee, thisArg, 3);
58149
58150                         var result = baseMap(collection, function(value, key, collection) {
58151                             return {
58152                                 'criteria': iteratee(value, key, collection),
58153                                 'index': ++index,
58154                                 'value': value
58155                             };
58156                         });
58157                         return baseSortBy(result, compareAscending);
58158                     }
58159
58160                     /**
58161                      * This method is like `_.sortBy` except that it can sort by multiple
58162                      * iteratees or property names.
58163                      * 
58164                      * If a property name is provided for an iteratee the created `_.property`
58165                      * style callback returns the property value of the given element.
58166                      * 
58167                      * If an object is provided for an iteratee the created `_.matches` style
58168                      * callback returns `true` for elements that have the properties of the
58169                      * given object, else `false`.
58170                      * 
58171                      * @static
58172                      * @memberOf _
58173                      * @category Collection
58174                      * @param {Array|Object|string}
58175                      *            collection The collection to iterate over.
58176                      * @param {...(Function|Function[]|Object|Object[]|string|string[])}
58177                      *            iteratees The iteratees to sort by, specified as individual
58178                      *            values or arrays of values.
58179                      * @returns {Array} Returns the new sorted array.
58180                      * @example
58181                      * 
58182                      * var users = [ { 'user': 'fred', 'age': 48 }, { 'user': 'barney', 'age':
58183                      * 36 }, { 'user': 'fred', 'age': 42 }, { 'user': 'barney', 'age': 34 } ];
58184                      * 
58185                      * _.map(_.sortByAll(users, ['user', 'age']), _.values); // => [['barney',
58186                      * 34], ['barney', 36], ['fred', 42], ['fred', 48]]
58187                      * 
58188                      * _.map(_.sortByAll(users, 'user', function(chr) { return
58189                      * Math.floor(chr.age / 10); }), _.values); // => [['barney', 36],
58190                      * ['barney', 34], ['fred', 48], ['fred', 42]]
58191                      */
58192                     var sortByAll = restParam(function(collection, iteratees) {
58193                         if (collection == null) {
58194                             return [];
58195                         }
58196                         var guard = iteratees[2];
58197                         if (guard && isIterateeCall(iteratees[0], iteratees[1], guard)) {
58198                             iteratees.length = 1;
58199                         }
58200                         return baseSortByOrder(collection, baseFlatten(iteratees), []);
58201                     });
58202
58203                     /**
58204                      * This method is like `_.sortByAll` except that it allows specifying the
58205                      * sort orders of the iteratees to sort by. If `orders` is unspecified, all
58206                      * values are sorted in ascending order. Otherwise, a value is sorted in
58207                      * ascending order if its corresponding order is "asc", and descending if
58208                      * "desc".
58209                      * 
58210                      * If a property name is provided for an iteratee the created `_.property`
58211                      * style callback returns the property value of the given element.
58212                      * 
58213                      * If an object is provided for an iteratee the created `_.matches` style
58214                      * callback returns `true` for elements that have the properties of the
58215                      * given object, else `false`.
58216                      * 
58217                      * @static
58218                      * @memberOf _
58219                      * @category Collection
58220                      * @param {Array|Object|string}
58221                      *            collection The collection to iterate over.
58222                      * @param {Function[]|Object[]|string[]}
58223                      *            iteratees The iteratees to sort by.
58224                      * @param {boolean[]}
58225                      *            [orders] The sort orders of `iteratees`.
58226                      * @param- {Object} [guard] Enables use as a callback for functions like
58227                      *         `_.reduce`.
58228                      * @returns {Array} Returns the new sorted array.
58229                      * @example
58230                      * 
58231                      * var users = [ { 'user': 'fred', 'age': 48 }, { 'user': 'barney', 'age':
58232                      * 34 }, { 'user': 'fred', 'age': 42 }, { 'user': 'barney', 'age': 36 } ];
58233                      *  // sort by `user` in ascending order and by `age` in descending order
58234                      * _.map(_.sortByOrder(users, ['user', 'age'], ['asc', 'desc']), _.values); // =>
58235                      * [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]]
58236                      */
58237                     function sortByOrder(collection, iteratees, orders, guard) {
58238                         if (collection == null) {
58239                             return [];
58240                         }
58241                         if (guard && isIterateeCall(iteratees, orders, guard)) {
58242                             orders = undefined;
58243                         }
58244                         if (!isArray(iteratees)) {
58245                             iteratees = iteratees == null ? [] : [iteratees];
58246                         }
58247                         if (!isArray(orders)) {
58248                             orders = orders == null ? [] : [orders];
58249                         }
58250                         return baseSortByOrder(collection, iteratees, orders);
58251                     }
58252
58253                     /**
58254                      * Performs a deep comparison between each element in `collection` and the
58255                      * source object, returning an array of all elements that have equivalent
58256                      * property values.
58257                      * 
58258                      * **Note:** This method supports comparing arrays, booleans, `Date`
58259                      * objects, numbers, `Object` objects, regexes, and strings. Objects are
58260                      * compared by their own, not inherited, enumerable properties. For
58261                      * comparing a single own or inherited property value see
58262                      * `_.matchesProperty`.
58263                      * 
58264                      * @static
58265                      * @memberOf _
58266                      * @category Collection
58267                      * @param {Array|Object|string}
58268                      *            collection The collection to search.
58269                      * @param {Object}
58270                      *            source The object of property values to match.
58271                      * @returns {Array} Returns the new filtered array.
58272                      * @example
58273                      * 
58274                      * var users = [ { 'user': 'barney', 'age': 36, 'active': false, 'pets':
58275                      * ['hoppy'] }, { 'user': 'fred', 'age': 40, 'active': true, 'pets': ['baby
58276                      * puss', 'dino'] } ];
58277                      * 
58278                      * _.pluck(_.where(users, { 'age': 36, 'active': false }), 'user'); // =>
58279                      * ['barney']
58280                      * 
58281                      * _.pluck(_.where(users, { 'pets': ['dino'] }), 'user'); // => ['fred']
58282                      */
58283                     function where(collection, source) {
58284                         return filter(collection, baseMatches(source));
58285                     }
58286
58287                     /*------------------------------------------------------------------------*/
58288
58289                     /**
58290                      * Gets the number of milliseconds that have elapsed since the Unix epoch (1
58291                      * January 1970 00:00:00 UTC).
58292                      * 
58293                      * @static
58294                      * @memberOf _
58295                      * @category Date
58296                      * @example
58297                      * 
58298                      * _.defer(function(stamp) { console.log(_.now() - stamp); }, _.now()); // =>
58299                      * logs the number of milliseconds it took for the deferred function to be
58300                      * invoked
58301                      */
58302                     var now = nativeNow || function() {
58303                         return new Date().getTime();
58304                     };
58305
58306                     /*------------------------------------------------------------------------*/
58307
58308                     /**
58309                      * The opposite of `_.before`; this method creates a function that invokes
58310                      * `func` once it is called `n` or more times.
58311                      * 
58312                      * @static
58313                      * @memberOf _
58314                      * @category Function
58315                      * @param {number}
58316                      *            n The number of calls before `func` is invoked.
58317                      * @param {Function}
58318                      *            func The function to restrict.
58319                      * @returns {Function} Returns the new restricted function.
58320                      * @example
58321                      * 
58322                      * var saves = ['profile', 'settings'];
58323                      * 
58324                      * var done = _.after(saves.length, function() { console.log('done
58325                      * saving!'); });
58326                      * 
58327                      * _.forEach(saves, function(type) { asyncSave({ 'type': type, 'complete':
58328                      * done }); }); // => logs 'done saving!' after the two async saves have
58329                      * completed
58330                      */
58331                     function after(n, func) {
58332                         if (typeof func != 'function') {
58333                             if (typeof n == 'function') {
58334                                 var temp = n;
58335                                 n = func;
58336                                 func = temp;
58337                             } else {
58338                                 throw new TypeError(FUNC_ERROR_TEXT);
58339                             }
58340                         }
58341                         n = nativeIsFinite(n = +n) ? n : 0;
58342                         return function() {
58343                             if (--n < 1) {
58344                                 return func.apply(this, arguments);
58345                             }
58346                         };
58347                     }
58348
58349                     /**
58350                      * Creates a function that accepts up to `n` arguments ignoring any
58351                      * additional arguments.
58352                      * 
58353                      * @static
58354                      * @memberOf _
58355                      * @category Function
58356                      * @param {Function}
58357                      *            func The function to cap arguments for.
58358                      * @param {number}
58359                      *            [n=func.length] The arity cap.
58360                      * @param- {Object} [guard] Enables use as a callback for functions like
58361                      *         `_.map`.
58362                      * @returns {Function} Returns the new function.
58363                      * @example
58364                      * 
58365                      * _.map(['6', '8', '10'], _.ary(parseInt, 1)); // => [6, 8, 10]
58366                      */
58367                     function ary(func, n, guard) {
58368                         if (guard && isIterateeCall(func, n, guard)) {
58369                             n = undefined;
58370                         }
58371                         n = (func && n == null) ? func.length : nativeMax(+n || 0, 0);
58372                         return createWrapper(func, ARY_FLAG, undefined, undefined, undefined, undefined, n);
58373                     }
58374
58375                     /**
58376                      * Creates a function that invokes `func`, with the `this` binding and
58377                      * arguments of the created function, while it is called less than `n`
58378                      * times. Subsequent calls to the created function return the result of the
58379                      * last `func` invocation.
58380                      * 
58381                      * @static
58382                      * @memberOf _
58383                      * @category Function
58384                      * @param {number}
58385                      *            n The number of calls at which `func` is no longer invoked.
58386                      * @param {Function}
58387                      *            func The function to restrict.
58388                      * @returns {Function} Returns the new restricted function.
58389                      * @example
58390                      * 
58391                      * jQuery('#add').on('click', _.before(5, addContactToList)); // => allows
58392                      * adding up to 4 contacts to the list
58393                      */
58394                     function before(n, func) {
58395                         var result;
58396                         if (typeof func != 'function') {
58397                             if (typeof n == 'function') {
58398                                 var temp = n;
58399                                 n = func;
58400                                 func = temp;
58401                             } else {
58402                                 throw new TypeError(FUNC_ERROR_TEXT);
58403                             }
58404                         }
58405                         return function() {
58406                             if (--n > 0) {
58407                                 result = func.apply(this, arguments);
58408                             }
58409                             if (n <= 1) {
58410                                 func = undefined;
58411                             }
58412                             return result;
58413                         };
58414                     }
58415
58416                     /**
58417                      * Creates a function that invokes `func` with the `this` binding of
58418                      * `thisArg` and prepends any additional `_.bind` arguments to those
58419                      * provided to the bound function.
58420                      * 
58421                      * The `_.bind.placeholder` value, which defaults to `_` in monolithic
58422                      * builds, may be used as a placeholder for partially applied arguments.
58423                      * 
58424                      * **Note:** Unlike native `Function#bind` this method does not set the
58425                      * "length" property of bound functions.
58426                      * 
58427                      * @static
58428                      * @memberOf _
58429                      * @category Function
58430                      * @param {Function}
58431                      *            func The function to bind.
58432                      * @param {*}
58433                      *            thisArg The `this` binding of `func`.
58434                      * @param {...*}
58435                      *            [partials] The arguments to be partially applied.
58436                      * @returns {Function} Returns the new bound function.
58437                      * @example
58438                      * 
58439                      * var greet = function(greeting, punctuation) { return greeting + ' ' +
58440                      * this.user + punctuation; };
58441                      * 
58442                      * var object = { 'user': 'fred' };
58443                      * 
58444                      * var bound = _.bind(greet, object, 'hi'); bound('!'); // => 'hi fred!'
58445                      *  // using placeholders var bound = _.bind(greet, object, _, '!');
58446                      * bound('hi'); // => 'hi fred!'
58447                      */
58448                     var bind = restParam(function(func, thisArg, partials) {
58449                         var bitmask = BIND_FLAG;
58450                         if (partials.length) {
58451                             var holders = replaceHolders(partials, bind.placeholder);
58452                             bitmask |= PARTIAL_FLAG;
58453                         }
58454                         return createWrapper(func, bitmask, thisArg, partials, holders);
58455                     });
58456
58457                     /**
58458                      * Binds methods of an object to the object itself, overwriting the existing
58459                      * method. Method names may be specified as individual arguments or as
58460                      * arrays of method names. If no method names are provided all enumerable
58461                      * function properties, own and inherited, of `object` are bound.
58462                      * 
58463                      * **Note:** This method does not set the "length" property of bound
58464                      * functions.
58465                      * 
58466                      * @static
58467                      * @memberOf _
58468                      * @category Function
58469                      * @param {Object}
58470                      *            object The object to bind and assign the bound methods to.
58471                      * @param {...(string|string[])}
58472                      *            [methodNames] The object method names to bind, specified as
58473                      *            individual method names or arrays of method names.
58474                      * @returns {Object} Returns `object`.
58475                      * @example
58476                      * 
58477                      * var view = { 'label': 'docs', 'onClick': function() {
58478                      * console.log('clicked ' + this.label); } };
58479                      * 
58480                      * _.bindAll(view); jQuery('#docs').on('click', view.onClick); // => logs
58481                      * 'clicked docs' when the element is clicked
58482                      */
58483                     var bindAll = restParam(function(object, methodNames) {
58484                         methodNames = methodNames.length ? baseFlatten(methodNames) : functions(object);
58485
58486                         var index = -1,
58487                             length = methodNames.length;
58488
58489                         while (++index < length) {
58490                             var key = methodNames[index];
58491                             object[key] = createWrapper(object[key], BIND_FLAG, object);
58492                         }
58493                         return object;
58494                     });
58495
58496                     /**
58497                      * Creates a function that invokes the method at `object[key]` and prepends
58498                      * any additional `_.bindKey` arguments to those provided to the bound
58499                      * function.
58500                      * 
58501                      * This method differs from `_.bind` by allowing bound functions to
58502                      * reference methods that may be redefined or don't yet exist. See [Peter
58503                      * Michaux's
58504                      * article](http://peter.michaux.ca/articles/lazy-function-definition-pattern)
58505                      * for more details.
58506                      * 
58507                      * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic
58508                      * builds, may be used as a placeholder for partially applied arguments.
58509                      * 
58510                      * @static
58511                      * @memberOf _
58512                      * @category Function
58513                      * @param {Object}
58514                      *            object The object the method belongs to.
58515                      * @param {string}
58516                      *            key The key of the method.
58517                      * @param {...*}
58518                      *            [partials] The arguments to be partially applied.
58519                      * @returns {Function} Returns the new bound function.
58520                      * @example
58521                      * 
58522                      * var object = { 'user': 'fred', 'greet': function(greeting, punctuation) {
58523                      * return greeting + ' ' + this.user + punctuation; } };
58524                      * 
58525                      * var bound = _.bindKey(object, 'greet', 'hi'); bound('!'); // => 'hi
58526                      * fred!'
58527                      * 
58528                      * object.greet = function(greeting, punctuation) { return greeting + 'ya ' +
58529                      * this.user + punctuation; };
58530                      * 
58531                      * bound('!'); // => 'hiya fred!'
58532                      *  // using placeholders var bound = _.bindKey(object, 'greet', _, '!');
58533                      * bound('hi'); // => 'hiya fred!'
58534                      */
58535                     var bindKey = restParam(function(object, key, partials) {
58536                         var bitmask = BIND_FLAG | BIND_KEY_FLAG;
58537                         if (partials.length) {
58538                             var holders = replaceHolders(partials, bindKey.placeholder);
58539                             bitmask |= PARTIAL_FLAG;
58540                         }
58541                         return createWrapper(key, bitmask, object, partials, holders);
58542                     });
58543
58544                     /**
58545                      * Creates a function that accepts one or more arguments of `func` that when
58546                      * called either invokes `func` returning its result, if all `func`
58547                      * arguments have been provided, or returns a function that accepts one or
58548                      * more of the remaining `func` arguments, and so on. The arity of `func`
58549                      * may be specified if `func.length` is not sufficient.
58550                      * 
58551                      * The `_.curry.placeholder` value, which defaults to `_` in monolithic
58552                      * builds, may be used as a placeholder for provided arguments.
58553                      * 
58554                      * **Note:** This method does not set the "length" property of curried
58555                      * functions.
58556                      * 
58557                      * @static
58558                      * @memberOf _
58559                      * @category Function
58560                      * @param {Function}
58561                      *            func The function to curry.
58562                      * @param {number}
58563                      *            [arity=func.length] The arity of `func`.
58564                      * @param- {Object} [guard] Enables use as a callback for functions like
58565                      *         `_.map`.
58566                      * @returns {Function} Returns the new curried function.
58567                      * @example
58568                      * 
58569                      * var abc = function(a, b, c) { return [a, b, c]; };
58570                      * 
58571                      * var curried = _.curry(abc);
58572                      * 
58573                      * curried(1)(2)(3); // => [1, 2, 3]
58574                      * 
58575                      * curried(1, 2)(3); // => [1, 2, 3]
58576                      * 
58577                      * curried(1, 2, 3); // => [1, 2, 3]
58578                      *  // using placeholders curried(1)(_, 3)(2); // => [1, 2, 3]
58579                      */
58580                     var curry = createCurry(CURRY_FLAG);
58581
58582                     /**
58583                      * This method is like `_.curry` except that arguments are applied to `func`
58584                      * in the manner of `_.partialRight` instead of `_.partial`.
58585                      * 
58586                      * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic
58587                      * builds, may be used as a placeholder for provided arguments.
58588                      * 
58589                      * **Note:** This method does not set the "length" property of curried
58590                      * functions.
58591                      * 
58592                      * @static
58593                      * @memberOf _
58594                      * @category Function
58595                      * @param {Function}
58596                      *            func The function to curry.
58597                      * @param {number}
58598                      *            [arity=func.length] The arity of `func`.
58599                      * @param- {Object} [guard] Enables use as a callback for functions like
58600                      *         `_.map`.
58601                      * @returns {Function} Returns the new curried function.
58602                      * @example
58603                      * 
58604                      * var abc = function(a, b, c) { return [a, b, c]; };
58605                      * 
58606                      * var curried = _.curryRight(abc);
58607                      * 
58608                      * curried(3)(2)(1); // => [1, 2, 3]
58609                      * 
58610                      * curried(2, 3)(1); // => [1, 2, 3]
58611                      * 
58612                      * curried(1, 2, 3); // => [1, 2, 3]
58613                      *  // using placeholders curried(3)(1, _)(2); // => [1, 2, 3]
58614                      */
58615                     var curryRight = createCurry(CURRY_RIGHT_FLAG);
58616
58617                     /**
58618                      * Creates a debounced function that delays invoking `func` until after
58619                      * `wait` milliseconds have elapsed since the last time the debounced
58620                      * function was invoked. The debounced function comes with a `cancel` method
58621                      * to cancel delayed invocations. Provide an options object to indicate that
58622                      * `func` should be invoked on the leading and/or trailing edge of the
58623                      * `wait` timeout. Subsequent calls to the debounced function return the
58624                      * result of the last `func` invocation.
58625                      * 
58626                      * **Note:** If `leading` and `trailing` options are `true`, `func` is
58627                      * invoked on the trailing edge of the timeout only if the the debounced
58628                      * function is invoked more than once during the `wait` timeout.
58629                      * 
58630                      * See [David Corbacho's
58631                      * article](http://drupalmotion.com/article/debounce-and-throttle-visual-explanation)
58632                      * for details over the differences between `_.debounce` and `_.throttle`.
58633                      * 
58634                      * @static
58635                      * @memberOf _
58636                      * @category Function
58637                      * @param {Function}
58638                      *            func The function to debounce.
58639                      * @param {number}
58640                      *            [wait=0] The number of milliseconds to delay.
58641                      * @param {Object}
58642                      *            [options] The options object.
58643                      * @param {boolean}
58644                      *            [options.leading=false] Specify invoking on the leading edge
58645                      *            of the timeout.
58646                      * @param {number}
58647                      *            [options.maxWait] The maximum time `func` is allowed to be
58648                      *            delayed before it is invoked.
58649                      * @param {boolean}
58650                      *            [options.trailing=true] Specify invoking on the trailing edge
58651                      *            of the timeout.
58652                      * @returns {Function} Returns the new debounced function.
58653                      * @example
58654                      *  // avoid costly calculations while the window size is in flux
58655                      * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
58656                      *  // invoke `sendMail` when the click event is fired, debouncing
58657                      * subsequent calls jQuery('#postbox').on('click', _.debounce(sendMail, 300, {
58658                      * 'leading': true, 'trailing': false }));
58659                      *  // ensure `batchLog` is invoked once after 1 second of debounced calls
58660                      * var source = new EventSource('/stream'); jQuery(source).on('message',
58661                      * _.debounce(batchLog, 250, { 'maxWait': 1000 }));
58662                      *  // cancel a debounced call var todoChanges = _.debounce(batchLog, 1000);
58663                      * Object.observe(models.todo, todoChanges);
58664                      * 
58665                      * Object.observe(models, function(changes) { if (_.find(changes, { 'user':
58666                      * 'todo', 'type': 'delete'})) { todoChanges.cancel(); } }, ['delete']);
58667                      *  // ...at some point `models.todo` is changed models.todo.completed =
58668                      * true;
58669                      *  // ...before 1 second has passed `models.todo` is deleted // which
58670                      * cancels the debounced `todoChanges` call delete models.todo;
58671                      */
58672                     function debounce(func, wait, options) {
58673                         var args,
58674                             maxTimeoutId,
58675                             result,
58676                             stamp,
58677                             thisArg,
58678                             timeoutId,
58679                             trailingCall,
58680                             lastCalled = 0,
58681                             maxWait = false,
58682                             trailing = true;
58683
58684                         if (typeof func != 'function') {
58685                             throw new TypeError(FUNC_ERROR_TEXT);
58686                         }
58687                         wait = wait < 0 ? 0 : (+wait || 0);
58688                         if (options === true) {
58689                             var leading = true;
58690                             trailing = false;
58691                         } else if (isObject(options)) {
58692                             leading = !!options.leading;
58693                             maxWait = 'maxWait' in options && nativeMax(+options.maxWait || 0, wait);
58694                             trailing = 'trailing' in options ? !!options.trailing : trailing;
58695                         }
58696
58697                         function cancel() {
58698                             if (timeoutId) {
58699                                 clearTimeout(timeoutId);
58700                             }
58701                             if (maxTimeoutId) {
58702                                 clearTimeout(maxTimeoutId);
58703                             }
58704                             lastCalled = 0;
58705                             maxTimeoutId = timeoutId = trailingCall = undefined;
58706                         }
58707
58708                         function complete(isCalled, id) {
58709                             if (id) {
58710                                 clearTimeout(id);
58711                             }
58712                             maxTimeoutId = timeoutId = trailingCall = undefined;
58713                             if (isCalled) {
58714                                 lastCalled = now();
58715                                 result = func.apply(thisArg, args);
58716                                 if (!timeoutId && !maxTimeoutId) {
58717                                     args = thisArg = undefined;
58718                                 }
58719                             }
58720                         }
58721
58722                         function delayed() {
58723                             var remaining = wait - (now() - stamp);
58724                             if (remaining <= 0 || remaining > wait) {
58725                                 complete(trailingCall, maxTimeoutId);
58726                             } else {
58727                                 timeoutId = setTimeout(delayed, remaining);
58728                             }
58729                         }
58730
58731                         function maxDelayed() {
58732                             complete(trailing, timeoutId);
58733                         }
58734
58735                         function debounced() {
58736                             args = arguments;
58737                             stamp = now();
58738                             thisArg = this;
58739                             trailingCall = trailing && (timeoutId || !leading);
58740
58741                             if (maxWait === false) {
58742                                 var leadingCall = leading && !timeoutId;
58743                             } else {
58744                                 if (!maxTimeoutId && !leading) {
58745                                     lastCalled = stamp;
58746                                 }
58747                                 var remaining = maxWait - (stamp - lastCalled),
58748                                     isCalled = remaining <= 0 || remaining > maxWait;
58749
58750                                 if (isCalled) {
58751                                     if (maxTimeoutId) {
58752                                         maxTimeoutId = clearTimeout(maxTimeoutId);
58753                                     }
58754                                     lastCalled = stamp;
58755                                     result = func.apply(thisArg, args);
58756                                 } else if (!maxTimeoutId) {
58757                                     maxTimeoutId = setTimeout(maxDelayed, remaining);
58758                                 }
58759                             }
58760                             if (isCalled && timeoutId) {
58761                                 timeoutId = clearTimeout(timeoutId);
58762                             } else if (!timeoutId && wait !== maxWait) {
58763                                 timeoutId = setTimeout(delayed, wait);
58764                             }
58765                             if (leadingCall) {
58766                                 isCalled = true;
58767                                 result = func.apply(thisArg, args);
58768                             }
58769                             if (isCalled && !timeoutId && !maxTimeoutId) {
58770                                 args = thisArg = undefined;
58771                             }
58772                             return result;
58773                         }
58774                         debounced.cancel = cancel;
58775                         return debounced;
58776                     }
58777
58778                     /**
58779                      * Defers invoking the `func` until the current call stack has cleared. Any
58780                      * additional arguments are provided to `func` when it is invoked.
58781                      * 
58782                      * @static
58783                      * @memberOf _
58784                      * @category Function
58785                      * @param {Function}
58786                      *            func The function to defer.
58787                      * @param {...*}
58788                      *            [args] The arguments to invoke the function with.
58789                      * @returns {number} Returns the timer id.
58790                      * @example
58791                      * 
58792                      * _.defer(function(text) { console.log(text); }, 'deferred'); // logs
58793                      * 'deferred' after one or more milliseconds
58794                      */
58795                     var defer = restParam(function(func, args) {
58796                         return baseDelay(func, 1, args);
58797                     });
58798
58799                     /**
58800                      * Invokes `func` after `wait` milliseconds. Any additional arguments are
58801                      * provided to `func` when it is invoked.
58802                      * 
58803                      * @static
58804                      * @memberOf _
58805                      * @category Function
58806                      * @param {Function}
58807                      *            func The function to delay.
58808                      * @param {number}
58809                      *            wait The number of milliseconds to delay invocation.
58810                      * @param {...*}
58811                      *            [args] The arguments to invoke the function with.
58812                      * @returns {number} Returns the timer id.
58813                      * @example
58814                      * 
58815                      * _.delay(function(text) { console.log(text); }, 1000, 'later'); // => logs
58816                      * 'later' after one second
58817                      */
58818                     var delay = restParam(function(func, wait, args) {
58819                         return baseDelay(func, wait, args);
58820                     });
58821
58822                     /**
58823                      * Creates a function that returns the result of invoking the provided
58824                      * functions with the `this` binding of the created function, where each
58825                      * successive invocation is supplied the return value of the previous.
58826                      * 
58827                      * @static
58828                      * @memberOf _
58829                      * @category Function
58830                      * @param {...Function}
58831                      *            [funcs] Functions to invoke.
58832                      * @returns {Function} Returns the new function.
58833                      * @example
58834                      * 
58835                      * function square(n) { return n * n; }
58836                      * 
58837                      * var addSquare = _.flow(_.add, square); addSquare(1, 2); // => 9
58838                      */
58839                     var flow = createFlow();
58840
58841                     /**
58842                      * This method is like `_.flow` except that it creates a function that
58843                      * invokes the provided functions from right to left.
58844                      * 
58845                      * @static
58846                      * @memberOf _
58847                      * @alias backflow, compose
58848                      * @category Function
58849                      * @param {...Function}
58850                      *            [funcs] Functions to invoke.
58851                      * @returns {Function} Returns the new function.
58852                      * @example
58853                      * 
58854                      * function square(n) { return n * n; }
58855                      * 
58856                      * var addSquare = _.flowRight(square, _.add); addSquare(1, 2); // => 9
58857                      */
58858                     var flowRight = createFlow(true);
58859
58860                     /**
58861                      * Creates a function that memoizes the result of `func`. If `resolver` is
58862                      * provided it determines the cache key for storing the result based on the
58863                      * arguments provided to the memoized function. By default, the first
58864                      * argument provided to the memoized function is coerced to a string and
58865                      * used as the cache key. The `func` is invoked with the `this` binding of
58866                      * the memoized function.
58867                      * 
58868                      * **Note:** The cache is exposed as the `cache` property on the memoized
58869                      * function. Its creation may be customized by replacing the
58870                      * `_.memoize.Cache` constructor with one whose instances implement the
58871                      * [`Map`](http://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-map-prototype-object)
58872                      * method interface of `get`, `has`, and `set`.
58873                      * 
58874                      * @static
58875                      * @memberOf _
58876                      * @category Function
58877                      * @param {Function}
58878                      *            func The function to have its output memoized.
58879                      * @param {Function}
58880                      *            [resolver] The function to resolve the cache key.
58881                      * @returns {Function} Returns the new memoizing function.
58882                      * @example
58883                      * 
58884                      * var upperCase = _.memoize(function(string) { return string.toUpperCase();
58885                      * });
58886                      * 
58887                      * upperCase('fred'); // => 'FRED'
58888                      *  // modifying the result cache upperCase.cache.set('fred', 'BARNEY');
58889                      * upperCase('fred'); // => 'BARNEY'
58890                      *  // replacing `_.memoize.Cache` var object = { 'user': 'fred' }; var
58891                      * other = { 'user': 'barney' }; var identity = _.memoize(_.identity);
58892                      * 
58893                      * identity(object); // => { 'user': 'fred' } identity(other); // => {
58894                      * 'user': 'fred' }
58895                      * 
58896                      * _.memoize.Cache = WeakMap; var identity = _.memoize(_.identity);
58897                      * 
58898                      * identity(object); // => { 'user': 'fred' } identity(other); // => {
58899                      * 'user': 'barney' }
58900                      */
58901                     function memoize(func, resolver) {
58902                         if (typeof func != 'function' || (resolver && typeof resolver != 'function')) {
58903                             throw new TypeError(FUNC_ERROR_TEXT);
58904                         }
58905                         var memoized = function() {
58906                             var args = arguments,
58907                                 key = resolver ? resolver.apply(this, args) : args[0],
58908                                 cache = memoized.cache;
58909
58910                             if (cache.has(key)) {
58911                                 return cache.get(key);
58912                             }
58913                             var result = func.apply(this, args);
58914                             memoized.cache = cache.set(key, result);
58915                             return result;
58916                         };
58917                         memoized.cache = new memoize.Cache;
58918                         return memoized;
58919                     }
58920
58921                     /**
58922                      * Creates a function that runs each argument through a corresponding
58923                      * transform function.
58924                      * 
58925                      * @static
58926                      * @memberOf _
58927                      * @category Function
58928                      * @param {Function}
58929                      *            func The function to wrap.
58930                      * @param {...(Function|Function[])}
58931                      *            [transforms] The functions to transform arguments, specified
58932                      *            as individual functions or arrays of functions.
58933                      * @returns {Function} Returns the new function.
58934                      * @example
58935                      * 
58936                      * function doubled(n) { return n * 2; }
58937                      * 
58938                      * function square(n) { return n * n; }
58939                      * 
58940                      * var modded = _.modArgs(function(x, y) { return [x, y]; }, square,
58941                      * doubled);
58942                      * 
58943                      * modded(1, 2); // => [1, 4]
58944                      * 
58945                      * modded(5, 10); // => [25, 20]
58946                      */
58947                     var modArgs = restParam(function(func, transforms) {
58948                         transforms = baseFlatten(transforms);
58949                         if (typeof func != 'function' || !arrayEvery(transforms, baseIsFunction)) {
58950                             throw new TypeError(FUNC_ERROR_TEXT);
58951                         }
58952                         var length = transforms.length;
58953                         return restParam(function(args) {
58954                             var index = nativeMin(args.length, length);
58955                             while (index--) {
58956                                 args[index] = transforms[index](args[index]);
58957                             }
58958                             return func.apply(this, args);
58959                         });
58960                     });
58961
58962                     /**
58963                      * Creates a function that negates the result of the predicate `func`. The
58964                      * `func` predicate is invoked with the `this` binding and arguments of the
58965                      * created function.
58966                      * 
58967                      * @static
58968                      * @memberOf _
58969                      * @category Function
58970                      * @param {Function}
58971                      *            predicate The predicate to negate.
58972                      * @returns {Function} Returns the new function.
58973                      * @example
58974                      * 
58975                      * function isEven(n) { return n % 2 == 0; }
58976                      * 
58977                      * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven)); // => [1, 3, 5]
58978                      */
58979                     function negate(predicate) {
58980                         if (typeof predicate != 'function') {
58981                             throw new TypeError(FUNC_ERROR_TEXT);
58982                         }
58983                         return function() {
58984                             return !predicate.apply(this, arguments);
58985                         };
58986                     }
58987
58988                     /**
58989                      * Creates a function that is restricted to invoking `func` once. Repeat
58990                      * calls to the function return the value of the first call. The `func` is
58991                      * invoked with the `this` binding and arguments of the created function.
58992                      * 
58993                      * @static
58994                      * @memberOf _
58995                      * @category Function
58996                      * @param {Function}
58997                      *            func The function to restrict.
58998                      * @returns {Function} Returns the new restricted function.
58999                      * @example
59000                      * 
59001                      * var initialize = _.once(createApplication); initialize(); initialize(); //
59002                      * `initialize` invokes `createApplication` once
59003                      */
59004                     function once(func) {
59005                         return before(2, func);
59006                     }
59007
59008                     /**
59009                      * Creates a function that invokes `func` with `partial` arguments prepended
59010                      * to those provided to the new function. This method is like `_.bind`
59011                      * except it does **not** alter the `this` binding.
59012                      * 
59013                      * The `_.partial.placeholder` value, which defaults to `_` in monolithic
59014                      * builds, may be used as a placeholder for partially applied arguments.
59015                      * 
59016                      * **Note:** This method does not set the "length" property of partially
59017                      * applied functions.
59018                      * 
59019                      * @static
59020                      * @memberOf _
59021                      * @category Function
59022                      * @param {Function}
59023                      *            func The function to partially apply arguments to.
59024                      * @param {...*}
59025                      *            [partials] The arguments to be partially applied.
59026                      * @returns {Function} Returns the new partially applied function.
59027                      * @example
59028                      * 
59029                      * var greet = function(greeting, name) { return greeting + ' ' + name; };
59030                      * 
59031                      * var sayHelloTo = _.partial(greet, 'hello'); sayHelloTo('fred'); // =>
59032                      * 'hello fred'
59033                      *  // using placeholders var greetFred = _.partial(greet, _, 'fred');
59034                      * greetFred('hi'); // => 'hi fred'
59035                      */
59036                     var partial = createPartial(PARTIAL_FLAG);
59037
59038                     /**
59039                      * This method is like `_.partial` except that partially applied arguments
59040                      * are appended to those provided to the new function.
59041                      * 
59042                      * The `_.partialRight.placeholder` value, which defaults to `_` in
59043                      * monolithic builds, may be used as a placeholder for partially applied
59044                      * arguments.
59045                      * 
59046                      * **Note:** This method does not set the "length" property of partially
59047                      * applied functions.
59048                      * 
59049                      * @static
59050                      * @memberOf _
59051                      * @category Function
59052                      * @param {Function}
59053                      *            func The function to partially apply arguments to.
59054                      * @param {...*}
59055                      *            [partials] The arguments to be partially applied.
59056                      * @returns {Function} Returns the new partially applied function.
59057                      * @example
59058                      * 
59059                      * var greet = function(greeting, name) { return greeting + ' ' + name; };
59060                      * 
59061                      * var greetFred = _.partialRight(greet, 'fred'); greetFred('hi'); // => 'hi
59062                      * fred'
59063                      *  // using placeholders var sayHelloTo = _.partialRight(greet, 'hello',
59064                      * _); sayHelloTo('fred'); // => 'hello fred'
59065                      */
59066                     var partialRight = createPartial(PARTIAL_RIGHT_FLAG);
59067
59068                     /**
59069                      * Creates a function that invokes `func` with arguments arranged according
59070                      * to the specified indexes where the argument value at the first index is
59071                      * provided as the first argument, the argument value at the second index is
59072                      * provided as the second argument, and so on.
59073                      * 
59074                      * @static
59075                      * @memberOf _
59076                      * @category Function
59077                      * @param {Function}
59078                      *            func The function to rearrange arguments for.
59079                      * @param {...(number|number[])}
59080                      *            indexes The arranged argument indexes, specified as individual
59081                      *            indexes or arrays of indexes.
59082                      * @returns {Function} Returns the new function.
59083                      * @example
59084                      * 
59085                      * var rearged = _.rearg(function(a, b, c) { return [a, b, c]; }, 2, 0, 1);
59086                      * 
59087                      * rearged('b', 'c', 'a') // => ['a', 'b', 'c']
59088                      * 
59089                      * var map = _.rearg(_.map, [1, 0]); map(function(n) { return n * 3; }, [1,
59090                      * 2, 3]); // => [3, 6, 9]
59091                      */
59092                     var rearg = restParam(function(func, indexes) {
59093                         return createWrapper(func, REARG_FLAG, undefined, undefined, undefined, baseFlatten(indexes));
59094                     });
59095
59096                     /**
59097                      * Creates a function that invokes `func` with the `this` binding of the
59098                      * created function and arguments from `start` and beyond provided as an
59099                      * array.
59100                      * 
59101                      * **Note:** This method is based on the [rest
59102                      * parameter](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/rest_parameters).
59103                      * 
59104                      * @static
59105                      * @memberOf _
59106                      * @category Function
59107                      * @param {Function}
59108                      *            func The function to apply a rest parameter to.
59109                      * @param {number}
59110                      *            [start=func.length-1] The start position of the rest
59111                      *            parameter.
59112                      * @returns {Function} Returns the new function.
59113                      * @example
59114                      * 
59115                      * var say = _.restParam(function(what, names) { return what + ' ' +
59116                      * _.initial(names).join(', ') + (_.size(names) > 1 ? ', & ' : '') +
59117                      * _.last(names); });
59118                      * 
59119                      * say('hello', 'fred', 'barney', 'pebbles'); // => 'hello fred, barney, &
59120                      * pebbles'
59121                      */
59122                     function restParam(func, start) {
59123                         if (typeof func != 'function') {
59124                             throw new TypeError(FUNC_ERROR_TEXT);
59125                         }
59126                         start = nativeMax(start === undefined ? (func.length - 1) : (+start || 0), 0);
59127                         return function() {
59128                             var args = arguments,
59129                                 index = -1,
59130                                 length = nativeMax(args.length - start, 0),
59131                                 rest = Array(length);
59132
59133                             while (++index < length) {
59134                                 rest[index] = args[start + index];
59135                             }
59136                             switch (start) {
59137                                 case 0:
59138                                     return func.call(this, rest);
59139                                 case 1:
59140                                     return func.call(this, args[0], rest);
59141                                 case 2:
59142                                     return func.call(this, args[0], args[1], rest);
59143                             }
59144                             var otherArgs = Array(start + 1);
59145                             index = -1;
59146                             while (++index < start) {
59147                                 otherArgs[index] = args[index];
59148                             }
59149                             otherArgs[start] = rest;
59150                             return func.apply(this, otherArgs);
59151                         };
59152                     }
59153
59154                     /**
59155                      * Creates a function that invokes `func` with the `this` binding of the
59156                      * created function and an array of arguments much like
59157                      * [`Function#apply`](https://es5.github.io/#x15.3.4.3).
59158                      * 
59159                      * **Note:** This method is based on the [spread
59160                      * operator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Spread_operator).
59161                      * 
59162                      * @static
59163                      * @memberOf _
59164                      * @category Function
59165                      * @param {Function}
59166                      *            func The function to spread arguments over.
59167                      * @returns {Function} Returns the new function.
59168                      * @example
59169                      * 
59170                      * var say = _.spread(function(who, what) { return who + ' says ' + what;
59171                      * });
59172                      * 
59173                      * say(['fred', 'hello']); // => 'fred says hello'
59174                      *  // with a Promise var numbers = Promise.all([ Promise.resolve(40),
59175                      * Promise.resolve(36) ]);
59176                      * 
59177                      * numbers.then(_.spread(function(x, y) { return x + y; })); // => a Promise
59178                      * of 76
59179                      */
59180                     function spread(func) {
59181                         if (typeof func != 'function') {
59182                             throw new TypeError(FUNC_ERROR_TEXT);
59183                         }
59184                         return function(array) {
59185                             return func.apply(this, array);
59186                         };
59187                     }
59188
59189                     /**
59190                      * Creates a throttled function that only invokes `func` at most once per
59191                      * every `wait` milliseconds. The throttled function comes with a `cancel`
59192                      * method to cancel delayed invocations. Provide an options object to
59193                      * indicate that `func` should be invoked on the leading and/or trailing
59194                      * edge of the `wait` timeout. Subsequent calls to the throttled function
59195                      * return the result of the last `func` call.
59196                      * 
59197                      * **Note:** If `leading` and `trailing` options are `true`, `func` is
59198                      * invoked on the trailing edge of the timeout only if the the throttled
59199                      * function is invoked more than once during the `wait` timeout.
59200                      * 
59201                      * See [David Corbacho's
59202                      * article](http://drupalmotion.com/article/debounce-and-throttle-visual-explanation)
59203                      * for details over the differences between `_.throttle` and `_.debounce`.
59204                      * 
59205                      * @static
59206                      * @memberOf _
59207                      * @category Function
59208                      * @param {Function}
59209                      *            func The function to throttle.
59210                      * @param {number}
59211                      *            [wait=0] The number of milliseconds to throttle invocations
59212                      *            to.
59213                      * @param {Object}
59214                      *            [options] The options object.
59215                      * @param {boolean}
59216                      *            [options.leading=true] Specify invoking on the leading edge of
59217                      *            the timeout.
59218                      * @param {boolean}
59219                      *            [options.trailing=true] Specify invoking on the trailing edge
59220                      *            of the timeout.
59221                      * @returns {Function} Returns the new throttled function.
59222                      * @example
59223                      *  // avoid excessively updating the position while scrolling
59224                      * jQuery(window).on('scroll', _.throttle(updatePosition, 100));
59225                      *  // invoke `renewToken` when the click event is fired, but not more than
59226                      * once every 5 minutes jQuery('.interactive').on('click',
59227                      * _.throttle(renewToken, 300000, { 'trailing': false }));
59228                      *  // cancel a trailing throttled call jQuery(window).on('popstate',
59229                      * throttled.cancel);
59230                      */
59231                     function throttle(func, wait, options) {
59232                         var leading = true,
59233                             trailing = true;
59234
59235                         if (typeof func != 'function') {
59236                             throw new TypeError(FUNC_ERROR_TEXT);
59237                         }
59238                         if (options === false) {
59239                             leading = false;
59240                         } else if (isObject(options)) {
59241                             leading = 'leading' in options ? !!options.leading : leading;
59242                             trailing = 'trailing' in options ? !!options.trailing : trailing;
59243                         }
59244                         return debounce(func, wait, {
59245                             'leading': leading,
59246                             'maxWait': +wait,
59247                             'trailing': trailing
59248                         });
59249                     }
59250
59251                     /**
59252                      * Creates a function that provides `value` to the wrapper function as its
59253                      * first argument. Any additional arguments provided to the function are
59254                      * appended to those provided to the wrapper function. The wrapper is
59255                      * invoked with the `this` binding of the created function.
59256                      * 
59257                      * @static
59258                      * @memberOf _
59259                      * @category Function
59260                      * @param {*}
59261                      *            value The value to wrap.
59262                      * @param {Function}
59263                      *            wrapper The wrapper function.
59264                      * @returns {Function} Returns the new function.
59265                      * @example
59266                      * 
59267                      * var p = _.wrap(_.escape, function(func, text) { return '
59268                      * <p>' + func(text) + '
59269                      * </p>'; });
59270                      * 
59271                      * p('fred, barney, & pebbles'); // => '
59272                      * <p>
59273                      * fred, barney, &amp; pebbles
59274                      * </p>'
59275                      */
59276                     function wrap(value, wrapper) {
59277                         wrapper = wrapper == null ? identity : wrapper;
59278                         return createWrapper(wrapper, PARTIAL_FLAG, undefined, [value], []);
59279                     }
59280
59281                     /*------------------------------------------------------------------------*/
59282
59283                     /**
59284                      * Creates a clone of `value`. If `isDeep` is `true` nested objects are
59285                      * cloned, otherwise they are assigned by reference. If `customizer` is
59286                      * provided it is invoked to produce the cloned values. If `customizer`
59287                      * returns `undefined` cloning is handled by the method instead. The
59288                      * `customizer` is bound to `thisArg` and invoked with two argument; (value [,
59289                      * index|key, object]).
59290                      * 
59291                      * **Note:** This method is loosely based on the [structured clone
59292                      * algorithm](http://www.w3.org/TR/html5/infrastructure.html#internal-structured-cloning-algorithm).
59293                      * The enumerable properties of `arguments` objects and objects created by
59294                      * constructors other than `Object` are cloned to plain `Object` objects. An
59295                      * empty object is returned for uncloneable values such as functions, DOM
59296                      * nodes, Maps, Sets, and WeakMaps.
59297                      * 
59298                      * @static
59299                      * @memberOf _
59300                      * @category Lang
59301                      * @param {*}
59302                      *            value The value to clone.
59303                      * @param {boolean}
59304                      *            [isDeep] Specify a deep clone.
59305                      * @param {Function}
59306                      *            [customizer] The function to customize cloning values.
59307                      * @param {*}
59308                      *            [thisArg] The `this` binding of `customizer`.
59309                      * @returns {*} Returns the cloned value.
59310                      * @example
59311                      * 
59312                      * var users = [ { 'user': 'barney' }, { 'user': 'fred' } ];
59313                      * 
59314                      * var shallow = _.clone(users); shallow[0] === users[0]; // => true
59315                      * 
59316                      * var deep = _.clone(users, true); deep[0] === users[0]; // => false
59317                      *  // using a customizer callback var el = _.clone(document.body,
59318                      * function(value) { if (_.isElement(value)) { return
59319                      * value.cloneNode(false); } });
59320                      * 
59321                      * el === document.body // => false el.nodeName // => BODY
59322                      * el.childNodes.length; // => 0
59323                      */
59324                     function clone(value, isDeep, customizer, thisArg) {
59325                         if (isDeep && typeof isDeep != 'boolean' && isIterateeCall(value, isDeep, customizer)) {
59326                             isDeep = false;
59327                         } else if (typeof isDeep == 'function') {
59328                             thisArg = customizer;
59329                             customizer = isDeep;
59330                             isDeep = false;
59331                         }
59332                         return typeof customizer == 'function' ? baseClone(value, isDeep, bindCallback(customizer, thisArg, 1)) : baseClone(value, isDeep);
59333                     }
59334
59335                     /**
59336                      * Creates a deep clone of `value`. If `customizer` is provided it is
59337                      * invoked to produce the cloned values. If `customizer` returns `undefined`
59338                      * cloning is handled by the method instead. The `customizer` is bound to
59339                      * `thisArg` and invoked with two argument; (value [, index|key, object]).
59340                      * 
59341                      * **Note:** This method is loosely based on the [structured clone
59342                      * algorithm](http://www.w3.org/TR/html5/infrastructure.html#internal-structured-cloning-algorithm).
59343                      * The enumerable properties of `arguments` objects and objects created by
59344                      * constructors other than `Object` are cloned to plain `Object` objects. An
59345                      * empty object is returned for uncloneable values such as functions, DOM
59346                      * nodes, Maps, Sets, and WeakMaps.
59347                      * 
59348                      * @static
59349                      * @memberOf _
59350                      * @category Lang
59351                      * @param {*}
59352                      *            value The value to deep clone.
59353                      * @param {Function}
59354                      *            [customizer] The function to customize cloning values.
59355                      * @param {*}
59356                      *            [thisArg] The `this` binding of `customizer`.
59357                      * @returns {*} Returns the deep cloned value.
59358                      * @example
59359                      * 
59360                      * var users = [ { 'user': 'barney' }, { 'user': 'fred' } ];
59361                      * 
59362                      * var deep = _.cloneDeep(users); deep[0] === users[0]; // => false
59363                      *  // using a customizer callback var el = _.cloneDeep(document.body,
59364                      * function(value) { if (_.isElement(value)) { return value.cloneNode(true); }
59365                      * });
59366                      * 
59367                      * el === document.body // => false el.nodeName // => BODY
59368                      * el.childNodes.length; // => 20
59369                      */
59370                     function cloneDeep(value, customizer, thisArg) {
59371                         return typeof customizer == 'function' ? baseClone(value, true, bindCallback(customizer, thisArg, 1)) : baseClone(value, true);
59372                     }
59373
59374                     /**
59375                      * Checks if `value` is greater than `other`.
59376                      * 
59377                      * @static
59378                      * @memberOf _
59379                      * @category Lang
59380                      * @param {*}
59381                      *            value The value to compare.
59382                      * @param {*}
59383                      *            other The other value to compare.
59384                      * @returns {boolean} Returns `true` if `value` is greater than `other`,
59385                      *          else `false`.
59386                      * @example
59387                      * 
59388                      * _.gt(3, 1); // => true
59389                      * 
59390                      * _.gt(3, 3); // => false
59391                      * 
59392                      * _.gt(1, 3); // => false
59393                      */
59394                     function gt(value, other) {
59395                         return value > other;
59396                     }
59397
59398                     /**
59399                      * Checks if `value` is greater than or equal to `other`.
59400                      * 
59401                      * @static
59402                      * @memberOf _
59403                      * @category Lang
59404                      * @param {*}
59405                      *            value The value to compare.
59406                      * @param {*}
59407                      *            other The other value to compare.
59408                      * @returns {boolean} Returns `true` if `value` is greater than or equal to
59409                      *          `other`, else `false`.
59410                      * @example
59411                      * 
59412                      * _.gte(3, 1); // => true
59413                      * 
59414                      * _.gte(3, 3); // => true
59415                      * 
59416                      * _.gte(1, 3); // => false
59417                      */
59418                     function gte(value, other) {
59419                         return value >= other;
59420                     }
59421
59422                     /**
59423                      * Checks if `value` is classified as an `arguments` object.
59424                      * 
59425                      * @static
59426                      * @memberOf _
59427                      * @category Lang
59428                      * @param {*}
59429                      *            value The value to check.
59430                      * @returns {boolean} Returns `true` if `value` is correctly classified,
59431                      *          else `false`.
59432                      * @example
59433                      * 
59434                      * _.isArguments(function() { return arguments; }()); // => true
59435                      * 
59436                      * _.isArguments([1, 2, 3]); // => false
59437                      */
59438                     function isArguments(value) {
59439                         return isObjectLike(value) && isArrayLike(value) &&
59440                             hasOwnProperty.call(value, 'callee') && !propertyIsEnumerable.call(value, 'callee');
59441                     }
59442
59443                     /**
59444                      * Checks if `value` is classified as an `Array` object.
59445                      * 
59446                      * @static
59447                      * @memberOf _
59448                      * @category Lang
59449                      * @param {*}
59450                      *            value The value to check.
59451                      * @returns {boolean} Returns `true` if `value` is correctly classified,
59452                      *          else `false`.
59453                      * @example
59454                      * 
59455                      * _.isArray([1, 2, 3]); // => true
59456                      * 
59457                      * _.isArray(function() { return arguments; }()); // => false
59458                      */
59459                     var isArray = nativeIsArray || function(value) {
59460                         return isObjectLike(value) && isLength(value.length) && objToString.call(value) == arrayTag;
59461                     };
59462
59463                     /**
59464                      * Checks if `value` is classified as a boolean primitive or object.
59465                      * 
59466                      * @static
59467                      * @memberOf _
59468                      * @category Lang
59469                      * @param {*}
59470                      *            value The value to check.
59471                      * @returns {boolean} Returns `true` if `value` is correctly classified,
59472                      *          else `false`.
59473                      * @example
59474                      * 
59475                      * _.isBoolean(false); // => true
59476                      * 
59477                      * _.isBoolean(null); // => false
59478                      */
59479                     function isBoolean(value) {
59480                         return value === true || value === false || (isObjectLike(value) && objToString.call(value) == boolTag);
59481                     }
59482
59483                     /**
59484                      * Checks if `value` is classified as a `Date` object.
59485                      * 
59486                      * @static
59487                      * @memberOf _
59488                      * @category Lang
59489                      * @param {*}
59490                      *            value The value to check.
59491                      * @returns {boolean} Returns `true` if `value` is correctly classified,
59492                      *          else `false`.
59493                      * @example
59494                      * 
59495                      * _.isDate(new Date); // => true
59496                      * 
59497                      * _.isDate('Mon April 23 2012'); // => false
59498                      */
59499                     function isDate(value) {
59500                         return isObjectLike(value) && objToString.call(value) == dateTag;
59501                     }
59502
59503                     /**
59504                      * Checks if `value` is a DOM element.
59505                      * 
59506                      * @static
59507                      * @memberOf _
59508                      * @category Lang
59509                      * @param {*}
59510                      *            value The value to check.
59511                      * @returns {boolean} Returns `true` if `value` is a DOM element, else
59512                      *          `false`.
59513                      * @example
59514                      * 
59515                      * _.isElement(document.body); // => true
59516                      * 
59517                      * _.isElement('<body>'); // => false
59518                      */
59519                     function isElement(value) {
59520                         return !!value && value.nodeType === 1 && isObjectLike(value) && !isPlainObject(value);
59521                     }
59522
59523                     /**
59524                      * Checks if `value` is empty. A value is considered empty unless it is an
59525                      * `arguments` object, array, string, or jQuery-like collection with a
59526                      * length greater than `0` or an object with own enumerable properties.
59527                      * 
59528                      * @static
59529                      * @memberOf _
59530                      * @category Lang
59531                      * @param {Array|Object|string}
59532                      *            value The value to inspect.
59533                      * @returns {boolean} Returns `true` if `value` is empty, else `false`.
59534                      * @example
59535                      * 
59536                      * _.isEmpty(null); // => true
59537                      * 
59538                      * _.isEmpty(true); // => true
59539                      * 
59540                      * _.isEmpty(1); // => true
59541                      * 
59542                      * _.isEmpty([1, 2, 3]); // => false
59543                      * 
59544                      * _.isEmpty({ 'a': 1 }); // => false
59545                      */
59546                     function isEmpty(value) {
59547                         if (value == null) {
59548                             return true;
59549                         }
59550                         if (isArrayLike(value) && (isArray(value) || isString(value) || isArguments(value) ||
59551                                 (isObjectLike(value) && isFunction(value.splice)))) {
59552                             return !value.length;
59553                         }
59554                         return !keys(value).length;
59555                     }
59556
59557                     /**
59558                      * Performs a deep comparison between two values to determine if they are
59559                      * equivalent. If `customizer` is provided it is invoked to compare values.
59560                      * If `customizer` returns `undefined` comparisons are handled by the method
59561                      * instead. The `customizer` is bound to `thisArg` and invoked with three
59562                      * arguments: (value, other [, index|key]).
59563                      * 
59564                      * **Note:** This method supports comparing arrays, booleans, `Date`
59565                      * objects, numbers, `Object` objects, regexes, and strings. Objects are
59566                      * compared by their own, not inherited, enumerable properties. Functions
59567                      * and DOM nodes are **not** supported. Provide a customizer function to
59568                      * extend support for comparing other values.
59569                      * 
59570                      * @static
59571                      * @memberOf _
59572                      * @alias eq
59573                      * @category Lang
59574                      * @param {*}
59575                      *            value The value to compare.
59576                      * @param {*}
59577                      *            other The other value to compare.
59578                      * @param {Function}
59579                      *            [customizer] The function to customize value comparisons.
59580                      * @param {*}
59581                      *            [thisArg] The `this` binding of `customizer`.
59582                      * @returns {boolean} Returns `true` if the values are equivalent, else
59583                      *          `false`.
59584                      * @example
59585                      * 
59586                      * var object = { 'user': 'fred' }; var other = { 'user': 'fred' };
59587                      * 
59588                      * object == other; // => false
59589                      * 
59590                      * _.isEqual(object, other); // => true
59591                      *  // using a customizer callback var array = ['hello', 'goodbye']; var
59592                      * other = ['hi', 'goodbye'];
59593                      * 
59594                      * _.isEqual(array, other, function(value, other) { if (_.every([value,
59595                      * other], RegExp.prototype.test, /^h(?:i|ello)$/)) { return true; } }); // =>
59596                      * true
59597                      */
59598                     function isEqual(value, other, customizer, thisArg) {
59599                         customizer = typeof customizer == 'function' ? bindCallback(customizer, thisArg, 3) : undefined;
59600                         var result = customizer ? customizer(value, other) : undefined;
59601                         return result === undefined ? baseIsEqual(value, other, customizer) : !!result;
59602                     }
59603
59604                     /**
59605                      * Checks if `value` is an `Error`, `EvalError`, `RangeError`,
59606                      * `ReferenceError`, `SyntaxError`, `TypeError`, or `URIError` object.
59607                      * 
59608                      * @static
59609                      * @memberOf _
59610                      * @category Lang
59611                      * @param {*}
59612                      *            value The value to check.
59613                      * @returns {boolean} Returns `true` if `value` is an error object, else
59614                      *          `false`.
59615                      * @example
59616                      * 
59617                      * _.isError(new Error); // => true
59618                      * 
59619                      * _.isError(Error); // => false
59620                      */
59621                     function isError(value) {
59622                         return isObjectLike(value) && typeof value.message == 'string' && objToString.call(value) == errorTag;
59623                     }
59624
59625                     /**
59626                      * Checks if `value` is a finite primitive number.
59627                      * 
59628                      * **Note:** This method is based on
59629                      * [`Number.isFinite`](http://ecma-international.org/ecma-262/6.0/#sec-number.isfinite).
59630                      * 
59631                      * @static
59632                      * @memberOf _
59633                      * @category Lang
59634                      * @param {*}
59635                      *            value The value to check.
59636                      * @returns {boolean} Returns `true` if `value` is a finite number, else
59637                      *          `false`.
59638                      * @example
59639                      * 
59640                      * _.isFinite(10); // => true
59641                      * 
59642                      * _.isFinite('10'); // => false
59643                      * 
59644                      * _.isFinite(true); // => false
59645                      * 
59646                      * _.isFinite(Object(10)); // => false
59647                      * 
59648                      * _.isFinite(Infinity); // => false
59649                      */
59650                     function isFinite(value) {
59651                         return typeof value == 'number' && nativeIsFinite(value);
59652                     }
59653
59654                     /**
59655                      * Checks if `value` is classified as a `Function` object.
59656                      * 
59657                      * @static
59658                      * @memberOf _
59659                      * @category Lang
59660                      * @param {*}
59661                      *            value The value to check.
59662                      * @returns {boolean} Returns `true` if `value` is correctly classified,
59663                      *          else `false`.
59664                      * @example
59665                      * 
59666                      * _.isFunction(_); // => true
59667                      * 
59668                      * _.isFunction(/abc/); // => false
59669                      */
59670                     function isFunction(value) {
59671                         // The use of `Object#toString` avoids issues with the `typeof` operator
59672                         // in older versions of Chrome and Safari which return 'function' for
59673                         // regexes
59674                         // and Safari 8 equivalents which return 'object' for typed array
59675                         // constructors.
59676                         return isObject(value) && objToString.call(value) == funcTag;
59677                     }
59678
59679                     /**
59680                      * Checks if `value` is the [language type](https://es5.github.io/#x8) of
59681                      * `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and
59682                      * `new String('')`)
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 object, else `false`.
59690                      * @example
59691                      * 
59692                      * _.isObject({}); // => true
59693                      * 
59694                      * _.isObject([1, 2, 3]); // => true
59695                      * 
59696                      * _.isObject(1); // => false
59697                      */
59698                     function isObject(value) {
59699                         // Avoid a V8 JIT bug in Chrome 19-20.
59700                         // See https://code.google.com/p/v8/issues/detail?id=2291 for more
59701                         // details.
59702                         var type = typeof value;
59703                         return !!value && (type == 'object' || type == 'function');
59704                     }
59705
59706                     /**
59707                      * Performs a deep comparison between `object` and `source` to determine if
59708                      * `object` contains equivalent property values. If `customizer` is provided
59709                      * it is invoked to compare values. If `customizer` returns `undefined`
59710                      * comparisons are handled by the method instead. The `customizer` is bound
59711                      * to `thisArg` and invoked with three arguments: (value, other, index|key).
59712                      * 
59713                      * **Note:** This method supports comparing properties of arrays, booleans,
59714                      * `Date` objects, numbers, `Object` objects, regexes, and strings.
59715                      * Functions and DOM nodes are **not** supported. Provide a customizer
59716                      * function to extend support for comparing other values.
59717                      * 
59718                      * @static
59719                      * @memberOf _
59720                      * @category Lang
59721                      * @param {Object}
59722                      *            object The object to inspect.
59723                      * @param {Object}
59724                      *            source The object of property values to match.
59725                      * @param {Function}
59726                      *            [customizer] The function to customize value comparisons.
59727                      * @param {*}
59728                      *            [thisArg] The `this` binding of `customizer`.
59729                      * @returns {boolean} Returns `true` if `object` is a match, else `false`.
59730                      * @example
59731                      * 
59732                      * var object = { 'user': 'fred', 'age': 40 };
59733                      * 
59734                      * _.isMatch(object, { 'age': 40 }); // => true
59735                      * 
59736                      * _.isMatch(object, { 'age': 36 }); // => false
59737                      *  // using a customizer callback var object = { 'greeting': 'hello' }; var
59738                      * source = { 'greeting': 'hi' };
59739                      * 
59740                      * _.isMatch(object, source, function(value, other) { return _.every([value,
59741                      * other], RegExp.prototype.test, /^h(?:i|ello)$/) || undefined; }); // =>
59742                      * true
59743                      */
59744                     function isMatch(object, source, customizer, thisArg) {
59745                         customizer = typeof customizer == 'function' ? bindCallback(customizer, thisArg, 3) : undefined;
59746                         return baseIsMatch(object, getMatchData(source), customizer);
59747                     }
59748
59749                     /**
59750                      * Checks if `value` is `NaN`.
59751                      * 
59752                      * **Note:** This method is not the same as
59753                      * [`isNaN`](https://es5.github.io/#x15.1.2.4) which returns `true` for
59754                      * `undefined` and other non-numeric values.
59755                      * 
59756                      * @static
59757                      * @memberOf _
59758                      * @category Lang
59759                      * @param {*}
59760                      *            value The value to check.
59761                      * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
59762                      * @example
59763                      * 
59764                      * _.isNaN(NaN); // => true
59765                      * 
59766                      * _.isNaN(new Number(NaN)); // => true
59767                      * 
59768                      * isNaN(undefined); // => true
59769                      * 
59770                      * _.isNaN(undefined); // => false
59771                      */
59772                     function isNaN(value) {
59773                         // An `NaN` primitive is the only value that is not equal to itself.
59774                         // Perform the `toStringTag` check first to avoid errors with some host
59775                         // objects in IE.
59776                         return isNumber(value) && value != +value;
59777                     }
59778
59779                     /**
59780                      * Checks if `value` is a native function.
59781                      * 
59782                      * @static
59783                      * @memberOf _
59784                      * @category Lang
59785                      * @param {*}
59786                      *            value The value to check.
59787                      * @returns {boolean} Returns `true` if `value` is a native function, else
59788                      *          `false`.
59789                      * @example
59790                      * 
59791                      * _.isNative(Array.prototype.push); // => true
59792                      * 
59793                      * _.isNative(_); // => false
59794                      */
59795                     function isNative(value) {
59796                         if (value == null) {
59797                             return false;
59798                         }
59799                         if (isFunction(value)) {
59800                             return reIsNative.test(fnToString.call(value));
59801                         }
59802                         return isObjectLike(value) && reIsHostCtor.test(value);
59803                     }
59804
59805                     /**
59806                      * Checks if `value` is `null`.
59807                      * 
59808                      * @static
59809                      * @memberOf _
59810                      * @category Lang
59811                      * @param {*}
59812                      *            value The value to check.
59813                      * @returns {boolean} Returns `true` if `value` is `null`, else `false`.
59814                      * @example
59815                      * 
59816                      * _.isNull(null); // => true
59817                      * 
59818                      * _.isNull(void 0); // => false
59819                      */
59820                     function isNull(value) {
59821                         return value === null;
59822                     }
59823
59824                     /**
59825                      * Checks if `value` is classified as a `Number` primitive or object.
59826                      * 
59827                      * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are
59828                      * classified as numbers, use the `_.isFinite` method.
59829                      * 
59830                      * @static
59831                      * @memberOf _
59832                      * @category Lang
59833                      * @param {*}
59834                      *            value The value to check.
59835                      * @returns {boolean} Returns `true` if `value` is correctly classified,
59836                      *          else `false`.
59837                      * @example
59838                      * 
59839                      * _.isNumber(8.4); // => true
59840                      * 
59841                      * _.isNumber(NaN); // => true
59842                      * 
59843                      * _.isNumber('8.4'); // => false
59844                      */
59845                     function isNumber(value) {
59846                         return typeof value == 'number' || (isObjectLike(value) && objToString.call(value) == numberTag);
59847                     }
59848
59849                     /**
59850                      * Checks if `value` is a plain object, that is, an object created by the
59851                      * `Object` constructor or one with a `[[Prototype]]` of `null`.
59852                      * 
59853                      * **Note:** This method assumes objects created by the `Object` constructor
59854                      * have no inherited enumerable properties.
59855                      * 
59856                      * @static
59857                      * @memberOf _
59858                      * @category Lang
59859                      * @param {*}
59860                      *            value The value to check.
59861                      * @returns {boolean} Returns `true` if `value` is a plain object, else
59862                      *          `false`.
59863                      * @example
59864                      * 
59865                      * function Foo() { this.a = 1; }
59866                      * 
59867                      * _.isPlainObject(new Foo); // => false
59868                      * 
59869                      * _.isPlainObject([1, 2, 3]); // => false
59870                      * 
59871                      * _.isPlainObject({ 'x': 0, 'y': 0 }); // => true
59872                      * 
59873                      * _.isPlainObject(Object.create(null)); // => true
59874                      */
59875                     function isPlainObject(value) {
59876                         var Ctor;
59877
59878                         // Exit early for non `Object` objects.
59879                         if (!(isObjectLike(value) && objToString.call(value) == objectTag && !isArguments(value)) ||
59880                             (!hasOwnProperty.call(value, 'constructor') && (Ctor = value.constructor, typeof Ctor == 'function' && !(Ctor instanceof Ctor)))) {
59881                             return false;
59882                         }
59883                         // IE < 9 iterates inherited properties before own properties. If the
59884                         // first
59885                         // iterated property is an object's own property then there are no
59886                         // inherited
59887                         // enumerable properties.
59888                         var result;
59889                         // In most environments an object's own properties are iterated before
59890                         // its inherited properties. If the last iterated property is an
59891                         // object's
59892                         // own property then there are no inherited enumerable properties.
59893                         baseForIn(value, function(subValue, key) {
59894                             result = key;
59895                         });
59896                         return result === undefined || hasOwnProperty.call(value, result);
59897                     }
59898
59899                     /**
59900                      * Checks if `value` is classified as a `RegExp` object.
59901                      * 
59902                      * @static
59903                      * @memberOf _
59904                      * @category Lang
59905                      * @param {*}
59906                      *            value The value to check.
59907                      * @returns {boolean} Returns `true` if `value` is correctly classified,
59908                      *          else `false`.
59909                      * @example
59910                      * 
59911                      * _.isRegExp(/abc/); // => true
59912                      * 
59913                      * _.isRegExp('/abc/'); // => false
59914                      */
59915                     function isRegExp(value) {
59916                         return isObject(value) && objToString.call(value) == regexpTag;
59917                     }
59918
59919                     /**
59920                      * Checks if `value` is classified as a `String` primitive or object.
59921                      * 
59922                      * @static
59923                      * @memberOf _
59924                      * @category Lang
59925                      * @param {*}
59926                      *            value The value to check.
59927                      * @returns {boolean} Returns `true` if `value` is correctly classified,
59928                      *          else `false`.
59929                      * @example
59930                      * 
59931                      * _.isString('abc'); // => true
59932                      * 
59933                      * _.isString(1); // => false
59934                      */
59935                     function isString(value) {
59936                         return typeof value == 'string' || (isObjectLike(value) && objToString.call(value) == stringTag);
59937                     }
59938
59939                     /**
59940                      * Checks if `value` is classified as a typed array.
59941                      * 
59942                      * @static
59943                      * @memberOf _
59944                      * @category Lang
59945                      * @param {*}
59946                      *            value The value to check.
59947                      * @returns {boolean} Returns `true` if `value` is correctly classified,
59948                      *          else `false`.
59949                      * @example
59950                      * 
59951                      * _.isTypedArray(new Uint8Array); // => true
59952                      * 
59953                      * _.isTypedArray([]); // => false
59954                      */
59955                     function isTypedArray(value) {
59956                         return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[objToString.call(value)];
59957                     }
59958
59959                     /**
59960                      * Checks if `value` is `undefined`.
59961                      * 
59962                      * @static
59963                      * @memberOf _
59964                      * @category Lang
59965                      * @param {*}
59966                      *            value The value to check.
59967                      * @returns {boolean} Returns `true` if `value` is `undefined`, else
59968                      *          `false`.
59969                      * @example
59970                      * 
59971                      * _.isUndefined(void 0); // => true
59972                      * 
59973                      * _.isUndefined(null); // => false
59974                      */
59975                     function isUndefined(value) {
59976                         return value === undefined;
59977                     }
59978
59979                     /**
59980                      * Checks if `value` is less than `other`.
59981                      * 
59982                      * @static
59983                      * @memberOf _
59984                      * @category Lang
59985                      * @param {*}
59986                      *            value The value to compare.
59987                      * @param {*}
59988                      *            other The other value to compare.
59989                      * @returns {boolean} Returns `true` if `value` is less than `other`, else
59990                      *          `false`.
59991                      * @example
59992                      * 
59993                      * _.lt(1, 3); // => true
59994                      * 
59995                      * _.lt(3, 3); // => false
59996                      * 
59997                      * _.lt(3, 1); // => false
59998                      */
59999                     function lt(value, other) {
60000                         return value < other;
60001                     }
60002
60003                     /**
60004                      * Checks if `value` is less than or equal to `other`.
60005                      * 
60006                      * @static
60007                      * @memberOf _
60008                      * @category Lang
60009                      * @param {*}
60010                      *            value The value to compare.
60011                      * @param {*}
60012                      *            other The other value to compare.
60013                      * @returns {boolean} Returns `true` if `value` is less than or equal to
60014                      *          `other`, else `false`.
60015                      * @example
60016                      * 
60017                      * _.lte(1, 3); // => true
60018                      * 
60019                      * _.lte(3, 3); // => true
60020                      * 
60021                      * _.lte(3, 1); // => false
60022                      */
60023                     function lte(value, other) {
60024                         return value <= other;
60025                     }
60026
60027                     /**
60028                      * Converts `value` to an array.
60029                      * 
60030                      * @static
60031                      * @memberOf _
60032                      * @category Lang
60033                      * @param {*}
60034                      *            value The value to convert.
60035                      * @returns {Array} Returns the converted array.
60036                      * @example
60037                      * 
60038                      * (function() { return _.toArray(arguments).slice(1); }(1, 2, 3)); // =>
60039                      * [2, 3]
60040                      */
60041                     function toArray(value) {
60042                         var length = value ? getLength(value) : 0;
60043                         if (!isLength(length)) {
60044                             return values(value);
60045                         }
60046                         if (!length) {
60047                             return [];
60048                         }
60049                         return arrayCopy(value);
60050                     }
60051
60052                     /**
60053                      * Converts `value` to a plain object flattening inherited enumerable
60054                      * properties of `value` to own properties of the plain object.
60055                      * 
60056                      * @static
60057                      * @memberOf _
60058                      * @category Lang
60059                      * @param {*}
60060                      *            value The value to convert.
60061                      * @returns {Object} Returns the converted plain object.
60062                      * @example
60063                      * 
60064                      * function Foo() { this.b = 2; }
60065                      * 
60066                      * Foo.prototype.c = 3;
60067                      * 
60068                      * _.assign({ 'a': 1 }, new Foo); // => { 'a': 1, 'b': 2 }
60069                      * 
60070                      * _.assign({ 'a': 1 }, _.toPlainObject(new Foo)); // => { 'a': 1, 'b': 2,
60071                      * 'c': 3 }
60072                      */
60073                     function toPlainObject(value) {
60074                         return baseCopy(value, keysIn(value));
60075                     }
60076
60077                     /*------------------------------------------------------------------------*/
60078
60079                     /**
60080                      * Recursively merges own enumerable properties of the source object(s),
60081                      * that don't resolve to `undefined` into the destination object. Subsequent
60082                      * sources overwrite property assignments of previous sources. If
60083                      * `customizer` is provided it is invoked to produce the merged values of
60084                      * the destination and source properties. If `customizer` returns
60085                      * `undefined` merging is handled by the method instead. The `customizer` is
60086                      * bound to `thisArg` and invoked with five arguments: (objectValue,
60087                      * sourceValue, key, object, source).
60088                      * 
60089                      * @static
60090                      * @memberOf _
60091                      * @category Object
60092                      * @param {Object}
60093                      *            object The destination object.
60094                      * @param {...Object}
60095                      *            [sources] The source objects.
60096                      * @param {Function}
60097                      *            [customizer] The function to customize assigned values.
60098                      * @param {*}
60099                      *            [thisArg] The `this` binding of `customizer`.
60100                      * @returns {Object} Returns `object`.
60101                      * @example
60102                      * 
60103                      * var users = { 'data': [{ 'user': 'barney' }, { 'user': 'fred' }] };
60104                      * 
60105                      * var ages = { 'data': [{ 'age': 36 }, { 'age': 40 }] };
60106                      * 
60107                      * _.merge(users, ages); // => { 'data': [{ 'user': 'barney', 'age': 36 }, {
60108                      * 'user': 'fred', 'age': 40 }] }
60109                      *  // using a customizer callback var object = { 'fruits': ['apple'],
60110                      * 'vegetables': ['beet'] };
60111                      * 
60112                      * var other = { 'fruits': ['banana'], 'vegetables': ['carrot'] };
60113                      * 
60114                      * _.merge(object, other, function(a, b) { if (_.isArray(a)) { return
60115                      * a.concat(b); } }); // => { 'fruits': ['apple', 'banana'], 'vegetables':
60116                      * ['beet', 'carrot'] }
60117                      */
60118                     var merge = createAssigner(baseMerge);
60119
60120                     /**
60121                      * Assigns own enumerable properties of source object(s) to the destination
60122                      * object. Subsequent sources overwrite property assignments of previous
60123                      * sources. If `customizer` is provided it is invoked to produce the
60124                      * assigned values. The `customizer` is bound to `thisArg` and invoked with
60125                      * five arguments: (objectValue, sourceValue, key, object, source).
60126                      * 
60127                      * **Note:** This method mutates `object` and is based on
60128                      * [`Object.assign`](http://ecma-international.org/ecma-262/6.0/#sec-object.assign).
60129                      * 
60130                      * @static
60131                      * @memberOf _
60132                      * @alias extend
60133                      * @category Object
60134                      * @param {Object}
60135                      *            object The destination object.
60136                      * @param {...Object}
60137                      *            [sources] The source objects.
60138                      * @param {Function}
60139                      *            [customizer] The function to customize assigned values.
60140                      * @param {*}
60141                      *            [thisArg] The `this` binding of `customizer`.
60142                      * @returns {Object} Returns `object`.
60143                      * @example
60144                      * 
60145                      * _.assign({ 'user': 'barney' }, { 'age': 40 }, { 'user': 'fred' }); // => {
60146                      * 'user': 'fred', 'age': 40 }
60147                      *  // using a customizer callback var defaults = _.partialRight(_.assign,
60148                      * function(value, other) { return _.isUndefined(value) ? other : value; });
60149                      * 
60150                      * defaults({ 'user': 'barney' }, { 'age': 36 }, { 'user': 'fred' }); // => {
60151                      * 'user': 'barney', 'age': 36 }
60152                      */
60153                     var assign = createAssigner(function(object, source, customizer) {
60154                         return customizer ? assignWith(object, source, customizer) : baseAssign(object, source);
60155                     });
60156
60157                     /**
60158                      * Creates an object that inherits from the given `prototype` object. If a
60159                      * `properties` object is provided its own enumerable properties are
60160                      * assigned to the created object.
60161                      * 
60162                      * @static
60163                      * @memberOf _
60164                      * @category Object
60165                      * @param {Object}
60166                      *            prototype The object to inherit from.
60167                      * @param {Object}
60168                      *            [properties] The properties to assign to the object.
60169                      * @param- {Object} [guard] Enables use as a callback for functions like
60170                      *         `_.map`.
60171                      * @returns {Object} Returns the new object.
60172                      * @example
60173                      * 
60174                      * function Shape() { this.x = 0; this.y = 0; }
60175                      * 
60176                      * function Circle() { Shape.call(this); }
60177                      * 
60178                      * Circle.prototype = _.create(Shape.prototype, { 'constructor': Circle });
60179                      * 
60180                      * var circle = new Circle; circle instanceof Circle; // => true
60181                      * 
60182                      * circle instanceof Shape; // => true
60183                      */
60184                     function create(prototype, properties, guard) {
60185                         var result = baseCreate(prototype);
60186                         if (guard && isIterateeCall(prototype, properties, guard)) {
60187                             properties = undefined;
60188                         }
60189                         return properties ? baseAssign(result, properties) : result;
60190                     }
60191
60192                     /**
60193                      * Assigns own enumerable properties of source object(s) to the destination
60194                      * object for all destination properties that resolve to `undefined`. Once a
60195                      * property is set, additional values of the same property are ignored.
60196                      * 
60197                      * **Note:** This method mutates `object`.
60198                      * 
60199                      * @static
60200                      * @memberOf _
60201                      * @category Object
60202                      * @param {Object}
60203                      *            object The destination object.
60204                      * @param {...Object}
60205                      *            [sources] The source objects.
60206                      * @returns {Object} Returns `object`.
60207                      * @example
60208                      * 
60209                      * _.defaults({ 'user': 'barney' }, { 'age': 36 }, { 'user': 'fred' }); // => {
60210                      * 'user': 'barney', 'age': 36 }
60211                      */
60212                     var defaults = createDefaults(assign, assignDefaults);
60213
60214                     /**
60215                      * This method is like `_.defaults` except that it recursively assigns
60216                      * default properties.
60217                      * 
60218                      * **Note:** This method mutates `object`.
60219                      * 
60220                      * @static
60221                      * @memberOf _
60222                      * @category Object
60223                      * @param {Object}
60224                      *            object The destination object.
60225                      * @param {...Object}
60226                      *            [sources] The source objects.
60227                      * @returns {Object} Returns `object`.
60228                      * @example
60229                      * 
60230                      * _.defaultsDeep({ 'user': { 'name': 'barney' } }, { 'user': { 'name':
60231                      * 'fred', 'age': 36 } }); // => { 'user': { 'name': 'barney', 'age': 36 } }
60232                      * 
60233                      */
60234                     var defaultsDeep = createDefaults(merge, mergeDefaults);
60235
60236                     /**
60237                      * This method is like `_.find` except that it returns the key of the first
60238                      * element `predicate` returns truthy for instead of the element itself.
60239                      * 
60240                      * If a property name is provided for `predicate` the created `_.property`
60241                      * style callback returns the property value of the given element.
60242                      * 
60243                      * If a value is also provided for `thisArg` the created `_.matchesProperty`
60244                      * style callback returns `true` for elements that have a matching property
60245                      * value, else `false`.
60246                      * 
60247                      * If an object is provided for `predicate` the created `_.matches` style
60248                      * callback returns `true` for elements that have the properties of the
60249                      * given object, else `false`.
60250                      * 
60251                      * @static
60252                      * @memberOf _
60253                      * @category Object
60254                      * @param {Object}
60255                      *            object The object to search.
60256                      * @param {Function|Object|string}
60257                      *            [predicate=_.identity] The function invoked per iteration.
60258                      * @param {*}
60259                      *            [thisArg] The `this` binding of `predicate`.
60260                      * @returns {string|undefined} Returns the key of the matched element, else
60261                      *          `undefined`.
60262                      * @example
60263                      * 
60264                      * var users = { 'barney': { 'age': 36, 'active': true }, 'fred': { 'age':
60265                      * 40, 'active': false }, 'pebbles': { 'age': 1, 'active': true } };
60266                      * 
60267                      * _.findKey(users, function(chr) { return chr.age < 40; }); // => 'barney'
60268                      * (iteration order is not guaranteed)
60269                      *  // using the `_.matches` callback shorthand _.findKey(users, { 'age': 1,
60270                      * 'active': true }); // => 'pebbles'
60271                      *  // using the `_.matchesProperty` callback shorthand _.findKey(users,
60272                      * 'active', false); // => 'fred'
60273                      *  // using the `_.property` callback shorthand _.findKey(users, 'active'); // =>
60274                      * 'barney'
60275                      */
60276                     var findKey = createFindKey(baseForOwn);
60277
60278                     /**
60279                      * This method is like `_.findKey` except that it iterates over elements of
60280                      * a collection in the opposite order.
60281                      * 
60282                      * If a property name is provided for `predicate` the created `_.property`
60283                      * style callback returns the property value of the given element.
60284                      * 
60285                      * If a value is also provided for `thisArg` the created `_.matchesProperty`
60286                      * style callback returns `true` for elements that have a matching property
60287                      * value, else `false`.
60288                      * 
60289                      * If an object is provided for `predicate` the created `_.matches` style
60290                      * callback returns `true` for elements that have the properties of the
60291                      * given object, else `false`.
60292                      * 
60293                      * @static
60294                      * @memberOf _
60295                      * @category Object
60296                      * @param {Object}
60297                      *            object The object to search.
60298                      * @param {Function|Object|string}
60299                      *            [predicate=_.identity] The function invoked per iteration.
60300                      * @param {*}
60301                      *            [thisArg] The `this` binding of `predicate`.
60302                      * @returns {string|undefined} Returns the key of the matched element, else
60303                      *          `undefined`.
60304                      * @example
60305                      * 
60306                      * var users = { 'barney': { 'age': 36, 'active': true }, 'fred': { 'age':
60307                      * 40, 'active': false }, 'pebbles': { 'age': 1, 'active': true } };
60308                      * 
60309                      * _.findLastKey(users, function(chr) { return chr.age < 40; }); // =>
60310                      * returns `pebbles` assuming `_.findKey` returns `barney`
60311                      *  // using the `_.matches` callback shorthand _.findLastKey(users, {
60312                      * 'age': 36, 'active': true }); // => 'barney'
60313                      *  // using the `_.matchesProperty` callback shorthand _.findLastKey(users,
60314                      * 'active', false); // => 'fred'
60315                      *  // using the `_.property` callback shorthand _.findLastKey(users,
60316                      * 'active'); // => 'pebbles'
60317                      */
60318                     var findLastKey = createFindKey(baseForOwnRight);
60319
60320                     /**
60321                      * Iterates over own and inherited enumerable properties of an object
60322                      * invoking `iteratee` for each property. The `iteratee` is bound to
60323                      * `thisArg` and invoked with three arguments: (value, key, object).
60324                      * Iteratee functions may exit iteration early by explicitly returning
60325                      * `false`.
60326                      * 
60327                      * @static
60328                      * @memberOf _
60329                      * @category Object
60330                      * @param {Object}
60331                      *            object The object to iterate over.
60332                      * @param {Function}
60333                      *            [iteratee=_.identity] The function invoked per iteration.
60334                      * @param {*}
60335                      *            [thisArg] The `this` binding of `iteratee`.
60336                      * @returns {Object} Returns `object`.
60337                      * @example
60338                      * 
60339                      * function Foo() { this.a = 1; this.b = 2; }
60340                      * 
60341                      * Foo.prototype.c = 3;
60342                      * 
60343                      * _.forIn(new Foo, function(value, key) { console.log(key); }); // => logs
60344                      * 'a', 'b', and 'c' (iteration order is not guaranteed)
60345                      */
60346                     var forIn = createForIn(baseFor);
60347
60348                     /**
60349                      * This method is like `_.forIn` except that it iterates over properties of
60350                      * `object` in the opposite order.
60351                      * 
60352                      * @static
60353                      * @memberOf _
60354                      * @category Object
60355                      * @param {Object}
60356                      *            object The object to iterate over.
60357                      * @param {Function}
60358                      *            [iteratee=_.identity] The function invoked per iteration.
60359                      * @param {*}
60360                      *            [thisArg] The `this` binding of `iteratee`.
60361                      * @returns {Object} Returns `object`.
60362                      * @example
60363                      * 
60364                      * function Foo() { this.a = 1; this.b = 2; }
60365                      * 
60366                      * Foo.prototype.c = 3;
60367                      * 
60368                      * _.forInRight(new Foo, function(value, key) { console.log(key); }); // =>
60369                      * logs 'c', 'b', and 'a' assuming `_.forIn ` logs 'a', 'b', and 'c'
60370                      */
60371                     var forInRight = createForIn(baseForRight);
60372
60373                     /**
60374                      * Iterates over own enumerable properties of an object invoking `iteratee`
60375                      * for each property. The `iteratee` is bound to `thisArg` and invoked with
60376                      * three arguments: (value, key, object). Iteratee functions may exit
60377                      * iteration early by explicitly returning `false`.
60378                      * 
60379                      * @static
60380                      * @memberOf _
60381                      * @category Object
60382                      * @param {Object}
60383                      *            object The object to iterate over.
60384                      * @param {Function}
60385                      *            [iteratee=_.identity] The function invoked per iteration.
60386                      * @param {*}
60387                      *            [thisArg] The `this` binding of `iteratee`.
60388                      * @returns {Object} Returns `object`.
60389                      * @example
60390                      * 
60391                      * function Foo() { this.a = 1; this.b = 2; }
60392                      * 
60393                      * Foo.prototype.c = 3;
60394                      * 
60395                      * _.forOwn(new Foo, function(value, key) { console.log(key); }); // => logs
60396                      * 'a' and 'b' (iteration order is not guaranteed)
60397                      */
60398                     var forOwn = createForOwn(baseForOwn);
60399
60400                     /**
60401                      * This method is like `_.forOwn` except that it iterates over properties of
60402                      * `object` in the opposite order.
60403                      * 
60404                      * @static
60405                      * @memberOf _
60406                      * @category Object
60407                      * @param {Object}
60408                      *            object The object to iterate over.
60409                      * @param {Function}
60410                      *            [iteratee=_.identity] The function invoked per iteration.
60411                      * @param {*}
60412                      *            [thisArg] The `this` binding of `iteratee`.
60413                      * @returns {Object} Returns `object`.
60414                      * @example
60415                      * 
60416                      * function Foo() { this.a = 1; this.b = 2; }
60417                      * 
60418                      * Foo.prototype.c = 3;
60419                      * 
60420                      * _.forOwnRight(new Foo, function(value, key) { console.log(key); }); // =>
60421                      * logs 'b' and 'a' assuming `_.forOwn` logs 'a' and 'b'
60422                      */
60423                     var forOwnRight = createForOwn(baseForOwnRight);
60424
60425                     /**
60426                      * Creates an array of function property names from all enumerable
60427                      * properties, own and inherited, of `object`.
60428                      * 
60429                      * @static
60430                      * @memberOf _
60431                      * @alias methods
60432                      * @category Object
60433                      * @param {Object}
60434                      *            object The object to inspect.
60435                      * @returns {Array} Returns the new array of property names.
60436                      * @example
60437                      * 
60438                      * _.functions(_); // => ['after', 'ary', 'assign', ...]
60439                      */
60440                     function functions(object) {
60441                         return baseFunctions(object, keysIn(object));
60442                     }
60443
60444                     /**
60445                      * Gets the property value at `path` of `object`. If the resolved value is
60446                      * `undefined` the `defaultValue` is used in its place.
60447                      * 
60448                      * @static
60449                      * @memberOf _
60450                      * @category Object
60451                      * @param {Object}
60452                      *            object The object to query.
60453                      * @param {Array|string}
60454                      *            path The path of the property to get.
60455                      * @param {*}
60456                      *            [defaultValue] The value returned if the resolved value is
60457                      *            `undefined`.
60458                      * @returns {*} Returns the resolved value.
60459                      * @example
60460                      * 
60461                      * var object = { 'a': [{ 'b': { 'c': 3 } }] };
60462                      * 
60463                      * _.get(object, 'a[0].b.c'); // => 3
60464                      * 
60465                      * _.get(object, ['a', '0', 'b', 'c']); // => 3
60466                      * 
60467                      * _.get(object, 'a.b.c', 'default'); // => 'default'
60468                      */
60469                     function get(object, path, defaultValue) {
60470                         var result = object == null ? undefined : baseGet(object, toPath(path), path + '');
60471                         return result === undefined ? defaultValue : result;
60472                     }
60473
60474                     /**
60475                      * Checks if `path` is a direct property.
60476                      * 
60477                      * @static
60478                      * @memberOf _
60479                      * @category Object
60480                      * @param {Object}
60481                      *            object The object to query.
60482                      * @param {Array|string}
60483                      *            path The path to check.
60484                      * @returns {boolean} Returns `true` if `path` is a direct property, else
60485                      *          `false`.
60486                      * @example
60487                      * 
60488                      * var object = { 'a': { 'b': { 'c': 3 } } };
60489                      * 
60490                      * _.has(object, 'a'); // => true
60491                      * 
60492                      * _.has(object, 'a.b.c'); // => true
60493                      * 
60494                      * _.has(object, ['a', 'b', 'c']); // => true
60495                      */
60496                     function has(object, path) {
60497                         if (object == null) {
60498                             return false;
60499                         }
60500                         var result = hasOwnProperty.call(object, path);
60501                         if (!result && !isKey(path)) {
60502                             path = toPath(path);
60503                             object = path.length == 1 ? object : baseGet(object, baseSlice(path, 0, -1));
60504                             if (object == null) {
60505                                 return false;
60506                             }
60507                             path = last(path);
60508                             result = hasOwnProperty.call(object, path);
60509                         }
60510                         return result || (isLength(object.length) && isIndex(path, object.length) &&
60511                             (isArray(object) || isArguments(object)));
60512                     }
60513
60514                     /**
60515                      * Creates an object composed of the inverted keys and values of `object`.
60516                      * If `object` contains duplicate values, subsequent values overwrite
60517                      * property assignments of previous values unless `multiValue` is `true`.
60518                      * 
60519                      * @static
60520                      * @memberOf _
60521                      * @category Object
60522                      * @param {Object}
60523                      *            object The object to invert.
60524                      * @param {boolean}
60525                      *            [multiValue] Allow multiple values per key.
60526                      * @param- {Object} [guard] Enables use as a callback for functions like
60527                      *         `_.map`.
60528                      * @returns {Object} Returns the new inverted object.
60529                      * @example
60530                      * 
60531                      * var object = { 'a': 1, 'b': 2, 'c': 1 };
60532                      * 
60533                      * _.invert(object); // => { '1': 'c', '2': 'b' }
60534                      *  // with `multiValue` _.invert(object, true); // => { '1': ['a', 'c'],
60535                      * '2': ['b'] }
60536                      */
60537                     function invert(object, multiValue, guard) {
60538                         if (guard && isIterateeCall(object, multiValue, guard)) {
60539                             multiValue = undefined;
60540                         }
60541                         var index = -1,
60542                             props = keys(object),
60543                             length = props.length,
60544                             result = {};
60545
60546                         while (++index < length) {
60547                             var key = props[index],
60548                                 value = object[key];
60549
60550                             if (multiValue) {
60551                                 if (hasOwnProperty.call(result, value)) {
60552                                     result[value].push(key);
60553                                 } else {
60554                                     result[value] = [key];
60555                                 }
60556                             } else {
60557                                 result[value] = key;
60558                             }
60559                         }
60560                         return result;
60561                     }
60562
60563                     /**
60564                      * Creates an array of the own enumerable property names of `object`.
60565                      * 
60566                      * **Note:** Non-object values are coerced to objects. See the [ES
60567                      * spec](http://ecma-international.org/ecma-262/6.0/#sec-object.keys) for
60568                      * more details.
60569                      * 
60570                      * @static
60571                      * @memberOf _
60572                      * @category Object
60573                      * @param {Object}
60574                      *            object The object to query.
60575                      * @returns {Array} Returns the array of property names.
60576                      * @example
60577                      * 
60578                      * function Foo() { this.a = 1; this.b = 2; }
60579                      * 
60580                      * Foo.prototype.c = 3;
60581                      * 
60582                      * _.keys(new Foo); // => ['a', 'b'] (iteration order is not guaranteed)
60583                      * 
60584                      * _.keys('hi'); // => ['0', '1']
60585                      */
60586                     var keys = !nativeKeys ? shimKeys : function(object) {
60587                         var Ctor = object == null ? undefined : object.constructor;
60588                         if ((typeof Ctor == 'function' && Ctor.prototype === object) ||
60589                             (typeof object != 'function' && isArrayLike(object))) {
60590                             return shimKeys(object);
60591                         }
60592                         return isObject(object) ? nativeKeys(object) : [];
60593                     };
60594
60595                     /**
60596                      * Creates an array of the own and inherited enumerable property names of
60597                      * `object`.
60598                      * 
60599                      * **Note:** Non-object values are coerced to objects.
60600                      * 
60601                      * @static
60602                      * @memberOf _
60603                      * @category Object
60604                      * @param {Object}
60605                      *            object The object to query.
60606                      * @returns {Array} Returns the array of property names.
60607                      * @example
60608                      * 
60609                      * function Foo() { this.a = 1; this.b = 2; }
60610                      * 
60611                      * Foo.prototype.c = 3;
60612                      * 
60613                      * _.keysIn(new Foo); // => ['a', 'b', 'c'] (iteration order is not
60614                      * guaranteed)
60615                      */
60616                     function keysIn(object) {
60617                         if (object == null) {
60618                             return [];
60619                         }
60620                         if (!isObject(object)) {
60621                             object = Object(object);
60622                         }
60623                         var length = object.length;
60624                         length = (length && isLength(length) &&
60625                             (isArray(object) || isArguments(object)) && length) || 0;
60626
60627                         var Ctor = object.constructor,
60628                             index = -1,
60629                             isProto = typeof Ctor == 'function' && Ctor.prototype === object,
60630                             result = Array(length),
60631                             skipIndexes = length > 0;
60632
60633                         while (++index < length) {
60634                             result[index] = (index + '');
60635                         }
60636                         for (var key in object) {
60637                             if (!(skipIndexes && isIndex(key, length)) &&
60638                                 !(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
60639                                 result.push(key);
60640                             }
60641                         }
60642                         return result;
60643                     }
60644
60645                     /**
60646                      * The opposite of `_.mapValues`; this method creates an object with the
60647                      * same values as `object` and keys generated by running each own enumerable
60648                      * property of `object` through `iteratee`.
60649                      * 
60650                      * @static
60651                      * @memberOf _
60652                      * @category Object
60653                      * @param {Object}
60654                      *            object The object to iterate over.
60655                      * @param {Function|Object|string}
60656                      *            [iteratee=_.identity] The function invoked per iteration.
60657                      * @param {*}
60658                      *            [thisArg] The `this` binding of `iteratee`.
60659                      * @returns {Object} Returns the new mapped object.
60660                      * @example
60661                      * 
60662                      * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) { return key + value;
60663                      * }); // => { 'a1': 1, 'b2': 2 }
60664                      */
60665                     var mapKeys = createObjectMapper(true);
60666
60667                     /**
60668                      * Creates an object with the same keys as `object` and values generated by
60669                      * running each own enumerable property of `object` through `iteratee`. The
60670                      * iteratee function is bound to `thisArg` and invoked with three arguments:
60671                      * (value, key, object).
60672                      * 
60673                      * If a property name is provided for `iteratee` the created `_.property`
60674                      * style callback returns the property value of the given element.
60675                      * 
60676                      * If a value is also provided for `thisArg` the created `_.matchesProperty`
60677                      * style callback returns `true` for elements that have a matching property
60678                      * value, else `false`.
60679                      * 
60680                      * If an object is provided for `iteratee` the created `_.matches` style
60681                      * callback returns `true` for elements that have the properties of the
60682                      * given object, else `false`.
60683                      * 
60684                      * @static
60685                      * @memberOf _
60686                      * @category Object
60687                      * @param {Object}
60688                      *            object The object to iterate over.
60689                      * @param {Function|Object|string}
60690                      *            [iteratee=_.identity] The function invoked per iteration.
60691                      * @param {*}
60692                      *            [thisArg] The `this` binding of `iteratee`.
60693                      * @returns {Object} Returns the new mapped object.
60694                      * @example
60695                      * 
60696                      * _.mapValues({ 'a': 1, 'b': 2 }, function(n) { return n * 3; }); // => {
60697                      * 'a': 3, 'b': 6 }
60698                      * 
60699                      * var users = { 'fred': { 'user': 'fred', 'age': 40 }, 'pebbles': { 'user':
60700                      * 'pebbles', 'age': 1 } };
60701                      *  // using the `_.property` callback shorthand _.mapValues(users, 'age'); // => {
60702                      * 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
60703                      */
60704                     var mapValues = createObjectMapper();
60705
60706                     /**
60707                      * The opposite of `_.pick`; this method creates an object composed of the
60708                      * own and inherited enumerable properties of `object` that are not omitted.
60709                      * 
60710                      * @static
60711                      * @memberOf _
60712                      * @category Object
60713                      * @param {Object}
60714                      *            object The source object.
60715                      * @param {Function|...(string|string[])}
60716                      *            [predicate] The function invoked per iteration or property
60717                      *            names to omit, specified as individual property names or
60718                      *            arrays of property names.
60719                      * @param {*}
60720                      *            [thisArg] The `this` binding of `predicate`.
60721                      * @returns {Object} Returns the new object.
60722                      * @example
60723                      * 
60724                      * var object = { 'user': 'fred', 'age': 40 };
60725                      * 
60726                      * _.omit(object, 'age'); // => { 'user': 'fred' }
60727                      * 
60728                      * _.omit(object, _.isNumber); // => { 'user': 'fred' }
60729                      */
60730                     var omit = restParam(function(object, props) {
60731                         if (object == null) {
60732                             return {};
60733                         }
60734                         if (typeof props[0] != 'function') {
60735                             var props = arrayMap(baseFlatten(props), String);
60736                             return pickByArray(object, baseDifference(keysIn(object), props));
60737                         }
60738                         var predicate = bindCallback(props[0], props[1], 3);
60739                         return pickByCallback(object, function(value, key, object) {
60740                             return !predicate(value, key, object);
60741                         });
60742                     });
60743
60744                     /**
60745                      * Creates a two dimensional array of the key-value pairs for `object`, e.g.
60746                      * `[[key1, value1], [key2, value2]]`.
60747                      * 
60748                      * @static
60749                      * @memberOf _
60750                      * @category Object
60751                      * @param {Object}
60752                      *            object The object to query.
60753                      * @returns {Array} Returns the new array of key-value pairs.
60754                      * @example
60755                      * 
60756                      * _.pairs({ 'barney': 36, 'fred': 40 }); // => [['barney', 36], ['fred',
60757                      * 40]] (iteration order is not guaranteed)
60758                      */
60759                     function pairs(object) {
60760                         object = toObject(object);
60761
60762                         var index = -1,
60763                             props = keys(object),
60764                             length = props.length,
60765                             result = Array(length);
60766
60767                         while (++index < length) {
60768                             var key = props[index];
60769                             result[index] = [key, object[key]];
60770                         }
60771                         return result;
60772                     }
60773
60774                     /**
60775                      * Creates an object composed of the picked `object` properties. Property
60776                      * names may be specified as individual arguments or as arrays of property
60777                      * names. If `predicate` is provided it is invoked for each property of
60778                      * `object` picking the properties `predicate` returns truthy for. The
60779                      * predicate is bound to `thisArg` and invoked with three arguments: (value,
60780                      * key, object).
60781                      * 
60782                      * @static
60783                      * @memberOf _
60784                      * @category Object
60785                      * @param {Object}
60786                      *            object The source object.
60787                      * @param {Function|...(string|string[])}
60788                      *            [predicate] The function invoked per iteration or property
60789                      *            names to pick, specified as individual property names or
60790                      *            arrays of property names.
60791                      * @param {*}
60792                      *            [thisArg] The `this` binding of `predicate`.
60793                      * @returns {Object} Returns the new object.
60794                      * @example
60795                      * 
60796                      * var object = { 'user': 'fred', 'age': 40 };
60797                      * 
60798                      * _.pick(object, 'user'); // => { 'user': 'fred' }
60799                      * 
60800                      * _.pick(object, _.isString); // => { 'user': 'fred' }
60801                      */
60802                     var pick = restParam(function(object, props) {
60803                         if (object == null) {
60804                             return {};
60805                         }
60806                         return typeof props[0] == 'function' ? pickByCallback(object, bindCallback(props[0], props[1], 3)) : pickByArray(object, baseFlatten(props));
60807                     });
60808
60809                     /**
60810                      * This method is like `_.get` except that if the resolved value is a
60811                      * function it is invoked with the `this` binding of its parent object and
60812                      * its result is returned.
60813                      * 
60814                      * @static
60815                      * @memberOf _
60816                      * @category Object
60817                      * @param {Object}
60818                      *            object The object to query.
60819                      * @param {Array|string}
60820                      *            path The path of the property to resolve.
60821                      * @param {*}
60822                      *            [defaultValue] The value returned if the resolved value is
60823                      *            `undefined`.
60824                      * @returns {*} Returns the resolved value.
60825                      * @example
60826                      * 
60827                      * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };
60828                      * 
60829                      * _.result(object, 'a[0].b.c1'); // => 3
60830                      * 
60831                      * _.result(object, 'a[0].b.c2'); // => 4
60832                      * 
60833                      * _.result(object, 'a.b.c', 'default'); // => 'default'
60834                      * 
60835                      * _.result(object, 'a.b.c', _.constant('default')); // => 'default'
60836                      */
60837                     function result(object, path, defaultValue) {
60838                         var result = object == null ? undefined : object[path];
60839                         if (result === undefined) {
60840                             if (object != null && !isKey(path, object)) {
60841                                 path = toPath(path);
60842                                 object = path.length == 1 ? object : baseGet(object, baseSlice(path, 0, -1));
60843                                 result = object == null ? undefined : object[last(path)];
60844                             }
60845                             result = result === undefined ? defaultValue : result;
60846                         }
60847                         return isFunction(result) ? result.call(object) : result;
60848                     }
60849
60850                     /**
60851                      * Sets the property value of `path` on `object`. If a portion of `path`
60852                      * does not exist it is created.
60853                      * 
60854                      * @static
60855                      * @memberOf _
60856                      * @category Object
60857                      * @param {Object}
60858                      *            object The object to augment.
60859                      * @param {Array|string}
60860                      *            path The path of the property to set.
60861                      * @param {*}
60862                      *            value The value to set.
60863                      * @returns {Object} Returns `object`.
60864                      * @example
60865                      * 
60866                      * var object = { 'a': [{ 'b': { 'c': 3 } }] };
60867                      * 
60868                      * _.set(object, 'a[0].b.c', 4); console.log(object.a[0].b.c); // => 4
60869                      * 
60870                      * _.set(object, 'x[0].y.z', 5); console.log(object.x[0].y.z); // => 5
60871                      */
60872                     function set(object, path, value) {
60873                         if (object == null) {
60874                             return object;
60875                         }
60876                         var pathKey = (path + '');
60877                         path = (object[pathKey] != null || isKey(path, object)) ? [pathKey] : toPath(path);
60878
60879                         var index = -1,
60880                             length = path.length,
60881                             lastIndex = length - 1,
60882                             nested = object;
60883
60884                         while (nested != null && ++index < length) {
60885                             var key = path[index];
60886                             if (isObject(nested)) {
60887                                 if (index == lastIndex) {
60888                                     nested[key] = value;
60889                                 } else if (nested[key] == null) {
60890                                     nested[key] = isIndex(path[index + 1]) ? [] : {};
60891                                 }
60892                             }
60893                             nested = nested[key];
60894                         }
60895                         return object;
60896                     }
60897
60898                     /**
60899                      * An alternative to `_.reduce`; this method transforms `object` to a new
60900                      * `accumulator` object which is the result of running each of its own
60901                      * enumerable properties through `iteratee`, with each invocation
60902                      * potentially mutating the `accumulator` object. The `iteratee` is bound to
60903                      * `thisArg` and invoked with four arguments: (accumulator, value, key,
60904                      * object). Iteratee functions may exit iteration early by explicitly
60905                      * returning `false`.
60906                      * 
60907                      * @static
60908                      * @memberOf _
60909                      * @category Object
60910                      * @param {Array|Object}
60911                      *            object The object to iterate over.
60912                      * @param {Function}
60913                      *            [iteratee=_.identity] The function invoked per iteration.
60914                      * @param {*}
60915                      *            [accumulator] The custom accumulator value.
60916                      * @param {*}
60917                      *            [thisArg] The `this` binding of `iteratee`.
60918                      * @returns {*} Returns the accumulated value.
60919                      * @example
60920                      * 
60921                      * _.transform([2, 3, 4], function(result, n) { result.push(n *= n); return
60922                      * n % 2 == 0; }); // => [4, 9]
60923                      * 
60924                      * _.transform({ 'a': 1, 'b': 2 }, function(result, n, key) { result[key] =
60925                      * n * 3; }); // => { 'a': 3, 'b': 6 }
60926                      */
60927                     function transform(object, iteratee, accumulator, thisArg) {
60928                         var isArr = isArray(object) || isTypedArray(object);
60929                         iteratee = getCallback(iteratee, thisArg, 4);
60930
60931                         if (accumulator == null) {
60932                             if (isArr || isObject(object)) {
60933                                 var Ctor = object.constructor;
60934                                 if (isArr) {
60935                                     accumulator = isArray(object) ? new Ctor : [];
60936                                 } else {
60937                                     accumulator = baseCreate(isFunction(Ctor) ? Ctor.prototype : undefined);
60938                                 }
60939                             } else {
60940                                 accumulator = {};
60941                             }
60942                         }
60943                         (isArr ? arrayEach : baseForOwn)(object, function(value, index, object) {
60944                             return iteratee(accumulator, value, index, object);
60945                         });
60946                         return accumulator;
60947                     }
60948
60949                     /**
60950                      * Creates an array of the own enumerable property values of `object`.
60951                      * 
60952                      * **Note:** Non-object values are coerced to objects.
60953                      * 
60954                      * @static
60955                      * @memberOf _
60956                      * @category Object
60957                      * @param {Object}
60958                      *            object The object to query.
60959                      * @returns {Array} Returns the array of property values.
60960                      * @example
60961                      * 
60962                      * function Foo() { this.a = 1; this.b = 2; }
60963                      * 
60964                      * Foo.prototype.c = 3;
60965                      * 
60966                      * _.values(new Foo); // => [1, 2] (iteration order is not guaranteed)
60967                      * 
60968                      * _.values('hi'); // => ['h', 'i']
60969                      */
60970                     function values(object) {
60971                         return baseValues(object, keys(object));
60972                     }
60973
60974                     /**
60975                      * Creates an array of the own and inherited enumerable property values of
60976                      * `object`.
60977                      * 
60978                      * **Note:** Non-object values are coerced to objects.
60979                      * 
60980                      * @static
60981                      * @memberOf _
60982                      * @category Object
60983                      * @param {Object}
60984                      *            object The object to query.
60985                      * @returns {Array} Returns the array of property values.
60986                      * @example
60987                      * 
60988                      * function Foo() { this.a = 1; this.b = 2; }
60989                      * 
60990                      * Foo.prototype.c = 3;
60991                      * 
60992                      * _.valuesIn(new Foo); // => [1, 2, 3] (iteration order is not guaranteed)
60993                      */
60994                     function valuesIn(object) {
60995                         return baseValues(object, keysIn(object));
60996                     }
60997
60998                     /*------------------------------------------------------------------------*/
60999
61000                     /**
61001                      * Checks if `n` is between `start` and up to but not including, `end`. If
61002                      * `end` is not specified it is set to `start` with `start` then set to `0`.
61003                      * 
61004                      * @static
61005                      * @memberOf _
61006                      * @category Number
61007                      * @param {number}
61008                      *            n The number to check.
61009                      * @param {number}
61010                      *            [start=0] The start of the range.
61011                      * @param {number}
61012                      *            end The end of the range.
61013                      * @returns {boolean} Returns `true` if `n` is in the range, else `false`.
61014                      * @example
61015                      * 
61016                      * _.inRange(3, 2, 4); // => true
61017                      * 
61018                      * _.inRange(4, 8); // => true
61019                      * 
61020                      * _.inRange(4, 2); // => false
61021                      * 
61022                      * _.inRange(2, 2); // => false
61023                      * 
61024                      * _.inRange(1.2, 2); // => true
61025                      * 
61026                      * _.inRange(5.2, 4); // => false
61027                      */
61028                     function inRange(value, start, end) {
61029                         start = +start || 0;
61030                         if (end === undefined) {
61031                             end = start;
61032                             start = 0;
61033                         } else {
61034                             end = +end || 0;
61035                         }
61036                         return value >= nativeMin(start, end) && value < nativeMax(start, end);
61037                     }
61038
61039                     /**
61040                      * Produces a random number between `min` and `max` (inclusive). If only one
61041                      * argument is provided a number between `0` and the given number is
61042                      * returned. If `floating` is `true`, or either `min` or `max` are floats, a
61043                      * floating-point number is returned instead of an integer.
61044                      * 
61045                      * @static
61046                      * @memberOf _
61047                      * @category Number
61048                      * @param {number}
61049                      *            [min=0] The minimum possible value.
61050                      * @param {number}
61051                      *            [max=1] The maximum possible value.
61052                      * @param {boolean}
61053                      *            [floating] Specify returning a floating-point number.
61054                      * @returns {number} Returns the random number.
61055                      * @example
61056                      * 
61057                      * _.random(0, 5); // => an integer between 0 and 5
61058                      * 
61059                      * _.random(5); // => also an integer between 0 and 5
61060                      * 
61061                      * _.random(5, true); // => a floating-point number between 0 and 5
61062                      * 
61063                      * _.random(1.2, 5.2); // => a floating-point number between 1.2 and 5.2
61064                      */
61065                     function random(min, max, floating) {
61066                         if (floating && isIterateeCall(min, max, floating)) {
61067                             max = floating = undefined;
61068                         }
61069                         var noMin = min == null,
61070                             noMax = max == null;
61071
61072                         if (floating == null) {
61073                             if (noMax && typeof min == 'boolean') {
61074                                 floating = min;
61075                                 min = 1;
61076                             } else if (typeof max == 'boolean') {
61077                                 floating = max;
61078                                 noMax = true;
61079                             }
61080                         }
61081                         if (noMin && noMax) {
61082                             max = 1;
61083                             noMax = false;
61084                         }
61085                         min = +min || 0;
61086                         if (noMax) {
61087                             max = min;
61088                             min = 0;
61089                         } else {
61090                             max = +max || 0;
61091                         }
61092                         if (floating || min % 1 || max % 1) {
61093                             var rand = nativeRandom();
61094                             return nativeMin(min + (rand * (max - min + parseFloat('1e-' + ((rand + '').length - 1)))), max);
61095                         }
61096                         return baseRandom(min, max);
61097                     }
61098
61099                     /*------------------------------------------------------------------------*/
61100
61101                     /**
61102                      * Converts `string` to [camel
61103                      * case](https://en.wikipedia.org/wiki/CamelCase).
61104                      * 
61105                      * @static
61106                      * @memberOf _
61107                      * @category String
61108                      * @param {string}
61109                      *            [string=''] The string to convert.
61110                      * @returns {string} Returns the camel cased string.
61111                      * @example
61112                      * 
61113                      * _.camelCase('Foo Bar'); // => 'fooBar'
61114                      * 
61115                      * _.camelCase('--foo-bar'); // => 'fooBar'
61116                      * 
61117                      * _.camelCase('__foo_bar__'); // => 'fooBar'
61118                      */
61119                     var camelCase = createCompounder(function(result, word, index) {
61120                         word = word.toLowerCase();
61121                         return result + (index ? (word.charAt(0).toUpperCase() + word.slice(1)) : word);
61122                     });
61123
61124                     /**
61125                      * Capitalizes the first character of `string`.
61126                      * 
61127                      * @static
61128                      * @memberOf _
61129                      * @category String
61130                      * @param {string}
61131                      *            [string=''] The string to capitalize.
61132                      * @returns {string} Returns the capitalized string.
61133                      * @example
61134                      * 
61135                      * _.capitalize('fred'); // => 'Fred'
61136                      */
61137                     function capitalize(string) {
61138                         string = baseToString(string);
61139                         return string && (string.charAt(0).toUpperCase() + string.slice(1));
61140                     }
61141
61142                     /**
61143                      * Deburrs `string` by converting [latin-1 supplementary
61144                      * letters](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)
61145                      * to basic latin letters and removing [combining diacritical
61146                      * marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).
61147                      * 
61148                      * @static
61149                      * @memberOf _
61150                      * @category String
61151                      * @param {string}
61152                      *            [string=''] The string to deburr.
61153                      * @returns {string} Returns the deburred string.
61154                      * @example
61155                      * 
61156                      * _.deburr('déjà vu'); // => 'deja vu'
61157                      */
61158                     function deburr(string) {
61159                         string = baseToString(string);
61160                         return string && string.replace(reLatin1, deburrLetter).replace(reComboMark, '');
61161                     }
61162
61163                     /**
61164                      * Checks if `string` ends with the given target string.
61165                      * 
61166                      * @static
61167                      * @memberOf _
61168                      * @category String
61169                      * @param {string}
61170                      *            [string=''] The string to search.
61171                      * @param {string}
61172                      *            [target] The string to search for.
61173                      * @param {number}
61174                      *            [position=string.length] The position to search from.
61175                      * @returns {boolean} Returns `true` if `string` ends with `target`, else
61176                      *          `false`.
61177                      * @example
61178                      * 
61179                      * _.endsWith('abc', 'c'); // => true
61180                      * 
61181                      * _.endsWith('abc', 'b'); // => false
61182                      * 
61183                      * _.endsWith('abc', 'b', 2); // => true
61184                      */
61185                     function endsWith(string, target, position) {
61186                         string = baseToString(string);
61187                         target = (target + '');
61188
61189                         var length = string.length;
61190                         position = position === undefined ? length : nativeMin(position < 0 ? 0 : (+position || 0), length);
61191
61192                         position -= target.length;
61193                         return position >= 0 && string.indexOf(target, position) == position;
61194                     }
61195
61196                     /**
61197                      * Converts the characters "&", "<", ">", '"', "'", and "\`", in `string`
61198                      * to their corresponding HTML entities.
61199                      * 
61200                      * **Note:** No other characters are escaped. To escape additional
61201                      * characters use a third-party library like [_he_](https://mths.be/he).
61202                      * 
61203                      * Though the ">" character is escaped for symmetry, characters like ">" and
61204                      * "/" don't need escaping in HTML and have no special meaning unless
61205                      * they're part of a tag or unquoted attribute value. See [Mathias Bynens's
61206                      * article](https://mathiasbynens.be/notes/ambiguous-ampersands) (under
61207                      * "semi-related fun fact") for more details.
61208                      * 
61209                      * Backticks are escaped because in Internet Explorer < 9, they can break
61210                      * out of attribute values or HTML comments. See
61211                      * [#59](https://html5sec.org/#59), [#102](https://html5sec.org/#102),
61212                      * [#108](https://html5sec.org/#108), and [#133](https://html5sec.org/#133)
61213                      * of the [HTML5 Security Cheatsheet](https://html5sec.org/) for more
61214                      * details.
61215                      * 
61216                      * When working with HTML you should always [quote attribute
61217                      * values](http://wonko.com/post/html-escaping) to reduce XSS vectors.
61218                      * 
61219                      * @static
61220                      * @memberOf _
61221                      * @category String
61222                      * @param {string}
61223                      *            [string=''] The string to escape.
61224                      * @returns {string} Returns the escaped string.
61225                      * @example
61226                      * 
61227                      * _.escape('fred, barney, & pebbles'); // => 'fred, barney, &amp; pebbles'
61228                      */
61229                     function escape(string) {
61230                         // Reset `lastIndex` because in IE < 9 `String#replace` does not.
61231                         string = baseToString(string);
61232                         return (string && reHasUnescapedHtml.test(string)) ? string.replace(reUnescapedHtml, escapeHtmlChar) : string;
61233                     }
61234
61235                     /**
61236                      * Escapes the `RegExp` special characters "\", "/", "^", "$", ".", "|",
61237                      * "?", "*", "+", "(", ")", "[", "]", "{" and "}" in `string`.
61238                      * 
61239                      * @static
61240                      * @memberOf _
61241                      * @category String
61242                      * @param {string}
61243                      *            [string=''] The string to escape.
61244                      * @returns {string} Returns the escaped string.
61245                      * @example
61246                      * 
61247                      * _.escapeRegExp('[lodash](https://lodash.com/)'); // =>
61248                      * '\[lodash\]\(https:\/\/lodash\.com\/\)'
61249                      */
61250                     function escapeRegExp(string) {
61251                         string = baseToString(string);
61252                         return (string && reHasRegExpChars.test(string)) ? string.replace(reRegExpChars, escapeRegExpChar) : (string || '(?:)');
61253                     }
61254
61255                     /**
61256                      * Converts `string` to [kebab
61257                      * case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).
61258                      * 
61259                      * @static
61260                      * @memberOf _
61261                      * @category String
61262                      * @param {string}
61263                      *            [string=''] The string to convert.
61264                      * @returns {string} Returns the kebab cased string.
61265                      * @example
61266                      * 
61267                      * _.kebabCase('Foo Bar'); // => 'foo-bar'
61268                      * 
61269                      * _.kebabCase('fooBar'); // => 'foo-bar'
61270                      * 
61271                      * _.kebabCase('__foo_bar__'); // => 'foo-bar'
61272                      */
61273                     var kebabCase = createCompounder(function(result, word, index) {
61274                         return result + (index ? '-' : '') + word.toLowerCase();
61275                     });
61276
61277                     /**
61278                      * Pads `string` on the left and right sides if it's shorter than `length`.
61279                      * Padding characters are truncated if they can't be evenly divided by
61280                      * `length`.
61281                      * 
61282                      * @static
61283                      * @memberOf _
61284                      * @category String
61285                      * @param {string}
61286                      *            [string=''] The string to pad.
61287                      * @param {number}
61288                      *            [length=0] The padding length.
61289                      * @param {string}
61290                      *            [chars=' '] The string used as padding.
61291                      * @returns {string} Returns the padded string.
61292                      * @example
61293                      * 
61294                      * _.pad('abc', 8); // => ' abc '
61295                      * 
61296                      * _.pad('abc', 8, '_-'); // => '_-abc_-_'
61297                      * 
61298                      * _.pad('abc', 3); // => 'abc'
61299                      */
61300                     function pad(string, length, chars) {
61301                         string = baseToString(string);
61302                         length = +length;
61303
61304                         var strLength = string.length;
61305                         if (strLength >= length || !nativeIsFinite(length)) {
61306                             return string;
61307                         }
61308                         var mid = (length - strLength) / 2,
61309                             leftLength = nativeFloor(mid),
61310                             rightLength = nativeCeil(mid);
61311
61312                         chars = createPadding('', rightLength, chars);
61313                         return chars.slice(0, leftLength) + string + chars;
61314                     }
61315
61316                     /**
61317                      * Pads `string` on the left side if it's shorter than `length`. Padding
61318                      * characters are truncated if they exceed `length`.
61319                      * 
61320                      * @static
61321                      * @memberOf _
61322                      * @category String
61323                      * @param {string}
61324                      *            [string=''] The string to pad.
61325                      * @param {number}
61326                      *            [length=0] The padding length.
61327                      * @param {string}
61328                      *            [chars=' '] The string used as padding.
61329                      * @returns {string} Returns the padded string.
61330                      * @example
61331                      * 
61332                      * _.padLeft('abc', 6); // => ' abc'
61333                      * 
61334                      * _.padLeft('abc', 6, '_-'); // => '_-_abc'
61335                      * 
61336                      * _.padLeft('abc', 3); // => 'abc'
61337                      */
61338                     var padLeft = createPadDir();
61339
61340                     /**
61341                      * Pads `string` on the right side if it's shorter than `length`. Padding
61342                      * characters are truncated if they exceed `length`.
61343                      * 
61344                      * @static
61345                      * @memberOf _
61346                      * @category String
61347                      * @param {string}
61348                      *            [string=''] The string to pad.
61349                      * @param {number}
61350                      *            [length=0] The padding length.
61351                      * @param {string}
61352                      *            [chars=' '] The string used as padding.
61353                      * @returns {string} Returns the padded string.
61354                      * @example
61355                      * 
61356                      * _.padRight('abc', 6); // => 'abc '
61357                      * 
61358                      * _.padRight('abc', 6, '_-'); // => 'abc_-_'
61359                      * 
61360                      * _.padRight('abc', 3); // => 'abc'
61361                      */
61362                     var padRight = createPadDir(true);
61363
61364                     /**
61365                      * Converts `string` to an integer of the specified radix. If `radix` is
61366                      * `undefined` or `0`, a `radix` of `10` is used unless `value` is a
61367                      * hexadecimal, in which case a `radix` of `16` is used.
61368                      * 
61369                      * **Note:** This method aligns with the [ES5
61370                      * implementation](https://es5.github.io/#E) of `parseInt`.
61371                      * 
61372                      * @static
61373                      * @memberOf _
61374                      * @category String
61375                      * @param {string}
61376                      *            string The string to convert.
61377                      * @param {number}
61378                      *            [radix] The radix to interpret `value` by.
61379                      * @param- {Object} [guard] Enables use as a callback for functions like
61380                      *         `_.map`.
61381                      * @returns {number} Returns the converted integer.
61382                      * @example
61383                      * 
61384                      * _.parseInt('08'); // => 8
61385                      * 
61386                      * _.map(['6', '08', '10'], _.parseInt); // => [6, 8, 10]
61387                      */
61388                     function parseInt(string, radix, guard) {
61389                         // Firefox < 21 and Opera < 15 follow ES3 for `parseInt`.
61390                         // Chrome fails to trim leading <BOM> whitespace characters.
61391                         // See https://code.google.com/p/v8/issues/detail?id=3109 for more
61392                         // details.
61393                         if (guard ? isIterateeCall(string, radix, guard) : radix == null) {
61394                             radix = 0;
61395                         } else if (radix) {
61396                             radix = +radix;
61397                         }
61398                         string = trim(string);
61399                         return nativeParseInt(string, radix || (reHasHexPrefix.test(string) ? 16 : 10));
61400                     }
61401
61402                     /**
61403                      * Repeats the given string `n` times.
61404                      * 
61405                      * @static
61406                      * @memberOf _
61407                      * @category String
61408                      * @param {string}
61409                      *            [string=''] The string to repeat.
61410                      * @param {number}
61411                      *            [n=0] The number of times to repeat the string.
61412                      * @returns {string} Returns the repeated string.
61413                      * @example
61414                      * 
61415                      * _.repeat('*', 3); // => '***'
61416                      * 
61417                      * _.repeat('abc', 2); // => 'abcabc'
61418                      * 
61419                      * _.repeat('abc', 0); // => ''
61420                      */
61421                     function repeat(string, n) {
61422                         var result = '';
61423                         string = baseToString(string);
61424                         n = +n;
61425                         if (n < 1 || !string || !nativeIsFinite(n)) {
61426                             return result;
61427                         }
61428                         // Leverage the exponentiation by squaring algorithm for a faster
61429                         // repeat.
61430                         // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more
61431                         // details.
61432                         do {
61433                             if (n % 2) {
61434                                 result += string;
61435                             }
61436                             n = nativeFloor(n / 2);
61437                             string += string;
61438                         } while (n);
61439
61440                         return result;
61441                     }
61442
61443                     /**
61444                      * Converts `string` to [snake
61445                      * case](https://en.wikipedia.org/wiki/Snake_case).
61446                      * 
61447                      * @static
61448                      * @memberOf _
61449                      * @category String
61450                      * @param {string}
61451                      *            [string=''] The string to convert.
61452                      * @returns {string} Returns the snake cased string.
61453                      * @example
61454                      * 
61455                      * _.snakeCase('Foo Bar'); // => 'foo_bar'
61456                      * 
61457                      * _.snakeCase('fooBar'); // => 'foo_bar'
61458                      * 
61459                      * _.snakeCase('--foo-bar'); // => 'foo_bar'
61460                      */
61461                     var snakeCase = createCompounder(function(result, word, index) {
61462                         return result + (index ? '_' : '') + word.toLowerCase();
61463                     });
61464
61465                     /**
61466                      * Converts `string` to [start
61467                      * case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).
61468                      * 
61469                      * @static
61470                      * @memberOf _
61471                      * @category String
61472                      * @param {string}
61473                      *            [string=''] The string to convert.
61474                      * @returns {string} Returns the start cased string.
61475                      * @example
61476                      * 
61477                      * _.startCase('--foo-bar'); // => 'Foo Bar'
61478                      * 
61479                      * _.startCase('fooBar'); // => 'Foo Bar'
61480                      * 
61481                      * _.startCase('__foo_bar__'); // => 'Foo Bar'
61482                      */
61483                     var startCase = createCompounder(function(result, word, index) {
61484                         return result + (index ? ' ' : '') + (word.charAt(0).toUpperCase() + word.slice(1));
61485                     });
61486
61487                     /**
61488                      * Checks if `string` starts with the given target string.
61489                      * 
61490                      * @static
61491                      * @memberOf _
61492                      * @category String
61493                      * @param {string}
61494                      *            [string=''] The string to search.
61495                      * @param {string}
61496                      *            [target] The string to search for.
61497                      * @param {number}
61498                      *            [position=0] The position to search from.
61499                      * @returns {boolean} Returns `true` if `string` starts with `target`, else
61500                      *          `false`.
61501                      * @example
61502                      * 
61503                      * _.startsWith('abc', 'a'); // => true
61504                      * 
61505                      * _.startsWith('abc', 'b'); // => false
61506                      * 
61507                      * _.startsWith('abc', 'b', 1); // => true
61508                      */
61509                     function startsWith(string, target, position) {
61510                         string = baseToString(string);
61511                         position = position == null ? 0 : nativeMin(position < 0 ? 0 : (+position || 0), string.length);
61512
61513                         return string.lastIndexOf(target, position) == position;
61514                     }
61515
61516                     /**
61517                      * Creates a compiled template function that can interpolate data properties
61518                      * in "interpolate" delimiters, HTML-escape interpolated data properties in
61519                      * "escape" delimiters, and execute JavaScript in "evaluate" delimiters.
61520                      * Data properties may be accessed as free variables in the template. If a
61521                      * setting object is provided it takes precedence over `_.templateSettings`
61522                      * values.
61523                      * 
61524                      * **Note:** In the development build `_.template` utilizes
61525                      * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)
61526                      * for easier debugging.
61527                      * 
61528                      * For more information on precompiling templates see [lodash's custom
61529                      * builds documentation](https://lodash.com/custom-builds).
61530                      * 
61531                      * For more information on Chrome extension sandboxes see [Chrome's
61532                      * extensions
61533                      * documentation](https://developer.chrome.com/extensions/sandboxingEval).
61534                      * 
61535                      * @static
61536                      * @memberOf _
61537                      * @category String
61538                      * @param {string}
61539                      *            [string=''] The template string.
61540                      * @param {Object}
61541                      *            [options] The options object.
61542                      * @param {RegExp}
61543                      *            [options.escape] The HTML "escape" delimiter.
61544                      * @param {RegExp}
61545                      *            [options.evaluate] The "evaluate" delimiter.
61546                      * @param {Object}
61547                      *            [options.imports] An object to import into the template as
61548                      *            free variables.
61549                      * @param {RegExp}
61550                      *            [options.interpolate] The "interpolate" delimiter.
61551                      * @param {string}
61552                      *            [options.sourceURL] The sourceURL of the template's compiled
61553                      *            source.
61554                      * @param {string}
61555                      *            [options.variable] The data object variable name.
61556                      * @param- {Object} [otherOptions] Enables the legacy `options` param
61557                      *         signature.
61558                      * @returns {Function} Returns the compiled template function.
61559                      * @example
61560                      *  // using the "interpolate" delimiter to create a compiled
61561                      * template var compiled = _.template('hello <%= user %>!'); compiled({
61562                      * 'user': 'fred' }); // => 'hello fred!'
61563                      *  // using the HTML "escape" delimiter to escape data property values var
61564                      * compiled = _.template('<b><%- value %></b>'); compiled({ 'value': '<script>'
61565                      * }); // => '<b>&lt;script&gt;</b>'
61566                      *  // using the "evaluate" delimiter to execute JavaScript and generate
61567                      * HTML var compiled = _.template('<% _.forEach(users, function(user) { %>
61568                      * <li><%- user %></li><% }); %>'); compiled({ 'users': ['fred',
61569                      * 'barney'] }); // => '
61570                      * <li>fred</li>
61571                      * <li>barney</li>'
61572                      *  // using the internal `print` function in "evaluate" delimiters var
61573                      * compiled = _.template('<% print("hello " + user); %>!'); compiled({
61574                      * 'user': 'barney' }); // => 'hello barney!'
61575                      *  // using the ES delimiter as an alternative to the default "interpolate"
61576                      * delimiter var compiled = _.template('hello ${ user }!'); compiled({
61577                      * 'user': 'pebbles' }); // => 'hello pebbles!'
61578                      *  // using custom template delimiters _.templateSettings.interpolate =
61579                      * /{{([\s\S]+?)}}/g; var compiled = _.template('hello {{ user }}!');
61580                      * compiled({ 'user': 'mustache' }); // => 'hello mustache!'
61581                      *  // using backslashes to treat delimiters as plain text var compiled =
61582                      * _.template('<%= "\\<%- value %\\>" %>'); compiled({ 'value': 'ignored'
61583                      * }); // => '<%- value %>'
61584                      *  // using the `imports` option to import `jQuery` as `jq` var text = '<%
61585                      * jq.each(users, function(user) { %>
61586                      * <li><%- user %></li><% }); %>'; var compiled = _.template(text, {
61587                      * 'imports': { 'jq': jQuery } }); compiled({ 'users': ['fred', 'barney']
61588                      * }); // => '
61589                      * <li>fred</li>
61590                      * <li>barney</li>'
61591                      *  // using the `sourceURL` option to specify a custom sourceURL for the
61592                      * template var compiled = _.template('hello <%= user %>!', { 'sourceURL':
61593                      * '/basic/greeting.jst' }); compiled(data); // => find the source of
61594                      * "greeting.jst" under the Sources tab or Resources panel of the web
61595                      * inspector
61596                      *  // using the `variable` option to ensure a with-statement isn't used in
61597                      * the compiled template var compiled = _.template('hi <%= data.user %>!', {
61598                      * 'variable': 'data' }); compiled.source; // => function(data) { // var
61599                      * __t, __p = ''; // __p += 'hi ' + ((__t = ( data.user )) == null ? '' :
61600                      * __t) + '!'; // return __p; // }
61601                      *  // using the `source` property to inline compiled templates for
61602                      * meaningful // line numbers in error messages and a stack trace
61603                      * fs.writeFileSync(path.join(cwd, 'jst.js'), '\ var JST = {\ "main": ' +
61604                      * _.template(mainText).source + '\ };\ ');
61605                      */
61606                     function template(string, options, otherOptions) {
61607                         // Based on John Resig's `tmpl` implementation
61608                         // (http://ejohn.org/blog/javascript-micro-templating/)
61609                         // and Laura Doktorova's doT.js (https://github.com/olado/doT).
61610                         var settings = lodash.templateSettings;
61611
61612                         if (otherOptions && isIterateeCall(string, options, otherOptions)) {
61613                             options = otherOptions = undefined;
61614                         }
61615                         string = baseToString(string);
61616                         options = assignWith(baseAssign({}, otherOptions || options), settings, assignOwnDefaults);
61617
61618                         var imports = assignWith(baseAssign({}, options.imports), settings.imports, assignOwnDefaults),
61619                             importsKeys = keys(imports),
61620                             importsValues = baseValues(imports, importsKeys);
61621
61622                         var isEscaping,
61623                             isEvaluating,
61624                             index = 0,
61625                             interpolate = options.interpolate || reNoMatch,
61626                             source = "__p += '";
61627
61628                         // Compile the regexp to match each delimiter.
61629                         var reDelimiters = RegExp(
61630                             (options.escape || reNoMatch).source + '|' +
61631                             interpolate.source + '|' +
61632                             (interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + '|' +
61633                             (options.evaluate || reNoMatch).source + '|$', 'g');
61634
61635                         // Use a sourceURL for easier debugging.
61636                         var sourceURL = '//# sourceURL=' +
61637                             ('sourceURL' in options ? options.sourceURL : ('lodash.templateSources[' + (++templateCounter) + ']')) + '\n';
61638
61639                         string.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) {
61640                             interpolateValue || (interpolateValue = esTemplateValue);
61641
61642                             // Escape characters that can't be included in string literals.
61643                             source += string.slice(index, offset).replace(reUnescapedString, escapeStringChar);
61644
61645                             // Replace delimiters with snippets.
61646                             if (escapeValue) {
61647                                 isEscaping = true;
61648                                 source += "' +\n__e(" + escapeValue + ") +\n'";
61649                             }
61650                             if (evaluateValue) {
61651                                 isEvaluating = true;
61652                                 source += "';\n" + evaluateValue + ";\n__p += '";
61653                             }
61654                             if (interpolateValue) {
61655                                 source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'";
61656                             }
61657                             index = offset + match.length;
61658
61659                             // The JS engine embedded in Adobe products requires returning the
61660                             // `match`
61661                             // string in order to produce the correct `offset` value.
61662                             return match;
61663                         });
61664
61665                         source += "';\n";
61666
61667                         // If `variable` is not specified wrap a with-statement around the
61668                         // generated
61669                         // code to add the data object to the top of the scope chain.
61670                         var variable = options.variable;
61671                         if (!variable) {
61672                             source = 'with (obj) {\n' + source + '\n}\n';
61673                         }
61674                         // Cleanup code by stripping empty strings.
61675                         source = (isEvaluating ? source.replace(reEmptyStringLeading, '') : source)
61676                             .replace(reEmptyStringMiddle, '$1')
61677                             .replace(reEmptyStringTrailing, '$1;');
61678
61679                         // Frame code as the function body.
61680                         source = 'function(' + (variable || 'obj') + ') {\n' +
61681                             (variable ? '' : 'obj || (obj = {});\n') +
61682                             "var __t, __p = ''" +
61683                             (isEscaping ? ', __e = _.escape' : '') +
61684                             (isEvaluating ? ', __j = Array.prototype.join;\n' +
61685                                 "function print() { __p += __j.call(arguments, '') }\n" : ';\n'
61686                             ) +
61687                             source +
61688                             'return __p\n}';
61689
61690                         var result = attempt(function() {
61691                             return Function(importsKeys, sourceURL + 'return ' + source).apply(undefined, importsValues);
61692                         });
61693
61694                         // Provide the compiled function's source by its `toString` method or
61695                         // the `source` property as a convenience for inlining compiled
61696                         // templates.
61697                         result.source = source;
61698                         if (isError(result)) {
61699                             throw result;
61700                         }
61701                         return result;
61702                     }
61703
61704                     /**
61705                      * Removes leading and trailing whitespace or specified characters from
61706                      * `string`.
61707                      * 
61708                      * @static
61709                      * @memberOf _
61710                      * @category String
61711                      * @param {string}
61712                      *            [string=''] The string to trim.
61713                      * @param {string}
61714                      *            [chars=whitespace] The characters to trim.
61715                      * @param- {Object} [guard] Enables use as a callback for functions like
61716                      *         `_.map`.
61717                      * @returns {string} Returns the trimmed string.
61718                      * @example
61719                      * 
61720                      * _.trim(' abc '); // => 'abc'
61721                      * 
61722                      * _.trim('-_-abc-_-', '_-'); // => 'abc'
61723                      * 
61724                      * _.map([' foo ', ' bar '], _.trim); // => ['foo', 'bar']
61725                      */
61726                     function trim(string, chars, guard) {
61727                         var value = string;
61728                         string = baseToString(string);
61729                         if (!string) {
61730                             return string;
61731                         }
61732                         if (guard ? isIterateeCall(value, chars, guard) : chars == null) {
61733                             return string.slice(trimmedLeftIndex(string), trimmedRightIndex(string) + 1);
61734                         }
61735                         chars = (chars + '');
61736                         return string.slice(charsLeftIndex(string, chars), charsRightIndex(string, chars) + 1);
61737                     }
61738
61739                     /**
61740                      * Removes leading whitespace or specified characters from `string`.
61741                      * 
61742                      * @static
61743                      * @memberOf _
61744                      * @category String
61745                      * @param {string}
61746                      *            [string=''] The string to trim.
61747                      * @param {string}
61748                      *            [chars=whitespace] The characters to trim.
61749                      * @param- {Object} [guard] Enables use as a callback for functions like
61750                      *         `_.map`.
61751                      * @returns {string} Returns the trimmed string.
61752                      * @example
61753                      * 
61754                      * _.trimLeft(' abc '); // => 'abc '
61755                      * 
61756                      * _.trimLeft('-_-abc-_-', '_-'); // => 'abc-_-'
61757                      */
61758                     function trimLeft(string, chars, guard) {
61759                         var value = string;
61760                         string = baseToString(string);
61761                         if (!string) {
61762                             return string;
61763                         }
61764                         if (guard ? isIterateeCall(value, chars, guard) : chars == null) {
61765                             return string.slice(trimmedLeftIndex(string));
61766                         }
61767                         return string.slice(charsLeftIndex(string, (chars + '')));
61768                     }
61769
61770                     /**
61771                      * Removes trailing whitespace or specified characters from `string`.
61772                      * 
61773                      * @static
61774                      * @memberOf _
61775                      * @category String
61776                      * @param {string}
61777                      *            [string=''] The string to trim.
61778                      * @param {string}
61779                      *            [chars=whitespace] The characters to trim.
61780                      * @param- {Object} [guard] Enables use as a callback for functions like
61781                      *         `_.map`.
61782                      * @returns {string} Returns the trimmed string.
61783                      * @example
61784                      * 
61785                      * _.trimRight(' abc '); // => ' abc'
61786                      * 
61787                      * _.trimRight('-_-abc-_-', '_-'); // => '-_-abc'
61788                      */
61789                     function trimRight(string, chars, guard) {
61790                         var value = string;
61791                         string = baseToString(string);
61792                         if (!string) {
61793                             return string;
61794                         }
61795                         if (guard ? isIterateeCall(value, chars, guard) : chars == null) {
61796                             return string.slice(0, trimmedRightIndex(string) + 1);
61797                         }
61798                         return string.slice(0, charsRightIndex(string, (chars + '')) + 1);
61799                     }
61800
61801                     /**
61802                      * Truncates `string` if it's longer than the given maximum string length.
61803                      * The last characters of the truncated string are replaced with the
61804                      * omission string which defaults to "...".
61805                      * 
61806                      * @static
61807                      * @memberOf _
61808                      * @category String
61809                      * @param {string}
61810                      *            [string=''] The string to truncate.
61811                      * @param {Object|number}
61812                      *            [options] The options object or maximum string length.
61813                      * @param {number}
61814                      *            [options.length=30] The maximum string length.
61815                      * @param {string}
61816                      *            [options.omission='...'] The string to indicate text is
61817                      *            omitted.
61818                      * @param {RegExp|string}
61819                      *            [options.separator] The separator pattern to truncate to.
61820                      * @param- {Object} [guard] Enables use as a callback for functions like
61821                      *         `_.map`.
61822                      * @returns {string} Returns the truncated string.
61823                      * @example
61824                      * 
61825                      * _.trunc('hi-diddly-ho there, neighborino'); // => 'hi-diddly-ho there,
61826                      * neighbo...'
61827                      * 
61828                      * _.trunc('hi-diddly-ho there, neighborino', 24); // => 'hi-diddly-ho
61829                      * there, n...'
61830                      * 
61831                      * _.trunc('hi-diddly-ho there, neighborino', { 'length': 24, 'separator': ' '
61832                      * }); // => 'hi-diddly-ho there,...'
61833                      * 
61834                      * _.trunc('hi-diddly-ho there, neighborino', { 'length': 24, 'separator':
61835                      * /,? +/ }); // => 'hi-diddly-ho there...'
61836                      * 
61837                      * _.trunc('hi-diddly-ho there, neighborino', { 'omission': ' [...]' }); // =>
61838                      * 'hi-diddly-ho there, neig [...]'
61839                      */
61840                     function trunc(string, options, guard) {
61841                         if (guard && isIterateeCall(string, options, guard)) {
61842                             options = undefined;
61843                         }
61844                         var length = DEFAULT_TRUNC_LENGTH,
61845                             omission = DEFAULT_TRUNC_OMISSION;
61846
61847                         if (options != null) {
61848                             if (isObject(options)) {
61849                                 var separator = 'separator' in options ? options.separator : separator;
61850                                 length = 'length' in options ? (+options.length || 0) : length;
61851                                 omission = 'omission' in options ? baseToString(options.omission) : omission;
61852                             } else {
61853                                 length = +options || 0;
61854                             }
61855                         }
61856                         string = baseToString(string);
61857                         if (length >= string.length) {
61858                             return string;
61859                         }
61860                         var end = length - omission.length;
61861                         if (end < 1) {
61862                             return omission;
61863                         }
61864                         var result = string.slice(0, end);
61865                         if (separator == null) {
61866                             return result + omission;
61867                         }
61868                         if (isRegExp(separator)) {
61869                             if (string.slice(end).search(separator)) {
61870                                 var match,
61871                                     newEnd,
61872                                     substring = string.slice(0, end);
61873
61874                                 if (!separator.global) {
61875                                     separator = RegExp(separator.source, (reFlags.exec(separator) || '') + 'g');
61876                                 }
61877                                 separator.lastIndex = 0;
61878                                 while ((match = separator.exec(substring))) {
61879                                     newEnd = match.index;
61880                                 }
61881                                 result = result.slice(0, newEnd == null ? end : newEnd);
61882                             }
61883                         } else if (string.indexOf(separator, end) != end) {
61884                             var index = result.lastIndexOf(separator);
61885                             if (index > -1) {
61886                                 result = result.slice(0, index);
61887                             }
61888                         }
61889                         return result + omission;
61890                     }
61891
61892                     /**
61893                      * The inverse of `_.escape`; this method converts the HTML entities
61894                      * `&amp;`, `&lt;`, `&gt;`, `&quot;`, `&#39;`, and `&#96;` in `string` to
61895                      * their corresponding characters.
61896                      * 
61897                      * **Note:** No other HTML entities are unescaped. To unescape additional
61898                      * HTML entities use a third-party library like [_he_](https://mths.be/he).
61899                      * 
61900                      * @static
61901                      * @memberOf _
61902                      * @category String
61903                      * @param {string}
61904                      *            [string=''] The string to unescape.
61905                      * @returns {string} Returns the unescaped string.
61906                      * @example
61907                      * 
61908                      * _.unescape('fred, barney, &amp; pebbles'); // => 'fred, barney, &
61909                      * pebbles'
61910                      */
61911                     function unescape(string) {
61912                         string = baseToString(string);
61913                         return (string && reHasEscapedHtml.test(string)) ? string.replace(reEscapedHtml, unescapeHtmlChar) : string;
61914                     }
61915
61916                     /**
61917                      * Splits `string` into an array of its words.
61918                      * 
61919                      * @static
61920                      * @memberOf _
61921                      * @category String
61922                      * @param {string}
61923                      *            [string=''] The string to inspect.
61924                      * @param {RegExp|string}
61925                      *            [pattern] The pattern to match words.
61926                      * @param- {Object} [guard] Enables use as a callback for functions like
61927                      *         `_.map`.
61928                      * @returns {Array} Returns the words of `string`.
61929                      * @example
61930                      * 
61931                      * _.words('fred, barney, & pebbles'); // => ['fred', 'barney', 'pebbles']
61932                      * 
61933                      * _.words('fred, barney, & pebbles', /[^, ]+/g); // => ['fred', 'barney',
61934                      * '&', 'pebbles']
61935                      */
61936                     function words(string, pattern, guard) {
61937                         if (guard && isIterateeCall(string, pattern, guard)) {
61938                             pattern = undefined;
61939                         }
61940                         string = baseToString(string);
61941                         return string.match(pattern || reWords) || [];
61942                     }
61943
61944                     /*------------------------------------------------------------------------*/
61945
61946                     /**
61947                      * Attempts to invoke `func`, returning either the result or the caught
61948                      * error object. Any additional arguments are provided to `func` when it is
61949                      * invoked.
61950                      * 
61951                      * @static
61952                      * @memberOf _
61953                      * @category Utility
61954                      * @param {Function}
61955                      *            func The function to attempt.
61956                      * @returns {*} Returns the `func` result or error object.
61957                      * @example
61958                      *  // avoid throwing errors for invalid selectors var elements =
61959                      * _.attempt(function(selector) { return
61960                      * document.querySelectorAll(selector); }, '>_>');
61961                      * 
61962                      * if (_.isError(elements)) { elements = []; }
61963                      */
61964                     var attempt = restParam(function(func, args) {
61965                         try {
61966                             return func.apply(undefined, args);
61967                         } catch (e) {
61968                             return isError(e) ? e : new Error(e);
61969                         }
61970                     });
61971
61972                     /**
61973                      * Creates a function that invokes `func` with the `this` binding of
61974                      * `thisArg` and arguments of the created function. If `func` is a property
61975                      * name the created callback returns the property value for a given element.
61976                      * If `func` is an object the created callback returns `true` for elements
61977                      * that contain the equivalent object properties, otherwise it returns
61978                      * `false`.
61979                      * 
61980                      * @static
61981                      * @memberOf _
61982                      * @alias iteratee
61983                      * @category Utility
61984                      * @param {*}
61985                      *            [func=_.identity] The value to convert to a callback.
61986                      * @param {*}
61987                      *            [thisArg] The `this` binding of `func`.
61988                      * @param- {Object} [guard] Enables use as a callback for functions like
61989                      *         `_.map`.
61990                      * @returns {Function} Returns the callback.
61991                      * @example
61992                      * 
61993                      * var users = [ { 'user': 'barney', 'age': 36 }, { 'user': 'fred', 'age':
61994                      * 40 } ];
61995                      *  // wrap to create custom callback shorthands _.callback =
61996                      * _.wrap(_.callback, function(callback, func, thisArg) { var match =
61997                      * /^(.+?)__([gl]t)(.+)$/.exec(func); if (!match) { return callback(func,
61998                      * thisArg); } return function(object) { return match[2] == 'gt' ?
61999                      * object[match[1]] > match[3] : object[match[1]] < match[3]; }; });
62000                      * 
62001                      * _.filter(users, 'age__gt36'); // => [{ 'user': 'fred', 'age': 40 }]
62002                      */
62003                     function callback(func, thisArg, guard) {
62004                         if (guard && isIterateeCall(func, thisArg, guard)) {
62005                             thisArg = undefined;
62006                         }
62007                         return isObjectLike(func) ? matches(func) : baseCallback(func, thisArg);
62008                     }
62009
62010                     /**
62011                      * Creates a function that returns `value`.
62012                      * 
62013                      * @static
62014                      * @memberOf _
62015                      * @category Utility
62016                      * @param {*}
62017                      *            value The value to return from the new function.
62018                      * @returns {Function} Returns the new function.
62019                      * @example
62020                      * 
62021                      * var object = { 'user': 'fred' }; var getter = _.constant(object);
62022                      * 
62023                      * getter() === object; // => true
62024                      */
62025                     function constant(value) {
62026                         return function() {
62027                             return value;
62028                         };
62029                     }
62030
62031                     /**
62032                      * This method returns the first argument provided to it.
62033                      * 
62034                      * @static
62035                      * @memberOf _
62036                      * @category Utility
62037                      * @param {*}
62038                      *            value Any value.
62039                      * @returns {*} Returns `value`.
62040                      * @example
62041                      * 
62042                      * var object = { 'user': 'fred' };
62043                      * 
62044                      * _.identity(object) === object; // => true
62045                      */
62046                     function identity(value) {
62047                         return value;
62048                     }
62049
62050                     /**
62051                      * Creates a function that performs a deep comparison between a given object
62052                      * and `source`, returning `true` if the given object has equivalent
62053                      * property values, else `false`.
62054                      * 
62055                      * **Note:** This method supports comparing arrays, booleans, `Date`
62056                      * objects, numbers, `Object` objects, regexes, and strings. Objects are
62057                      * compared by their own, not inherited, enumerable properties. For
62058                      * comparing a single own or inherited property value see
62059                      * `_.matchesProperty`.
62060                      * 
62061                      * @static
62062                      * @memberOf _
62063                      * @category Utility
62064                      * @param {Object}
62065                      *            source The object of property values to match.
62066                      * @returns {Function} Returns the new function.
62067                      * @example
62068                      * 
62069                      * var users = [ { 'user': 'barney', 'age': 36, 'active': true }, { 'user':
62070                      * 'fred', 'age': 40, 'active': false } ];
62071                      * 
62072                      * _.filter(users, _.matches({ 'age': 40, 'active': false })); // => [{
62073                      * 'user': 'fred', 'age': 40, 'active': false }]
62074                      */
62075                     function matches(source) {
62076                         return baseMatches(baseClone(source, true));
62077                     }
62078
62079                     /**
62080                      * Creates a function that compares the property value of `path` on a given
62081                      * object to `value`.
62082                      * 
62083                      * **Note:** This method supports comparing arrays, booleans, `Date`
62084                      * objects, numbers, `Object` objects, regexes, and strings. Objects are
62085                      * compared by their own, not inherited, enumerable properties.
62086                      * 
62087                      * @static
62088                      * @memberOf _
62089                      * @category Utility
62090                      * @param {Array|string}
62091                      *            path The path of the property to get.
62092                      * @param {*}
62093                      *            srcValue The value to match.
62094                      * @returns {Function} Returns the new function.
62095                      * @example
62096                      * 
62097                      * var users = [ { 'user': 'barney' }, { 'user': 'fred' } ];
62098                      * 
62099                      * _.find(users, _.matchesProperty('user', 'fred')); // => { 'user': 'fred' }
62100                      */
62101                     function matchesProperty(path, srcValue) {
62102                         return baseMatchesProperty(path, baseClone(srcValue, true));
62103                     }
62104
62105                     /**
62106                      * Creates a function that invokes the method at `path` on a given object.
62107                      * Any additional arguments are provided to the invoked method.
62108                      * 
62109                      * @static
62110                      * @memberOf _
62111                      * @category Utility
62112                      * @param {Array|string}
62113                      *            path The path of the method to invoke.
62114                      * @param {...*}
62115                      *            [args] The arguments to invoke the method with.
62116                      * @returns {Function} Returns the new function.
62117                      * @example
62118                      * 
62119                      * var objects = [ { 'a': { 'b': { 'c': _.constant(2) } } }, { 'a': { 'b': {
62120                      * 'c': _.constant(1) } } } ];
62121                      * 
62122                      * _.map(objects, _.method('a.b.c')); // => [2, 1]
62123                      * 
62124                      * _.invoke(_.sortBy(objects, _.method(['a', 'b', 'c'])), 'a.b.c'); // =>
62125                      * [1, 2]
62126                      */
62127                     var method = restParam(function(path, args) {
62128                         return function(object) {
62129                             return invokePath(object, path, args);
62130                         };
62131                     });
62132
62133                     /**
62134                      * The opposite of `_.method`; this method creates a function that invokes
62135                      * the method at a given path on `object`. Any additional arguments are
62136                      * provided to the invoked method.
62137                      * 
62138                      * @static
62139                      * @memberOf _
62140                      * @category Utility
62141                      * @param {Object}
62142                      *            object The object to query.
62143                      * @param {...*}
62144                      *            [args] The arguments to invoke the method with.
62145                      * @returns {Function} Returns the new function.
62146                      * @example
62147                      * 
62148                      * var array = _.times(3, _.constant), object = { 'a': array, 'b': array,
62149                      * 'c': array };
62150                      * 
62151                      * _.map(['a[2]', 'c[0]'], _.methodOf(object)); // => [2, 0]
62152                      * 
62153                      * _.map([['a', '2'], ['c', '0']], _.methodOf(object)); // => [2, 0]
62154                      */
62155                     var methodOf = restParam(function(object, args) {
62156                         return function(path) {
62157                             return invokePath(object, path, args);
62158                         };
62159                     });
62160
62161                     /**
62162                      * Adds all own enumerable function properties of a source object to the
62163                      * destination object. If `object` is a function then methods are added to
62164                      * its prototype as well.
62165                      * 
62166                      * **Note:** Use `_.runInContext` to create a pristine `lodash` function to
62167                      * avoid conflicts caused by modifying the original.
62168                      * 
62169                      * @static
62170                      * @memberOf _
62171                      * @category Utility
62172                      * @param {Function|Object}
62173                      *            [object=lodash] The destination object.
62174                      * @param {Object}
62175                      *            source The object of functions to add.
62176                      * @param {Object}
62177                      *            [options] The options object.
62178                      * @param {boolean}
62179                      *            [options.chain=true] Specify whether the functions added are
62180                      *            chainable.
62181                      * @returns {Function|Object} Returns `object`.
62182                      * @example
62183                      * 
62184                      * function vowels(string) { return _.filter(string, function(v) { return
62185                      * /[aeiou]/i.test(v); }); }
62186                      * 
62187                      * _.mixin({ 'vowels': vowels }); _.vowels('fred'); // => ['e']
62188                      * 
62189                      * _('fred').vowels().value(); // => ['e']
62190                      * 
62191                      * _.mixin({ 'vowels': vowels }, { 'chain': false }); _('fred').vowels(); // =>
62192                      * ['e']
62193                      */
62194                     function mixin(object, source, options) {
62195                         if (options == null) {
62196                             var isObj = isObject(source),
62197                                 props = isObj ? keys(source) : undefined,
62198                                 methodNames = (props && props.length) ? baseFunctions(source, props) : undefined;
62199
62200                             if (!(methodNames ? methodNames.length : isObj)) {
62201                                 methodNames = false;
62202                                 options = source;
62203                                 source = object;
62204                                 object = this;
62205                             }
62206                         }
62207                         if (!methodNames) {
62208                             methodNames = baseFunctions(source, keys(source));
62209                         }
62210                         var chain = true,
62211                             index = -1,
62212                             isFunc = isFunction(object),
62213                             length = methodNames.length;
62214
62215                         if (options === false) {
62216                             chain = false;
62217                         } else if (isObject(options) && 'chain' in options) {
62218                             chain = options.chain;
62219                         }
62220                         while (++index < length) {
62221                             var methodName = methodNames[index],
62222                                 func = source[methodName];
62223
62224                             object[methodName] = func;
62225                             if (isFunc) {
62226                                 object.prototype[methodName] = (function(func) {
62227                                     return function() {
62228                                         var chainAll = this.__chain__;
62229                                         if (chain || chainAll) {
62230                                             var result = object(this.__wrapped__),
62231                                                 actions = result.__actions__ = arrayCopy(this.__actions__);
62232
62233                                             actions.push({
62234                                                 'func': func,
62235                                                 'args': arguments,
62236                                                 'thisArg': object
62237                                             });
62238                                             result.__chain__ = chainAll;
62239                                             return result;
62240                                         }
62241                                         return func.apply(object, arrayPush([this.value()], arguments));
62242                                     };
62243                                 }(func));
62244                             }
62245                         }
62246                         return object;
62247                     }
62248
62249                     /**
62250                      * Reverts the `_` variable to its previous value and returns a reference to
62251                      * the `lodash` function.
62252                      * 
62253                      * @static
62254                      * @memberOf _
62255                      * @category Utility
62256                      * @returns {Function} Returns the `lodash` function.
62257                      * @example
62258                      * 
62259                      * var lodash = _.noConflict();
62260                      */
62261                     function noConflict() {
62262                         root._ = oldDash;
62263                         return this;
62264                     }
62265
62266                     /**
62267                      * A no-operation function that returns `undefined` regardless of the
62268                      * arguments it receives.
62269                      * 
62270                      * @static
62271                      * @memberOf _
62272                      * @category Utility
62273                      * @example
62274                      * 
62275                      * var object = { 'user': 'fred' };
62276                      * 
62277                      * _.noop(object) === undefined; // => true
62278                      */
62279                     function noop() {
62280                         // No operation performed.
62281                     }
62282
62283                     /**
62284                      * Creates a function that returns the property value at `path` on a given
62285                      * object.
62286                      * 
62287                      * @static
62288                      * @memberOf _
62289                      * @category Utility
62290                      * @param {Array|string}
62291                      *            path The path of the property to get.
62292                      * @returns {Function} Returns the new function.
62293                      * @example
62294                      * 
62295                      * var objects = [ { 'a': { 'b': { 'c': 2 } } }, { 'a': { 'b': { 'c': 1 } } } ];
62296                      * 
62297                      * _.map(objects, _.property('a.b.c')); // => [2, 1]
62298                      * 
62299                      * _.pluck(_.sortBy(objects, _.property(['a', 'b', 'c'])), 'a.b.c'); // =>
62300                      * [1, 2]
62301                      */
62302                     function property(path) {
62303                         return isKey(path) ? baseProperty(path) : basePropertyDeep(path);
62304                     }
62305
62306                     /**
62307                      * The opposite of `_.property`; this method creates a function that returns
62308                      * the property value at a given path on `object`.
62309                      * 
62310                      * @static
62311                      * @memberOf _
62312                      * @category Utility
62313                      * @param {Object}
62314                      *            object The object to query.
62315                      * @returns {Function} Returns the new function.
62316                      * @example
62317                      * 
62318                      * var array = [0, 1, 2], object = { 'a': array, 'b': array, 'c': array };
62319                      * 
62320                      * _.map(['a[2]', 'c[0]'], _.propertyOf(object)); // => [2, 0]
62321                      * 
62322                      * _.map([['a', '2'], ['c', '0']], _.propertyOf(object)); // => [2, 0]
62323                      */
62324                     function propertyOf(object) {
62325                         return function(path) {
62326                             return baseGet(object, toPath(path), path + '');
62327                         };
62328                     }
62329
62330                     /**
62331                      * Creates an array of numbers (positive and/or negative) progressing from
62332                      * `start` up to, but not including, `end`. If `end` is not specified it is
62333                      * set to `start` with `start` then set to `0`. If `end` is less than
62334                      * `start` a zero-length range is created unless a negative `step` is
62335                      * specified.
62336                      * 
62337                      * @static
62338                      * @memberOf _
62339                      * @category Utility
62340                      * @param {number}
62341                      *            [start=0] The start of the range.
62342                      * @param {number}
62343                      *            end The end of the range.
62344                      * @param {number}
62345                      *            [step=1] The value to increment or decrement by.
62346                      * @returns {Array} Returns the new array of numbers.
62347                      * @example
62348                      * 
62349                      * _.range(4); // => [0, 1, 2, 3]
62350                      * 
62351                      * _.range(1, 5); // => [1, 2, 3, 4]
62352                      * 
62353                      * _.range(0, 20, 5); // => [0, 5, 10, 15]
62354                      * 
62355                      * _.range(0, -4, -1); // => [0, -1, -2, -3]
62356                      * 
62357                      * _.range(1, 4, 0); // => [1, 1, 1]
62358                      * 
62359                      * _.range(0); // => []
62360                      */
62361                     function range(start, end, step) {
62362                         if (step && isIterateeCall(start, end, step)) {
62363                             end = step = undefined;
62364                         }
62365                         start = +start || 0;
62366                         step = step == null ? 1 : (+step || 0);
62367
62368                         if (end == null) {
62369                             end = start;
62370                             start = 0;
62371                         } else {
62372                             end = +end || 0;
62373                         }
62374                         // Use `Array(length)` so engines like Chakra and V8 avoid slower modes.
62375                         // See https://youtu.be/XAqIpGU8ZZk#t=17m25s for more details.
62376                         var index = -1,
62377                             length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),
62378                             result = Array(length);
62379
62380                         while (++index < length) {
62381                             result[index] = start;
62382                             start += step;
62383                         }
62384                         return result;
62385                     }
62386
62387                     /**
62388                      * Invokes the iteratee function `n` times, returning an array of the
62389                      * results of each invocation. The `iteratee` is bound to `thisArg` and
62390                      * invoked with one argument; (index).
62391                      * 
62392                      * @static
62393                      * @memberOf _
62394                      * @category Utility
62395                      * @param {number}
62396                      *            n The number of times to invoke `iteratee`.
62397                      * @param {Function}
62398                      *            [iteratee=_.identity] The function invoked per iteration.
62399                      * @param {*}
62400                      *            [thisArg] The `this` binding of `iteratee`.
62401                      * @returns {Array} Returns the array of results.
62402                      * @example
62403                      * 
62404                      * var diceRolls = _.times(3, _.partial(_.random, 1, 6, false)); // => [3,
62405                      * 6, 4]
62406                      * 
62407                      * _.times(3, function(n) { mage.castSpell(n); }); // => invokes
62408                      * `mage.castSpell(n)` three times with `n` of `0`, `1`, and `2`
62409                      * 
62410                      * _.times(3, function(n) { this.cast(n); }, mage); // => also invokes
62411                      * `mage.castSpell(n)` three times
62412                      */
62413                     function times(n, iteratee, thisArg) {
62414                         n = nativeFloor(n);
62415
62416                         // Exit early to avoid a JSC JIT bug in Safari 8
62417                         // where `Array(0)` is treated as `Array(1)`.
62418                         if (n < 1 || !nativeIsFinite(n)) {
62419                             return [];
62420                         }
62421                         var index = -1,
62422                             result = Array(nativeMin(n, MAX_ARRAY_LENGTH));
62423
62424                         iteratee = bindCallback(iteratee, thisArg, 1);
62425                         while (++index < n) {
62426                             if (index < MAX_ARRAY_LENGTH) {
62427                                 result[index] = iteratee(index);
62428                             } else {
62429                                 iteratee(index);
62430                             }
62431                         }
62432                         return result;
62433                     }
62434
62435                     /**
62436                      * Generates a unique ID. If `prefix` is provided the ID is appended to it.
62437                      * 
62438                      * @static
62439                      * @memberOf _
62440                      * @category Utility
62441                      * @param {string}
62442                      *            [prefix] The value to prefix the ID with.
62443                      * @returns {string} Returns the unique ID.
62444                      * @example
62445                      * 
62446                      * _.uniqueId('contact_'); // => 'contact_104'
62447                      * 
62448                      * _.uniqueId(); // => '105'
62449                      */
62450                     function uniqueId(prefix) {
62451                         var id = ++idCounter;
62452                         return baseToString(prefix) + id;
62453                     }
62454
62455                     /*------------------------------------------------------------------------*/
62456
62457                     /**
62458                      * Adds two numbers.
62459                      * 
62460                      * @static
62461                      * @memberOf _
62462                      * @category Math
62463                      * @param {number}
62464                      *            augend The first number to add.
62465                      * @param {number}
62466                      *            addend The second number to add.
62467                      * @returns {number} Returns the sum.
62468                      * @example
62469                      * 
62470                      * _.add(6, 4); // => 10
62471                      */
62472                     function add(augend, addend) {
62473                         return (+augend || 0) + (+addend || 0);
62474                     }
62475
62476                     /**
62477                      * Calculates `n` rounded up to `precision`.
62478                      * 
62479                      * @static
62480                      * @memberOf _
62481                      * @category Math
62482                      * @param {number}
62483                      *            n The number to round up.
62484                      * @param {number}
62485                      *            [precision=0] The precision to round up to.
62486                      * @returns {number} Returns the rounded up number.
62487                      * @example
62488                      * 
62489                      * _.ceil(4.006); // => 5
62490                      * 
62491                      * _.ceil(6.004, 2); // => 6.01
62492                      * 
62493                      * _.ceil(6040, -2); // => 6100
62494                      */
62495                     var ceil = createRound('ceil');
62496
62497                     /**
62498                      * Calculates `n` rounded down to `precision`.
62499                      * 
62500                      * @static
62501                      * @memberOf _
62502                      * @category Math
62503                      * @param {number}
62504                      *            n The number to round down.
62505                      * @param {number}
62506                      *            [precision=0] The precision to round down to.
62507                      * @returns {number} Returns the rounded down number.
62508                      * @example
62509                      * 
62510                      * _.floor(4.006); // => 4
62511                      * 
62512                      * _.floor(0.046, 2); // => 0.04
62513                      * 
62514                      * _.floor(4060, -2); // => 4000
62515                      */
62516                     var floor = createRound('floor');
62517
62518                     /**
62519                      * Gets the maximum value of `collection`. If `collection` is empty or
62520                      * falsey `-Infinity` is returned. If an iteratee function is provided it is
62521                      * invoked for each value in `collection` to generate the criterion by which
62522                      * the value is ranked. The `iteratee` is bound to `thisArg` and invoked
62523                      * with three arguments: (value, index, collection).
62524                      * 
62525                      * If a property name is provided for `iteratee` the created `_.property`
62526                      * style callback returns the property value of the given element.
62527                      * 
62528                      * If a value is also provided for `thisArg` the created `_.matchesProperty`
62529                      * style callback returns `true` for elements that have a matching property
62530                      * value, else `false`.
62531                      * 
62532                      * If an object is provided for `iteratee` the created `_.matches` style
62533                      * callback returns `true` for elements that have the properties of the
62534                      * given object, else `false`.
62535                      * 
62536                      * @static
62537                      * @memberOf _
62538                      * @category Math
62539                      * @param {Array|Object|string}
62540                      *            collection The collection to iterate over.
62541                      * @param {Function|Object|string}
62542                      *            [iteratee] The function invoked per iteration.
62543                      * @param {*}
62544                      *            [thisArg] The `this` binding of `iteratee`.
62545                      * @returns {*} Returns the maximum value.
62546                      * @example
62547                      * 
62548                      * _.max([4, 2, 8, 6]); // => 8
62549                      * 
62550                      * _.max([]); // => -Infinity
62551                      * 
62552                      * var users = [ { 'user': 'barney', 'age': 36 }, { 'user': 'fred', 'age':
62553                      * 40 } ];
62554                      * 
62555                      * _.max(users, function(chr) { return chr.age; }); // => { 'user': 'fred',
62556                      * 'age': 40 }
62557                      *  // using the `_.property` callback shorthand _.max(users, 'age'); // => {
62558                      * 'user': 'fred', 'age': 40 }
62559                      */
62560                     var max = createExtremum(gt, NEGATIVE_INFINITY);
62561
62562                     /**
62563                      * Gets the minimum value of `collection`. If `collection` is empty or
62564                      * falsey `Infinity` is returned. If an iteratee function is provided it is
62565                      * invoked for each value in `collection` to generate the criterion by which
62566                      * the value is ranked. The `iteratee` is bound to `thisArg` and invoked
62567                      * with three arguments: (value, index, collection).
62568                      * 
62569                      * If a property name is provided for `iteratee` the created `_.property`
62570                      * style callback returns the property value of the given element.
62571                      * 
62572                      * If a value is also provided for `thisArg` the created `_.matchesProperty`
62573                      * style callback returns `true` for elements that have a matching property
62574                      * value, else `false`.
62575                      * 
62576                      * If an object is provided for `iteratee` the created `_.matches` style
62577                      * callback returns `true` for elements that have the properties of the
62578                      * given object, else `false`.
62579                      * 
62580                      * @static
62581                      * @memberOf _
62582                      * @category Math
62583                      * @param {Array|Object|string}
62584                      *            collection The collection to iterate over.
62585                      * @param {Function|Object|string}
62586                      *            [iteratee] The function invoked per iteration.
62587                      * @param {*}
62588                      *            [thisArg] The `this` binding of `iteratee`.
62589                      * @returns {*} Returns the minimum value.
62590                      * @example
62591                      * 
62592                      * _.min([4, 2, 8, 6]); // => 2
62593                      * 
62594                      * _.min([]); // => Infinity
62595                      * 
62596                      * var users = [ { 'user': 'barney', 'age': 36 }, { 'user': 'fred', 'age':
62597                      * 40 } ];
62598                      * 
62599                      * _.min(users, function(chr) { return chr.age; }); // => { 'user':
62600                      * 'barney', 'age': 36 }
62601                      *  // using the `_.property` callback shorthand _.min(users, 'age'); // => {
62602                      * 'user': 'barney', 'age': 36 }
62603                      */
62604                     var min = createExtremum(lt, POSITIVE_INFINITY);
62605
62606                     /**
62607                      * Calculates `n` rounded to `precision`.
62608                      * 
62609                      * @static
62610                      * @memberOf _
62611                      * @category Math
62612                      * @param {number}
62613                      *            n The number to round.
62614                      * @param {number}
62615                      *            [precision=0] The precision to round to.
62616                      * @returns {number} Returns the rounded number.
62617                      * @example
62618                      * 
62619                      * _.round(4.006); // => 4
62620                      * 
62621                      * _.round(4.006, 2); // => 4.01
62622                      * 
62623                      * _.round(4060, -2); // => 4100
62624                      */
62625                     var round = createRound('round');
62626
62627                     /**
62628                      * Gets the sum of the values in `collection`.
62629                      * 
62630                      * @static
62631                      * @memberOf _
62632                      * @category Math
62633                      * @param {Array|Object|string}
62634                      *            collection The collection to iterate over.
62635                      * @param {Function|Object|string}
62636                      *            [iteratee] The function invoked per iteration.
62637                      * @param {*}
62638                      *            [thisArg] The `this` binding of `iteratee`.
62639                      * @returns {number} Returns the sum.
62640                      * @example
62641                      * 
62642                      * _.sum([4, 6]); // => 10
62643                      * 
62644                      * _.sum({ 'a': 4, 'b': 6 }); // => 10
62645                      * 
62646                      * var objects = [ { 'n': 4 }, { 'n': 6 } ];
62647                      * 
62648                      * _.sum(objects, function(object) { return object.n; }); // => 10
62649                      *  // using the `_.property` callback shorthand _.sum(objects, 'n'); // =>
62650                      * 10
62651                      */
62652                     function sum(collection, iteratee, thisArg) {
62653                         if (thisArg && isIterateeCall(collection, iteratee, thisArg)) {
62654                             iteratee = undefined;
62655                         }
62656                         iteratee = getCallback(iteratee, thisArg, 3);
62657                         return iteratee.length == 1 ? arraySum(isArray(collection) ? collection : toIterable(collection), iteratee) : baseSum(collection, iteratee);
62658                     }
62659
62660                     /*------------------------------------------------------------------------*/
62661
62662                     // Ensure wrappers are instances of `baseLodash`.
62663                     lodash.prototype = baseLodash.prototype;
62664
62665                     LodashWrapper.prototype = baseCreate(baseLodash.prototype);
62666                     LodashWrapper.prototype.constructor = LodashWrapper;
62667
62668                     LazyWrapper.prototype = baseCreate(baseLodash.prototype);
62669                     LazyWrapper.prototype.constructor = LazyWrapper;
62670
62671                     // Add functions to the `Map` cache.
62672                     MapCache.prototype['delete'] = mapDelete;
62673                     MapCache.prototype.get = mapGet;
62674                     MapCache.prototype.has = mapHas;
62675                     MapCache.prototype.set = mapSet;
62676
62677                     // Add functions to the `Set` cache.
62678                     SetCache.prototype.push = cachePush;
62679
62680                     // Assign cache to `_.memoize`.
62681                     memoize.Cache = MapCache;
62682
62683                     // Add functions that return wrapped values when chaining.
62684                     lodash.after = after;
62685                     lodash.ary = ary;
62686                     lodash.assign = assign;
62687                     lodash.at = at;
62688                     lodash.before = before;
62689                     lodash.bind = bind;
62690                     lodash.bindAll = bindAll;
62691                     lodash.bindKey = bindKey;
62692                     lodash.callback = callback;
62693                     lodash.chain = chain;
62694                     lodash.chunk = chunk;
62695                     lodash.compact = compact;
62696                     lodash.constant = constant;
62697                     lodash.countBy = countBy;
62698                     lodash.create = create;
62699                     lodash.curry = curry;
62700                     lodash.curryRight = curryRight;
62701                     lodash.debounce = debounce;
62702                     lodash.defaults = defaults;
62703                     lodash.defaultsDeep = defaultsDeep;
62704                     lodash.defer = defer;
62705                     lodash.delay = delay;
62706                     lodash.difference = difference;
62707                     lodash.drop = drop;
62708                     lodash.dropRight = dropRight;
62709                     lodash.dropRightWhile = dropRightWhile;
62710                     lodash.dropWhile = dropWhile;
62711                     lodash.fill = fill;
62712                     lodash.filter = filter;
62713                     lodash.flatten = flatten;
62714                     lodash.flattenDeep = flattenDeep;
62715                     lodash.flow = flow;
62716                     lodash.flowRight = flowRight;
62717                     lodash.forEach = forEach;
62718                     lodash.forEachRight = forEachRight;
62719                     lodash.forIn = forIn;
62720                     lodash.forInRight = forInRight;
62721                     lodash.forOwn = forOwn;
62722                     lodash.forOwnRight = forOwnRight;
62723                     lodash.functions = functions;
62724                     lodash.groupBy = groupBy;
62725                     lodash.indexBy = indexBy;
62726                     lodash.initial = initial;
62727                     lodash.intersection = intersection;
62728                     lodash.invert = invert;
62729                     lodash.invoke = invoke;
62730                     lodash.keys = keys;
62731                     lodash.keysIn = keysIn;
62732                     lodash.map = map;
62733                     lodash.mapKeys = mapKeys;
62734                     lodash.mapValues = mapValues;
62735                     lodash.matches = matches;
62736                     lodash.matchesProperty = matchesProperty;
62737                     lodash.memoize = memoize;
62738                     lodash.merge = merge;
62739                     lodash.method = method;
62740                     lodash.methodOf = methodOf;
62741                     lodash.mixin = mixin;
62742                     lodash.modArgs = modArgs;
62743                     lodash.negate = negate;
62744                     lodash.omit = omit;
62745                     lodash.once = once;
62746                     lodash.pairs = pairs;
62747                     lodash.partial = partial;
62748                     lodash.partialRight = partialRight;
62749                     lodash.partition = partition;
62750                     lodash.pick = pick;
62751                     lodash.pluck = pluck;
62752                     lodash.property = property;
62753                     lodash.propertyOf = propertyOf;
62754                     lodash.pull = pull;
62755                     lodash.pullAt = pullAt;
62756                     lodash.range = range;
62757                     lodash.rearg = rearg;
62758                     lodash.reject = reject;
62759                     lodash.remove = remove;
62760                     lodash.rest = rest;
62761                     lodash.restParam = restParam;
62762                     lodash.set = set;
62763                     lodash.shuffle = shuffle;
62764                     lodash.slice = slice;
62765                     lodash.sortBy = sortBy;
62766                     lodash.sortByAll = sortByAll;
62767                     lodash.sortByOrder = sortByOrder;
62768                     lodash.spread = spread;
62769                     lodash.take = take;
62770                     lodash.takeRight = takeRight;
62771                     lodash.takeRightWhile = takeRightWhile;
62772                     lodash.takeWhile = takeWhile;
62773                     lodash.tap = tap;
62774                     lodash.throttle = throttle;
62775                     lodash.thru = thru;
62776                     lodash.times = times;
62777                     lodash.toArray = toArray;
62778                     lodash.toPlainObject = toPlainObject;
62779                     lodash.transform = transform;
62780                     lodash.union = union;
62781                     lodash.uniq = uniq;
62782                     lodash.unzip = unzip;
62783                     lodash.unzipWith = unzipWith;
62784                     lodash.values = values;
62785                     lodash.valuesIn = valuesIn;
62786                     lodash.where = where;
62787                     lodash.without = without;
62788                     lodash.wrap = wrap;
62789                     lodash.xor = xor;
62790                     lodash.zip = zip;
62791                     lodash.zipObject = zipObject;
62792                     lodash.zipWith = zipWith;
62793
62794                     // Add aliases.
62795                     lodash.backflow = flowRight;
62796                     lodash.collect = map;
62797                     lodash.compose = flowRight;
62798                     lodash.each = forEach;
62799                     lodash.eachRight = forEachRight;
62800                     lodash.extend = assign;
62801                     lodash.iteratee = callback;
62802                     lodash.methods = functions;
62803                     lodash.object = zipObject;
62804                     lodash.select = filter;
62805                     lodash.tail = rest;
62806                     lodash.unique = uniq;
62807
62808                     // Add functions to `lodash.prototype`.
62809                     mixin(lodash, lodash);
62810
62811                     /*------------------------------------------------------------------------*/
62812
62813                     // Add functions that return unwrapped values when chaining.
62814                     lodash.add = add;
62815                     lodash.attempt = attempt;
62816                     lodash.camelCase = camelCase;
62817                     lodash.capitalize = capitalize;
62818                     lodash.ceil = ceil;
62819                     lodash.clone = clone;
62820                     lodash.cloneDeep = cloneDeep;
62821                     lodash.deburr = deburr;
62822                     lodash.endsWith = endsWith;
62823                     lodash.escape = escape;
62824                     lodash.escapeRegExp = escapeRegExp;
62825                     lodash.every = every;
62826                     lodash.find = find;
62827                     lodash.findIndex = findIndex;
62828                     lodash.findKey = findKey;
62829                     lodash.findLast = findLast;
62830                     lodash.findLastIndex = findLastIndex;
62831                     lodash.findLastKey = findLastKey;
62832                     lodash.findWhere = findWhere;
62833                     lodash.first = first;
62834                     lodash.floor = floor;
62835                     lodash.get = get;
62836                     lodash.gt = gt;
62837                     lodash.gte = gte;
62838                     lodash.has = has;
62839                     lodash.identity = identity;
62840                     lodash.includes = includes;
62841                     lodash.indexOf = indexOf;
62842                     lodash.inRange = inRange;
62843                     lodash.isArguments = isArguments;
62844                     lodash.isArray = isArray;
62845                     lodash.isBoolean = isBoolean;
62846                     lodash.isDate = isDate;
62847                     lodash.isElement = isElement;
62848                     lodash.isEmpty = isEmpty;
62849                     lodash.isEqual = isEqual;
62850                     lodash.isError = isError;
62851                     lodash.isFinite = isFinite;
62852                     lodash.isFunction = isFunction;
62853                     lodash.isMatch = isMatch;
62854                     lodash.isNaN = isNaN;
62855                     lodash.isNative = isNative;
62856                     lodash.isNull = isNull;
62857                     lodash.isNumber = isNumber;
62858                     lodash.isObject = isObject;
62859                     lodash.isPlainObject = isPlainObject;
62860                     lodash.isRegExp = isRegExp;
62861                     lodash.isString = isString;
62862                     lodash.isTypedArray = isTypedArray;
62863                     lodash.isUndefined = isUndefined;
62864                     lodash.kebabCase = kebabCase;
62865                     lodash.last = last;
62866                     lodash.lastIndexOf = lastIndexOf;
62867                     lodash.lt = lt;
62868                     lodash.lte = lte;
62869                     lodash.max = max;
62870                     lodash.min = min;
62871                     lodash.noConflict = noConflict;
62872                     lodash.noop = noop;
62873                     lodash.now = now;
62874                     lodash.pad = pad;
62875                     lodash.padLeft = padLeft;
62876                     lodash.padRight = padRight;
62877                     lodash.parseInt = parseInt;
62878                     lodash.random = random;
62879                     lodash.reduce = reduce;
62880                     lodash.reduceRight = reduceRight;
62881                     lodash.repeat = repeat;
62882                     lodash.result = result;
62883                     lodash.round = round;
62884                     lodash.runInContext = runInContext;
62885                     lodash.size = size;
62886                     lodash.snakeCase = snakeCase;
62887                     lodash.some = some;
62888                     lodash.sortedIndex = sortedIndex;
62889                     lodash.sortedLastIndex = sortedLastIndex;
62890                     lodash.startCase = startCase;
62891                     lodash.startsWith = startsWith;
62892                     lodash.sum = sum;
62893                     lodash.template = template;
62894                     lodash.trim = trim;
62895                     lodash.trimLeft = trimLeft;
62896                     lodash.trimRight = trimRight;
62897                     lodash.trunc = trunc;
62898                     lodash.unescape = unescape;
62899                     lodash.uniqueId = uniqueId;
62900                     lodash.words = words;
62901
62902                     // Add aliases.
62903                     lodash.all = every;
62904                     lodash.any = some;
62905                     lodash.contains = includes;
62906                     lodash.eq = isEqual;
62907                     lodash.detect = find;
62908                     lodash.foldl = reduce;
62909                     lodash.foldr = reduceRight;
62910                     lodash.head = first;
62911                     lodash.include = includes;
62912                     lodash.inject = reduce;
62913
62914                     mixin(lodash, (function() {
62915                         var source = {};
62916                         baseForOwn(lodash, function(func, methodName) {
62917                             if (!lodash.prototype[methodName]) {
62918                                 source[methodName] = func;
62919                             }
62920                         });
62921                         return source;
62922                     }()), false);
62923
62924                     /*------------------------------------------------------------------------*/
62925
62926                     // Add functions capable of returning wrapped and unwrapped values when
62927                     // chaining.
62928                     lodash.sample = sample;
62929
62930                     lodash.prototype.sample = function(n) {
62931                         if (!this.__chain__ && n == null) {
62932                             return sample(this.value());
62933                         }
62934                         return this.thru(function(value) {
62935                             return sample(value, n);
62936                         });
62937                     };
62938
62939                     /*------------------------------------------------------------------------*/
62940
62941                     /**
62942                      * The semantic version number.
62943                      * 
62944                      * @static
62945                      * @memberOf _
62946                      * @type string
62947                      */
62948                     lodash.VERSION = VERSION;
62949
62950                     // Assign default placeholders.
62951                     arrayEach(['bind', 'bindKey', 'curry', 'curryRight', 'partial', 'partialRight'], function(methodName) {
62952                         lodash[methodName].placeholder = lodash;
62953                     });
62954
62955                     // Add `LazyWrapper` methods for `_.drop` and `_.take` variants.
62956                     arrayEach(['drop', 'take'], function(methodName, index) {
62957                         LazyWrapper.prototype[methodName] = function(n) {
62958                             var filtered = this.__filtered__;
62959                             if (filtered && !index) {
62960                                 return new LazyWrapper(this);
62961                             }
62962                             n = n == null ? 1 : nativeMax(nativeFloor(n) || 0, 0);
62963
62964                             var result = this.clone();
62965                             if (filtered) {
62966                                 result.__takeCount__ = nativeMin(result.__takeCount__, n);
62967                             } else {
62968                                 result.__views__.push({
62969                                     'size': n,
62970                                     'type': methodName + (result.__dir__ < 0 ? 'Right' : '')
62971                                 });
62972                             }
62973                             return result;
62974                         };
62975
62976                         LazyWrapper.prototype[methodName + 'Right'] = function(n) {
62977                             return this.reverse()[methodName](n).reverse();
62978                         };
62979                     });
62980
62981                     // Add `LazyWrapper` methods that accept an `iteratee` value.
62982                     arrayEach(['filter', 'map', 'takeWhile'], function(methodName, index) {
62983                         var type = index + 1,
62984                             isFilter = type != LAZY_MAP_FLAG;
62985
62986                         LazyWrapper.prototype[methodName] = function(iteratee, thisArg) {
62987                             var result = this.clone();
62988                             result.__iteratees__.push({
62989                                 'iteratee': getCallback(iteratee, thisArg, 1),
62990                                 'type': type
62991                             });
62992                             result.__filtered__ = result.__filtered__ || isFilter;
62993                             return result;
62994                         };
62995                     });
62996
62997                     // Add `LazyWrapper` methods for `_.first` and `_.last`.
62998                     arrayEach(['first', 'last'], function(methodName, index) {
62999                         var takeName = 'take' + (index ? 'Right' : '');
63000
63001                         LazyWrapper.prototype[methodName] = function() {
63002                             return this[takeName](1).value()[0];
63003                         };
63004                     });
63005
63006                     // Add `LazyWrapper` methods for `_.initial` and `_.rest`.
63007                     arrayEach(['initial', 'rest'], function(methodName, index) {
63008                         var dropName = 'drop' + (index ? '' : 'Right');
63009
63010                         LazyWrapper.prototype[methodName] = function() {
63011                             return this.__filtered__ ? new LazyWrapper(this) : this[dropName](1);
63012                         };
63013                     });
63014
63015                     // Add `LazyWrapper` methods for `_.pluck` and `_.where`.
63016                     arrayEach(['pluck', 'where'], function(methodName, index) {
63017                         var operationName = index ? 'filter' : 'map',
63018                             createCallback = index ? baseMatches : property;
63019
63020                         LazyWrapper.prototype[methodName] = function(value) {
63021                             return this[operationName](createCallback(value));
63022                         };
63023                     });
63024
63025                     LazyWrapper.prototype.compact = function() {
63026                         return this.filter(identity);
63027                     };
63028
63029                     LazyWrapper.prototype.reject = function(predicate, thisArg) {
63030                         predicate = getCallback(predicate, thisArg, 1);
63031                         return this.filter(function(value) {
63032                             return !predicate(value);
63033                         });
63034                     };
63035
63036                     LazyWrapper.prototype.slice = function(start, end) {
63037                         start = start == null ? 0 : (+start || 0);
63038
63039                         var result = this;
63040                         if (result.__filtered__ && (start > 0 || end < 0)) {
63041                             return new LazyWrapper(result);
63042                         }
63043                         if (start < 0) {
63044                             result = result.takeRight(-start);
63045                         } else if (start) {
63046                             result = result.drop(start);
63047                         }
63048                         if (end !== undefined) {
63049                             end = (+end || 0);
63050                             result = end < 0 ? result.dropRight(-end) : result.take(end - start);
63051                         }
63052                         return result;
63053                     };
63054
63055                     LazyWrapper.prototype.takeRightWhile = function(predicate, thisArg) {
63056                         return this.reverse().takeWhile(predicate, thisArg).reverse();
63057                     };
63058
63059                     LazyWrapper.prototype.toArray = function() {
63060                         return this.take(POSITIVE_INFINITY);
63061                     };
63062
63063                     // Add `LazyWrapper` methods to `lodash.prototype`.
63064                     baseForOwn(LazyWrapper.prototype, function(func, methodName) {
63065                         var checkIteratee = /^(?:filter|map|reject)|While$/.test(methodName),
63066                             retUnwrapped = /^(?:first|last)$/.test(methodName),
63067                             lodashFunc = lodash[retUnwrapped ? ('take' + (methodName == 'last' ? 'Right' : '')) : methodName];
63068
63069                         if (!lodashFunc) {
63070                             return;
63071                         }
63072                         lodash.prototype[methodName] = function() {
63073                             var args = retUnwrapped ? [1] : arguments,
63074                                 chainAll = this.__chain__,
63075                                 value = this.__wrapped__,
63076                                 isHybrid = !!this.__actions__.length,
63077                                 isLazy = value instanceof LazyWrapper,
63078                                 iteratee = args[0],
63079                                 useLazy = isLazy || isArray(value);
63080
63081                             if (useLazy && checkIteratee && typeof iteratee == 'function' && iteratee.length != 1) {
63082                                 // Avoid lazy use if the iteratee has a "length" value other than
63083                                 // `1`.
63084                                 isLazy = useLazy = false;
63085                             }
63086                             var interceptor = function(value) {
63087                                 return (retUnwrapped && chainAll) ? lodashFunc(value, 1)[0] : lodashFunc.apply(undefined, arrayPush([value], args));
63088                             };
63089
63090                             var action = {
63091                                     'func': thru,
63092                                     'args': [interceptor],
63093                                     'thisArg': undefined
63094                                 },
63095                                 onlyLazy = isLazy && !isHybrid;
63096
63097                             if (retUnwrapped && !chainAll) {
63098                                 if (onlyLazy) {
63099                                     value = value.clone();
63100                                     value.__actions__.push(action);
63101                                     return func.call(value);
63102                                 }
63103                                 return lodashFunc.call(undefined, this.value())[0];
63104                             }
63105                             if (!retUnwrapped && useLazy) {
63106                                 value = onlyLazy ? value : new LazyWrapper(this);
63107                                 var result = func.apply(value, args);
63108                                 result.__actions__.push(action);
63109                                 return new LodashWrapper(result, chainAll);
63110                             }
63111                             return this.thru(interceptor);
63112                         };
63113                     });
63114
63115                     // Add `Array` and `String` methods to `lodash.prototype`.
63116                     arrayEach(['join', 'pop', 'push', 'replace', 'shift', 'sort', 'splice', 'split', 'unshift'], function(methodName) {
63117                         var func = (/^(?:replace|split)$/.test(methodName) ? stringProto : arrayProto)[methodName],
63118                             chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru',
63119                             retUnwrapped = /^(?:join|pop|replace|shift)$/.test(methodName);
63120
63121                         lodash.prototype[methodName] = function() {
63122                             var args = arguments;
63123                             if (retUnwrapped && !this.__chain__) {
63124                                 return func.apply(this.value(), args);
63125                             }
63126                             return this[chainName](function(value) {
63127                                 return func.apply(value, args);
63128                             });
63129                         };
63130                     });
63131
63132                     // Map minified function names to their real names.
63133                     baseForOwn(LazyWrapper.prototype, function(func, methodName) {
63134                         var lodashFunc = lodash[methodName];
63135                         if (lodashFunc) {
63136                             var key = lodashFunc.name,
63137                                 names = realNames[key] || (realNames[key] = []);
63138
63139                             names.push({
63140                                 'name': methodName,
63141                                 'func': lodashFunc
63142                             });
63143                         }
63144                     });
63145
63146                     realNames[createHybridWrapper(undefined, BIND_KEY_FLAG).name] = [{
63147                         'name': 'wrapper',
63148                         'func': undefined
63149                     }];
63150
63151                     // Add functions to the lazy wrapper.
63152                     LazyWrapper.prototype.clone = lazyClone;
63153                     LazyWrapper.prototype.reverse = lazyReverse;
63154                     LazyWrapper.prototype.value = lazyValue;
63155
63156                     // Add chaining functions to the `lodash` wrapper.
63157                     lodash.prototype.chain = wrapperChain;
63158                     lodash.prototype.commit = wrapperCommit;
63159                     lodash.prototype.concat = wrapperConcat;
63160                     lodash.prototype.plant = wrapperPlant;
63161                     lodash.prototype.reverse = wrapperReverse;
63162                     lodash.prototype.toString = wrapperToString;
63163                     lodash.prototype.run = lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue;
63164
63165                     // Add function aliases to the `lodash` wrapper.
63166                     lodash.prototype.collect = lodash.prototype.map;
63167                     lodash.prototype.head = lodash.prototype.first;
63168                     lodash.prototype.select = lodash.prototype.filter;
63169                     lodash.prototype.tail = lodash.prototype.rest;
63170
63171                     return lodash;
63172                 }
63173
63174                 /*--------------------------------------------------------------------------*/
63175
63176                 // Export lodash.
63177                 var _ = runInContext();
63178
63179                 // Some AMD build optimizers like r.js check for condition patterns like the
63180                 // following:
63181                 if (typeof define == 'function' && typeof define.amd == 'object' && define.amd) {
63182                     // Expose lodash to the global object when an AMD loader is present to avoid
63183                     // errors in cases where lodash is loaded by a script tag and not intended
63184                     // as an AMD module. See http://requirejs.org/docs/errors.html#mismatch for
63185                     // more details.
63186                     root._ = _;
63187
63188                     // Define as an anonymous module so, through path mapping, it can be
63189                     // referenced as the "underscore" module.
63190                     define(function() {
63191                         return _;
63192                     });
63193                 }
63194                 // Check for `exports` after `define` in case a build optimizer adds an
63195                 // `exports` object.
63196                 else if (freeExports && freeModule) {
63197                     // Export for Node.js or RingoJS.
63198                     if (moduleExports) {
63199                         (freeModule.exports = _)._ = _;
63200                     }
63201                     // Export for Rhino with CommonJS support.
63202                     else {
63203                         freeExports._ = _;
63204                     }
63205                 } else {
63206                     // Export for a browser or Rhino.
63207                     root._ = _;
63208                 }
63209             }.call(this));
63210
63211         }).call(this, typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
63212     }, {}],
63213     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\LazyWrapper.js": [function(require, module, exports) {
63214         var baseCreate = require('./baseCreate'),
63215             baseLodash = require('./baseLodash');
63216
63217         /** Used as references for `-Infinity` and `Infinity`. */
63218         var POSITIVE_INFINITY = Number.POSITIVE_INFINITY;
63219
63220         /**
63221          * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.
63222          * 
63223          * @private
63224          * @param {*}
63225          *            value The value to wrap.
63226          */
63227         function LazyWrapper(value) {
63228             this.__wrapped__ = value;
63229             this.__actions__ = [];
63230             this.__dir__ = 1;
63231             this.__filtered__ = false;
63232             this.__iteratees__ = [];
63233             this.__takeCount__ = POSITIVE_INFINITY;
63234             this.__views__ = [];
63235         }
63236
63237         LazyWrapper.prototype = baseCreate(baseLodash.prototype);
63238         LazyWrapper.prototype.constructor = LazyWrapper;
63239
63240         module.exports = LazyWrapper;
63241
63242     }, {
63243         "./baseCreate": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseCreate.js",
63244         "./baseLodash": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseLodash.js"
63245     }],
63246     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\LodashWrapper.js": [function(require, module, exports) {
63247         var baseCreate = require('./baseCreate'),
63248             baseLodash = require('./baseLodash');
63249
63250         /**
63251          * The base constructor for creating `lodash` wrapper objects.
63252          * 
63253          * @private
63254          * @param {*}
63255          *            value The value to wrap.
63256          * @param {boolean}
63257          *            [chainAll] Enable chaining for all wrapper methods.
63258          * @param {Array}
63259          *            [actions=[]] Actions to peform to resolve the unwrapped value.
63260          */
63261         function LodashWrapper(value, chainAll, actions) {
63262             this.__wrapped__ = value;
63263             this.__actions__ = actions || [];
63264             this.__chain__ = !!chainAll;
63265         }
63266
63267         LodashWrapper.prototype = baseCreate(baseLodash.prototype);
63268         LodashWrapper.prototype.constructor = LodashWrapper;
63269
63270         module.exports = LodashWrapper;
63271
63272     }, {
63273         "./baseCreate": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseCreate.js",
63274         "./baseLodash": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseLodash.js"
63275     }],
63276     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\SetCache.js": [function(require, module, exports) {
63277         (function(global) {
63278             var cachePush = require('./cachePush'),
63279                 getNative = require('./getNative');
63280
63281             /** Native method references. */
63282             var Set = getNative(global, 'Set');
63283
63284             /*
63285              * Native method references for those with the same name as other `lodash`
63286              * methods.
63287              */
63288             var nativeCreate = getNative(Object, 'create');
63289
63290             /**
63291              * 
63292              * Creates a cache object to store unique values.
63293              * 
63294              * @private
63295              * @param {Array}
63296              *            [values] The values to cache.
63297              */
63298             function SetCache(values) {
63299                 var length = values ? values.length : 0;
63300
63301                 this.data = {
63302                     'hash': nativeCreate(null),
63303                     'set': new Set
63304                 };
63305                 while (length--) {
63306                     this.push(values[length]);
63307                 }
63308             }
63309
63310             // Add functions to the `Set` cache.
63311             SetCache.prototype.push = cachePush;
63312
63313             module.exports = SetCache;
63314
63315         }).call(this, typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
63316     }, {
63317         "./cachePush": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\cachePush.js",
63318         "./getNative": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\getNative.js"
63319     }],
63320     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\arrayCopy.js": [function(require, module, exports) {
63321         /**
63322          * Copies the values of `source` to `array`.
63323          * 
63324          * @private
63325          * @param {Array}
63326          *            source The array to copy values from.
63327          * @param {Array}
63328          *            [array=[]] The array to copy values to.
63329          * @returns {Array} Returns `array`.
63330          */
63331         function arrayCopy(source, array) {
63332             var index = -1,
63333                 length = source.length;
63334
63335             array || (array = Array(length));
63336             while (++index < length) {
63337                 array[index] = source[index];
63338             }
63339             return array;
63340         }
63341
63342         module.exports = arrayCopy;
63343
63344     }, {}],
63345     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\arrayEach.js": [function(require, module, exports) {
63346         /**
63347          * A specialized version of `_.forEach` for arrays without support for callback
63348          * shorthands and `this` binding.
63349          * 
63350          * @private
63351          * @param {Array}
63352          *            array The array to iterate over.
63353          * @param {Function}
63354          *            iteratee The function invoked per iteration.
63355          * @returns {Array} Returns `array`.
63356          */
63357         function arrayEach(array, iteratee) {
63358             var index = -1,
63359                 length = array.length;
63360
63361             while (++index < length) {
63362                 if (iteratee(array[index], index, array) === false) {
63363                     break;
63364                 }
63365             }
63366             return array;
63367         }
63368
63369         module.exports = arrayEach;
63370
63371     }, {}],
63372     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\arrayEvery.js": [function(require, module, exports) {
63373         /**
63374          * A specialized version of `_.every` for arrays without support for callback
63375          * shorthands and `this` binding.
63376          * 
63377          * @private
63378          * @param {Array}
63379          *            array The array to iterate over.
63380          * @param {Function}
63381          *            predicate The function invoked per iteration.
63382          * @returns {boolean} Returns `true` if all elements pass the predicate check,
63383          *          else `false`.
63384          */
63385         function arrayEvery(array, predicate) {
63386             var index = -1,
63387                 length = array.length;
63388
63389             while (++index < length) {
63390                 if (!predicate(array[index], index, array)) {
63391                     return false;
63392                 }
63393             }
63394             return true;
63395         }
63396
63397         module.exports = arrayEvery;
63398
63399     }, {}],
63400     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\arrayFilter.js": [function(require, module, exports) {
63401         /**
63402          * A specialized version of `_.filter` for arrays without support for callback
63403          * shorthands and `this` binding.
63404          * 
63405          * @private
63406          * @param {Array}
63407          *            array The array to iterate over.
63408          * @param {Function}
63409          *            predicate The function invoked per iteration.
63410          * @returns {Array} Returns the new filtered array.
63411          */
63412         function arrayFilter(array, predicate) {
63413             var index = -1,
63414                 length = array.length,
63415                 resIndex = -1,
63416                 result = [];
63417
63418             while (++index < length) {
63419                 var value = array[index];
63420                 if (predicate(value, index, array)) {
63421                     result[++resIndex] = value;
63422                 }
63423             }
63424             return result;
63425         }
63426
63427         module.exports = arrayFilter;
63428
63429     }, {}],
63430     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\arrayMap.js": [function(require, module, exports) {
63431         /**
63432          * A specialized version of `_.map` for arrays without support for callback
63433          * shorthands and `this` binding.
63434          * 
63435          * @private
63436          * @param {Array}
63437          *            array The array to iterate over.
63438          * @param {Function}
63439          *            iteratee The function invoked per iteration.
63440          * @returns {Array} Returns the new mapped array.
63441          */
63442         function arrayMap(array, iteratee) {
63443             var index = -1,
63444                 length = array.length,
63445                 result = Array(length);
63446
63447             while (++index < length) {
63448                 result[index] = iteratee(array[index], index, array);
63449             }
63450             return result;
63451         }
63452
63453         module.exports = arrayMap;
63454
63455     }, {}],
63456     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\arrayPush.js": [function(require, module, exports) {
63457         /**
63458          * Appends the elements of `values` to `array`.
63459          * 
63460          * @private
63461          * @param {Array}
63462          *            array The array to modify.
63463          * @param {Array}
63464          *            values The values to append.
63465          * @returns {Array} Returns `array`.
63466          */
63467         function arrayPush(array, values) {
63468             var index = -1,
63469                 length = values.length,
63470                 offset = array.length;
63471
63472             while (++index < length) {
63473                 array[offset + index] = values[index];
63474             }
63475             return array;
63476         }
63477
63478         module.exports = arrayPush;
63479
63480     }, {}],
63481     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\arrayReduce.js": [function(require, module, exports) {
63482         /**
63483          * A specialized version of `_.reduce` for arrays without support for callback
63484          * shorthands and `this` binding.
63485          * 
63486          * @private
63487          * @param {Array}
63488          *            array The array to iterate over.
63489          * @param {Function}
63490          *            iteratee The function invoked per iteration.
63491          * @param {*}
63492          *            [accumulator] The initial value.
63493          * @param {boolean}
63494          *            [initFromArray] Specify using the first element of `array` as the
63495          *            initial value.
63496          * @returns {*} Returns the accumulated value.
63497          */
63498         function arrayReduce(array, iteratee, accumulator, initFromArray) {
63499             var index = -1,
63500                 length = array.length;
63501
63502             if (initFromArray && length) {
63503                 accumulator = array[++index];
63504             }
63505             while (++index < length) {
63506                 accumulator = iteratee(accumulator, array[index], index, array);
63507             }
63508             return accumulator;
63509         }
63510
63511         module.exports = arrayReduce;
63512
63513     }, {}],
63514     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\arraySome.js": [function(require, module, exports) {
63515         /**
63516          * A specialized version of `_.some` for arrays without support for callback
63517          * shorthands and `this` binding.
63518          * 
63519          * @private
63520          * @param {Array}
63521          *            array The array to iterate over.
63522          * @param {Function}
63523          *            predicate The function invoked per iteration.
63524          * @returns {boolean} Returns `true` if any element passes the predicate check,
63525          *          else `false`.
63526          */
63527         function arraySome(array, predicate) {
63528             var index = -1,
63529                 length = array.length;
63530
63531             while (++index < length) {
63532                 if (predicate(array[index], index, array)) {
63533                     return true;
63534                 }
63535             }
63536             return false;
63537         }
63538
63539         module.exports = arraySome;
63540
63541     }, {}],
63542     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\assignWith.js": [function(require, module, exports) {
63543         var keys = require('../object/keys');
63544
63545         /**
63546          * A specialized version of `_.assign` for customizing assigned values without
63547          * support for argument juggling, multiple sources, and `this` binding
63548          * `customizer` functions.
63549          * 
63550          * @private
63551          * @param {Object}
63552          *            object The destination object.
63553          * @param {Object}
63554          *            source The source object.
63555          * @param {Function}
63556          *            customizer The function to customize assigned values.
63557          * @returns {Object} Returns `object`.
63558          */
63559         function assignWith(object, source, customizer) {
63560             var index = -1,
63561                 props = keys(source),
63562                 length = props.length;
63563
63564             while (++index < length) {
63565                 var key = props[index],
63566                     value = object[key],
63567                     result = customizer(value, source[key], key, object, source);
63568
63569                 if ((result === result ? (result !== value) : (value === value)) ||
63570                     (value === undefined && !(key in object))) {
63571                     object[key] = result;
63572                 }
63573             }
63574             return object;
63575         }
63576
63577         module.exports = assignWith;
63578
63579     }, {
63580         "../object/keys": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\keys.js"
63581     }],
63582     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseAssign.js": [function(require, module, exports) {
63583         var baseCopy = require('./baseCopy'),
63584             keys = require('../object/keys');
63585
63586         /**
63587          * The base implementation of `_.assign` without support for argument juggling,
63588          * multiple sources, and `customizer` functions.
63589          * 
63590          * @private
63591          * @param {Object}
63592          *            object The destination object.
63593          * @param {Object}
63594          *            source The source object.
63595          * @returns {Object} Returns `object`.
63596          */
63597         function baseAssign(object, source) {
63598             return source == null ? object : baseCopy(source, keys(source), object);
63599         }
63600
63601         module.exports = baseAssign;
63602
63603     }, {
63604         "../object/keys": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\keys.js",
63605         "./baseCopy": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseCopy.js"
63606     }],
63607     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseCallback.js": [function(require, module, exports) {
63608         var baseMatches = require('./baseMatches'),
63609             baseMatchesProperty = require('./baseMatchesProperty'),
63610             bindCallback = require('./bindCallback'),
63611             identity = require('../utility/identity'),
63612             property = require('../utility/property');
63613
63614         /**
63615          * The base implementation of `_.callback` which supports specifying the number
63616          * of arguments to provide to `func`.
63617          * 
63618          * @private
63619          * @param {*}
63620          *            [func=_.identity] The value to convert to a callback.
63621          * @param {*}
63622          *            [thisArg] The `this` binding of `func`.
63623          * @param {number}
63624          *            [argCount] The number of arguments to provide to `func`.
63625          * @returns {Function} Returns the callback.
63626          */
63627         function baseCallback(func, thisArg, argCount) {
63628             var type = typeof func;
63629             if (type == 'function') {
63630                 return thisArg === undefined ? func : bindCallback(func, thisArg, argCount);
63631             }
63632             if (func == null) {
63633                 return identity;
63634             }
63635             if (type == 'object') {
63636                 return baseMatches(func);
63637             }
63638             return thisArg === undefined ? property(func) : baseMatchesProperty(func, thisArg);
63639         }
63640
63641         module.exports = baseCallback;
63642
63643     }, {
63644         "../utility/identity": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\utility\\identity.js",
63645         "../utility/property": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\utility\\property.js",
63646         "./baseMatches": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseMatches.js",
63647         "./baseMatchesProperty": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseMatchesProperty.js",
63648         "./bindCallback": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\bindCallback.js"
63649     }],
63650     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseCompareAscending.js": [function(require, module, exports) {
63651         /**
63652          * The base implementation of `compareAscending` which compares values and sorts
63653          * them in ascending order without guaranteeing a stable sort.
63654          * 
63655          * @private
63656          * @param {*}
63657          *            value The value to compare.
63658          * @param {*}
63659          *            other The other value to compare.
63660          * @returns {number} Returns the sort order indicator for `value`.
63661          */
63662         function baseCompareAscending(value, other) {
63663             if (value !== other) {
63664                 var valIsNull = value === null,
63665                     valIsUndef = value === undefined,
63666                     valIsReflexive = value === value;
63667
63668                 var othIsNull = other === null,
63669                     othIsUndef = other === undefined,
63670                     othIsReflexive = other === other;
63671
63672                 if ((value > other && !othIsNull) || !valIsReflexive ||
63673                     (valIsNull && !othIsUndef && othIsReflexive) ||
63674                     (valIsUndef && othIsReflexive)) {
63675                     return 1;
63676                 }
63677                 if ((value < other && !valIsNull) || !othIsReflexive ||
63678                     (othIsNull && !valIsUndef && valIsReflexive) ||
63679                     (othIsUndef && valIsReflexive)) {
63680                     return -1;
63681                 }
63682             }
63683             return 0;
63684         }
63685
63686         module.exports = baseCompareAscending;
63687
63688     }, {}],
63689     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseCopy.js": [function(require, module, exports) {
63690         /**
63691          * Copies properties of `source` to `object`.
63692          * 
63693          * @private
63694          * @param {Object}
63695          *            source The object to copy properties from.
63696          * @param {Array}
63697          *            props The property names to copy.
63698          * @param {Object}
63699          *            [object={}] The object to copy properties to.
63700          * @returns {Object} Returns `object`.
63701          */
63702         function baseCopy(source, props, object) {
63703             object || (object = {});
63704
63705             var index = -1,
63706                 length = props.length;
63707
63708             while (++index < length) {
63709                 var key = props[index];
63710                 object[key] = source[key];
63711             }
63712             return object;
63713         }
63714
63715         module.exports = baseCopy;
63716
63717     }, {}],
63718     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseCreate.js": [function(require, module, exports) {
63719         var isObject = require('../lang/isObject');
63720
63721         /**
63722          * The base implementation of `_.create` without support for assigning
63723          * properties to the created object.
63724          * 
63725          * @private
63726          * @param {Object}
63727          *            prototype The object to inherit from.
63728          * @returns {Object} Returns the new object.
63729          */
63730         var baseCreate = (function() {
63731             function object() {}
63732             return function(prototype) {
63733                 if (isObject(prototype)) {
63734                     object.prototype = prototype;
63735                     var result = new object;
63736                     object.prototype = undefined;
63737                 }
63738                 return result || {};
63739             };
63740         }());
63741
63742         module.exports = baseCreate;
63743
63744     }, {
63745         "../lang/isObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isObject.js"
63746     }],
63747     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseDelay.js": [function(require, module, exports) {
63748         /** Used as the `TypeError` message for "Functions" methods. */
63749         var FUNC_ERROR_TEXT = 'Expected a function';
63750
63751         /**
63752          * The base implementation of `_.delay` and `_.defer` which accepts an index of
63753          * where to slice the arguments to provide to `func`.
63754          * 
63755          * @private
63756          * @param {Function}
63757          *            func The function to delay.
63758          * @param {number}
63759          *            wait The number of milliseconds to delay invocation.
63760          * @param {Object}
63761          *            args The arguments provide to `func`.
63762          * @returns {number} Returns the timer id.
63763          */
63764         function baseDelay(func, wait, args) {
63765             if (typeof func != 'function') {
63766                 throw new TypeError(FUNC_ERROR_TEXT);
63767             }
63768             return setTimeout(function() {
63769                 func.apply(undefined, args);
63770             }, wait);
63771         }
63772
63773         module.exports = baseDelay;
63774
63775     }, {}],
63776     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseDifference.js": [function(require, module, exports) {
63777         var baseIndexOf = require('./baseIndexOf'),
63778             cacheIndexOf = require('./cacheIndexOf'),
63779             createCache = require('./createCache');
63780
63781         /** Used as the size to enable large array optimizations. */
63782         var LARGE_ARRAY_SIZE = 200;
63783
63784         /**
63785          * The base implementation of `_.difference` which accepts a single array of
63786          * values to exclude.
63787          * 
63788          * @private
63789          * @param {Array}
63790          *            array The array to inspect.
63791          * @param {Array}
63792          *            values The values to exclude.
63793          * @returns {Array} Returns the new array of filtered values.
63794          */
63795         function baseDifference(array, values) {
63796             var length = array ? array.length : 0,
63797                 result = [];
63798
63799             if (!length) {
63800                 return result;
63801             }
63802             var index = -1,
63803                 indexOf = baseIndexOf,
63804                 isCommon = true,
63805                 cache = (isCommon && values.length >= LARGE_ARRAY_SIZE) ? createCache(values) : null,
63806                 valuesLength = values.length;
63807
63808             if (cache) {
63809                 indexOf = cacheIndexOf;
63810                 isCommon = false;
63811                 values = cache;
63812             }
63813             outer:
63814                 while (++index < length) {
63815                     var value = array[index];
63816
63817                     if (isCommon && value === value) {
63818                         var valuesIndex = valuesLength;
63819                         while (valuesIndex--) {
63820                             if (values[valuesIndex] === value) {
63821                                 continue outer;
63822                             }
63823                         }
63824                         result.push(value);
63825                     } else if (indexOf(values, value, 0) < 0) {
63826                         result.push(value);
63827                     }
63828                 }
63829             return result;
63830         }
63831
63832         module.exports = baseDifference;
63833
63834     }, {
63835         "./baseIndexOf": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseIndexOf.js",
63836         "./cacheIndexOf": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\cacheIndexOf.js",
63837         "./createCache": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createCache.js"
63838     }],
63839     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseEach.js": [function(require, module, exports) {
63840         var baseForOwn = require('./baseForOwn'),
63841             createBaseEach = require('./createBaseEach');
63842
63843         /**
63844          * The base implementation of `_.forEach` without support for callback
63845          * shorthands and `this` binding.
63846          * 
63847          * @private
63848          * @param {Array|Object|string}
63849          *            collection The collection to iterate over.
63850          * @param {Function}
63851          *            iteratee The function invoked per iteration.
63852          * @returns {Array|Object|string} Returns `collection`.
63853          */
63854         var baseEach = createBaseEach(baseForOwn);
63855
63856         module.exports = baseEach;
63857
63858     }, {
63859         "./baseForOwn": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseForOwn.js",
63860         "./createBaseEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createBaseEach.js"
63861     }],
63862     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseEvery.js": [function(require, module, exports) {
63863         var baseEach = require('./baseEach');
63864
63865         /**
63866          * The base implementation of `_.every` without support for callback shorthands
63867          * and `this` binding.
63868          * 
63869          * @private
63870          * @param {Array|Object|string}
63871          *            collection The collection to iterate over.
63872          * @param {Function}
63873          *            predicate The function invoked per iteration.
63874          * @returns {boolean} Returns `true` if all elements pass the predicate check,
63875          *          else `false`
63876          */
63877         function baseEvery(collection, predicate) {
63878             var result = true;
63879             baseEach(collection, function(value, index, collection) {
63880                 result = !!predicate(value, index, collection);
63881                 return result;
63882             });
63883             return result;
63884         }
63885
63886         module.exports = baseEvery;
63887
63888     }, {
63889         "./baseEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseEach.js"
63890     }],
63891     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseFilter.js": [function(require, module, exports) {
63892         var baseEach = require('./baseEach');
63893
63894         /**
63895          * The base implementation of `_.filter` without support for callback shorthands
63896          * and `this` binding.
63897          * 
63898          * @private
63899          * @param {Array|Object|string}
63900          *            collection The collection to iterate over.
63901          * @param {Function}
63902          *            predicate The function invoked per iteration.
63903          * @returns {Array} Returns the new filtered array.
63904          */
63905         function baseFilter(collection, predicate) {
63906             var result = [];
63907             baseEach(collection, function(value, index, collection) {
63908                 if (predicate(value, index, collection)) {
63909                     result.push(value);
63910                 }
63911             });
63912             return result;
63913         }
63914
63915         module.exports = baseFilter;
63916
63917     }, {
63918         "./baseEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseEach.js"
63919     }],
63920     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseFind.js": [function(require, module, exports) {
63921         /**
63922          * The base implementation of `_.find`, `_.findLast`, `_.findKey`, and
63923          * `_.findLastKey`, without support for callback shorthands and `this` binding,
63924          * which iterates over `collection` using the provided `eachFunc`.
63925          * 
63926          * @private
63927          * @param {Array|Object|string}
63928          *            collection The collection to search.
63929          * @param {Function}
63930          *            predicate The function invoked per iteration.
63931          * @param {Function}
63932          *            eachFunc The function to iterate over `collection`.
63933          * @param {boolean}
63934          *            [retKey] Specify returning the key of the found element instead of
63935          *            the element itself.
63936          * @returns {*} Returns the found element or its key, else `undefined`.
63937          */
63938         function baseFind(collection, predicate, eachFunc, retKey) {
63939             var result;
63940             eachFunc(collection, function(value, key, collection) {
63941                 if (predicate(value, key, collection)) {
63942                     result = retKey ? key : value;
63943                     return false;
63944                 }
63945             });
63946             return result;
63947         }
63948
63949         module.exports = baseFind;
63950
63951     }, {}],
63952     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseFindIndex.js": [function(require, module, exports) {
63953         /**
63954          * The base implementation of `_.findIndex` and `_.findLastIndex` without
63955          * support for callback shorthands and `this` binding.
63956          * 
63957          * @private
63958          * @param {Array}
63959          *            array The array to search.
63960          * @param {Function}
63961          *            predicate The function invoked per iteration.
63962          * @param {boolean}
63963          *            [fromRight] Specify iterating from right to left.
63964          * @returns {number} Returns the index of the matched value, else `-1`.
63965          */
63966         function baseFindIndex(array, predicate, fromRight) {
63967             var length = array.length,
63968                 index = fromRight ? length : -1;
63969
63970             while ((fromRight ? index-- : ++index < length)) {
63971                 if (predicate(array[index], index, array)) {
63972                     return index;
63973                 }
63974             }
63975             return -1;
63976         }
63977
63978         module.exports = baseFindIndex;
63979
63980     }, {}],
63981     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseFlatten.js": [function(require, module, exports) {
63982         var arrayPush = require('./arrayPush'),
63983             isArguments = require('../lang/isArguments'),
63984             isArray = require('../lang/isArray'),
63985             isArrayLike = require('./isArrayLike'),
63986             isObjectLike = require('./isObjectLike');
63987
63988         /**
63989          * The base implementation of `_.flatten` with added support for restricting
63990          * flattening and specifying the start index.
63991          * 
63992          * @private
63993          * @param {Array}
63994          *            array The array to flatten.
63995          * @param {boolean}
63996          *            [isDeep] Specify a deep flatten.
63997          * @param {boolean}
63998          *            [isStrict] Restrict flattening to arrays-like objects.
63999          * @param {Array}
64000          *            [result=[]] The initial result value.
64001          * @returns {Array} Returns the new flattened array.
64002          */
64003         function baseFlatten(array, isDeep, isStrict, result) {
64004             result || (result = []);
64005
64006             var index = -1,
64007                 length = array.length;
64008
64009             while (++index < length) {
64010                 var value = array[index];
64011                 if (isObjectLike(value) && isArrayLike(value) &&
64012                     (isStrict || isArray(value) || isArguments(value))) {
64013                     if (isDeep) {
64014                         // Recursively flatten arrays (susceptible to call stack limits).
64015                         baseFlatten(value, isDeep, isStrict, result);
64016                     } else {
64017                         arrayPush(result, value);
64018                     }
64019                 } else if (!isStrict) {
64020                     result[result.length] = value;
64021                 }
64022             }
64023             return result;
64024         }
64025
64026         module.exports = baseFlatten;
64027
64028     }, {
64029         "../lang/isArguments": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArguments.js",
64030         "../lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js",
64031         "./arrayPush": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\arrayPush.js",
64032         "./isArrayLike": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isArrayLike.js",
64033         "./isObjectLike": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isObjectLike.js"
64034     }],
64035     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseFor.js": [function(require, module, exports) {
64036         var createBaseFor = require('./createBaseFor');
64037
64038         /**
64039          * The base implementation of `baseForIn` and `baseForOwn` which iterates over
64040          * `object` properties returned by `keysFunc` invoking `iteratee` for each
64041          * property. Iteratee functions may exit iteration early by explicitly returning
64042          * `false`.
64043          * 
64044          * @private
64045          * @param {Object}
64046          *            object The object to iterate over.
64047          * @param {Function}
64048          *            iteratee The function invoked per iteration.
64049          * @param {Function}
64050          *            keysFunc The function to get the keys of `object`.
64051          * @returns {Object} Returns `object`.
64052          */
64053         var baseFor = createBaseFor();
64054
64055         module.exports = baseFor;
64056
64057     }, {
64058         "./createBaseFor": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createBaseFor.js"
64059     }],
64060     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseForIn.js": [function(require, module, exports) {
64061         var baseFor = require('./baseFor'),
64062             keysIn = require('../object/keysIn');
64063
64064         /**
64065          * The base implementation of `_.forIn` without support for callback shorthands
64066          * and `this` binding.
64067          * 
64068          * @private
64069          * @param {Object}
64070          *            object The object to iterate over.
64071          * @param {Function}
64072          *            iteratee The function invoked per iteration.
64073          * @returns {Object} Returns `object`.
64074          */
64075         function baseForIn(object, iteratee) {
64076             return baseFor(object, iteratee, keysIn);
64077         }
64078
64079         module.exports = baseForIn;
64080
64081     }, {
64082         "../object/keysIn": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\keysIn.js",
64083         "./baseFor": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseFor.js"
64084     }],
64085     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseForOwn.js": [function(require, module, exports) {
64086         var baseFor = require('./baseFor'),
64087             keys = require('../object/keys');
64088
64089         /**
64090          * The base implementation of `_.forOwn` without support for callback shorthands
64091          * and `this` binding.
64092          * 
64093          * @private
64094          * @param {Object}
64095          *            object The object to iterate over.
64096          * @param {Function}
64097          *            iteratee The function invoked per iteration.
64098          * @returns {Object} Returns `object`.
64099          */
64100         function baseForOwn(object, iteratee) {
64101             return baseFor(object, iteratee, keys);
64102         }
64103
64104         module.exports = baseForOwn;
64105
64106     }, {
64107         "../object/keys": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\keys.js",
64108         "./baseFor": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseFor.js"
64109     }],
64110     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseGet.js": [function(require, module, exports) {
64111         var toObject = require('./toObject');
64112
64113         /**
64114          * The base implementation of `get` without support for string paths and default
64115          * values.
64116          * 
64117          * @private
64118          * @param {Object}
64119          *            object The object to query.
64120          * @param {Array}
64121          *            path The path of the property to get.
64122          * @param {string}
64123          *            [pathKey] The key representation of path.
64124          * @returns {*} Returns the resolved value.
64125          */
64126         function baseGet(object, path, pathKey) {
64127             if (object == null) {
64128                 return;
64129             }
64130             if (pathKey !== undefined && pathKey in toObject(object)) {
64131                 path = [pathKey];
64132             }
64133             var index = 0,
64134                 length = path.length;
64135
64136             while (object != null && index < length) {
64137                 object = object[path[index++]];
64138             }
64139             return (index && index == length) ? object : undefined;
64140         }
64141
64142         module.exports = baseGet;
64143
64144     }, {
64145         "./toObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\toObject.js"
64146     }],
64147     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseIndexOf.js": [function(require, module, exports) {
64148         var indexOfNaN = require('./indexOfNaN');
64149
64150         /**
64151          * The base implementation of `_.indexOf` without support for binary searches.
64152          * 
64153          * @private
64154          * @param {Array}
64155          *            array The array to search.
64156          * @param {*}
64157          *            value The value to search for.
64158          * @param {number}
64159          *            fromIndex The index to search from.
64160          * @returns {number} Returns the index of the matched value, else `-1`.
64161          */
64162         function baseIndexOf(array, value, fromIndex) {
64163             if (value !== value) {
64164                 return indexOfNaN(array, fromIndex);
64165             }
64166             var index = fromIndex - 1,
64167                 length = array.length;
64168
64169             while (++index < length) {
64170                 if (array[index] === value) {
64171                     return index;
64172                 }
64173             }
64174             return -1;
64175         }
64176
64177         module.exports = baseIndexOf;
64178
64179     }, {
64180         "./indexOfNaN": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\indexOfNaN.js"
64181     }],
64182     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseIsEqual.js": [function(require, module, exports) {
64183         var baseIsEqualDeep = require('./baseIsEqualDeep'),
64184             isObject = require('../lang/isObject'),
64185             isObjectLike = require('./isObjectLike');
64186
64187         /**
64188          * The base implementation of `_.isEqual` without support for `this` binding
64189          * `customizer` functions.
64190          * 
64191          * @private
64192          * @param {*}
64193          *            value The value to compare.
64194          * @param {*}
64195          *            other The other value to compare.
64196          * @param {Function}
64197          *            [customizer] The function to customize comparing values.
64198          * @param {boolean}
64199          *            [isLoose] Specify performing partial comparisons.
64200          * @param {Array}
64201          *            [stackA] Tracks traversed `value` objects.
64202          * @param {Array}
64203          *            [stackB] Tracks traversed `other` objects.
64204          * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
64205          */
64206         function baseIsEqual(value, other, customizer, isLoose, stackA, stackB) {
64207             if (value === other) {
64208                 return true;
64209             }
64210             if (value == null || other == null || (!isObject(value) && !isObjectLike(other))) {
64211                 return value !== value && other !== other;
64212             }
64213             return baseIsEqualDeep(value, other, baseIsEqual, customizer, isLoose, stackA, stackB);
64214         }
64215
64216         module.exports = baseIsEqual;
64217
64218     }, {
64219         "../lang/isObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isObject.js",
64220         "./baseIsEqualDeep": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseIsEqualDeep.js",
64221         "./isObjectLike": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isObjectLike.js"
64222     }],
64223     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseIsEqualDeep.js": [function(require, module, exports) {
64224         var equalArrays = require('./equalArrays'),
64225             equalByTag = require('./equalByTag'),
64226             equalObjects = require('./equalObjects'),
64227             isArray = require('../lang/isArray'),
64228             isTypedArray = require('../lang/isTypedArray');
64229
64230         /** `Object#toString` result references. */
64231         var argsTag = '[object Arguments]',
64232             arrayTag = '[object Array]',
64233             objectTag = '[object Object]';
64234
64235         /** Used for native method references. */
64236         var objectProto = Object.prototype;
64237
64238         /** Used to check objects for own properties. */
64239         var hasOwnProperty = objectProto.hasOwnProperty;
64240
64241         /**
64242          * Used to resolve the
64243          * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
64244          * of values.
64245          */
64246         var objToString = objectProto.toString;
64247
64248         /**
64249          * A specialized version of `baseIsEqual` for arrays and objects which performs
64250          * deep comparisons and tracks traversed objects enabling objects with circular
64251          * references to be compared.
64252          * 
64253          * @private
64254          * @param {Object}
64255          *            object The object to compare.
64256          * @param {Object}
64257          *            other The other object to compare.
64258          * @param {Function}
64259          *            equalFunc The function to determine equivalents of values.
64260          * @param {Function}
64261          *            [customizer] The function to customize comparing objects.
64262          * @param {boolean}
64263          *            [isLoose] Specify performing partial comparisons.
64264          * @param {Array}
64265          *            [stackA=[]] Tracks traversed `value` objects.
64266          * @param {Array}
64267          *            [stackB=[]] Tracks traversed `other` objects.
64268          * @returns {boolean} Returns `true` if the objects are equivalent, else
64269          *          `false`.
64270          */
64271         function baseIsEqualDeep(object, other, equalFunc, customizer, isLoose, stackA, stackB) {
64272             var objIsArr = isArray(object),
64273                 othIsArr = isArray(other),
64274                 objTag = arrayTag,
64275                 othTag = arrayTag;
64276
64277             if (!objIsArr) {
64278                 objTag = objToString.call(object);
64279                 if (objTag == argsTag) {
64280                     objTag = objectTag;
64281                 } else if (objTag != objectTag) {
64282                     objIsArr = isTypedArray(object);
64283                 }
64284             }
64285             if (!othIsArr) {
64286                 othTag = objToString.call(other);
64287                 if (othTag == argsTag) {
64288                     othTag = objectTag;
64289                 } else if (othTag != objectTag) {
64290                     othIsArr = isTypedArray(other);
64291                 }
64292             }
64293             var objIsObj = objTag == objectTag,
64294                 othIsObj = othTag == objectTag,
64295                 isSameTag = objTag == othTag;
64296
64297             if (isSameTag && !(objIsArr || objIsObj)) {
64298                 return equalByTag(object, other, objTag);
64299             }
64300             if (!isLoose) {
64301                 var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
64302                     othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
64303
64304                 if (objIsWrapped || othIsWrapped) {
64305                     return equalFunc(objIsWrapped ? object.value() : object, othIsWrapped ? other.value() : other, customizer, isLoose, stackA, stackB);
64306                 }
64307             }
64308             if (!isSameTag) {
64309                 return false;
64310             }
64311             // Assume cyclic values are equal.
64312             // For more information on detecting circular references see
64313             // https://es5.github.io/#JO.
64314             stackA || (stackA = []);
64315             stackB || (stackB = []);
64316
64317             var length = stackA.length;
64318             while (length--) {
64319                 if (stackA[length] == object) {
64320                     return stackB[length] == other;
64321                 }
64322             }
64323             // Add `object` and `other` to the stack of traversed objects.
64324             stackA.push(object);
64325             stackB.push(other);
64326
64327             var result = (objIsArr ? equalArrays : equalObjects)(object, other, equalFunc, customizer, isLoose, stackA, stackB);
64328
64329             stackA.pop();
64330             stackB.pop();
64331
64332             return result;
64333         }
64334
64335         module.exports = baseIsEqualDeep;
64336
64337     }, {
64338         "../lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js",
64339         "../lang/isTypedArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isTypedArray.js",
64340         "./equalArrays": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\equalArrays.js",
64341         "./equalByTag": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\equalByTag.js",
64342         "./equalObjects": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\equalObjects.js"
64343     }],
64344     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseIsMatch.js": [function(require, module, exports) {
64345         var baseIsEqual = require('./baseIsEqual'),
64346             toObject = require('./toObject');
64347
64348         /**
64349          * The base implementation of `_.isMatch` without support for callback
64350          * shorthands and `this` binding.
64351          * 
64352          * @private
64353          * @param {Object}
64354          *            object The object to inspect.
64355          * @param {Array}
64356          *            matchData The propery names, values, and compare flags to match.
64357          * @param {Function}
64358          *            [customizer] The function to customize comparing objects.
64359          * @returns {boolean} Returns `true` if `object` is a match, else `false`.
64360          */
64361         function baseIsMatch(object, matchData, customizer) {
64362             var index = matchData.length,
64363                 length = index,
64364                 noCustomizer = !customizer;
64365
64366             if (object == null) {
64367                 return !length;
64368             }
64369             object = toObject(object);
64370             while (index--) {
64371                 var data = matchData[index];
64372                 if ((noCustomizer && data[2]) ? data[1] !== object[data[0]] : !(data[0] in object)) {
64373                     return false;
64374                 }
64375             }
64376             while (++index < length) {
64377                 data = matchData[index];
64378                 var key = data[0],
64379                     objValue = object[key],
64380                     srcValue = data[1];
64381
64382                 if (noCustomizer && data[2]) {
64383                     if (objValue === undefined && !(key in object)) {
64384                         return false;
64385                     }
64386                 } else {
64387                     var result = customizer ? customizer(objValue, srcValue, key) : undefined;
64388                     if (!(result === undefined ? baseIsEqual(srcValue, objValue, customizer, true) : result)) {
64389                         return false;
64390                     }
64391                 }
64392             }
64393             return true;
64394         }
64395
64396         module.exports = baseIsMatch;
64397
64398     }, {
64399         "./baseIsEqual": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseIsEqual.js",
64400         "./toObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\toObject.js"
64401     }],
64402     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseLodash.js": [function(require, module, exports) {
64403         /**
64404          * The function whose prototype all chaining wrappers inherit from.
64405          * 
64406          * @private
64407          */
64408         function baseLodash() {
64409             // No operation performed.
64410         }
64411
64412         module.exports = baseLodash;
64413
64414     }, {}],
64415     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseMap.js": [function(require, module, exports) {
64416         var baseEach = require('./baseEach'),
64417             isArrayLike = require('./isArrayLike');
64418
64419         /**
64420          * The base implementation of `_.map` without support for callback shorthands
64421          * and `this` binding.
64422          * 
64423          * @private
64424          * @param {Array|Object|string}
64425          *            collection The collection to iterate over.
64426          * @param {Function}
64427          *            iteratee The function invoked per iteration.
64428          * @returns {Array} Returns the new mapped array.
64429          */
64430         function baseMap(collection, iteratee) {
64431             var index = -1,
64432                 result = isArrayLike(collection) ? Array(collection.length) : [];
64433
64434             baseEach(collection, function(value, key, collection) {
64435                 result[++index] = iteratee(value, key, collection);
64436             });
64437             return result;
64438         }
64439
64440         module.exports = baseMap;
64441
64442     }, {
64443         "./baseEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseEach.js",
64444         "./isArrayLike": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isArrayLike.js"
64445     }],
64446     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseMatches.js": [function(require, module, exports) {
64447         var baseIsMatch = require('./baseIsMatch'),
64448             getMatchData = require('./getMatchData'),
64449             toObject = require('./toObject');
64450
64451         /**
64452          * The base implementation of `_.matches` which does not clone `source`.
64453          * 
64454          * @private
64455          * @param {Object}
64456          *            source The object of property values to match.
64457          * @returns {Function} Returns the new function.
64458          */
64459         function baseMatches(source) {
64460             var matchData = getMatchData(source);
64461             if (matchData.length == 1 && matchData[0][2]) {
64462                 var key = matchData[0][0],
64463                     value = matchData[0][1];
64464
64465                 return function(object) {
64466                     if (object == null) {
64467                         return false;
64468                     }
64469                     return object[key] === value && (value !== undefined || (key in toObject(object)));
64470                 };
64471             }
64472             return function(object) {
64473                 return baseIsMatch(object, matchData);
64474             };
64475         }
64476
64477         module.exports = baseMatches;
64478
64479     }, {
64480         "./baseIsMatch": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseIsMatch.js",
64481         "./getMatchData": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\getMatchData.js",
64482         "./toObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\toObject.js"
64483     }],
64484     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseMatchesProperty.js": [function(require, module, exports) {
64485         var baseGet = require('./baseGet'),
64486             baseIsEqual = require('./baseIsEqual'),
64487             baseSlice = require('./baseSlice'),
64488             isArray = require('../lang/isArray'),
64489             isKey = require('./isKey'),
64490             isStrictComparable = require('./isStrictComparable'),
64491             last = require('../array/last'),
64492             toObject = require('./toObject'),
64493             toPath = require('./toPath');
64494
64495         /**
64496          * The base implementation of `_.matchesProperty` which does not clone
64497          * `srcValue`.
64498          * 
64499          * @private
64500          * @param {string}
64501          *            path The path of the property to get.
64502          * @param {*}
64503          *            srcValue The value to compare.
64504          * @returns {Function} Returns the new function.
64505          */
64506         function baseMatchesProperty(path, srcValue) {
64507             var isArr = isArray(path),
64508                 isCommon = isKey(path) && isStrictComparable(srcValue),
64509                 pathKey = (path + '');
64510
64511             path = toPath(path);
64512             return function(object) {
64513                 if (object == null) {
64514                     return false;
64515                 }
64516                 var key = pathKey;
64517                 object = toObject(object);
64518                 if ((isArr || !isCommon) && !(key in object)) {
64519                     object = path.length == 1 ? object : baseGet(object, baseSlice(path, 0, -1));
64520                     if (object == null) {
64521                         return false;
64522                     }
64523                     key = last(path);
64524                     object = toObject(object);
64525                 }
64526                 return object[key] === srcValue ? (srcValue !== undefined || (key in object)) : baseIsEqual(srcValue, object[key], undefined, true);
64527             };
64528         }
64529
64530         module.exports = baseMatchesProperty;
64531
64532     }, {
64533         "../array/last": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\array\\last.js",
64534         "../lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js",
64535         "./baseGet": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseGet.js",
64536         "./baseIsEqual": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseIsEqual.js",
64537         "./baseSlice": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseSlice.js",
64538         "./isKey": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isKey.js",
64539         "./isStrictComparable": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isStrictComparable.js",
64540         "./toObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\toObject.js",
64541         "./toPath": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\toPath.js"
64542     }],
64543     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseMerge.js": [function(require, module, exports) {
64544         var arrayEach = require('./arrayEach'),
64545             baseMergeDeep = require('./baseMergeDeep'),
64546             isArray = require('../lang/isArray'),
64547             isArrayLike = require('./isArrayLike'),
64548             isObject = require('../lang/isObject'),
64549             isObjectLike = require('./isObjectLike'),
64550             isTypedArray = require('../lang/isTypedArray'),
64551             keys = require('../object/keys');
64552
64553         /**
64554          * The base implementation of `_.merge` without support for argument juggling,
64555          * multiple sources, and `this` binding `customizer` functions.
64556          * 
64557          * @private
64558          * @param {Object}
64559          *            object The destination object.
64560          * @param {Object}
64561          *            source The source object.
64562          * @param {Function}
64563          *            [customizer] The function to customize merged values.
64564          * @param {Array}
64565          *            [stackA=[]] Tracks traversed source objects.
64566          * @param {Array}
64567          *            [stackB=[]] Associates values with source counterparts.
64568          * @returns {Object} Returns `object`.
64569          */
64570         function baseMerge(object, source, customizer, stackA, stackB) {
64571             if (!isObject(object)) {
64572                 return object;
64573             }
64574             var isSrcArr = isArrayLike(source) && (isArray(source) || isTypedArray(source)),
64575                 props = isSrcArr ? undefined : keys(source);
64576
64577             arrayEach(props || source, function(srcValue, key) {
64578                 if (props) {
64579                     key = srcValue;
64580                     srcValue = source[key];
64581                 }
64582                 if (isObjectLike(srcValue)) {
64583                     stackA || (stackA = []);
64584                     stackB || (stackB = []);
64585                     baseMergeDeep(object, source, key, baseMerge, customizer, stackA, stackB);
64586                 } else {
64587                     var value = object[key],
64588                         result = customizer ? customizer(value, srcValue, key, object, source) : undefined,
64589                         isCommon = result === undefined;
64590
64591                     if (isCommon) {
64592                         result = srcValue;
64593                     }
64594                     if ((result !== undefined || (isSrcArr && !(key in object))) &&
64595                         (isCommon || (result === result ? (result !== value) : (value === value)))) {
64596                         object[key] = result;
64597                     }
64598                 }
64599             });
64600             return object;
64601         }
64602
64603         module.exports = baseMerge;
64604
64605     }, {
64606         "../lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js",
64607         "../lang/isObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isObject.js",
64608         "../lang/isTypedArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isTypedArray.js",
64609         "../object/keys": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\keys.js",
64610         "./arrayEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\arrayEach.js",
64611         "./baseMergeDeep": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseMergeDeep.js",
64612         "./isArrayLike": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isArrayLike.js",
64613         "./isObjectLike": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isObjectLike.js"
64614     }],
64615     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseMergeDeep.js": [function(require, module, exports) {
64616         var arrayCopy = require('./arrayCopy'),
64617             isArguments = require('../lang/isArguments'),
64618             isArray = require('../lang/isArray'),
64619             isArrayLike = require('./isArrayLike'),
64620             isPlainObject = require('../lang/isPlainObject'),
64621             isTypedArray = require('../lang/isTypedArray'),
64622             toPlainObject = require('../lang/toPlainObject');
64623
64624         /**
64625          * A specialized version of `baseMerge` for arrays and objects which performs
64626          * deep merges and tracks traversed objects enabling objects with circular
64627          * references to be merged.
64628          * 
64629          * @private
64630          * @param {Object}
64631          *            object The destination object.
64632          * @param {Object}
64633          *            source The source object.
64634          * @param {string}
64635          *            key The key of the value to merge.
64636          * @param {Function}
64637          *            mergeFunc The function to merge values.
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 {boolean} Returns `true` if the objects are equivalent, else
64645          *          `false`.
64646          */
64647         function baseMergeDeep(object, source, key, mergeFunc, customizer, stackA, stackB) {
64648             var length = stackA.length,
64649                 srcValue = source[key];
64650
64651             while (length--) {
64652                 if (stackA[length] == srcValue) {
64653                     object[key] = stackB[length];
64654                     return;
64655                 }
64656             }
64657             var value = object[key],
64658                 result = customizer ? customizer(value, srcValue, key, object, source) : undefined,
64659                 isCommon = result === undefined;
64660
64661             if (isCommon) {
64662                 result = srcValue;
64663                 if (isArrayLike(srcValue) && (isArray(srcValue) || isTypedArray(srcValue))) {
64664                     result = isArray(value) ? value : (isArrayLike(value) ? arrayCopy(value) : []);
64665                 } else if (isPlainObject(srcValue) || isArguments(srcValue)) {
64666                     result = isArguments(value) ? toPlainObject(value) : (isPlainObject(value) ? value : {});
64667                 } else {
64668                     isCommon = false;
64669                 }
64670             }
64671             // Add the source value to the stack of traversed objects and associate
64672             // it with its merged value.
64673             stackA.push(srcValue);
64674             stackB.push(result);
64675
64676             if (isCommon) {
64677                 // Recursively merge objects and arrays (susceptible to call stack limits).
64678                 object[key] = mergeFunc(result, srcValue, customizer, stackA, stackB);
64679             } else if (result === result ? (result !== value) : (value === value)) {
64680                 object[key] = result;
64681             }
64682         }
64683
64684         module.exports = baseMergeDeep;
64685
64686     }, {
64687         "../lang/isArguments": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArguments.js",
64688         "../lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js",
64689         "../lang/isPlainObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isPlainObject.js",
64690         "../lang/isTypedArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isTypedArray.js",
64691         "../lang/toPlainObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\toPlainObject.js",
64692         "./arrayCopy": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\arrayCopy.js",
64693         "./isArrayLike": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isArrayLike.js"
64694     }],
64695     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseProperty.js": [function(require, module, exports) {
64696         /**
64697          * The base implementation of `_.property` without support for deep paths.
64698          * 
64699          * @private
64700          * @param {string}
64701          *            key The key of the property to get.
64702          * @returns {Function} Returns the new function.
64703          */
64704         function baseProperty(key) {
64705             return function(object) {
64706                 return object == null ? undefined : object[key];
64707             };
64708         }
64709
64710         module.exports = baseProperty;
64711
64712     }, {}],
64713     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\basePropertyDeep.js": [function(require, module, exports) {
64714         var baseGet = require('./baseGet'),
64715             toPath = require('./toPath');
64716
64717         /**
64718          * A specialized version of `baseProperty` which supports deep paths.
64719          * 
64720          * @private
64721          * @param {Array|string}
64722          *            path The path of the property to get.
64723          * @returns {Function} Returns the new function.
64724          */
64725         function basePropertyDeep(path) {
64726             var pathKey = (path + '');
64727             path = toPath(path);
64728             return function(object) {
64729                 return baseGet(object, path, pathKey);
64730             };
64731         }
64732
64733         module.exports = basePropertyDeep;
64734
64735     }, {
64736         "./baseGet": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseGet.js",
64737         "./toPath": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\toPath.js"
64738     }],
64739     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseReduce.js": [function(require, module, exports) {
64740         /**
64741          * The base implementation of `_.reduce` and `_.reduceRight` without support for
64742          * callback shorthands and `this` binding, which iterates over `collection`
64743          * using the provided `eachFunc`.
64744          * 
64745          * @private
64746          * @param {Array|Object|string}
64747          *            collection The collection to iterate over.
64748          * @param {Function}
64749          *            iteratee The function invoked per iteration.
64750          * @param {*}
64751          *            accumulator The initial value.
64752          * @param {boolean}
64753          *            initFromCollection Specify using the first or last element of
64754          *            `collection` as the initial value.
64755          * @param {Function}
64756          *            eachFunc The function to iterate over `collection`.
64757          * @returns {*} Returns the accumulated value.
64758          */
64759         function baseReduce(collection, iteratee, accumulator, initFromCollection, eachFunc) {
64760             eachFunc(collection, function(value, index, collection) {
64761                 accumulator = initFromCollection ? (initFromCollection = false, value) : iteratee(accumulator, value, index, collection);
64762             });
64763             return accumulator;
64764         }
64765
64766         module.exports = baseReduce;
64767
64768     }, {}],
64769     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseSetData.js": [function(require, module, exports) {
64770         var identity = require('../utility/identity'),
64771             metaMap = require('./metaMap');
64772
64773         /**
64774          * The base implementation of `setData` without support for hot loop detection.
64775          * 
64776          * @private
64777          * @param {Function}
64778          *            func The function to associate metadata with.
64779          * @param {*}
64780          *            data The metadata.
64781          * @returns {Function} Returns `func`.
64782          */
64783         var baseSetData = !metaMap ? identity : function(func, data) {
64784             metaMap.set(func, data);
64785             return func;
64786         };
64787
64788         module.exports = baseSetData;
64789
64790     }, {
64791         "../utility/identity": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\utility\\identity.js",
64792         "./metaMap": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\metaMap.js"
64793     }],
64794     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseSlice.js": [function(require, module, exports) {
64795         /**
64796          * The base implementation of `_.slice` without an iteratee call guard.
64797          * 
64798          * @private
64799          * @param {Array}
64800          *            array The array to slice.
64801          * @param {number}
64802          *            [start=0] The start position.
64803          * @param {number}
64804          *            [end=array.length] The end position.
64805          * @returns {Array} Returns the slice of `array`.
64806          */
64807         function baseSlice(array, start, end) {
64808             var index = -1,
64809                 length = array.length;
64810
64811             start = start == null ? 0 : (+start || 0);
64812             if (start < 0) {
64813                 start = -start > length ? 0 : (length + start);
64814             }
64815             end = (end === undefined || end > length) ? length : (+end || 0);
64816             if (end < 0) {
64817                 end += length;
64818             }
64819             length = start > end ? 0 : ((end - start) >>> 0);
64820             start >>>= 0;
64821
64822             var result = Array(length);
64823             while (++index < length) {
64824                 result[index] = array[index + start];
64825             }
64826             return result;
64827         }
64828
64829         module.exports = baseSlice;
64830
64831     }, {}],
64832     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseSome.js": [function(require, module, exports) {
64833         var baseEach = require('./baseEach');
64834
64835         /**
64836          * The base implementation of `_.some` without support for callback shorthands
64837          * and `this` binding.
64838          * 
64839          * @private
64840          * @param {Array|Object|string}
64841          *            collection The collection to iterate over.
64842          * @param {Function}
64843          *            predicate The function invoked per iteration.
64844          * @returns {boolean} Returns `true` if any element passes the predicate check,
64845          *          else `false`.
64846          */
64847         function baseSome(collection, predicate) {
64848             var result;
64849
64850             baseEach(collection, function(value, index, collection) {
64851                 result = predicate(value, index, collection);
64852                 return !result;
64853             });
64854             return !!result;
64855         }
64856
64857         module.exports = baseSome;
64858
64859     }, {
64860         "./baseEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseEach.js"
64861     }],
64862     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseSortBy.js": [function(require, module, exports) {
64863         /**
64864          * The base implementation of `_.sortBy` which uses `comparer` to define the
64865          * sort order of `array` and replaces criteria objects with their corresponding
64866          * values.
64867          * 
64868          * @private
64869          * @param {Array}
64870          *            array The array to sort.
64871          * @param {Function}
64872          *            comparer The function to define sort order.
64873          * @returns {Array} Returns `array`.
64874          */
64875         function baseSortBy(array, comparer) {
64876             var length = array.length;
64877
64878             array.sort(comparer);
64879             while (length--) {
64880                 array[length] = array[length].value;
64881             }
64882             return array;
64883         }
64884
64885         module.exports = baseSortBy;
64886
64887     }, {}],
64888     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseToString.js": [function(require, module, exports) {
64889         /**
64890          * Converts `value` to a string if it's not one. An empty string is returned for
64891          * `null` or `undefined` values.
64892          * 
64893          * @private
64894          * @param {*}
64895          *            value The value to process.
64896          * @returns {string} Returns the string.
64897          */
64898         function baseToString(value) {
64899             return value == null ? '' : (value + '');
64900         }
64901
64902         module.exports = baseToString;
64903
64904     }, {}],
64905     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseUniq.js": [function(require, module, exports) {
64906         var baseIndexOf = require('./baseIndexOf'),
64907             cacheIndexOf = require('./cacheIndexOf'),
64908             createCache = require('./createCache');
64909
64910         /** Used as the size to enable large array optimizations. */
64911         var LARGE_ARRAY_SIZE = 200;
64912
64913         /**
64914          * The base implementation of `_.uniq` without support for callback shorthands
64915          * and `this` binding.
64916          * 
64917          * @private
64918          * @param {Array}
64919          *            array The array to inspect.
64920          * @param {Function}
64921          *            [iteratee] The function invoked per iteration.
64922          * @returns {Array} Returns the new duplicate free array.
64923          */
64924         function baseUniq(array, iteratee) {
64925             var index = -1,
64926                 indexOf = baseIndexOf,
64927                 length = array.length,
64928                 isCommon = true,
64929                 isLarge = isCommon && length >= LARGE_ARRAY_SIZE,
64930                 seen = isLarge ? createCache() : null,
64931                 result = [];
64932
64933             if (seen) {
64934                 indexOf = cacheIndexOf;
64935                 isCommon = false;
64936             } else {
64937                 isLarge = false;
64938                 seen = iteratee ? [] : result;
64939             }
64940             outer:
64941                 while (++index < length) {
64942                     var value = array[index],
64943                         computed = iteratee ? iteratee(value, index, array) : value;
64944
64945                     if (isCommon && value === value) {
64946                         var seenIndex = seen.length;
64947                         while (seenIndex--) {
64948                             if (seen[seenIndex] === computed) {
64949                                 continue outer;
64950                             }
64951                         }
64952                         if (iteratee) {
64953                             seen.push(computed);
64954                         }
64955                         result.push(value);
64956                     } else if (indexOf(seen, computed, 0) < 0) {
64957                         if (iteratee || isLarge) {
64958                             seen.push(computed);
64959                         }
64960                         result.push(value);
64961                     }
64962                 }
64963             return result;
64964         }
64965
64966         module.exports = baseUniq;
64967
64968     }, {
64969         "./baseIndexOf": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseIndexOf.js",
64970         "./cacheIndexOf": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\cacheIndexOf.js",
64971         "./createCache": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createCache.js"
64972     }],
64973     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseValues.js": [function(require, module, exports) {
64974         /**
64975          * The base implementation of `_.values` and `_.valuesIn` which creates an array
64976          * of `object` property values corresponding to the property names of `props`.
64977          * 
64978          * @private
64979          * @param {Object}
64980          *            object The object to query.
64981          * @param {Array}
64982          *            props The property names to get values for.
64983          * @returns {Object} Returns the array of property values.
64984          */
64985         function baseValues(object, props) {
64986             var index = -1,
64987                 length = props.length,
64988                 result = Array(length);
64989
64990             while (++index < length) {
64991                 result[index] = object[props[index]];
64992             }
64993             return result;
64994         }
64995
64996         module.exports = baseValues;
64997
64998     }, {}],
64999     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\bindCallback.js": [function(require, module, exports) {
65000         var identity = require('../utility/identity');
65001
65002         /**
65003          * A specialized version of `baseCallback` which only supports `this` binding
65004          * and specifying the number of arguments to provide to `func`.
65005          * 
65006          * @private
65007          * @param {Function}
65008          *            func The function to bind.
65009          * @param {*}
65010          *            thisArg The `this` binding of `func`.
65011          * @param {number}
65012          *            [argCount] The number of arguments to provide to `func`.
65013          * @returns {Function} Returns the callback.
65014          */
65015         function bindCallback(func, thisArg, argCount) {
65016             if (typeof func != 'function') {
65017                 return identity;
65018             }
65019             if (thisArg === undefined) {
65020                 return func;
65021             }
65022             switch (argCount) {
65023                 case 1:
65024                     return function(value) {
65025                         return func.call(thisArg, value);
65026                     };
65027                 case 3:
65028                     return function(value, index, collection) {
65029                         return func.call(thisArg, value, index, collection);
65030                     };
65031                 case 4:
65032                     return function(accumulator, value, index, collection) {
65033                         return func.call(thisArg, accumulator, value, index, collection);
65034                     };
65035                 case 5:
65036                     return function(value, other, key, object, source) {
65037                         return func.call(thisArg, value, other, key, object, source);
65038                     };
65039             }
65040             return function() {
65041                 return func.apply(thisArg, arguments);
65042             };
65043         }
65044
65045         module.exports = bindCallback;
65046
65047     }, {
65048         "../utility/identity": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\utility\\identity.js"
65049     }],
65050     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\cacheIndexOf.js": [function(require, module, exports) {
65051         var isObject = require('../lang/isObject');
65052
65053         /**
65054          * Checks if `value` is in `cache` mimicking the return signature of `_.indexOf`
65055          * by returning `0` if the value is found, else `-1`.
65056          * 
65057          * @private
65058          * @param {Object}
65059          *            cache The cache to search.
65060          * @param {*}
65061          *            value The value to search for.
65062          * @returns {number} Returns `0` if `value` is found, else `-1`.
65063          */
65064         function cacheIndexOf(cache, value) {
65065             var data = cache.data,
65066                 result = (typeof value == 'string' || isObject(value)) ? data.set.has(value) : data.hash[value];
65067
65068             return result ? 0 : -1;
65069         }
65070
65071         module.exports = cacheIndexOf;
65072
65073     }, {
65074         "../lang/isObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isObject.js"
65075     }],
65076     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\cachePush.js": [function(require, module, exports) {
65077         var isObject = require('../lang/isObject');
65078
65079         /**
65080          * Adds `value` to the cache.
65081          * 
65082          * @private
65083          * @name push
65084          * @memberOf SetCache
65085          * @param {*}
65086          *            value The value to cache.
65087          */
65088         function cachePush(value) {
65089             var data = this.data;
65090             if (typeof value == 'string' || isObject(value)) {
65091                 data.set.add(value);
65092             } else {
65093                 data.hash[value] = true;
65094             }
65095         }
65096
65097         module.exports = cachePush;
65098
65099     }, {
65100         "../lang/isObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isObject.js"
65101     }],
65102     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\compareAscending.js": [function(require, module, exports) {
65103         var baseCompareAscending = require('./baseCompareAscending');
65104
65105         /**
65106          * Used by `_.sortBy` to compare transformed elements of a collection and stable
65107          * sort them in ascending order.
65108          * 
65109          * @private
65110          * @param {Object}
65111          *            object The object to compare.
65112          * @param {Object}
65113          *            other The other object to compare.
65114          * @returns {number} Returns the sort order indicator for `object`.
65115          */
65116         function compareAscending(object, other) {
65117             return baseCompareAscending(object.criteria, other.criteria) || (object.index - other.index);
65118         }
65119
65120         module.exports = compareAscending;
65121
65122     }, {
65123         "./baseCompareAscending": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseCompareAscending.js"
65124     }],
65125     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\composeArgs.js": [function(require, module, exports) {
65126         /*
65127          * Native method references for those with the same name as other `lodash`
65128          * methods.
65129          */
65130         var nativeMax = Math.max;
65131
65132         /**
65133          * Creates an array that is the composition of partially applied arguments,
65134          * placeholders, and provided arguments into a single array of arguments.
65135          * 
65136          * @private
65137          * @param {Array|Object}
65138          *            args The provided arguments.
65139          * @param {Array}
65140          *            partials The arguments to prepend to those provided.
65141          * @param {Array}
65142          *            holders The `partials` placeholder indexes.
65143          * @returns {Array} Returns the new array of composed arguments.
65144          */
65145         function composeArgs(args, partials, holders) {
65146             var holdersLength = holders.length,
65147                 argsIndex = -1,
65148                 argsLength = nativeMax(args.length - holdersLength, 0),
65149                 leftIndex = -1,
65150                 leftLength = partials.length,
65151                 result = Array(leftLength + argsLength);
65152
65153             while (++leftIndex < leftLength) {
65154                 result[leftIndex] = partials[leftIndex];
65155             }
65156             while (++argsIndex < holdersLength) {
65157                 result[holders[argsIndex]] = args[argsIndex];
65158             }
65159             while (argsLength--) {
65160                 result[leftIndex++] = args[argsIndex++];
65161             }
65162             return result;
65163         }
65164
65165         module.exports = composeArgs;
65166
65167     }, {}],
65168     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\composeArgsRight.js": [function(require, module, exports) {
65169         /*
65170          * Native method references for those with the same name as other `lodash`
65171          * methods.
65172          */
65173         var nativeMax = Math.max;
65174
65175         /**
65176          * This function is like `composeArgs` except that the arguments composition is
65177          * tailored for `_.partialRight`.
65178          * 
65179          * @private
65180          * @param {Array|Object}
65181          *            args The provided arguments.
65182          * @param {Array}
65183          *            partials The arguments to append to those provided.
65184          * @param {Array}
65185          *            holders The `partials` placeholder indexes.
65186          * @returns {Array} Returns the new array of composed arguments.
65187          */
65188         function composeArgsRight(args, partials, holders) {
65189             var holdersIndex = -1,
65190                 holdersLength = holders.length,
65191                 argsIndex = -1,
65192                 argsLength = nativeMax(args.length - holdersLength, 0),
65193                 rightIndex = -1,
65194                 rightLength = partials.length,
65195                 result = Array(argsLength + rightLength);
65196
65197             while (++argsIndex < argsLength) {
65198                 result[argsIndex] = args[argsIndex];
65199             }
65200             var offset = argsIndex;
65201             while (++rightIndex < rightLength) {
65202                 result[offset + rightIndex] = partials[rightIndex];
65203             }
65204             while (++holdersIndex < holdersLength) {
65205                 result[offset + holders[holdersIndex]] = args[argsIndex++];
65206             }
65207             return result;
65208         }
65209
65210         module.exports = composeArgsRight;
65211
65212     }, {}],
65213     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createAggregator.js": [function(require, module, exports) {
65214         var baseCallback = require('./baseCallback'),
65215             baseEach = require('./baseEach'),
65216             isArray = require('../lang/isArray');
65217
65218         /**
65219          * Creates a `_.countBy`, `_.groupBy`, `_.indexBy`, or `_.partition` function.
65220          * 
65221          * @private
65222          * @param {Function}
65223          *            setter The function to set keys and values of the accumulator
65224          *            object.
65225          * @param {Function}
65226          *            [initializer] The function to initialize the accumulator object.
65227          * @returns {Function} Returns the new aggregator function.
65228          */
65229         function createAggregator(setter, initializer) {
65230             return function(collection, iteratee, thisArg) {
65231                 var result = initializer ? initializer() : {};
65232                 iteratee = baseCallback(iteratee, thisArg, 3);
65233
65234                 if (isArray(collection)) {
65235                     var index = -1,
65236                         length = collection.length;
65237
65238                     while (++index < length) {
65239                         var value = collection[index];
65240                         setter(result, value, iteratee(value, index, collection), collection);
65241                     }
65242                 } else {
65243                     baseEach(collection, function(value, key, collection) {
65244                         setter(result, value, iteratee(value, key, collection), collection);
65245                     });
65246                 }
65247                 return result;
65248             };
65249         }
65250
65251         module.exports = createAggregator;
65252
65253     }, {
65254         "../lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js",
65255         "./baseCallback": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseCallback.js",
65256         "./baseEach": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseEach.js"
65257     }],
65258     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createAssigner.js": [function(require, module, exports) {
65259         var bindCallback = require('./bindCallback'),
65260             isIterateeCall = require('./isIterateeCall'),
65261             restParam = require('../function/restParam');
65262
65263         /**
65264          * Creates a `_.assign`, `_.defaults`, or `_.merge` function.
65265          * 
65266          * @private
65267          * @param {Function}
65268          *            assigner The function to assign values.
65269          * @returns {Function} Returns the new assigner function.
65270          */
65271         function createAssigner(assigner) {
65272             return restParam(function(object, sources) {
65273                 var index = -1,
65274                     length = object == null ? 0 : sources.length,
65275                     customizer = length > 2 ? sources[length - 2] : undefined,
65276                     guard = length > 2 ? sources[2] : undefined,
65277                     thisArg = length > 1 ? sources[length - 1] : undefined;
65278
65279                 if (typeof customizer == 'function') {
65280                     customizer = bindCallback(customizer, thisArg, 5);
65281                     length -= 2;
65282                 } else {
65283                     customizer = typeof thisArg == 'function' ? thisArg : undefined;
65284                     length -= (customizer ? 1 : 0);
65285                 }
65286                 if (guard && isIterateeCall(sources[0], sources[1], guard)) {
65287                     customizer = length < 3 ? undefined : customizer;
65288                     length = 1;
65289                 }
65290                 while (++index < length) {
65291                     var source = sources[index];
65292                     if (source) {
65293                         assigner(object, source, customizer);
65294                     }
65295                 }
65296                 return object;
65297             });
65298         }
65299
65300         module.exports = createAssigner;
65301
65302     }, {
65303         "../function/restParam": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\function\\restParam.js",
65304         "./bindCallback": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\bindCallback.js",
65305         "./isIterateeCall": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isIterateeCall.js"
65306     }],
65307     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createBaseEach.js": [function(require, module, exports) {
65308         var getLength = require('./getLength'),
65309             isLength = require('./isLength'),
65310             toObject = require('./toObject');
65311
65312         /**
65313          * Creates a `baseEach` or `baseEachRight` function.
65314          * 
65315          * @private
65316          * @param {Function}
65317          *            eachFunc The function to iterate over a collection.
65318          * @param {boolean}
65319          *            [fromRight] Specify iterating from right to left.
65320          * @returns {Function} Returns the new base function.
65321          */
65322         function createBaseEach(eachFunc, fromRight) {
65323             return function(collection, iteratee) {
65324                 var length = collection ? getLength(collection) : 0;
65325                 if (!isLength(length)) {
65326                     return eachFunc(collection, iteratee);
65327                 }
65328                 var index = fromRight ? length : -1,
65329                     iterable = toObject(collection);
65330
65331                 while ((fromRight ? index-- : ++index < length)) {
65332                     if (iteratee(iterable[index], index, iterable) === false) {
65333                         break;
65334                     }
65335                 }
65336                 return collection;
65337             };
65338         }
65339
65340         module.exports = createBaseEach;
65341
65342     }, {
65343         "./getLength": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\getLength.js",
65344         "./isLength": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isLength.js",
65345         "./toObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\toObject.js"
65346     }],
65347     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createBaseFor.js": [function(require, module, exports) {
65348         var toObject = require('./toObject');
65349
65350         /**
65351          * Creates a base function for `_.forIn` or `_.forInRight`.
65352          * 
65353          * @private
65354          * @param {boolean}
65355          *            [fromRight] Specify iterating from right to left.
65356          * @returns {Function} Returns the new base function.
65357          */
65358         function createBaseFor(fromRight) {
65359             return function(object, iteratee, keysFunc) {
65360                 var iterable = toObject(object),
65361                     props = keysFunc(object),
65362                     length = props.length,
65363                     index = fromRight ? length : -1;
65364
65365                 while ((fromRight ? index-- : ++index < length)) {
65366                     var key = props[index];
65367                     if (iteratee(iterable[key], key, iterable) === false) {
65368                         break;
65369                     }
65370                 }
65371                 return object;
65372             };
65373         }
65374
65375         module.exports = createBaseFor;
65376
65377     }, {
65378         "./toObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\toObject.js"
65379     }],
65380     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createBindWrapper.js": [function(require, module, exports) {
65381         (function(global) {
65382             var createCtorWrapper = require('./createCtorWrapper');
65383
65384             /**
65385              * Creates a function that wraps `func` and invokes it with the `this` binding
65386              * of `thisArg`.
65387              * 
65388              * @private
65389              * @param {Function}
65390              *            func The function to bind.
65391              * @param {*}
65392              *            [thisArg] The `this` binding of `func`.
65393              * @returns {Function} Returns the new bound function.
65394              */
65395             function createBindWrapper(func, thisArg) {
65396                 var Ctor = createCtorWrapper(func);
65397
65398                 function wrapper() {
65399                     var fn = (this && this !== global && this instanceof wrapper) ? Ctor : func;
65400                     return fn.apply(thisArg, arguments);
65401                 }
65402                 return wrapper;
65403             }
65404
65405             module.exports = createBindWrapper;
65406
65407         }).call(this, typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
65408     }, {
65409         "./createCtorWrapper": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createCtorWrapper.js"
65410     }],
65411     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createCache.js": [function(require, module, exports) {
65412         (function(global) {
65413             var SetCache = require('./SetCache'),
65414                 getNative = require('./getNative');
65415
65416             /** Native method references. */
65417             var Set = getNative(global, 'Set');
65418
65419             /*
65420              * Native method references for those with the same name as other `lodash`
65421              * methods.
65422              */
65423             var nativeCreate = getNative(Object, 'create');
65424
65425             /**
65426              * Creates a `Set` cache object to optimize linear searches of large arrays.
65427              * 
65428              * @private
65429              * @param {Array}
65430              *            [values] The values to cache.
65431              * @returns {null|Object} Returns the new cache object if `Set` is supported,
65432              *          else `null`.
65433              */
65434             function createCache(values) {
65435                 return (nativeCreate && Set) ? new SetCache(values) : null;
65436             }
65437
65438             module.exports = createCache;
65439
65440         }).call(this, typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
65441     }, {
65442         "./SetCache": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\SetCache.js",
65443         "./getNative": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\getNative.js"
65444     }],
65445     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createCtorWrapper.js": [function(require, module, exports) {
65446         var baseCreate = require('./baseCreate'),
65447             isObject = require('../lang/isObject');
65448
65449         /**
65450          * Creates a function that produces an instance of `Ctor` regardless of whether
65451          * it was invoked as part of a `new` expression or by `call` or `apply`.
65452          * 
65453          * @private
65454          * @param {Function}
65455          *            Ctor The constructor to wrap.
65456          * @returns {Function} Returns the new wrapped function.
65457          */
65458         function createCtorWrapper(Ctor) {
65459             return function() {
65460                 // Use a `switch` statement to work with class constructors.
65461                 // See
65462                 // http://ecma-international.org/ecma-262/6.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist
65463                 // for more details.
65464                 var args = arguments;
65465                 switch (args.length) {
65466                     case 0:
65467                         return new Ctor;
65468                     case 1:
65469                         return new Ctor(args[0]);
65470                     case 2:
65471                         return new Ctor(args[0], args[1]);
65472                     case 3:
65473                         return new Ctor(args[0], args[1], args[2]);
65474                     case 4:
65475                         return new Ctor(args[0], args[1], args[2], args[3]);
65476                     case 5:
65477                         return new Ctor(args[0], args[1], args[2], args[3], args[4]);
65478                     case 6:
65479                         return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);
65480                     case 7:
65481                         return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
65482                 }
65483                 var thisBinding = baseCreate(Ctor.prototype),
65484                     result = Ctor.apply(thisBinding, args);
65485
65486                 // Mimic the constructor's `return` behavior.
65487                 // See https://es5.github.io/#x13.2.2 for more details.
65488                 return isObject(result) ? result : thisBinding;
65489             };
65490         }
65491
65492         module.exports = createCtorWrapper;
65493
65494     }, {
65495         "../lang/isObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isObject.js",
65496         "./baseCreate": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseCreate.js"
65497     }],
65498     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createFind.js": [function(require, module, exports) {
65499         var baseCallback = require('./baseCallback'),
65500             baseFind = require('./baseFind'),
65501             baseFindIndex = require('./baseFindIndex'),
65502             isArray = require('../lang/isArray');
65503
65504         /**
65505          * Creates a `_.find` or `_.findLast` function.
65506          * 
65507          * @private
65508          * @param {Function}
65509          *            eachFunc The function to iterate over a collection.
65510          * @param {boolean}
65511          *            [fromRight] Specify iterating from right to left.
65512          * @returns {Function} Returns the new find function.
65513          */
65514         function createFind(eachFunc, fromRight) {
65515             return function(collection, predicate, thisArg) {
65516                 predicate = baseCallback(predicate, thisArg, 3);
65517                 if (isArray(collection)) {
65518                     var index = baseFindIndex(collection, predicate, fromRight);
65519                     return index > -1 ? collection[index] : undefined;
65520                 }
65521                 return baseFind(collection, predicate, eachFunc);
65522             };
65523         }
65524
65525         module.exports = createFind;
65526
65527     }, {
65528         "../lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js",
65529         "./baseCallback": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseCallback.js",
65530         "./baseFind": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseFind.js",
65531         "./baseFindIndex": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseFindIndex.js"
65532     }],
65533     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createForEach.js": [function(require, module, exports) {
65534         var bindCallback = require('./bindCallback'),
65535             isArray = require('../lang/isArray');
65536
65537         /**
65538          * Creates a function for `_.forEach` or `_.forEachRight`.
65539          * 
65540          * @private
65541          * @param {Function}
65542          *            arrayFunc The function to iterate over an array.
65543          * @param {Function}
65544          *            eachFunc The function to iterate over a collection.
65545          * @returns {Function} Returns the new each function.
65546          */
65547         function createForEach(arrayFunc, eachFunc) {
65548             return function(collection, iteratee, thisArg) {
65549                 return (typeof iteratee == 'function' && thisArg === undefined && isArray(collection)) ? arrayFunc(collection, iteratee) : eachFunc(collection, bindCallback(iteratee, thisArg, 3));
65550             };
65551         }
65552
65553         module.exports = createForEach;
65554
65555     }, {
65556         "../lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js",
65557         "./bindCallback": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\bindCallback.js"
65558     }],
65559     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createHybridWrapper.js": [function(require, module, exports) {
65560         (function(global) {
65561             var arrayCopy = require('./arrayCopy'),
65562                 composeArgs = require('./composeArgs'),
65563                 composeArgsRight = require('./composeArgsRight'),
65564                 createCtorWrapper = require('./createCtorWrapper'),
65565                 isLaziable = require('./isLaziable'),
65566                 reorder = require('./reorder'),
65567                 replaceHolders = require('./replaceHolders'),
65568                 setData = require('./setData');
65569
65570             /** Used to compose bitmasks for wrapper metadata. */
65571             var BIND_FLAG = 1,
65572                 BIND_KEY_FLAG = 2,
65573                 CURRY_BOUND_FLAG = 4,
65574                 CURRY_FLAG = 8,
65575                 CURRY_RIGHT_FLAG = 16,
65576                 PARTIAL_FLAG = 32,
65577                 PARTIAL_RIGHT_FLAG = 64,
65578                 ARY_FLAG = 128;
65579
65580             /*
65581              * Native method references for those with the same name as other `lodash`
65582              * methods.
65583              */
65584             var nativeMax = Math.max;
65585
65586             /**
65587              * Creates a function that wraps `func` and invokes it with optional `this`
65588              * binding of, partial application, and currying.
65589              * 
65590              * @private
65591              * @param {Function|string}
65592              *            func The function or method name to reference.
65593              * @param {number}
65594              *            bitmask The bitmask of flags. See `createWrapper` for more
65595              *            details.
65596              * @param {*}
65597              *            [thisArg] The `this` binding of `func`.
65598              * @param {Array}
65599              *            [partials] The arguments to prepend to those provided to the new
65600              *            function.
65601              * @param {Array}
65602              *            [holders] The `partials` placeholder indexes.
65603              * @param {Array}
65604              *            [partialsRight] The arguments to append to those provided to the
65605              *            new function.
65606              * @param {Array}
65607              *            [holdersRight] The `partialsRight` placeholder indexes.
65608              * @param {Array}
65609              *            [argPos] The argument positions of the new function.
65610              * @param {number}
65611              *            [ary] The arity cap of `func`.
65612              * @param {number}
65613              *            [arity] The arity of `func`.
65614              * @returns {Function} Returns the new wrapped function.
65615              */
65616             function createHybridWrapper(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {
65617                 var isAry = bitmask & ARY_FLAG,
65618                     isBind = bitmask & BIND_FLAG,
65619                     isBindKey = bitmask & BIND_KEY_FLAG,
65620                     isCurry = bitmask & CURRY_FLAG,
65621                     isCurryBound = bitmask & CURRY_BOUND_FLAG,
65622                     isCurryRight = bitmask & CURRY_RIGHT_FLAG,
65623                     Ctor = isBindKey ? undefined : createCtorWrapper(func);
65624
65625                 function wrapper() {
65626                     // Avoid `arguments` object use disqualifying optimizations by
65627                     // converting it to an array before providing it to other functions.
65628                     var length = arguments.length,
65629                         index = length,
65630                         args = Array(length);
65631
65632                     while (index--) {
65633                         args[index] = arguments[index];
65634                     }
65635                     if (partials) {
65636                         args = composeArgs(args, partials, holders);
65637                     }
65638                     if (partialsRight) {
65639                         args = composeArgsRight(args, partialsRight, holdersRight);
65640                     }
65641                     if (isCurry || isCurryRight) {
65642                         var placeholder = wrapper.placeholder,
65643                             argsHolders = replaceHolders(args, placeholder);
65644
65645                         length -= argsHolders.length;
65646                         if (length < arity) {
65647                             var newArgPos = argPos ? arrayCopy(argPos) : undefined,
65648                                 newArity = nativeMax(arity - length, 0),
65649                                 newsHolders = isCurry ? argsHolders : undefined,
65650                                 newHoldersRight = isCurry ? undefined : argsHolders,
65651                                 newPartials = isCurry ? args : undefined,
65652                                 newPartialsRight = isCurry ? undefined : args;
65653
65654                             bitmask |= (isCurry ? PARTIAL_FLAG : PARTIAL_RIGHT_FLAG);
65655                             bitmask &= ~(isCurry ? PARTIAL_RIGHT_FLAG : PARTIAL_FLAG);
65656
65657                             if (!isCurryBound) {
65658                                 bitmask &= ~(BIND_FLAG | BIND_KEY_FLAG);
65659                             }
65660                             var newData = [func, bitmask, thisArg, newPartials, newsHolders, newPartialsRight, newHoldersRight, newArgPos, ary, newArity],
65661                                 result = createHybridWrapper.apply(undefined, newData);
65662
65663                             if (isLaziable(func)) {
65664                                 setData(result, newData);
65665                             }
65666                             result.placeholder = placeholder;
65667                             return result;
65668                         }
65669                     }
65670                     var thisBinding = isBind ? thisArg : this,
65671                         fn = isBindKey ? thisBinding[func] : func;
65672
65673                     if (argPos) {
65674                         args = reorder(args, argPos);
65675                     }
65676                     if (isAry && ary < args.length) {
65677                         args.length = ary;
65678                     }
65679                     if (this && this !== global && this instanceof wrapper) {
65680                         fn = Ctor || createCtorWrapper(func);
65681                     }
65682                     return fn.apply(thisBinding, args);
65683                 }
65684                 return wrapper;
65685             }
65686
65687             module.exports = createHybridWrapper;
65688
65689         }).call(this, typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
65690     }, {
65691         "./arrayCopy": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\arrayCopy.js",
65692         "./composeArgs": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\composeArgs.js",
65693         "./composeArgsRight": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\composeArgsRight.js",
65694         "./createCtorWrapper": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createCtorWrapper.js",
65695         "./isLaziable": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isLaziable.js",
65696         "./reorder": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\reorder.js",
65697         "./replaceHolders": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\replaceHolders.js",
65698         "./setData": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\setData.js"
65699     }],
65700     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createPartialWrapper.js": [function(require, module, exports) {
65701         (function(global) {
65702             var createCtorWrapper = require('./createCtorWrapper');
65703
65704             /** Used to compose bitmasks for wrapper metadata. */
65705             var BIND_FLAG = 1;
65706
65707             /**
65708              * Creates a function that wraps `func` and invokes it with the optional `this`
65709              * binding of `thisArg` and the `partials` prepended to those provided to the
65710              * wrapper.
65711              * 
65712              * @private
65713              * @param {Function}
65714              *            func The function to partially apply arguments to.
65715              * @param {number}
65716              *            bitmask The bitmask of flags. See `createWrapper` for more
65717              *            details.
65718              * @param {*}
65719              *            thisArg The `this` binding of `func`.
65720              * @param {Array}
65721              *            partials The arguments to prepend to those provided to the new
65722              *            function.
65723              * @returns {Function} Returns the new bound function.
65724              */
65725             function createPartialWrapper(func, bitmask, thisArg, partials) {
65726                 var isBind = bitmask & BIND_FLAG,
65727                     Ctor = createCtorWrapper(func);
65728
65729                 function wrapper() {
65730                     // Avoid `arguments` object use disqualifying optimizations by
65731                     // converting it to an array before providing it `func`.
65732                     var argsIndex = -1,
65733                         argsLength = arguments.length,
65734                         leftIndex = -1,
65735                         leftLength = partials.length,
65736                         args = Array(leftLength + argsLength);
65737
65738                     while (++leftIndex < leftLength) {
65739                         args[leftIndex] = partials[leftIndex];
65740                     }
65741                     while (argsLength--) {
65742                         args[leftIndex++] = arguments[++argsIndex];
65743                     }
65744                     var fn = (this && this !== global && this instanceof wrapper) ? Ctor : func;
65745                     return fn.apply(isBind ? thisArg : this, args);
65746                 }
65747                 return wrapper;
65748             }
65749
65750             module.exports = createPartialWrapper;
65751
65752         }).call(this, typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
65753     }, {
65754         "./createCtorWrapper": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createCtorWrapper.js"
65755     }],
65756     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createReduce.js": [function(require, module, exports) {
65757         var baseCallback = require('./baseCallback'),
65758             baseReduce = require('./baseReduce'),
65759             isArray = require('../lang/isArray');
65760
65761         /**
65762          * Creates a function for `_.reduce` or `_.reduceRight`.
65763          * 
65764          * @private
65765          * @param {Function}
65766          *            arrayFunc The function to iterate over an array.
65767          * @param {Function}
65768          *            eachFunc The function to iterate over a collection.
65769          * @returns {Function} Returns the new each function.
65770          */
65771         function createReduce(arrayFunc, eachFunc) {
65772             return function(collection, iteratee, accumulator, thisArg) {
65773                 var initFromArray = arguments.length < 3;
65774                 return (typeof iteratee == 'function' && thisArg === undefined && isArray(collection)) ? arrayFunc(collection, iteratee, accumulator, initFromArray) : baseReduce(collection, baseCallback(iteratee, thisArg, 4), accumulator, initFromArray, eachFunc);
65775             };
65776         }
65777
65778         module.exports = createReduce;
65779
65780     }, {
65781         "../lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js",
65782         "./baseCallback": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseCallback.js",
65783         "./baseReduce": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseReduce.js"
65784     }],
65785     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createWrapper.js": [function(require, module, exports) {
65786         var baseSetData = require('./baseSetData'),
65787             createBindWrapper = require('./createBindWrapper'),
65788             createHybridWrapper = require('./createHybridWrapper'),
65789             createPartialWrapper = require('./createPartialWrapper'),
65790             getData = require('./getData'),
65791             mergeData = require('./mergeData'),
65792             setData = require('./setData');
65793
65794         /** Used to compose bitmasks for wrapper metadata. */
65795         var BIND_FLAG = 1,
65796             BIND_KEY_FLAG = 2,
65797             PARTIAL_FLAG = 32,
65798             PARTIAL_RIGHT_FLAG = 64;
65799
65800         /** Used as the `TypeError` message for "Functions" methods. */
65801         var FUNC_ERROR_TEXT = 'Expected a function';
65802
65803         /*
65804          * Native method references for those with the same name as other `lodash`
65805          * methods.
65806          */
65807         var nativeMax = Math.max;
65808
65809         /**
65810          * Creates a function that either curries or invokes `func` with optional `this`
65811          * binding and partially applied arguments.
65812          * 
65813          * @private
65814          * @param {Function|string}
65815          *            func The function or method name to reference.
65816          * @param {number}
65817          *            bitmask The bitmask of flags. The bitmask may be composed of the
65818          *            following flags: 1 - `_.bind` 2 - `_.bindKey` 4 - `_.curry` or
65819          *            `_.curryRight` of a bound function 8 - `_.curry` 16 -
65820          *            `_.curryRight` 32 - `_.partial` 64 - `_.partialRight` 128 -
65821          *            `_.rearg` 256 - `_.ary`
65822          * @param {*}
65823          *            [thisArg] The `this` binding of `func`.
65824          * @param {Array}
65825          *            [partials] The arguments to be partially applied.
65826          * @param {Array}
65827          *            [holders] The `partials` placeholder indexes.
65828          * @param {Array}
65829          *            [argPos] The argument positions of the new function.
65830          * @param {number}
65831          *            [ary] The arity cap of `func`.
65832          * @param {number}
65833          *            [arity] The arity of `func`.
65834          * @returns {Function} Returns the new wrapped function.
65835          */
65836         function createWrapper(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {
65837             var isBindKey = bitmask & BIND_KEY_FLAG;
65838             if (!isBindKey && typeof func != 'function') {
65839                 throw new TypeError(FUNC_ERROR_TEXT);
65840             }
65841             var length = partials ? partials.length : 0;
65842             if (!length) {
65843                 bitmask &= ~(PARTIAL_FLAG | PARTIAL_RIGHT_FLAG);
65844                 partials = holders = undefined;
65845             }
65846             length -= (holders ? holders.length : 0);
65847             if (bitmask & PARTIAL_RIGHT_FLAG) {
65848                 var partialsRight = partials,
65849                     holdersRight = holders;
65850
65851                 partials = holders = undefined;
65852             }
65853             var data = isBindKey ? undefined : getData(func),
65854                 newData = [func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity];
65855
65856             if (data) {
65857                 mergeData(newData, data);
65858                 bitmask = newData[1];
65859                 arity = newData[9];
65860             }
65861             newData[9] = arity == null ? (isBindKey ? 0 : func.length) : (nativeMax(arity - length, 0) || 0);
65862
65863             if (bitmask == BIND_FLAG) {
65864                 var result = createBindWrapper(newData[0], newData[2]);
65865             } else if ((bitmask == PARTIAL_FLAG || bitmask == (BIND_FLAG | PARTIAL_FLAG)) && !newData[4].length) {
65866                 result = createPartialWrapper.apply(undefined, newData);
65867             } else {
65868                 result = createHybridWrapper.apply(undefined, newData);
65869             }
65870             var setter = data ? baseSetData : setData;
65871             return setter(result, newData);
65872         }
65873
65874         module.exports = createWrapper;
65875
65876     }, {
65877         "./baseSetData": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseSetData.js",
65878         "./createBindWrapper": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createBindWrapper.js",
65879         "./createHybridWrapper": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createHybridWrapper.js",
65880         "./createPartialWrapper": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createPartialWrapper.js",
65881         "./getData": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\getData.js",
65882         "./mergeData": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\mergeData.js",
65883         "./setData": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\setData.js"
65884     }],
65885     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\equalArrays.js": [function(require, module, exports) {
65886         var arraySome = require('./arraySome');
65887
65888         /**
65889          * A specialized version of `baseIsEqualDeep` for arrays with support for
65890          * partial deep comparisons.
65891          * 
65892          * @private
65893          * @param {Array}
65894          *            array The array to compare.
65895          * @param {Array}
65896          *            other The other array to compare.
65897          * @param {Function}
65898          *            equalFunc The function to determine equivalents of values.
65899          * @param {Function}
65900          *            [customizer] The function to customize comparing arrays.
65901          * @param {boolean}
65902          *            [isLoose] Specify performing partial comparisons.
65903          * @param {Array}
65904          *            [stackA] Tracks traversed `value` objects.
65905          * @param {Array}
65906          *            [stackB] Tracks traversed `other` objects.
65907          * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
65908          */
65909         function equalArrays(array, other, equalFunc, customizer, isLoose, stackA, stackB) {
65910             var index = -1,
65911                 arrLength = array.length,
65912                 othLength = other.length;
65913
65914             if (arrLength != othLength && !(isLoose && othLength > arrLength)) {
65915                 return false;
65916             }
65917             // Ignore non-index properties.
65918             while (++index < arrLength) {
65919                 var arrValue = array[index],
65920                     othValue = other[index],
65921                     result = customizer ? customizer(isLoose ? othValue : arrValue, isLoose ? arrValue : othValue, index) : undefined;
65922
65923                 if (result !== undefined) {
65924                     if (result) {
65925                         continue;
65926                     }
65927                     return false;
65928                 }
65929                 // Recursively compare arrays (susceptible to call stack limits).
65930                 if (isLoose) {
65931                     if (!arraySome(other, function(othValue) {
65932                             return arrValue === othValue || equalFunc(arrValue, othValue, customizer, isLoose, stackA, stackB);
65933                         })) {
65934                         return false;
65935                     }
65936                 } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, customizer, isLoose, stackA, stackB))) {
65937                     return false;
65938                 }
65939             }
65940             return true;
65941         }
65942
65943         module.exports = equalArrays;
65944
65945     }, {
65946         "./arraySome": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\arraySome.js"
65947     }],
65948     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\equalByTag.js": [function(require, module, exports) {
65949         /** `Object#toString` result references. */
65950         var boolTag = '[object Boolean]',
65951             dateTag = '[object Date]',
65952             errorTag = '[object Error]',
65953             numberTag = '[object Number]',
65954             regexpTag = '[object RegExp]',
65955             stringTag = '[object String]';
65956
65957         /**
65958          * A specialized version of `baseIsEqualDeep` for comparing objects of the same
65959          * `toStringTag`.
65960          * 
65961          * **Note:** This function only supports comparing values with tags of
65962          * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
65963          * 
65964          * @private
65965          * @param {Object}
65966          *            object The object to compare.
65967          * @param {Object}
65968          *            other The other object to compare.
65969          * @param {string}
65970          *            tag The `toStringTag` of the objects to compare.
65971          * @returns {boolean} Returns `true` if the objects are equivalent, else
65972          *          `false`.
65973          */
65974         function equalByTag(object, other, tag) {
65975             switch (tag) {
65976                 case boolTag:
65977                 case dateTag:
65978                     // Coerce dates and booleans to numbers, dates to milliseconds and
65979                     // booleans
65980                     // to `1` or `0` treating invalid dates coerced to `NaN` as not equal.
65981                     return +object == +other;
65982
65983                 case errorTag:
65984                     return object.name == other.name && object.message == other.message;
65985
65986                 case numberTag:
65987                     // Treat `NaN` vs. `NaN` as equal.
65988                     return (object != +object) ? other != +other : object == +other;
65989
65990                 case regexpTag:
65991                 case stringTag:
65992                     // Coerce regexes to strings and treat strings primitives and string
65993                     // objects as equal. See https://es5.github.io/#x15.10.6.4 for more
65994                     // details.
65995                     return object == (other + '');
65996             }
65997             return false;
65998         }
65999
66000         module.exports = equalByTag;
66001
66002     }, {}],
66003     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\equalObjects.js": [function(require, module, exports) {
66004         var keys = require('../object/keys');
66005
66006         /** Used for native method references. */
66007         var objectProto = Object.prototype;
66008
66009         /** Used to check objects for own properties. */
66010         var hasOwnProperty = objectProto.hasOwnProperty;
66011
66012         /**
66013          * A specialized version of `baseIsEqualDeep` for objects with support for
66014          * partial deep comparisons.
66015          * 
66016          * @private
66017          * @param {Object}
66018          *            object The object to compare.
66019          * @param {Object}
66020          *            other The other object to compare.
66021          * @param {Function}
66022          *            equalFunc The function to determine equivalents of values.
66023          * @param {Function}
66024          *            [customizer] The function to customize comparing values.
66025          * @param {boolean}
66026          *            [isLoose] Specify performing partial comparisons.
66027          * @param {Array}
66028          *            [stackA] Tracks traversed `value` objects.
66029          * @param {Array}
66030          *            [stackB] Tracks traversed `other` objects.
66031          * @returns {boolean} Returns `true` if the objects are equivalent, else
66032          *          `false`.
66033          */
66034         function equalObjects(object, other, equalFunc, customizer, isLoose, stackA, stackB) {
66035             var objProps = keys(object),
66036                 objLength = objProps.length,
66037                 othProps = keys(other),
66038                 othLength = othProps.length;
66039
66040             if (objLength != othLength && !isLoose) {
66041                 return false;
66042             }
66043             var index = objLength;
66044             while (index--) {
66045                 var key = objProps[index];
66046                 if (!(isLoose ? key in other : hasOwnProperty.call(other, key))) {
66047                     return false;
66048                 }
66049             }
66050             var skipCtor = isLoose;
66051             while (++index < objLength) {
66052                 key = objProps[index];
66053                 var objValue = object[key],
66054                     othValue = other[key],
66055                     result = customizer ? customizer(isLoose ? othValue : objValue, isLoose ? objValue : othValue, key) : undefined;
66056
66057                 // Recursively compare objects (susceptible to call stack limits).
66058                 if (!(result === undefined ? equalFunc(objValue, othValue, customizer, isLoose, stackA, stackB) : result)) {
66059                     return false;
66060                 }
66061                 skipCtor || (skipCtor = key == 'constructor');
66062             }
66063             if (!skipCtor) {
66064                 var objCtor = object.constructor,
66065                     othCtor = other.constructor;
66066
66067                 // Non `Object` object instances with different constructors are not equal.
66068                 if (objCtor != othCtor &&
66069                     ('constructor' in object && 'constructor' in other) &&
66070                     !(typeof objCtor == 'function' && objCtor instanceof objCtor &&
66071                         typeof othCtor == 'function' && othCtor instanceof othCtor)) {
66072                     return false;
66073                 }
66074             }
66075             return true;
66076         }
66077
66078         module.exports = equalObjects;
66079
66080     }, {
66081         "../object/keys": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\keys.js"
66082     }],
66083     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\getData.js": [function(require, module, exports) {
66084         var metaMap = require('./metaMap'),
66085             noop = require('../utility/noop');
66086
66087         /**
66088          * Gets metadata for `func`.
66089          * 
66090          * @private
66091          * @param {Function}
66092          *            func The function to query.
66093          * @returns {*} Returns the metadata for `func`.
66094          */
66095         var getData = !metaMap ? noop : function(func) {
66096             return metaMap.get(func);
66097         };
66098
66099         module.exports = getData;
66100
66101     }, {
66102         "../utility/noop": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\utility\\noop.js",
66103         "./metaMap": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\metaMap.js"
66104     }],
66105     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\getFuncName.js": [function(require, module, exports) {
66106         var realNames = require('./realNames');
66107
66108         /**
66109          * Gets the name of `func`.
66110          * 
66111          * @private
66112          * @param {Function}
66113          *            func The function to query.
66114          * @returns {string} Returns the function name.
66115          */
66116         function getFuncName(func) {
66117             var result = (func.name + ''),
66118                 array = realNames[result],
66119                 length = array ? array.length : 0;
66120
66121             while (length--) {
66122                 var data = array[length],
66123                     otherFunc = data.func;
66124                 if (otherFunc == null || otherFunc == func) {
66125                     return data.name;
66126                 }
66127             }
66128             return result;
66129         }
66130
66131         module.exports = getFuncName;
66132
66133     }, {
66134         "./realNames": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\realNames.js"
66135     }],
66136     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\getLength.js": [function(require, module, exports) {
66137         var baseProperty = require('./baseProperty');
66138
66139         /**
66140          * Gets the "length" property value of `object`.
66141          * 
66142          * **Note:** This function is used to avoid a [JIT
66143          * bug](https://bugs.webkit.org/show_bug.cgi?id=142792) that affects Safari on
66144          * at least iOS 8.1-8.3 ARM64.
66145          * 
66146          * @private
66147          * @param {Object}
66148          *            object The object to query.
66149          * @returns {*} Returns the "length" value.
66150          */
66151         var getLength = baseProperty('length');
66152
66153         module.exports = getLength;
66154
66155     }, {
66156         "./baseProperty": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseProperty.js"
66157     }],
66158     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\getMatchData.js": [function(require, module, exports) {
66159         var isStrictComparable = require('./isStrictComparable'),
66160             pairs = require('../object/pairs');
66161
66162         /**
66163          * Gets the propery names, values, and compare flags of `object`.
66164          * 
66165          * @private
66166          * @param {Object}
66167          *            object The object to query.
66168          * @returns {Array} Returns the match data of `object`.
66169          */
66170         function getMatchData(object) {
66171             var result = pairs(object),
66172                 length = result.length;
66173
66174             while (length--) {
66175                 result[length][2] = isStrictComparable(result[length][1]);
66176             }
66177             return result;
66178         }
66179
66180         module.exports = getMatchData;
66181
66182     }, {
66183         "../object/pairs": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\pairs.js",
66184         "./isStrictComparable": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isStrictComparable.js"
66185     }],
66186     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\getNative.js": [function(require, module, exports) {
66187         var isNative = require('../lang/isNative');
66188
66189         /**
66190          * Gets the native function at `key` of `object`.
66191          * 
66192          * @private
66193          * @param {Object}
66194          *            object The object to query.
66195          * @param {string}
66196          *            key The key of the method to get.
66197          * @returns {*} Returns the function if it's native, else `undefined`.
66198          */
66199         function getNative(object, key) {
66200             var value = object == null ? undefined : object[key];
66201             return isNative(value) ? value : undefined;
66202         }
66203
66204         module.exports = getNative;
66205
66206     }, {
66207         "../lang/isNative": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isNative.js"
66208     }],
66209     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\indexOfNaN.js": [function(require, module, exports) {
66210         /**
66211          * Gets the index at which the first occurrence of `NaN` is found in `array`.
66212          * 
66213          * @private
66214          * @param {Array}
66215          *            array The array to search.
66216          * @param {number}
66217          *            fromIndex The index to search from.
66218          * @param {boolean}
66219          *            [fromRight] Specify iterating from right to left.
66220          * @returns {number} Returns the index of the matched `NaN`, else `-1`.
66221          */
66222         function indexOfNaN(array, fromIndex, fromRight) {
66223             var length = array.length,
66224                 index = fromIndex + (fromRight ? 0 : -1);
66225
66226             while ((fromRight ? index-- : ++index < length)) {
66227                 var other = array[index];
66228                 if (other !== other) {
66229                     return index;
66230                 }
66231             }
66232             return -1;
66233         }
66234
66235         module.exports = indexOfNaN;
66236
66237     }, {}],
66238     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isArrayLike.js": [function(require, module, exports) {
66239         var getLength = require('./getLength'),
66240             isLength = require('./isLength');
66241
66242         /**
66243          * Checks if `value` is array-like.
66244          * 
66245          * @private
66246          * @param {*}
66247          *            value The value to check.
66248          * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
66249          */
66250         function isArrayLike(value) {
66251             return value != null && isLength(getLength(value));
66252         }
66253
66254         module.exports = isArrayLike;
66255
66256     }, {
66257         "./getLength": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\getLength.js",
66258         "./isLength": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isLength.js"
66259     }],
66260     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isIndex.js": [function(require, module, exports) {
66261         /** Used to detect unsigned integer values. */
66262         var reIsUint = /^\d+$/;
66263
66264         /**
66265          * Used as the [maximum
66266          * length](http://ecma-international.org/ecma-262/6.0/#sec-number.max_safe_integer)
66267          * of an array-like value.
66268          */
66269         var MAX_SAFE_INTEGER = 9007199254740991;
66270
66271         /**
66272          * Checks if `value` is a valid array-like index.
66273          * 
66274          * @private
66275          * @param {*}
66276          *            value The value to check.
66277          * @param {number}
66278          *            [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
66279          * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
66280          */
66281         function isIndex(value, length) {
66282             value = (typeof value == 'number' || reIsUint.test(value)) ? +value : -1;
66283             length = length == null ? MAX_SAFE_INTEGER : length;
66284             return value > -1 && value % 1 == 0 && value < length;
66285         }
66286
66287         module.exports = isIndex;
66288
66289     }, {}],
66290     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isIterateeCall.js": [function(require, module, exports) {
66291         var isArrayLike = require('./isArrayLike'),
66292             isIndex = require('./isIndex'),
66293             isObject = require('../lang/isObject');
66294
66295         /**
66296          * Checks if the provided arguments are from an iteratee call.
66297          * 
66298          * @private
66299          * @param {*}
66300          *            value The potential iteratee value argument.
66301          * @param {*}
66302          *            index The potential iteratee index or key argument.
66303          * @param {*}
66304          *            object The potential iteratee object argument.
66305          * @returns {boolean} Returns `true` if the arguments are from an iteratee call,
66306          *          else `false`.
66307          */
66308         function isIterateeCall(value, index, object) {
66309             if (!isObject(object)) {
66310                 return false;
66311             }
66312             var type = typeof index;
66313             if (type == 'number' ? (isArrayLike(object) && isIndex(index, object.length)) : (type == 'string' && index in object)) {
66314                 var other = object[index];
66315                 return value === value ? (value === other) : (other !== other);
66316             }
66317             return false;
66318         }
66319
66320         module.exports = isIterateeCall;
66321
66322     }, {
66323         "../lang/isObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isObject.js",
66324         "./isArrayLike": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isArrayLike.js",
66325         "./isIndex": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isIndex.js"
66326     }],
66327     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isKey.js": [function(require, module, exports) {
66328         var isArray = require('../lang/isArray'),
66329             toObject = require('./toObject');
66330
66331         /** Used to match property names within property paths. */
66332         var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\n\\]|\\.)*?\1)\]/,
66333             reIsPlainProp = /^\w*$/;
66334
66335         /**
66336          * Checks if `value` is a property name and not a property path.
66337          * 
66338          * @private
66339          * @param {*}
66340          *            value The value to check.
66341          * @param {Object}
66342          *            [object] The object to query keys on.
66343          * @returns {boolean} Returns `true` if `value` is a property name, else
66344          *          `false`.
66345          */
66346         function isKey(value, object) {
66347             var type = typeof value;
66348             if ((type == 'string' && reIsPlainProp.test(value)) || type == 'number') {
66349                 return true;
66350             }
66351             if (isArray(value)) {
66352                 return false;
66353             }
66354             var result = !reIsDeepProp.test(value);
66355             return result || (object != null && value in toObject(object));
66356         }
66357
66358         module.exports = isKey;
66359
66360     }, {
66361         "../lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js",
66362         "./toObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\toObject.js"
66363     }],
66364     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isLaziable.js": [function(require, module, exports) {
66365         var LazyWrapper = require('./LazyWrapper'),
66366             getData = require('./getData'),
66367             getFuncName = require('./getFuncName'),
66368             lodash = require('../chain/lodash');
66369
66370         /**
66371          * Checks if `func` has a lazy counterpart.
66372          * 
66373          * @private
66374          * @param {Function}
66375          *            func The function to check.
66376          * @returns {boolean} Returns `true` if `func` has a lazy counterpart, else
66377          *          `false`.
66378          */
66379         function isLaziable(func) {
66380             var funcName = getFuncName(func),
66381                 other = lodash[funcName];
66382
66383             if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) {
66384                 return false;
66385             }
66386             if (func === other) {
66387                 return true;
66388             }
66389             var data = getData(other);
66390             return !!data && func === data[0];
66391         }
66392
66393         module.exports = isLaziable;
66394
66395     }, {
66396         "../chain/lodash": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\chain\\lodash.js",
66397         "./LazyWrapper": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\LazyWrapper.js",
66398         "./getData": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\getData.js",
66399         "./getFuncName": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\getFuncName.js"
66400     }],
66401     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isLength.js": [function(require, module, exports) {
66402         /**
66403          * Used as the [maximum
66404          * length](http://ecma-international.org/ecma-262/6.0/#sec-number.max_safe_integer)
66405          * of an array-like value.
66406          */
66407         var MAX_SAFE_INTEGER = 9007199254740991;
66408
66409         /**
66410          * Checks if `value` is a valid array-like length.
66411          * 
66412          * **Note:** This function is based on
66413          * [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength).
66414          * 
66415          * @private
66416          * @param {*}
66417          *            value The value to check.
66418          * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
66419          */
66420         function isLength(value) {
66421             return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
66422         }
66423
66424         module.exports = isLength;
66425
66426     }, {}],
66427     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isObjectLike.js": [function(require, module, exports) {
66428         /**
66429          * Checks if `value` is object-like.
66430          * 
66431          * @private
66432          * @param {*}
66433          *            value The value to check.
66434          * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
66435          */
66436         function isObjectLike(value) {
66437             return !!value && typeof value == 'object';
66438         }
66439
66440         module.exports = isObjectLike;
66441
66442     }, {}],
66443     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isStrictComparable.js": [function(require, module, exports) {
66444         var isObject = require('../lang/isObject');
66445
66446         /**
66447          * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
66448          * 
66449          * @private
66450          * @param {*}
66451          *            value The value to check.
66452          * @returns {boolean} Returns `true` if `value` if suitable for strict equality
66453          *          comparisons, else `false`.
66454          */
66455         function isStrictComparable(value) {
66456             return value === value && !isObject(value);
66457         }
66458
66459         module.exports = isStrictComparable;
66460
66461     }, {
66462         "../lang/isObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isObject.js"
66463     }],
66464     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\mergeData.js": [function(require, module, exports) {
66465         var arrayCopy = require('./arrayCopy'),
66466             composeArgs = require('./composeArgs'),
66467             composeArgsRight = require('./composeArgsRight'),
66468             replaceHolders = require('./replaceHolders');
66469
66470         /** Used to compose bitmasks for wrapper metadata. */
66471         var BIND_FLAG = 1,
66472             CURRY_BOUND_FLAG = 4,
66473             CURRY_FLAG = 8,
66474             ARY_FLAG = 128,
66475             REARG_FLAG = 256;
66476
66477         /** Used as the internal argument placeholder. */
66478         var PLACEHOLDER = '__lodash_placeholder__';
66479
66480         /*
66481          * Native method references for those with the same name as other `lodash`
66482          * methods.
66483          */
66484         var nativeMin = Math.min;
66485
66486         /**
66487          * Merges the function metadata of `source` into `data`.
66488          * 
66489          * Merging metadata reduces the number of wrappers required to invoke a
66490          * function. This is possible because methods like `_.bind`, `_.curry`, and
66491          * `_.partial` may be applied regardless of execution order. Methods like
66492          * `_.ary` and `_.rearg` augment function arguments, making the order in which
66493          * they are executed important, preventing the merging of metadata. However, we
66494          * make an exception for a safe common case where curried functions have `_.ary`
66495          * and or `_.rearg` applied.
66496          * 
66497          * @private
66498          * @param {Array}
66499          *            data The destination metadata.
66500          * @param {Array}
66501          *            source The source metadata.
66502          * @returns {Array} Returns `data`.
66503          */
66504         function mergeData(data, source) {
66505             var bitmask = data[1],
66506                 srcBitmask = source[1],
66507                 newBitmask = bitmask | srcBitmask,
66508                 isCommon = newBitmask < ARY_FLAG;
66509
66510             var isCombo =
66511                 (srcBitmask == ARY_FLAG && bitmask == CURRY_FLAG) ||
66512                 (srcBitmask == ARY_FLAG && bitmask == REARG_FLAG && data[7].length <= source[8]) ||
66513                 (srcBitmask == (ARY_FLAG | REARG_FLAG) && bitmask == CURRY_FLAG);
66514
66515             // Exit early if metadata can't be merged.
66516             if (!(isCommon || isCombo)) {
66517                 return data;
66518             }
66519             // Use source `thisArg` if available.
66520             if (srcBitmask & BIND_FLAG) {
66521                 data[2] = source[2];
66522                 // Set when currying a bound function.
66523                 newBitmask |= (bitmask & BIND_FLAG) ? 0 : CURRY_BOUND_FLAG;
66524             }
66525             // Compose partial arguments.
66526             var value = source[3];
66527             if (value) {
66528                 var partials = data[3];
66529                 data[3] = partials ? composeArgs(partials, value, source[4]) : arrayCopy(value);
66530                 data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : arrayCopy(source[4]);
66531             }
66532             // Compose partial right arguments.
66533             value = source[5];
66534             if (value) {
66535                 partials = data[5];
66536                 data[5] = partials ? composeArgsRight(partials, value, source[6]) : arrayCopy(value);
66537                 data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : arrayCopy(source[6]);
66538             }
66539             // Use source `argPos` if available.
66540             value = source[7];
66541             if (value) {
66542                 data[7] = arrayCopy(value);
66543             }
66544             // Use source `ary` if it's smaller.
66545             if (srcBitmask & ARY_FLAG) {
66546                 data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);
66547             }
66548             // Use source `arity` if one is not provided.
66549             if (data[9] == null) {
66550                 data[9] = source[9];
66551             }
66552             // Use source `func` and merge bitmasks.
66553             data[0] = source[0];
66554             data[1] = newBitmask;
66555
66556             return data;
66557         }
66558
66559         module.exports = mergeData;
66560
66561     }, {
66562         "./arrayCopy": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\arrayCopy.js",
66563         "./composeArgs": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\composeArgs.js",
66564         "./composeArgsRight": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\composeArgsRight.js",
66565         "./replaceHolders": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\replaceHolders.js"
66566     }],
66567     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\metaMap.js": [function(require, module, exports) {
66568         (function(global) {
66569             var getNative = require('./getNative');
66570
66571             /** Native method references. */
66572             var WeakMap = getNative(global, 'WeakMap');
66573
66574             /** Used to store function metadata. */
66575             var metaMap = WeakMap && new WeakMap;
66576
66577             module.exports = metaMap;
66578
66579         }).call(this, typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
66580     }, {
66581         "./getNative": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\getNative.js"
66582     }],
66583     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\pickByArray.js": [function(require, module, exports) {
66584         var toObject = require('./toObject');
66585
66586         /**
66587          * A specialized version of `_.pick` which picks `object` properties specified
66588          * by `props`.
66589          * 
66590          * @private
66591          * @param {Object}
66592          *            object The source object.
66593          * @param {string[]}
66594          *            props The property names to pick.
66595          * @returns {Object} Returns the new object.
66596          */
66597         function pickByArray(object, props) {
66598             object = toObject(object);
66599
66600             var index = -1,
66601                 length = props.length,
66602                 result = {};
66603
66604             while (++index < length) {
66605                 var key = props[index];
66606                 if (key in object) {
66607                     result[key] = object[key];
66608                 }
66609             }
66610             return result;
66611         }
66612
66613         module.exports = pickByArray;
66614
66615     }, {
66616         "./toObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\toObject.js"
66617     }],
66618     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\pickByCallback.js": [function(require, module, exports) {
66619         var baseForIn = require('./baseForIn');
66620
66621         /**
66622          * A specialized version of `_.pick` which picks `object` properties `predicate`
66623          * returns truthy for.
66624          * 
66625          * @private
66626          * @param {Object}
66627          *            object The source object.
66628          * @param {Function}
66629          *            predicate The function invoked per iteration.
66630          * @returns {Object} Returns the new object.
66631          */
66632         function pickByCallback(object, predicate) {
66633             var result = {};
66634             baseForIn(object, function(value, key, object) {
66635                 if (predicate(value, key, object)) {
66636                     result[key] = value;
66637                 }
66638             });
66639             return result;
66640         }
66641
66642         module.exports = pickByCallback;
66643
66644     }, {
66645         "./baseForIn": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseForIn.js"
66646     }],
66647     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\realNames.js": [function(require, module, exports) {
66648         /** Used to lookup unminified function names. */
66649         var realNames = {};
66650
66651         module.exports = realNames;
66652
66653     }, {}],
66654     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\reorder.js": [function(require, module, exports) {
66655         var arrayCopy = require('./arrayCopy'),
66656             isIndex = require('./isIndex');
66657
66658         /*
66659          * Native method references for those with the same name as other `lodash`
66660          * methods.
66661          */
66662         var nativeMin = Math.min;
66663
66664         /**
66665          * Reorder `array` according to the specified indexes where the element at the
66666          * first index is assigned as the first element, the element at the second index
66667          * is assigned as the second element, and so on.
66668          * 
66669          * @private
66670          * @param {Array}
66671          *            array The array to reorder.
66672          * @param {Array}
66673          *            indexes The arranged array indexes.
66674          * @returns {Array} Returns `array`.
66675          */
66676         function reorder(array, indexes) {
66677             var arrLength = array.length,
66678                 length = nativeMin(indexes.length, arrLength),
66679                 oldArray = arrayCopy(array);
66680
66681             while (length--) {
66682                 var index = indexes[length];
66683                 array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;
66684             }
66685             return array;
66686         }
66687
66688         module.exports = reorder;
66689
66690     }, {
66691         "./arrayCopy": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\arrayCopy.js",
66692         "./isIndex": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isIndex.js"
66693     }],
66694     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\replaceHolders.js": [function(require, module, exports) {
66695         /** Used as the internal argument placeholder. */
66696         var PLACEHOLDER = '__lodash_placeholder__';
66697
66698         /**
66699          * Replaces all `placeholder` elements in `array` with an internal placeholder
66700          * and returns an array of their indexes.
66701          * 
66702          * @private
66703          * @param {Array}
66704          *            array The array to modify.
66705          * @param {*}
66706          *            placeholder The placeholder to replace.
66707          * @returns {Array} Returns the new array of placeholder indexes.
66708          */
66709         function replaceHolders(array, placeholder) {
66710             var index = -1,
66711                 length = array.length,
66712                 resIndex = -1,
66713                 result = [];
66714
66715             while (++index < length) {
66716                 if (array[index] === placeholder) {
66717                     array[index] = PLACEHOLDER;
66718                     result[++resIndex] = index;
66719                 }
66720             }
66721             return result;
66722         }
66723
66724         module.exports = replaceHolders;
66725
66726     }, {}],
66727     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\setData.js": [function(require, module, exports) {
66728         var baseSetData = require('./baseSetData'),
66729             now = require('../date/now');
66730
66731         /** Used to detect when a function becomes hot. */
66732         var HOT_COUNT = 150,
66733             HOT_SPAN = 16;
66734
66735         /**
66736          * Sets metadata for `func`.
66737          * 
66738          * **Note:** If this function becomes hot, i.e. is invoked a lot in a short
66739          * period of time, it will trip its breaker and transition to an identity
66740          * function to avoid garbage collection pauses in V8. See [V8 issue
66741          * 2070](https://code.google.com/p/v8/issues/detail?id=2070) for more details.
66742          * 
66743          * @private
66744          * @param {Function}
66745          *            func The function to associate metadata with.
66746          * @param {*}
66747          *            data The metadata.
66748          * @returns {Function} Returns `func`.
66749          */
66750         var setData = (function() {
66751             var count = 0,
66752                 lastCalled = 0;
66753
66754             return function(key, value) {
66755                 var stamp = now(),
66756                     remaining = HOT_SPAN - (stamp - lastCalled);
66757
66758                 lastCalled = stamp;
66759                 if (remaining > 0) {
66760                     if (++count >= HOT_COUNT) {
66761                         return key;
66762                     }
66763                 } else {
66764                     count = 0;
66765                 }
66766                 return baseSetData(key, value);
66767             };
66768         }());
66769
66770         module.exports = setData;
66771
66772     }, {
66773         "../date/now": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\date\\now.js",
66774         "./baseSetData": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseSetData.js"
66775     }],
66776     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\shimKeys.js": [function(require, module, exports) {
66777         var isArguments = require('../lang/isArguments'),
66778             isArray = require('../lang/isArray'),
66779             isIndex = require('./isIndex'),
66780             isLength = require('./isLength'),
66781             keysIn = require('../object/keysIn');
66782
66783         /** Used for native method references. */
66784         var objectProto = Object.prototype;
66785
66786         /** Used to check objects for own properties. */
66787         var hasOwnProperty = objectProto.hasOwnProperty;
66788
66789         /**
66790          * A fallback implementation of `Object.keys` which creates an array of the own
66791          * enumerable property names of `object`.
66792          * 
66793          * @private
66794          * @param {Object}
66795          *            object The object to query.
66796          * @returns {Array} Returns the array of property names.
66797          */
66798         function shimKeys(object) {
66799             var props = keysIn(object),
66800                 propsLength = props.length,
66801                 length = propsLength && object.length;
66802
66803             var allowIndexes = !!length && isLength(length) &&
66804                 (isArray(object) || isArguments(object));
66805
66806             var index = -1,
66807                 result = [];
66808
66809             while (++index < propsLength) {
66810                 var key = props[index];
66811                 if ((allowIndexes && isIndex(key, length)) || hasOwnProperty.call(object, key)) {
66812                     result.push(key);
66813                 }
66814             }
66815             return result;
66816         }
66817
66818         module.exports = shimKeys;
66819
66820     }, {
66821         "../lang/isArguments": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArguments.js",
66822         "../lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js",
66823         "../object/keysIn": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\keysIn.js",
66824         "./isIndex": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isIndex.js",
66825         "./isLength": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isLength.js"
66826     }],
66827     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\sortedUniq.js": [function(require, module, exports) {
66828         /**
66829          * An implementation of `_.uniq` optimized for sorted arrays without support for
66830          * callback shorthands and `this` binding.
66831          * 
66832          * @private
66833          * @param {Array}
66834          *            array The array to inspect.
66835          * @param {Function}
66836          *            [iteratee] The function invoked per iteration.
66837          * @returns {Array} Returns the new duplicate free array.
66838          */
66839         function sortedUniq(array, iteratee) {
66840             var seen,
66841                 index = -1,
66842                 length = array.length,
66843                 resIndex = -1,
66844                 result = [];
66845
66846             while (++index < length) {
66847                 var value = array[index],
66848                     computed = iteratee ? iteratee(value, index, array) : value;
66849
66850                 if (!index || seen !== computed) {
66851                     seen = computed;
66852                     result[++resIndex] = value;
66853                 }
66854             }
66855             return result;
66856         }
66857
66858         module.exports = sortedUniq;
66859
66860     }, {}],
66861     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\toObject.js": [function(require, module, exports) {
66862         var isObject = require('../lang/isObject');
66863
66864         /**
66865          * Converts `value` to an object if it's not one.
66866          * 
66867          * @private
66868          * @param {*}
66869          *            value The value to process.
66870          * @returns {Object} Returns the object.
66871          */
66872         function toObject(value) {
66873             return isObject(value) ? value : Object(value);
66874         }
66875
66876         module.exports = toObject;
66877
66878     }, {
66879         "../lang/isObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isObject.js"
66880     }],
66881     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\toPath.js": [function(require, module, exports) {
66882         var baseToString = require('./baseToString'),
66883             isArray = require('../lang/isArray');
66884
66885         /** Used to match property names within property paths. */
66886         var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\n\\]|\\.)*?)\2)\]/g;
66887
66888         /** Used to match backslashes in property paths. */
66889         var reEscapeChar = /\\(\\)?/g;
66890
66891         /**
66892          * Converts `value` to property path array if it's not one.
66893          * 
66894          * @private
66895          * @param {*}
66896          *            value The value to process.
66897          * @returns {Array} Returns the property path array.
66898          */
66899         function toPath(value) {
66900             if (isArray(value)) {
66901                 return value;
66902             }
66903             var result = [];
66904             baseToString(value).replace(rePropName, function(match, number, quote, string) {
66905                 result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));
66906             });
66907             return result;
66908         }
66909
66910         module.exports = toPath;
66911
66912     }, {
66913         "../lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js",
66914         "./baseToString": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseToString.js"
66915     }],
66916     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\wrapperClone.js": [function(require, module, exports) {
66917         var LazyWrapper = require('./LazyWrapper'),
66918             LodashWrapper = require('./LodashWrapper'),
66919             arrayCopy = require('./arrayCopy');
66920
66921         /**
66922          * Creates a clone of `wrapper`.
66923          * 
66924          * @private
66925          * @param {Object}
66926          *            wrapper The wrapper to clone.
66927          * @returns {Object} Returns the cloned wrapper.
66928          */
66929         function wrapperClone(wrapper) {
66930             return wrapper instanceof LazyWrapper ? wrapper.clone() : new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__, arrayCopy(wrapper.__actions__));
66931         }
66932
66933         module.exports = wrapperClone;
66934
66935     }, {
66936         "./LazyWrapper": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\LazyWrapper.js",
66937         "./LodashWrapper": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\LodashWrapper.js",
66938         "./arrayCopy": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\arrayCopy.js"
66939     }],
66940     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArguments.js": [function(require, module, exports) {
66941         var isArrayLike = require('../internal/isArrayLike'),
66942             isObjectLike = require('../internal/isObjectLike');
66943
66944         /** Used for native method references. */
66945         var objectProto = Object.prototype;
66946
66947         /** Used to check objects for own properties. */
66948         var hasOwnProperty = objectProto.hasOwnProperty;
66949
66950         /** Native method references. */
66951         var propertyIsEnumerable = objectProto.propertyIsEnumerable;
66952
66953         /**
66954          * Checks if `value` is classified as an `arguments` object.
66955          * 
66956          * @static
66957          * @memberOf _
66958          * @category Lang
66959          * @param {*}
66960          *            value The value to check.
66961          * @returns {boolean} Returns `true` if `value` is correctly classified, else
66962          *          `false`.
66963          * @example
66964          * 
66965          * _.isArguments(function() { return arguments; }()); // => true
66966          * 
66967          * _.isArguments([1, 2, 3]); // => false
66968          */
66969         function isArguments(value) {
66970             return isObjectLike(value) && isArrayLike(value) &&
66971                 hasOwnProperty.call(value, 'callee') && !propertyIsEnumerable.call(value, 'callee');
66972         }
66973
66974         module.exports = isArguments;
66975
66976     }, {
66977         "../internal/isArrayLike": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isArrayLike.js",
66978         "../internal/isObjectLike": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isObjectLike.js"
66979     }],
66980     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js": [function(require, module, exports) {
66981         var getNative = require('../internal/getNative'),
66982             isLength = require('../internal/isLength'),
66983             isObjectLike = require('../internal/isObjectLike');
66984
66985         /** `Object#toString` result references. */
66986         var arrayTag = '[object Array]';
66987
66988         /** Used for native method references. */
66989         var objectProto = Object.prototype;
66990
66991         /**
66992          * Used to resolve the
66993          * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
66994          * of values.
66995          */
66996         var objToString = objectProto.toString;
66997
66998         /*
66999          * Native method references for those with the same name as other `lodash`
67000          * methods.
67001          */
67002         var nativeIsArray = getNative(Array, 'isArray');
67003
67004         /**
67005          * Checks if `value` is classified as an `Array` object.
67006          * 
67007          * @static
67008          * @memberOf _
67009          * @category Lang
67010          * @param {*}
67011          *            value The value to check.
67012          * @returns {boolean} Returns `true` if `value` is correctly classified, else
67013          *          `false`.
67014          * @example
67015          * 
67016          * _.isArray([1, 2, 3]); // => true
67017          * 
67018          * _.isArray(function() { return arguments; }()); // => false
67019          */
67020         var isArray = nativeIsArray || function(value) {
67021             return isObjectLike(value) && isLength(value.length) && objToString.call(value) == arrayTag;
67022         };
67023
67024         module.exports = isArray;
67025
67026     }, {
67027         "../internal/getNative": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\getNative.js",
67028         "../internal/isLength": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isLength.js",
67029         "../internal/isObjectLike": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isObjectLike.js"
67030     }],
67031     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isFunction.js": [function(require, module, exports) {
67032         var isObject = require('./isObject');
67033
67034         /** `Object#toString` result references. */
67035         var funcTag = '[object Function]';
67036
67037         /** Used for native method references. */
67038         var objectProto = Object.prototype;
67039
67040         /**
67041          * Used to resolve the
67042          * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
67043          * of values.
67044          */
67045         var objToString = objectProto.toString;
67046
67047         /**
67048          * Checks if `value` is classified as a `Function` object.
67049          * 
67050          * @static
67051          * @memberOf _
67052          * @category Lang
67053          * @param {*}
67054          *            value The value to check.
67055          * @returns {boolean} Returns `true` if `value` is correctly classified, else
67056          *          `false`.
67057          * @example
67058          * 
67059          * _.isFunction(_); // => true
67060          * 
67061          * _.isFunction(/abc/); // => false
67062          */
67063         function isFunction(value) {
67064             // The use of `Object#toString` avoids issues with the `typeof` operator
67065             // in older versions of Chrome and Safari which return 'function' for
67066             // regexes
67067             // and Safari 8 which returns 'object' for typed array constructors.
67068             return isObject(value) && objToString.call(value) == funcTag;
67069         }
67070
67071         module.exports = isFunction;
67072
67073     }, {
67074         "./isObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isObject.js"
67075     }],
67076     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isNative.js": [function(require, module, exports) {
67077         var isFunction = require('./isFunction'),
67078             isObjectLike = require('../internal/isObjectLike');
67079
67080         /** Used to detect host constructors (Safari > 5). */
67081         var reIsHostCtor = /^\[object .+?Constructor\]$/;
67082
67083         /** Used for native method references. */
67084         var objectProto = Object.prototype;
67085
67086         /** Used to resolve the decompiled source of functions. */
67087         var fnToString = Function.prototype.toString;
67088
67089         /** Used to check objects for own properties. */
67090         var hasOwnProperty = objectProto.hasOwnProperty;
67091
67092         /** Used to detect if a method is native. */
67093         var reIsNative = RegExp('^' +
67094             fnToString.call(hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g, '\\$&')
67095             .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
67096         );
67097
67098         /**
67099          * Checks if `value` is a native function.
67100          * 
67101          * @static
67102          * @memberOf _
67103          * @category Lang
67104          * @param {*}
67105          *            value The value to check.
67106          * @returns {boolean} Returns `true` if `value` is a native function, else
67107          *          `false`.
67108          * @example
67109          * 
67110          * _.isNative(Array.prototype.push); // => true
67111          * 
67112          * _.isNative(_); // => false
67113          */
67114         function isNative(value) {
67115             if (value == null) {
67116                 return false;
67117             }
67118             if (isFunction(value)) {
67119                 return reIsNative.test(fnToString.call(value));
67120             }
67121             return isObjectLike(value) && reIsHostCtor.test(value);
67122         }
67123
67124         module.exports = isNative;
67125
67126     }, {
67127         "../internal/isObjectLike": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isObjectLike.js",
67128         "./isFunction": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isFunction.js"
67129     }],
67130     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isNumber.js": [function(require, module, exports) {
67131         var isObjectLike = require('../internal/isObjectLike');
67132
67133         /** `Object#toString` result references. */
67134         var numberTag = '[object Number]';
67135
67136         /** Used for native method references. */
67137         var objectProto = Object.prototype;
67138
67139         /**
67140          * Used to resolve the
67141          * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
67142          * of values.
67143          */
67144         var objToString = objectProto.toString;
67145
67146         /**
67147          * Checks if `value` is classified as a `Number` primitive or object.
67148          * 
67149          * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are classified
67150          * as numbers, use the `_.isFinite` method.
67151          * 
67152          * @static
67153          * @memberOf _
67154          * @category Lang
67155          * @param {*}
67156          *            value The value to check.
67157          * @returns {boolean} Returns `true` if `value` is correctly classified, else
67158          *          `false`.
67159          * @example
67160          * 
67161          * _.isNumber(8.4); // => true
67162          * 
67163          * _.isNumber(NaN); // => true
67164          * 
67165          * _.isNumber('8.4'); // => false
67166          */
67167         function isNumber(value) {
67168             return typeof value == 'number' || (isObjectLike(value) && objToString.call(value) == numberTag);
67169         }
67170
67171         module.exports = isNumber;
67172
67173     }, {
67174         "../internal/isObjectLike": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isObjectLike.js"
67175     }],
67176     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isObject.js": [function(require, module, exports) {
67177         /**
67178          * Checks if `value` is the [language type](https://es5.github.io/#x8) of
67179          * `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and
67180          * `new String('')`)
67181          * 
67182          * @static
67183          * @memberOf _
67184          * @category Lang
67185          * @param {*}
67186          *            value The value to check.
67187          * @returns {boolean} Returns `true` if `value` is an object, else `false`.
67188          * @example
67189          * 
67190          * _.isObject({}); // => true
67191          * 
67192          * _.isObject([1, 2, 3]); // => true
67193          * 
67194          * _.isObject(1); // => false
67195          */
67196         function isObject(value) {
67197             // Avoid a V8 JIT bug in Chrome 19-20.
67198             // See https://code.google.com/p/v8/issues/detail?id=2291 for more details.
67199             var type = typeof value;
67200             return !!value && (type == 'object' || type == 'function');
67201         }
67202
67203         module.exports = isObject;
67204
67205     }, {}],
67206     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isPlainObject.js": [function(require, module, exports) {
67207         var baseForIn = require('../internal/baseForIn'),
67208             isArguments = require('./isArguments'),
67209             isObjectLike = require('../internal/isObjectLike');
67210
67211         /** `Object#toString` result references. */
67212         var objectTag = '[object Object]';
67213
67214         /** Used for native method references. */
67215         var objectProto = Object.prototype;
67216
67217         /** Used to check objects for own properties. */
67218         var hasOwnProperty = objectProto.hasOwnProperty;
67219
67220         /**
67221          * Used to resolve the
67222          * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
67223          * of values.
67224          */
67225         var objToString = objectProto.toString;
67226
67227         /**
67228          * Checks if `value` is a plain object, that is, an object created by the
67229          * `Object` constructor or one with a `[[Prototype]]` of `null`.
67230          * 
67231          * **Note:** This method assumes objects created by the `Object` constructor
67232          * have no inherited enumerable properties.
67233          * 
67234          * @static
67235          * @memberOf _
67236          * @category Lang
67237          * @param {*}
67238          *            value The value to check.
67239          * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
67240          * @example
67241          * 
67242          * function Foo() { this.a = 1; }
67243          * 
67244          * _.isPlainObject(new Foo); // => false
67245          * 
67246          * _.isPlainObject([1, 2, 3]); // => false
67247          * 
67248          * _.isPlainObject({ 'x': 0, 'y': 0 }); // => true
67249          * 
67250          * _.isPlainObject(Object.create(null)); // => true
67251          */
67252         function isPlainObject(value) {
67253             var Ctor;
67254
67255             // Exit early for non `Object` objects.
67256             if (!(isObjectLike(value) && objToString.call(value) == objectTag && !isArguments(value)) ||
67257                 (!hasOwnProperty.call(value, 'constructor') && (Ctor = value.constructor, typeof Ctor == 'function' && !(Ctor instanceof Ctor)))) {
67258                 return false;
67259             }
67260             // IE < 9 iterates inherited properties before own properties. If the first
67261             // iterated property is an object's own property then there are no inherited
67262             // enumerable properties.
67263             var result;
67264             // In most environments an object's own properties are iterated before
67265             // its inherited properties. If the last iterated property is an object's
67266             // own property then there are no inherited enumerable properties.
67267             baseForIn(value, function(subValue, key) {
67268                 result = key;
67269             });
67270             return result === undefined || hasOwnProperty.call(value, result);
67271         }
67272
67273         module.exports = isPlainObject;
67274
67275     }, {
67276         "../internal/baseForIn": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseForIn.js",
67277         "../internal/isObjectLike": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isObjectLike.js",
67278         "./isArguments": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArguments.js"
67279     }],
67280     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isString.js": [function(require, module, exports) {
67281         var isObjectLike = require('../internal/isObjectLike');
67282
67283         /** `Object#toString` result references. */
67284         var stringTag = '[object String]';
67285
67286         /** Used for native method references. */
67287         var objectProto = Object.prototype;
67288
67289         /**
67290          * Used to resolve the
67291          * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
67292          * of values.
67293          */
67294         var objToString = objectProto.toString;
67295
67296         /**
67297          * Checks if `value` is classified as a `String` primitive or object.
67298          * 
67299          * @static
67300          * @memberOf _
67301          * @category Lang
67302          * @param {*}
67303          *            value The value to check.
67304          * @returns {boolean} Returns `true` if `value` is correctly classified, else
67305          *          `false`.
67306          * @example
67307          * 
67308          * _.isString('abc'); // => true
67309          * 
67310          * _.isString(1); // => false
67311          */
67312         function isString(value) {
67313             return typeof value == 'string' || (isObjectLike(value) && objToString.call(value) == stringTag);
67314         }
67315
67316         module.exports = isString;
67317
67318     }, {
67319         "../internal/isObjectLike": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isObjectLike.js"
67320     }],
67321     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isTypedArray.js": [function(require, module, exports) {
67322         var isLength = require('../internal/isLength'),
67323             isObjectLike = require('../internal/isObjectLike');
67324
67325         /** `Object#toString` result references. */
67326         var argsTag = '[object Arguments]',
67327             arrayTag = '[object Array]',
67328             boolTag = '[object Boolean]',
67329             dateTag = '[object Date]',
67330             errorTag = '[object Error]',
67331             funcTag = '[object Function]',
67332             mapTag = '[object Map]',
67333             numberTag = '[object Number]',
67334             objectTag = '[object Object]',
67335             regexpTag = '[object RegExp]',
67336             setTag = '[object Set]',
67337             stringTag = '[object String]',
67338             weakMapTag = '[object WeakMap]';
67339
67340         var arrayBufferTag = '[object ArrayBuffer]',
67341             float32Tag = '[object Float32Array]',
67342             float64Tag = '[object Float64Array]',
67343             int8Tag = '[object Int8Array]',
67344             int16Tag = '[object Int16Array]',
67345             int32Tag = '[object Int32Array]',
67346             uint8Tag = '[object Uint8Array]',
67347             uint8ClampedTag = '[object Uint8ClampedArray]',
67348             uint16Tag = '[object Uint16Array]',
67349             uint32Tag = '[object Uint32Array]';
67350
67351         /** Used to identify `toStringTag` values of typed arrays. */
67352         var typedArrayTags = {};
67353         typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
67354             typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
67355             typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
67356             typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
67357             typedArrayTags[uint32Tag] = true;
67358         typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
67359             typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
67360             typedArrayTags[dateTag] = typedArrayTags[errorTag] =
67361             typedArrayTags[funcTag] = typedArrayTags[mapTag] =
67362             typedArrayTags[numberTag] = typedArrayTags[objectTag] =
67363             typedArrayTags[regexpTag] = typedArrayTags[setTag] =
67364             typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false;
67365
67366         /** Used for native method references. */
67367         var objectProto = Object.prototype;
67368
67369         /**
67370          * Used to resolve the
67371          * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
67372          * of values.
67373          */
67374         var objToString = objectProto.toString;
67375
67376         /**
67377          * Checks if `value` is classified as a typed array.
67378          * 
67379          * @static
67380          * @memberOf _
67381          * @category Lang
67382          * @param {*}
67383          *            value The value to check.
67384          * @returns {boolean} Returns `true` if `value` is correctly classified, else
67385          *          `false`.
67386          * @example
67387          * 
67388          * _.isTypedArray(new Uint8Array); // => true
67389          * 
67390          * _.isTypedArray([]); // => false
67391          */
67392         function isTypedArray(value) {
67393             return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[objToString.call(value)];
67394         }
67395
67396         module.exports = isTypedArray;
67397
67398     }, {
67399         "../internal/isLength": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isLength.js",
67400         "../internal/isObjectLike": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isObjectLike.js"
67401     }],
67402     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\toPlainObject.js": [function(require, module, exports) {
67403         var baseCopy = require('../internal/baseCopy'),
67404             keysIn = require('../object/keysIn');
67405
67406         /**
67407          * Converts `value` to a plain object flattening inherited enumerable properties
67408          * of `value` to own properties of the plain object.
67409          * 
67410          * @static
67411          * @memberOf _
67412          * @category Lang
67413          * @param {*}
67414          *            value The value to convert.
67415          * @returns {Object} Returns the converted plain object.
67416          * @example
67417          * 
67418          * function Foo() { this.b = 2; }
67419          * 
67420          * Foo.prototype.c = 3;
67421          * 
67422          * _.assign({ 'a': 1 }, new Foo); // => { 'a': 1, 'b': 2 }
67423          * 
67424          * _.assign({ 'a': 1 }, _.toPlainObject(new Foo)); // => { 'a': 1, 'b': 2, 'c':
67425          * 3 }
67426          */
67427         function toPlainObject(value) {
67428             return baseCopy(value, keysIn(value));
67429         }
67430
67431         module.exports = toPlainObject;
67432
67433     }, {
67434         "../internal/baseCopy": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseCopy.js",
67435         "../object/keysIn": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\keysIn.js"
67436     }],
67437     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\assign.js": [function(require, module, exports) {
67438         var assignWith = require('../internal/assignWith'),
67439             baseAssign = require('../internal/baseAssign'),
67440             createAssigner = require('../internal/createAssigner');
67441
67442         /**
67443          * Assigns own enumerable properties of source object(s) to the destination
67444          * object. Subsequent sources overwrite property assignments of previous
67445          * sources. If `customizer` is provided it's invoked to produce the assigned
67446          * values. The `customizer` is bound to `thisArg` and invoked with five
67447          * arguments: (objectValue, sourceValue, key, object, source).
67448          * 
67449          * **Note:** This method mutates `object` and is based on
67450          * [`Object.assign`](http://ecma-international.org/ecma-262/6.0/#sec-object.assign).
67451          * 
67452          * @static
67453          * @memberOf _
67454          * @alias extend
67455          * @category Object
67456          * @param {Object}
67457          *            object The destination object.
67458          * @param {...Object}
67459          *            [sources] The source objects.
67460          * @param {Function}
67461          *            [customizer] The function to customize assigned values.
67462          * @param {*}
67463          *            [thisArg] The `this` binding of `customizer`.
67464          * @returns {Object} Returns `object`.
67465          * @example
67466          * 
67467          * _.assign({ 'user': 'barney' }, { 'age': 40 }, { 'user': 'fred' }); // => {
67468          * 'user': 'fred', 'age': 40 }
67469          *  // using a customizer callback var defaults = _.partialRight(_.assign,
67470          * function(value, other) { return _.isUndefined(value) ? other : value; });
67471          * 
67472          * defaults({ 'user': 'barney' }, { 'age': 36 }, { 'user': 'fred' }); // => {
67473          * 'user': 'barney', 'age': 36 }
67474          */
67475         var assign = createAssigner(function(object, source, customizer) {
67476             return customizer ? assignWith(object, source, customizer) : baseAssign(object, source);
67477         });
67478
67479         module.exports = assign;
67480
67481     }, {
67482         "../internal/assignWith": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\assignWith.js",
67483         "../internal/baseAssign": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseAssign.js",
67484         "../internal/createAssigner": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createAssigner.js"
67485     }],
67486     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\keys.js": [function(require, module, exports) {
67487         var getNative = require('../internal/getNative'),
67488             isArrayLike = require('../internal/isArrayLike'),
67489             isObject = require('../lang/isObject'),
67490             shimKeys = require('../internal/shimKeys');
67491
67492         /*
67493          * Native method references for those with the same name as other `lodash`
67494          * methods.
67495          */
67496         var nativeKeys = getNative(Object, 'keys');
67497
67498         /**
67499          * Creates an array of the own enumerable property names of `object`.
67500          * 
67501          * **Note:** Non-object values are coerced to objects. See the [ES
67502          * spec](http://ecma-international.org/ecma-262/6.0/#sec-object.keys) for more
67503          * details.
67504          * 
67505          * @static
67506          * @memberOf _
67507          * @category Object
67508          * @param {Object}
67509          *            object The object to query.
67510          * @returns {Array} Returns the array of property names.
67511          * @example
67512          * 
67513          * function Foo() { this.a = 1; this.b = 2; }
67514          * 
67515          * Foo.prototype.c = 3;
67516          * 
67517          * _.keys(new Foo); // => ['a', 'b'] (iteration order is not guaranteed)
67518          * 
67519          * _.keys('hi'); // => ['0', '1']
67520          */
67521         var keys = !nativeKeys ? shimKeys : function(object) {
67522             var Ctor = object == null ? undefined : object.constructor;
67523             if ((typeof Ctor == 'function' && Ctor.prototype === object) ||
67524                 (typeof object != 'function' && isArrayLike(object))) {
67525                 return shimKeys(object);
67526             }
67527             return isObject(object) ? nativeKeys(object) : [];
67528         };
67529
67530         module.exports = keys;
67531
67532     }, {
67533         "../internal/getNative": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\getNative.js",
67534         "../internal/isArrayLike": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isArrayLike.js",
67535         "../internal/shimKeys": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\shimKeys.js",
67536         "../lang/isObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isObject.js"
67537     }],
67538     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\keysIn.js": [function(require, module, exports) {
67539         var isArguments = require('../lang/isArguments'),
67540             isArray = require('../lang/isArray'),
67541             isIndex = require('../internal/isIndex'),
67542             isLength = require('../internal/isLength'),
67543             isObject = require('../lang/isObject');
67544
67545         /** Used for native method references. */
67546         var objectProto = Object.prototype;
67547
67548         /** Used to check objects for own properties. */
67549         var hasOwnProperty = objectProto.hasOwnProperty;
67550
67551         /**
67552          * Creates an array of the own and inherited enumerable property names of
67553          * `object`.
67554          * 
67555          * **Note:** Non-object values are coerced to objects.
67556          * 
67557          * @static
67558          * @memberOf _
67559          * @category Object
67560          * @param {Object}
67561          *            object The object to query.
67562          * @returns {Array} Returns the array of property names.
67563          * @example
67564          * 
67565          * function Foo() { this.a = 1; this.b = 2; }
67566          * 
67567          * Foo.prototype.c = 3;
67568          * 
67569          * _.keysIn(new Foo); // => ['a', 'b', 'c'] (iteration order is not guaranteed)
67570          */
67571         function keysIn(object) {
67572             if (object == null) {
67573                 return [];
67574             }
67575             if (!isObject(object)) {
67576                 object = Object(object);
67577             }
67578             var length = object.length;
67579             length = (length && isLength(length) &&
67580                 (isArray(object) || isArguments(object)) && length) || 0;
67581
67582             var Ctor = object.constructor,
67583                 index = -1,
67584                 isProto = typeof Ctor == 'function' && Ctor.prototype === object,
67585                 result = Array(length),
67586                 skipIndexes = length > 0;
67587
67588             while (++index < length) {
67589                 result[index] = (index + '');
67590             }
67591             for (var key in object) {
67592                 if (!(skipIndexes && isIndex(key, length)) &&
67593                     !(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
67594                     result.push(key);
67595                 }
67596             }
67597             return result;
67598         }
67599
67600         module.exports = keysIn;
67601
67602     }, {
67603         "../internal/isIndex": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isIndex.js",
67604         "../internal/isLength": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isLength.js",
67605         "../lang/isArguments": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArguments.js",
67606         "../lang/isArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isArray.js",
67607         "../lang/isObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\lang\\isObject.js"
67608     }],
67609     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\merge.js": [function(require, module, exports) {
67610         var baseMerge = require('../internal/baseMerge'),
67611             createAssigner = require('../internal/createAssigner');
67612
67613         /**
67614          * Recursively merges own enumerable properties of the source object(s), that
67615          * don't resolve to `undefined` into the destination object. Subsequent sources
67616          * overwrite property assignments of previous sources. If `customizer` is
67617          * provided it's invoked to produce the merged values of the destination and
67618          * source properties. If `customizer` returns `undefined` merging is handled by
67619          * the method instead. The `customizer` is bound to `thisArg` and invoked with
67620          * five arguments: (objectValue, sourceValue, key, object, source).
67621          * 
67622          * @static
67623          * @memberOf _
67624          * @category Object
67625          * @param {Object}
67626          *            object The destination object.
67627          * @param {...Object}
67628          *            [sources] The source objects.
67629          * @param {Function}
67630          *            [customizer] The function to customize assigned values.
67631          * @param {*}
67632          *            [thisArg] The `this` binding of `customizer`.
67633          * @returns {Object} Returns `object`.
67634          * @example
67635          * 
67636          * var users = { 'data': [{ 'user': 'barney' }, { 'user': 'fred' }] };
67637          * 
67638          * var ages = { 'data': [{ 'age': 36 }, { 'age': 40 }] };
67639          * 
67640          * _.merge(users, ages); // => { 'data': [{ 'user': 'barney', 'age': 36 }, {
67641          * 'user': 'fred', 'age': 40 }] }
67642          *  // using a customizer callback var object = { 'fruits': ['apple'],
67643          * 'vegetables': ['beet'] };
67644          * 
67645          * var other = { 'fruits': ['banana'], 'vegetables': ['carrot'] };
67646          * 
67647          * _.merge(object, other, function(a, b) { if (_.isArray(a)) { return
67648          * a.concat(b); } }); // => { 'fruits': ['apple', 'banana'], 'vegetables':
67649          * ['beet', 'carrot'] }
67650          */
67651         var merge = createAssigner(baseMerge);
67652
67653         module.exports = merge;
67654
67655     }, {
67656         "../internal/baseMerge": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseMerge.js",
67657         "../internal/createAssigner": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\createAssigner.js"
67658     }],
67659     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\omit.js": [function(require, module, exports) {
67660         var arrayMap = require('../internal/arrayMap'),
67661             baseDifference = require('../internal/baseDifference'),
67662             baseFlatten = require('../internal/baseFlatten'),
67663             bindCallback = require('../internal/bindCallback'),
67664             keysIn = require('./keysIn'),
67665             pickByArray = require('../internal/pickByArray'),
67666             pickByCallback = require('../internal/pickByCallback'),
67667             restParam = require('../function/restParam');
67668
67669         /**
67670          * The opposite of `_.pick`; this method creates an object composed of the own
67671          * and inherited enumerable properties of `object` that are not omitted.
67672          * 
67673          * @static
67674          * @memberOf _
67675          * @category Object
67676          * @param {Object}
67677          *            object The source object.
67678          * @param {Function|...(string|string[])}
67679          *            [predicate] The function invoked per iteration or property names
67680          *            to omit, specified as individual property names or arrays of
67681          *            property names.
67682          * @param {*}
67683          *            [thisArg] The `this` binding of `predicate`.
67684          * @returns {Object} Returns the new object.
67685          * @example
67686          * 
67687          * var object = { 'user': 'fred', 'age': 40 };
67688          * 
67689          * _.omit(object, 'age'); // => { 'user': 'fred' }
67690          * 
67691          * _.omit(object, _.isNumber); // => { 'user': 'fred' }
67692          */
67693         var omit = restParam(function(object, props) {
67694             if (object == null) {
67695                 return {};
67696             }
67697             if (typeof props[0] != 'function') {
67698                 var props = arrayMap(baseFlatten(props), String);
67699                 return pickByArray(object, baseDifference(keysIn(object), props));
67700             }
67701             var predicate = bindCallback(props[0], props[1], 3);
67702             return pickByCallback(object, function(value, key, object) {
67703                 return !predicate(value, key, object);
67704             });
67705         });
67706
67707         module.exports = omit;
67708
67709     }, {
67710         "../function/restParam": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\function\\restParam.js",
67711         "../internal/arrayMap": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\arrayMap.js",
67712         "../internal/baseDifference": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseDifference.js",
67713         "../internal/baseFlatten": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseFlatten.js",
67714         "../internal/bindCallback": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\bindCallback.js",
67715         "../internal/pickByArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\pickByArray.js",
67716         "../internal/pickByCallback": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\pickByCallback.js",
67717         "./keysIn": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\keysIn.js"
67718     }],
67719     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\pairs.js": [function(require, module, exports) {
67720         var keys = require('./keys'),
67721             toObject = require('../internal/toObject');
67722
67723         /**
67724          * Creates a two dimensional array of the key-value pairs for `object`, e.g.
67725          * `[[key1, value1], [key2, value2]]`.
67726          * 
67727          * @static
67728          * @memberOf _
67729          * @category Object
67730          * @param {Object}
67731          *            object The object to query.
67732          * @returns {Array} Returns the new array of key-value pairs.
67733          * @example
67734          * 
67735          * _.pairs({ 'barney': 36, 'fred': 40 }); // => [['barney', 36], ['fred', 40]]
67736          * (iteration order is not guaranteed)
67737          */
67738         function pairs(object) {
67739             object = toObject(object);
67740
67741             var index = -1,
67742                 props = keys(object),
67743                 length = props.length,
67744                 result = Array(length);
67745
67746             while (++index < length) {
67747                 var key = props[index];
67748                 result[index] = [key, object[key]];
67749             }
67750             return result;
67751         }
67752
67753         module.exports = pairs;
67754
67755     }, {
67756         "../internal/toObject": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\toObject.js",
67757         "./keys": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\keys.js"
67758     }],
67759     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\pick.js": [function(require, module, exports) {
67760         var baseFlatten = require('../internal/baseFlatten'),
67761             bindCallback = require('../internal/bindCallback'),
67762             pickByArray = require('../internal/pickByArray'),
67763             pickByCallback = require('../internal/pickByCallback'),
67764             restParam = require('../function/restParam');
67765
67766         /**
67767          * Creates an object composed of the picked `object` properties. Property names
67768          * may be specified as individual arguments or as arrays of property names. If
67769          * `predicate` is provided it's invoked for each property of `object` picking
67770          * the properties `predicate` returns truthy for. The predicate is bound to
67771          * `thisArg` and invoked with three arguments: (value, key, object).
67772          * 
67773          * @static
67774          * @memberOf _
67775          * @category Object
67776          * @param {Object}
67777          *            object The source object.
67778          * @param {Function|...(string|string[])}
67779          *            [predicate] The function invoked per iteration or property names
67780          *            to pick, specified as individual property names or arrays of
67781          *            property names.
67782          * @param {*}
67783          *            [thisArg] The `this` binding of `predicate`.
67784          * @returns {Object} Returns the new object.
67785          * @example
67786          * 
67787          * var object = { 'user': 'fred', 'age': 40 };
67788          * 
67789          * _.pick(object, 'user'); // => { 'user': 'fred' }
67790          * 
67791          * _.pick(object, _.isString); // => { 'user': 'fred' }
67792          */
67793         var pick = restParam(function(object, props) {
67794             if (object == null) {
67795                 return {};
67796             }
67797             return typeof props[0] == 'function' ? pickByCallback(object, bindCallback(props[0], props[1], 3)) : pickByArray(object, baseFlatten(props));
67798         });
67799
67800         module.exports = pick;
67801
67802     }, {
67803         "../function/restParam": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\function\\restParam.js",
67804         "../internal/baseFlatten": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseFlatten.js",
67805         "../internal/bindCallback": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\bindCallback.js",
67806         "../internal/pickByArray": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\pickByArray.js",
67807         "../internal/pickByCallback": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\pickByCallback.js"
67808     }],
67809     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\values.js": [function(require, module, exports) {
67810         var baseValues = require('../internal/baseValues'),
67811             keys = require('./keys');
67812
67813         /**
67814          * Creates an array of the own enumerable property values of `object`.
67815          * 
67816          * **Note:** Non-object values are coerced to objects.
67817          * 
67818          * @static
67819          * @memberOf _
67820          * @category Object
67821          * @param {Object}
67822          *            object The object to query.
67823          * @returns {Array} Returns the array of property values.
67824          * @example
67825          * 
67826          * function Foo() { this.a = 1; this.b = 2; }
67827          * 
67828          * Foo.prototype.c = 3;
67829          * 
67830          * _.values(new Foo); // => [1, 2] (iteration order is not guaranteed)
67831          * 
67832          * _.values('hi'); // => ['h', 'i']
67833          */
67834         function values(object) {
67835             return baseValues(object, keys(object));
67836         }
67837
67838         module.exports = values;
67839
67840     }, {
67841         "../internal/baseValues": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseValues.js",
67842         "./keys": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\object\\keys.js"
67843     }],
67844     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\utility\\identity.js": [function(require, module, exports) {
67845         /**
67846          * This method returns the first argument provided to it.
67847          * 
67848          * @static
67849          * @memberOf _
67850          * @category Utility
67851          * @param {*}
67852          *            value Any value.
67853          * @returns {*} Returns `value`.
67854          * @example
67855          * 
67856          * var object = { 'user': 'fred' };
67857          * 
67858          * _.identity(object) === object; // => true
67859          */
67860         function identity(value) {
67861             return value;
67862         }
67863
67864         module.exports = identity;
67865
67866     }, {}],
67867     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\utility\\noop.js": [function(require, module, exports) {
67868         /**
67869          * A no-operation function that returns `undefined` regardless of the arguments
67870          * it receives.
67871          * 
67872          * @static
67873          * @memberOf _
67874          * @category Utility
67875          * @example
67876          * 
67877          * var object = { 'user': 'fred' };
67878          * 
67879          * _.noop(object) === undefined; // => true
67880          */
67881         function noop() {
67882             // No operation performed.
67883         }
67884
67885         module.exports = noop;
67886
67887     }, {}],
67888     "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\utility\\property.js": [function(require, module, exports) {
67889         var baseProperty = require('../internal/baseProperty'),
67890             basePropertyDeep = require('../internal/basePropertyDeep'),
67891             isKey = require('../internal/isKey');
67892
67893         /**
67894          * Creates a function that returns the property value at `path` on a given
67895          * object.
67896          * 
67897          * @static
67898          * @memberOf _
67899          * @category Utility
67900          * @param {Array|string}
67901          *            path The path of the property to get.
67902          * @returns {Function} Returns the new function.
67903          * @example
67904          * 
67905          * var objects = [ { 'a': { 'b': { 'c': 2 } } }, { 'a': { 'b': { 'c': 1 } } } ];
67906          * 
67907          * _.map(objects, _.property('a.b.c')); // => [2, 1]
67908          * 
67909          * _.pluck(_.sortBy(objects, _.property(['a', 'b', 'c'])), 'a.b.c'); // => [1,
67910          * 2]
67911          */
67912         function property(path) {
67913             return isKey(path) ? baseProperty(path) : basePropertyDeep(path);
67914         }
67915
67916         module.exports = property;
67917
67918     }, {
67919         "../internal/baseProperty": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\baseProperty.js",
67920         "../internal/basePropertyDeep": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\basePropertyDeep.js",
67921         "../internal/isKey": "\\bpmn-js-examples-master\\modeler\\node_modules\\lodash\\internal\\isKey.js"
67922     }]
67923 }, {}, ["\\bpmn-js-examples-master\\modeler\\app\\index.js"]);