Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
webpackJsonp([1],{
/***/ "../../../../../node_modules/asap/asap.js":
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process, setImmediate) {
// Use the fastest possible means to execute a task in a future turn
// of the event loop.
// linked list of tasks (single, with head node)
var head = {task: void 0, next: null};
var tail = head;
var flushing = false;
var requestFlush = void 0;
var isNodeJS = false;
function flush() {
/* jshint loopfunc: true */
while (head.next) {
head = head.next;
var task = head.task;
head.task = void 0;
var domain = head.domain;
if (domain) {
head.domain = void 0;
domain.enter();
}
try {
task();
} catch (e) {
if (isNodeJS) {
// In node, uncaught exceptions are considered fatal errors.
// Re-throw them synchronously to interrupt flushing!
// Ensure continuation if the uncaught exception is suppressed
// listening "uncaughtException" events (as domains does).
// Continue in next event to avoid tick recursion.
if (domain) {
domain.exit();
}
setTimeout(flush, 0);
if (domain) {
domain.enter();
}
throw e;
} else {
// In browsers, uncaught exceptions are not fatal.
// Re-throw them asynchronously to avoid slow-downs.
setTimeout(function() {
throw e;
}, 0);
}
}
if (domain) {
domain.exit();
}
}
flushing = false;
}
if (typeof process !== "undefined" && process.nextTick) {
// Node.js before 0.9. Note that some fake-Node environments, like the
// Mocha test runner, introduce a `process` global without a `nextTick`.
isNodeJS = true;
requestFlush = function () {
process.nextTick(flush);
};
} else if (typeof setImmediate === "function") {
// In IE10, Node.js 0.9+, or https://github.com/NobleJS/setImmediate
if (typeof window !== "undefined") {
requestFlush = setImmediate.bind(window, flush);
} else {
requestFlush = function () {
setImmediate(flush);
};
}
} else if (typeof MessageChannel !== "undefined") {
// modern browsers
// http://www.nonblocking.io/2011/06/windownexttick.html
var channel = new MessageChannel();
channel.port1.onmessage = flush;
requestFlush = function () {
channel.port2.postMessage(0);
};
} else {
// old browsers
requestFlush = function () {
setTimeout(flush, 0);
};
}
function asap(task) {
tail = tail.next = {
task: task,
domain: isNodeJS && process.domain,
next: null
};
if (!flushing) {
flushing = true;
requestFlush();
}
};
module.exports = asap;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__("../../../../../node_modules/process/browser.js"), __webpack_require__("../../../../../node_modules/timers-browserify/main.js").setImmediate))
/***/ }),
/***/ "../../../../../node_modules/css-loader/index.js?{\"sourceMap\":true,\"minimize\":false}!../../../../../node_modules/postcss-loader/lib/index.js?{\"sourceMap\":true}!../../../../../node_modules/less-loader/dist/cjs.js?{\"sourceMap\":true}!../../../../../node_modules/lightgallery/dist/css/lightgallery.css":
/***/ (function(module, exports, __webpack_require__) {
exports = module.exports = __webpack_require__("../../../../../node_modules/css-loader/lib/css-base.js")(true);
// imports
// module
// exports
/***/ }),
/***/ "../../../../../node_modules/css-loader/index.js?{\"sourceMap\":true,\"minimize\":false}!../../../../../node_modules/postcss-loader/lib/index.js?{\"sourceMap\":true}!../../../../../node_modules/less-loader/dist/cjs.js?{\"sourceMap\":true}!./style/blog.less":
/***/ (function(module, exports, __webpack_require__) {
exports = module.exports = __webpack_require__("../../../../../node_modules/css-loader/lib/css-base.js")(true);
// imports
// module
// exports
/***/ }),
/***/ "../../../../../node_modules/css-loader/index.js?{\"sourceMap\":true,\"minimize\":false}!../../../../../node_modules/postcss-loader/lib/index.js?{\"sourceMap\":true}!../../../../../node_modules/less-loader/dist/cjs.js?{\"sourceMap\":true}!./style/careers.less":
/***/ (function(module, exports, __webpack_require__) {
exports = module.exports = __webpack_require__("../../../../../node_modules/css-loader/lib/css-base.js")(true);
// imports
// module
// exports
/***/ }),
/***/ "../../../../../node_modules/css-loader/index.js?{\"sourceMap\":true,\"minimize\":false}!../../../../../node_modules/postcss-loader/lib/index.js?{\"sourceMap\":true}!../../../../../node_modules/less-loader/dist/cjs.js?{\"sourceMap\":true}!./style/contact.less":
/***/ (function(module, exports, __webpack_require__) {
exports = module.exports = __webpack_require__("../../../../../node_modules/css-loader/lib/css-base.js")(true);
// imports
// module
// exports
/***/ }),
/***/ "../../../../../node_modules/css-loader/index.js?{\"sourceMap\":true,\"minimize\":false}!../../../../../node_modules/postcss-loader/lib/index.js?{\"sourceMap\":true}!../../../../../node_modules/less-loader/dist/cjs.js?{\"sourceMap\":true}!./style/documentation.less":
/***/ (function(module, exports, __webpack_require__) {
exports = module.exports = __webpack_require__("../../../../../node_modules/css-loader/lib/css-base.js")(true);
// imports
// module
// exports
/***/ }),
/***/ "../../../../../node_modules/css-loader/index.js?{\"sourceMap\":true,\"minimize\":false}!../../../../../node_modules/postcss-loader/lib/index.js?{\"sourceMap\":true}!../../../../../node_modules/less-loader/dist/cjs.js?{\"sourceMap\":true}!./style/get-framac.less":
/***/ (function(module, exports, __webpack_require__) {
exports = module.exports = __webpack_require__("../../../../../node_modules/css-loader/lib/css-base.js")(true);
// imports
// module
// exports
/***/ }),
/***/ "../../../../../node_modules/css-loader/index.js?{\"sourceMap\":true,\"minimize\":false}!../../../../../node_modules/postcss-loader/lib/index.js?{\"sourceMap\":true}!../../../../../node_modules/less-loader/dist/cjs.js?{\"sourceMap\":true}!./style/home.less":
/***/ (function(module, exports, __webpack_require__) {
exports = module.exports = __webpack_require__("../../../../../node_modules/css-loader/lib/css-base.js")(true);
// imports
exports.i(__webpack_require__("../../../../../node_modules/css-loader/index.js?{\"sourceMap\":true,\"minimize\":false}!./style/lib/swiper.css"), "");
// module
// exports
/***/ }),
/***/ "../../../../../node_modules/css-loader/index.js?{\"sourceMap\":true,\"minimize\":false}!../../../../../node_modules/postcss-loader/lib/index.js?{\"sourceMap\":true}!../../../../../node_modules/less-loader/dist/cjs.js?{\"sourceMap\":true}!./style/main.less":
/***/ (function(module, exports, __webpack_require__) {
exports = module.exports = __webpack_require__("../../../../../node_modules/css-loader/lib/css-base.js")(true);
// imports
exports.push([module.i, "@import url(https://fonts.googleapis.com/css?family=Muli:300,300i,400,400i,600,600i,700,700i,800,800i,900,900i);", ""]);
// module
// exports
/***/ }),
/***/ "../../../../../node_modules/css-loader/index.js?{\"sourceMap\":true,\"minimize\":false}!../../../../../node_modules/postcss-loader/lib/index.js?{\"sourceMap\":true}!../../../../../node_modules/less-loader/dist/cjs.js?{\"sourceMap\":true}!./style/page.less":
/***/ (function(module, exports, __webpack_require__) {
exports = module.exports = __webpack_require__("../../../../../node_modules/css-loader/lib/css-base.js")(true);
// imports
// module
// exports
/***/ }),
/***/ "../../../../../node_modules/css-loader/index.js?{\"sourceMap\":true,\"minimize\":false}!../../../../../node_modules/postcss-loader/lib/index.js?{\"sourceMap\":true}!../../../../../node_modules/less-loader/dist/cjs.js?{\"sourceMap\":true}!./style/plugin.less":
/***/ (function(module, exports, __webpack_require__) {
exports = module.exports = __webpack_require__("../../../../../node_modules/css-loader/lib/css-base.js")(true);
// imports
// module
// exports
/***/ }),
/***/ "../../../../../node_modules/css-loader/index.js?{\"sourceMap\":true,\"minimize\":false}!../../../../../node_modules/postcss-loader/lib/index.js?{\"sourceMap\":true}!../../../../../node_modules/less-loader/dist/cjs.js?{\"sourceMap\":true}!./style/terms.less":
/***/ (function(module, exports, __webpack_require__) {
exports = module.exports = __webpack_require__("../../../../../node_modules/css-loader/lib/css-base.js")(true);
// imports
// module
// exports
/***/ }),
/***/ "../../../../../node_modules/css-loader/index.js?{\"sourceMap\":true,\"minimize\":false}!./style/lib/swiper.css":
/***/ (function(module, exports, __webpack_require__) {
// imports
// module
// exports
/***/ }),
/***/ "../../../../../node_modules/css-loader/lib/css-base.js":
/***/ (function(module, exports) {
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
// css base code, injected by the css-loader
module.exports = function(useSourceMap) {
var list = [];
// return the list of modules as css string
list.toString = function toString() {
return this.map(function (item) {
var content = cssWithMappingToString(item, useSourceMap);
if(item[2]) {
return "@media " + item[2] + "{" + content + "}";
} else {
return content;
}
}).join("");
};
// import a list of modules into the list
list.i = function(modules, mediaQuery) {
if(typeof modules === "string")
modules = [[null, modules, ""]];
var alreadyImportedModules = {};
for(var i = 0; i < this.length; i++) {
var id = this[i][0];
if(typeof id === "number")
alreadyImportedModules[id] = true;
}
for(i = 0; i < modules.length; i++) {
var item = modules[i];
// skip already imported module
// this implementation is not 100% perfect for weird media query combinations
// when a module is imported multiple times with different media queries.
// I hope this will never occur (Hey this way we have smaller bundles)
if(typeof item[0] !== "number" || !alreadyImportedModules[item[0]]) {
if(mediaQuery && !item[2]) {
item[2] = mediaQuery;
} else if(mediaQuery) {
item[2] = "(" + item[2] + ") and (" + mediaQuery + ")";
}
list.push(item);
}
}
};
return list;
};
function cssWithMappingToString(item, useSourceMap) {
var content = item[1] || '';
var cssMapping = item[3];
if (!cssMapping) {
return content;
}
if (useSourceMap && typeof btoa === 'function') {
var sourceMapping = toComment(cssMapping);
var sourceURLs = cssMapping.sources.map(function (source) {
return '/*# sourceURL=' + cssMapping.sourceRoot + source + ' */'
});
return [content].concat(sourceURLs).concat([sourceMapping]).join('\n');
}
return [content].join('\n');
}
// Adapted from convert-source-map (MIT)
function toComment(sourceMap) {
// eslint-disable-next-line no-undef
var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));
var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;
return '/*# ' + data + ' */';
}
/***/ }),
/***/ "../../../../../node_modules/google-maps-api/index.js":
/***/ (function(module, exports, __webpack_require__) {
/** @module google-maps-api */
var script = __webpack_require__( "../../../../../node_modules/scriptjs/dist/script.js" ),
promise = __webpack_require__( "../../../../../node_modules/promise/index.js" );
var maps = null,
callBacks = [],
key;
window.$$mapsCB = function() {
maps = google.maps;
for( var i = 0, len = callBacks.length; i < len; i++ ) {
resolve.apply( undefined, callBacks[ i ] );
}
};
function resolve( onOk, onErr, onComplete, err ) {
if( !err ) {
onOk( maps );
if( onComplete )
onComplete( undefined, maps );
} else {
onErr( err );
if( onComplete )
onComplete( err );
}
}
/**
* Load a Google Maps API Object asynchronously. This module will return a Promise.
* Which will on resolved will return the "google.maps" object.
*
* Or if you prefer you can simply use the callback instead.
*
* @param {String} apikey Your Google Maps API Key
* @param {Function} [onComplete] A callback which will return the google.maps object
* @return {Promise} When this promise resolves it will return the google.maps object
*
* @example using via promise
*
* ```javascript
* var mapsapi = require( 'google-maps-api' )( 'your api key' );
*
* mapsapi().then( function( maps ) {
*
* //use the google.maps object as you please
* });
* ```
*
* @example using via callback
* ```javascript
* require( 'google-maps-api' )( 'your api key', function( maps ) {
*
* //use the google.maps object as you please
* })
* ```
*/
module.exports = function( apikey, libraries, onComplete ) {
key = apikey || key;
if (typeof libraries == 'function') {
onComplete = libraries;
libraries = [];
}
return function() {
return new promise( function( onOk, onErr ) {
if( !key ) {
resolve( onOk, onErr, onComplete, new Error( 'No API key passed to require(\'google-maps-api\')' ) );
} else {
if( maps ) {
resolve( onOk, onErr, onComplete );
} else {
callBacks.push( [ onOk, onErr, onComplete ] );
if (callBacks.length == 1) {
var auth = '';
if (typeof key == 'string') {
auth = '&key=' + key;
} else if (typeof key == 'object') {
auth = '&' + Object.keys(key).map(function (k) {
return k + '=' + encodeURIComponent(key[k]);
}).join('&');
}
var url = 'https://maps.googleapis.com/maps/api/js?v=3&callback=$$mapsCB' + auth;
if (Array.isArray(libraries) && libraries.length > 0) {
url+='&libraries='+libraries.join(',');
}
script( url );
}
}
}
});
};
};
/***/ }),
/***/ "../../../../../node_modules/lightgallery/dist/css/lightgallery.css":
/***/ (function(module, exports, __webpack_require__) {
// style-loader: Adds some css to the DOM by adding a <style> tag
// load the styles
var content = __webpack_require__("../../../../../node_modules/css-loader/index.js?{\"sourceMap\":true,\"minimize\":false}!../../../../../node_modules/postcss-loader/lib/index.js?{\"sourceMap\":true}!../../../../../node_modules/less-loader/dist/cjs.js?{\"sourceMap\":true}!../../../../../node_modules/lightgallery/dist/css/lightgallery.css");
if(typeof content === 'string') content = [[module.i, content, '']];
// Prepare cssTransformation
var transform;
var options = {}
options.transform = transform
// add the styles to the DOM
var update = __webpack_require__("../../../../../node_modules/style-loader/lib/addStyles.js")(content, options);
if(content.locals) module.exports = content.locals;
// Hot Module Replacement
if(true) {
// When the styles change, update the <style> tags
if(!content.locals) {
module.hot.accept("../../../../../node_modules/css-loader/index.js?{\"sourceMap\":true,\"minimize\":false}!../../../../../node_modules/postcss-loader/lib/index.js?{\"sourceMap\":true}!../../../../../node_modules/less-loader/dist/cjs.js?{\"sourceMap\":true}!../../../../../node_modules/lightgallery/dist/css/lightgallery.css", function() {
var newContent = __webpack_require__("../../../../../node_modules/css-loader/index.js?{\"sourceMap\":true,\"minimize\":false}!../../../../../node_modules/postcss-loader/lib/index.js?{\"sourceMap\":true}!../../../../../node_modules/less-loader/dist/cjs.js?{\"sourceMap\":true}!../../../../../node_modules/lightgallery/dist/css/lightgallery.css");
if(typeof newContent === 'string') newContent = [[module.i, newContent, '']];
update(newContent);
});
}
// When the module is disposed, remove the <style> tags
module.hot.dispose(function() { update(); });
}
/***/ }),
/***/ "../../../../../node_modules/lightgallery/dist/fonts/lg.eot":
/***/ (function(module, exports, __webpack_require__) {
module.exports = __webpack_require__.p + "font/lg.ecff1170.eot";
/***/ }),
/***/ "../../../../../node_modules/lightgallery/dist/fonts/lg.eot?n1z373":
/***/ (function(module, exports, __webpack_require__) {
module.exports = __webpack_require__.p + "font/lg.ecff1170.eot";
/***/ }),
/***/ "../../../../../node_modules/lightgallery/dist/fonts/lg.svg?n1z373":
/***/ (function(module, exports, __webpack_require__) {
module.exports = __webpack_require__.p + "img/lg.0cb1b8af.svg";
/***/ }),
/***/ "../../../../../node_modules/lightgallery/dist/fonts/lg.ttf?n1z373":
/***/ (function(module, exports, __webpack_require__) {
module.exports = __webpack_require__.p + "font/lg.4fe6f9ca.ttf";
/***/ }),
/***/ "../../../../../node_modules/lightgallery/dist/fonts/lg.woff?n1z373":
/***/ (function(module, exports, __webpack_require__) {
module.exports = __webpack_require__.p + "font/lg.5fd4c338.woff";
/***/ }),
/***/ "../../../../../node_modules/lightgallery/dist/img/loading.gif":
/***/ (function(module, exports, __webpack_require__) {
module.exports = __webpack_require__.p + "img/loading.bbdac9cd.gif";
/***/ }),
/***/ "../../../../../node_modules/lightgallery/dist/img/video-play.png":
/***/ (function(module, exports, __webpack_require__) {
module.exports = __webpack_require__.p + "img/video-play.dc34cc9c.png";
/***/ }),
/***/ "../../../../../node_modules/lightgallery/dist/img/vimeo-play.png":
/***/ (function(module, exports, __webpack_require__) {
module.exports = __webpack_require__.p + "img/vimeo-play.dfe7764b.png";
/***/ }),
/***/ "../../../../../node_modules/lightgallery/dist/img/youtube-play.png":
/***/ (function(module, exports, __webpack_require__) {
module.exports = __webpack_require__.p + "img/youtube-play.e6f0c233.png";
/***/ }),
/***/ "../../../../../node_modules/parsleyjs/dist/parsley.js":
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(global) {/*!
* Parsley.js
* Version 2.7.2 - built Tue, May 9th 2017, 11:21 am
* http://parsleyjs.org
* Guillaume Potier - <guillaume@wisembly.com>
* Marc-Andre Lafortune - <petroselinum@marc-andre.ca>
* MIT Licensed
*/
// The source code below is generated by babel as
// Parsley is written in ECMAScript 6
//
var _slice = Array.prototype.slice;
var _slicedToArray = (function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i['return']) _i['return'](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError('Invalid attempt to destructure non-iterable instance'); } }; })();
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i]; return arr2; } else { return Array.from(arr); } }
(function (global, factory) {
true ? module.exports = factory(__webpack_require__("../../../../../node_modules/jquery/dist/jquery.js")) : typeof define === 'function' && define.amd ? define(['jquery'], factory) : global.parsley = factory(global.jQuery);
})(this, function ($) {
'use strict';
var globalID = 1;
var pastWarnings = {};
var Utils = {
// Parsley DOM-API
// returns object from dom attributes and values
attr: function attr(element, namespace, obj) {
var i;
var attribute;
var attributes;
var regex = new RegExp('^' + namespace, 'i');
if ('undefined' === typeof obj) obj = {};else {
// Clear all own properties. This won't affect prototype's values
for (i in obj) {
if (obj.hasOwnProperty(i)) delete obj[i];
}
}
if (!element) return obj;
attributes = element.attributes;
for (i = attributes.length; i--;) {
attribute = attributes[i];
if (attribute && attribute.specified && regex.test(attribute.name)) {
obj[this.camelize(attribute.name.slice(namespace.length))] = this.deserializeValue(attribute.value);
}
}
return obj;
},
checkAttr: function checkAttr(element, namespace, _checkAttr) {
return element.hasAttribute(namespace + _checkAttr);
},
setAttr: function setAttr(element, namespace, attr, value) {
element.setAttribute(this.dasherize(namespace + attr), String(value));
},
generateID: function generateID() {
return '' + globalID++;
},
/** Third party functions **/
// Zepto deserialize function
deserializeValue: function deserializeValue(value) {
var num;
try {
return value ? value == "true" || (value == "false" ? false : value == "null" ? null : !isNaN(num = Number(value)) ? num : /^[\[\{]/.test(value) ? $.parseJSON(value) : value) : value;
} catch (e) {
return value;
}
},
// Zepto camelize function
camelize: function camelize(str) {
return str.replace(/-+(.)?/g, function (match, chr) {
return chr ? chr.toUpperCase() : '';
});
},
// Zepto dasherize function
dasherize: function dasherize(str) {
return str.replace(/::/g, '/').replace(/([A-Z]+)([A-Z][a-z])/g, '$1_$2').replace(/([a-z\d])([A-Z])/g, '$1_$2').replace(/_/g, '-').toLowerCase();
},
warn: function warn() {
var _window$console;
if (window.console && 'function' === typeof window.console.warn) (_window$console = window.console).warn.apply(_window$console, arguments);
},
warnOnce: function warnOnce(msg) {
if (!pastWarnings[msg]) {
pastWarnings[msg] = true;
this.warn.apply(this, arguments);
}
},
_resetWarnings: function _resetWarnings() {
pastWarnings = {};
},
trimString: function trimString(string) {
return string.replace(/^\s+|\s+$/g, '');
},
parse: {
date: function date(string) {
var parsed = string.match(/^(\d{4,})-(\d\d)-(\d\d)$/);
if (!parsed) return null;
var _parsed$map = parsed.map(function (x) {
return parseInt(x, 10);
});
var _parsed$map2 = _slicedToArray(_parsed$map, 4);
var _ = _parsed$map2[0];
var year = _parsed$map2[1];
var month = _parsed$map2[2];
var day = _parsed$map2[3];
var date = new Date(year, month - 1, day);
if (date.getFullYear() !== year || date.getMonth() + 1 !== month || date.getDate() !== day) return null;
return date;
},
string: function string(_string) {
return _string;
},
integer: function integer(string) {
if (isNaN(string)) return null;
return parseInt(string, 10);
},
number: function number(string) {
if (isNaN(string)) throw null;
return parseFloat(string);
},
'boolean': function _boolean(string) {
return !/^\s*false\s*$/i.test(string);
},
object: function object(string) {
return Utils.deserializeValue(string);
},
regexp: function regexp(_regexp) {
var flags = '';
// Test if RegExp is literal, if not, nothing to be done, otherwise, we need to isolate flags and pattern
if (/^\/.*\/(?:[gimy]*)$/.test(_regexp)) {
// Replace the regexp literal string with the first match group: ([gimy]*)
// If no flag is present, this will be a blank string
flags = _regexp.replace(/.*\/([gimy]*)$/, '$1');
// Again, replace the regexp literal string with the first match group:
// everything excluding the opening and closing slashes and the flags
_regexp = _regexp.replace(new RegExp('^/(.*?)/' + flags + '$'), '$1');
} else {
// Anchor regexp:
_regexp = '^' + _regexp + '$';
}
return new RegExp(_regexp, flags);
}
},
parseRequirement: function parseRequirement(requirementType, string) {
var converter = this.parse[requirementType || 'string'];
if (!converter) throw 'Unknown requirement specification: "' + requirementType + '"';
var converted = converter(string);
if (converted === null) throw 'Requirement is not a ' + requirementType + ': "' + string + '"';
return converted;
},
namespaceEvents: function namespaceEvents(events, namespace) {
events = this.trimString(events || '').split(/\s+/);
if (!events[0]) return '';
return $.map(events, function (evt) {
return evt + '.' + namespace;
}).join(' ');
},
difference: function difference(array, remove) {
// This is O(N^2), should be optimized
var result = [];
$.each(array, function (_, elem) {
if (remove.indexOf(elem) == -1) result.push(elem);
});
return result;
},
// Alter-ego to native Promise.all, but for jQuery
all: function all(promises) {
// jQuery treats $.when() and $.when(singlePromise) differently; let's avoid that and add spurious elements
return $.when.apply($, _toConsumableArray(promises).concat([42, 42]));
},
// Object.create polyfill, see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/create#Polyfill
objectCreate: Object.create || (function () {
var Object = function Object() {};
return function (prototype) {
if (arguments.length > 1) {
throw Error('Second argument not supported');
}
if (typeof prototype != 'object') {
throw TypeError('Argument must be an object');
}
Object.prototype = prototype;
var result = new Object();
Object.prototype = null;
return result;
};
})(),
_SubmitSelector: 'input[type="submit"], button:submit'
};
// All these options could be overriden and specified directly in DOM using
// `data-parsley-` default DOM-API
// eg: `inputs` can be set in DOM using `data-parsley-inputs="input, textarea"`
// eg: `data-parsley-stop-on-first-failing-constraint="false"`
var Defaults = {
// ### General
// Default data-namespace for DOM API
namespace: 'data-parsley-',
// Supported inputs by default
inputs: 'input, textarea, select',
// Excluded inputs by default
excluded: 'input[type=button], input[type=submit], input[type=reset], input[type=hidden]',
// Stop validating field on highest priority failing constraint
priorityEnabled: true,
// ### Field only
// identifier used to group together inputs (e.g. radio buttons...)
multiple: null,
// identifier (or array of identifiers) used to validate only a select group of inputs
group: null,
// ### UI
// Enable\Disable error messages
uiEnabled: true,
// Key events threshold before validation
validationThreshold: 3,
// Focused field on form validation error. 'first'|'last'|'none'
focus: 'first',
// event(s) that will trigger validation before first failure. eg: `input`...
trigger: false,
// event(s) that will trigger validation after first failure.
triggerAfterFailure: 'input',
// Class that would be added on every failing validation Parsley field
errorClass: 'parsley-error',
// Same for success validation
successClass: 'parsley-success',
// Return the `$element` that will receive these above success or error classes
// Could also be (and given directly from DOM) a valid selector like `'#div'`
classHandler: function classHandler(Field) {},
// Return the `$element` where errors will be appended
// Could also be (and given directly from DOM) a valid selector like `'#div'`
errorsContainer: function errorsContainer(Field) {},
// ul elem that would receive errors' list
errorsWrapper: '<ul class="parsley-errors-list"></ul>',
// li elem that would receive error message
errorTemplate: '<li></li>'
};
var Base = function Base() {
this.__id__ = Utils.generateID();
};
Base.prototype = {
asyncSupport: true, // Deprecated
_pipeAccordingToValidationResult: function _pipeAccordingToValidationResult() {
var _this = this;
var pipe = function pipe() {
var r = $.Deferred();
if (true !== _this.validationResult) r.reject();
return r.resolve().promise();
};
return [pipe, pipe];
},
actualizeOptions: function actualizeOptions() {
Utils.attr(this.element, this.options.namespace, this.domOptions);
if (this.parent && this.parent.actualizeOptions) this.parent.actualizeOptions();
return this;
},
_resetOptions: function _resetOptions(initOptions) {
this.domOptions = Utils.objectCreate(this.parent.options);
this.options = Utils.objectCreate(this.domOptions);
// Shallow copy of ownProperties of initOptions:
for (var i in initOptions) {
if (initOptions.hasOwnProperty(i)) this.options[i] = initOptions[i];
}
this.actualizeOptions();
},
_listeners: null,
// Register a callback for the given event name
// Callback is called with context as the first argument and the `this`
// The context is the current parsley instance, or window.Parsley if global
// A return value of `false` will interrupt the calls
on: function on(name, fn) {
this._listeners = this._listeners || {};
var queue = this._listeners[name] = this._listeners[name] || [];
queue.push(fn);
return this;
},
// Deprecated. Use `on` instead
subscribe: function subscribe(name, fn) {
$.listenTo(this, name.toLowerCase(), fn);
},
// Unregister a callback (or all if none is given) for the given event name
off: function off(name, fn) {
var queue = this._listeners && this._listeners[name];
if (queue) {
if (!fn) {
delete this._listeners[name];
} else {
for (var i = queue.length; i--;) if (queue[i] === fn) queue.splice(i, 1);
}
}
return this;
},
// Deprecated. Use `off`
unsubscribe: function unsubscribe(name, fn) {
$.unsubscribeTo(this, name.toLowerCase());
},
// Trigger an event of the given name
// A return value of `false` interrupts the callback chain
// Returns false if execution was interrupted
trigger: function trigger(name, target, extraArg) {
target = target || this;
var queue = this._listeners && this._listeners[name];
var result;
var parentResult;
if (queue) {
for (var i = queue.length; i--;) {
result = queue[i].call(target, target, extraArg);
if (result === false) return result;
}
}
if (this.parent) {
return this.parent.trigger(name, target, extraArg);
}
return true;
},
asyncIsValid: function asyncIsValid(group, force) {
Utils.warnOnce("asyncIsValid is deprecated; please use whenValid instead");
return this.whenValid({ group: group, force: force });
},
_findRelated: function _findRelated() {
return this.options.multiple ? $(this.parent.element.querySelectorAll('[' + this.options.namespace + 'multiple="' + this.options.multiple + '"]')) : this.$element;
}
};
var convertArrayRequirement = function convertArrayRequirement(string, length) {
var m = string.match(/^\s*\[(.*)\]\s*$/);
if (!m) throw 'Requirement is not an array: "' + string + '"';
var values = m[1].split(',').map(Utils.trimString);
if (values.length !== length) throw 'Requirement has ' + values.length + ' values when ' + length + ' are needed';
return values;
};
var convertExtraOptionRequirement = function convertExtraOptionRequirement(requirementSpec, string, extraOptionReader) {
var main = null;
var extra = {};
for (var key in requirementSpec) {
if (key) {
var value = extraOptionReader(key);
if ('string' === typeof value) value = Utils.parseRequirement(requirementSpec[key], value);
extra[key] = value;
} else {
main = Utils.parseRequirement(requirementSpec[key], string);
}
}
return [main, extra];