SiteOrigin Widgets Bundle - Version 1.5.2

Version Description

  • November 10 2015 =
  • Removed word break style from headline widget.
  • Fixed image grid URL field.
  • Added more text styling options to features widget.
  • Added measurement field to use in various widgets.
  • Prefix function name in Google Map widget to prevent conflicts.
  • Fixed styling for contact form widget.
  • Fix to allow multiple duplicated contact forms on a single page.
  • Fixed Hero Image widget button shortcode in text mode.
  • TinyMCE fields maintain editor state.
  • Added support for WP Canvas Shortcodes in TinyMCE field.
  • Don't initialize TinyMCE outside the admin.
  • Added more styling to contact form submit button.
Download this release

Release Info

Developer gpriday
Plugin Icon 128x128 SiteOrigin Widgets Bundle
Version 1.5.2
Comparing to
See all releases

Code changes from version 1.5.1 to 1.5.2

Files changed (43) hide show
  1. admin/tpl/admin.php +10 -10
  2. admin/trianglify.min.js +2 -2
  3. base/inc.php +24 -2
  4. base/inc/fields/base.class.php +33 -4
  5. base/inc/fields/container-base.class.php +0 -20
  6. base/inc/fields/css/so-measurement-field.css +7 -0
  7. base/inc/fields/factory.class.php +1 -15
  8. base/inc/fields/font.class.php +1 -1
  9. base/inc/fields/icon.class.php +1 -1
  10. base/inc/fields/js/so-tinymce-field.js +9 -0
  11. base/inc/fields/js/so-tinymce-field.min.js +1 -1
  12. base/inc/fields/link.class.php +3 -3
  13. base/inc/fields/measurement.class.php +57 -0
  14. base/inc/fields/media.class.php +4 -25
  15. base/inc/fields/repeater.class.php +1 -1
  16. base/inc/fields/tinymce.class.php +93 -8
  17. base/inc/post-selector.php +1 -1
  18. base/js/admin.min.js +1 -1
  19. base/js/meta-box-manager.min.js +1 -1
  20. base/js/posts-selector.min.js +1 -1
  21. base/siteorigin-widget.class.php +46 -5
  22. js/jquery.cycle.min.js +1 -1
  23. js/slider/jquery.slider.min.js +1 -1
  24. readme.txt +15 -1
  25. so-widgets-bundle.php +2 -2
  26. widgets/so-contact-widget/so-contact-widget.php +26 -6
  27. widgets/so-contact-widget/styles/default.less +7 -4
  28. widgets/so-contact-widget/tpl/default.php +1 -1
  29. widgets/so-features-widget/so-features-widget.php +111 -1
  30. widgets/so-features-widget/styles/features.less +47 -0
  31. widgets/so-google-map-widget/js/js-map.js +142 -144
  32. widgets/so-google-map-widget/js/js-map.min.js +1 -1
  33. widgets/so-google-map-widget/so-google-map-widget.php +1 -1
  34. widgets/so-headline-widget/so-headline-widget.php +4 -26
  35. widgets/so-headline-widget/styles/sow-headline.less +2 -4
  36. widgets/so-hero-widget/so-hero-widget.php +1 -1
  37. widgets/so-image-grid-widget/so-image-grid-widget.php +1 -2
  38. widgets/so-image-grid-widget/tpl/default.php +2 -0
  39. widgets/so-post-carousel-widget/tpl/base.php +4 -4
  40. widgets/so-simple-masonry-widget/js/packery.pkgd.min.js +0 -1
  41. widgets/so-social-media-buttons-widget/js/social-media-buttons-admin.js +1 -1
  42. widgets/so-social-media-buttons-widget/js/social-media-buttons-admin.min.js +1 -1
  43. widgets/so-social-media-buttons-widget/tpl/social-media-buttons.php +2 -2
admin/tpl/admin.php CHANGED
@@ -6,17 +6,17 @@
6
  <img src="<?php echo plugin_dir_url(__FILE__) ?>../images/icon-gear.png" class="icon-gear" width="26" height="26">
7
  <img src="<?php echo plugin_dir_url(__FILE__) ?>../images/icon-front.png" class="icon-front" width="50" height="43">
8
  </span>
9
- <h1><?php _e('SiteOrigin Widgets Bundle', 'siteorigin-widgets') ?></h1>
10
 
11
  <div id="sow-widget-search">
12
- <input type="search" placeholder="<?php esc_attr_e('Filter Widgets', 'siteorigin-widgets') ?>" />
13
  </div>
14
  </div>
15
 
16
  <ul class="page-nav">
17
- <li class="active"><a href="#all"><?php _e('All', 'siteorigin-widgets') ?></a></li>
18
- <li><a href="#enabled"><?php _e('Enabled', 'siteorigin-widgets') ?></a></li>
19
- <li><a href="#disabled"><?php _e('Disabled', 'siteorigin-widgets') ?></a></li>
20
  </ul>
21
 
22
 
@@ -41,7 +41,7 @@
41
 
42
  <div class="so-widget-text">
43
 
44
- <div class="so-widget-active-indicator"><?php _e('Active', 'siteorigin-widgets') ?></div>
45
 
46
  <h3><?php echo esc_html( $widget['Name'] ); ?></h3>
47
 
@@ -63,8 +63,8 @@
63
  <?php endif; ?>
64
 
65
  <div class="so-widget-toggle-active">
66
- <button class="button-secondary so-widget-activate" data-status="1"><?php esc_html_e( 'Activate', 'siteorigin-widgets' ) ?></button>
67
- <button class="button-secondary so-widget-deactivate" data-status="0"><?php esc_html_e( 'Deactivate', 'siteorigin-widgets' ) ?></button>
68
  </div>
69
 
70
  </div>
@@ -76,8 +76,8 @@
76
  </div>
77
 
78
  <div class="developers-link">
79
- <?php _e('Developers - create your own widgets for the Widgets Bundle.', 'siteorigin-widgets') ?>
80
- <a href="https://siteorigin.com/docs/widgets-bundle/" target="_blank"><?php _e('Read More', 'siteorigin-widgets') ?></a>.
81
  </div>
82
 
83
  </div>
6
  <img src="<?php echo plugin_dir_url(__FILE__) ?>../images/icon-gear.png" class="icon-gear" width="26" height="26">
7
  <img src="<?php echo plugin_dir_url(__FILE__) ?>../images/icon-front.png" class="icon-front" width="50" height="43">
8
  </span>
9
+ <h1><?php _e('SiteOrigin Widgets Bundle', 'so-widgets-bundle') ?></h1>
10
 
11
  <div id="sow-widget-search">
12
+ <input type="search" placeholder="<?php esc_attr_e('Filter Widgets', 'so-widgets-bundle') ?>" />
13
  </div>
14
  </div>
15
 
16
  <ul class="page-nav">
17
+ <li class="active"><a href="#all"><?php _e('All', 'so-widgets-bundle') ?></a></li>
18
+ <li><a href="#enabled"><?php _e('Enabled', 'so-widgets-bundle') ?></a></li>
19
+ <li><a href="#disabled"><?php _e('Disabled', 'so-widgets-bundle') ?></a></li>
20
  </ul>
21
 
22
 
41
 
42
  <div class="so-widget-text">
43
 
44
+ <div class="so-widget-active-indicator"><?php _e('Active', 'so-widgets-bundle') ?></div>
45
 
46
  <h3><?php echo esc_html( $widget['Name'] ); ?></h3>
47
 
63
  <?php endif; ?>
64
 
65
  <div class="so-widget-toggle-active">
66
+ <button class="button-secondary so-widget-activate" data-status="1"><?php esc_html_e( 'Activate', 'so-widgets-bundle' ) ?></button>
67
+ <button class="button-secondary so-widget-deactivate" data-status="0"><?php esc_html_e( 'Deactivate', 'so-widgets-bundle' ) ?></button>
68
  </div>
69
 
70
  </div>
76
  </div>
77
 
78
  <div class="developers-link">
79
+ <?php _e('Developers - create your own widgets for the Widgets Bundle.', 'so-widgets-bundle') ?>
80
+ <a href="https://siteorigin.com/docs/widgets-bundle/" target="_blank"><?php _e('Read More', 'so-widgets-bundle') ?></a>.
81
  </div>
82
 
83
  </div>
admin/trianglify.min.js CHANGED
@@ -1,2 +1,2 @@
1
- !function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var r;r="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,r.Trianglify=e()}}(function(){var e;return function r(e,n,t){function f(o,i){if(!n[o]){if(!e[o]){var s="function"==typeof require&&require;if(!i&&s)return s(o,!0);if(a)return a(o,!0);var c=new Error("Cannot find module '"+o+"'");throw c.code="MODULE_NOT_FOUND",c}var u=n[o]={exports:{}};e[o][0].call(u.exports,function(r){var n=e[o][1][r];return f(n?n:r)},u,u.exports,r,e,n,t)}return n[o].exports}for(var a="function"==typeof require&&require,o=0;o<t.length;o++)f(t[o]);return f}({"./lib/trianglify.js":[function(e,r,n){function t(e){function r(e,r,n){return(e-r[0])*(n[1]-n[0])/(r[1]-r[0])+n[0]}function n(n,t){for(var f=[],a=-y;n+y>a;a+=e.cell_size)for(var o=-w;t+w>o;o+=e.cell_size){var i=a+e.cell_size/2+r(rand(),[0,1],[-v,v]),s=o+e.cell_size/2+r(rand(),[0,1],[-v,v]);f.push([i,s].map(Math.floor))}return f}function t(e){return{x:(e[0][0]+e[1][0]+e[2][0])/3,y:(e[0][1]+e[1][1]+e[2][1])/3}}function i(){if(e.palette instanceof Array)return e.palette[Math.floor(rand()*e.palette.length)];var r=Object.keys(e.palette);return e.palette[r[Math.floor(rand()*r.length)]]}function u(e,r){var n={};for(var t in e)n[t]=e[t];for(t in r){if(!e.hasOwnProperty(t))throw new Error(t+" is not a configuration option for Trianglify. Check your spelling?");n[t]=r[t]}return n}if(e=u(c,e),rand=a(e.seed),"random"===e.x_colors&&(e.x_colors=i()),"random"===e.y_colors&&(e.y_colors=i()),"match_x"===e.y_colors&&(e.y_colors=e.x_colors),!(e.width>0&&e.height>0))throw new Error("Width and height must be numbers greater than 0");if(e.cell_size<2)throw new Error("Cell size must be greater than 2.");var d;if(e.color_function)d=function(r,n){return o(e.color_function(r,n))};else{var l=o.scale(e.x_colors).mode(e.color_space),b=o.scale(e.y_colors).mode(e.color_space);d=function(r,n){return o.interpolate(l(r),b(n),.5,e.color_space)}}for(var h=e.width,g=e.height,p=Math.floor((h+4*e.cell_size)/e.cell_size),m=Math.floor((g+4*e.cell_size)/e.cell_size),y=(p*e.cell_size-h)/2,w=(m*e.cell_size-g)/2,v=e.cell_size*e.variance/2,x=function(e){return r(e,[-y,h+y],[0,1])},_=function(e){return r(e,[-w,g+w],[0,1])},k=n(h,g),j=f.triangulate(k),M=[],N=function(e){return k[e]},D=0;D<j.length;D+=3){var U=[j[D],j[D+1],j[D+2]].map(N),A=t(U),P=d(x(A.x),_(A.y)).hex();M.push([P,U])}return s(M,e)}var f=e("delaunay-fast"),a=e("seedrandom"),o=e("chroma-js"),i=e("./colorbrewer"),s=e("./pattern"),c={width:600,height:400,cell_size:75,variance:.75,seed:null,x_colors:"random",y_colors:"match_x",palette:i,color_space:"lab",color_function:null,stroke_width:1.51};t.colorbrewer=i,t.defaults=c,r.exports=t},{"./colorbrewer":"/Users/gpriday/Downloads/trianglify-master 2/lib/colorbrewer.js","./pattern":"/Users/gpriday/Downloads/trianglify-master 2/lib/pattern.js","chroma-js":"/Users/gpriday/Downloads/trianglify-master 2/node_modules/chroma-js/chroma.js","delaunay-fast":"/Users/gpriday/Downloads/trianglify-master 2/node_modules/delaunay-fast/delaunay.js",seedrandom:"/Users/gpriday/Downloads/trianglify-master 2/node_modules/seedrandom/index.js"}],"/Users/gpriday/Downloads/trianglify-master 2/lib/colorbrewer.js":[function(e,r,n){r.exports={YlGn:["#ffffe5","#f7fcb9","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#006837","#004529"],YlGnBu:["#ffffd9","#edf8b1","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#253494","#081d58"],GnBu:["#f7fcf0","#e0f3db","#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#0868ac","#084081"],BuGn:["#f7fcfd","#e5f5f9","#ccece6","#99d8c9","#66c2a4","#41ae76","#238b45","#006d2c","#00441b"],PuBuGn:["#fff7fb","#ece2f0","#d0d1e6","#a6bddb","#67a9cf","#3690c0","#02818a","#016c59","#014636"],PuBu:["#fff7fb","#ece7f2","#d0d1e6","#a6bddb","#74a9cf","#3690c0","#0570b0","#045a8d","#023858"],BuPu:["#f7fcfd","#e0ecf4","#bfd3e6","#9ebcda","#8c96c6","#8c6bb1","#88419d","#810f7c","#4d004b"],RdPu:["#fff7f3","#fde0dd","#fcc5c0","#fa9fb5","#f768a1","#dd3497","#ae017e","#7a0177","#49006a"],PuRd:["#f7f4f9","#e7e1ef","#d4b9da","#c994c7","#df65b0","#e7298a","#ce1256","#980043","#67001f"],OrRd:["#fff7ec","#fee8c8","#fdd49e","#fdbb84","#fc8d59","#ef6548","#d7301f","#b30000","#7f0000"],YlOrRd:["#ffffcc","#ffeda0","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#bd0026","#800026"],YlOrBr:["#ffffe5","#fff7bc","#fee391","#fec44f","#fe9929","#ec7014","#cc4c02","#993404","#662506"],Purples:["#fcfbfd","#efedf5","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#54278f","#3f007d"],Blues:["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#08519c","#08306b"],Greens:["#f7fcf5","#e5f5e0","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#006d2c","#00441b"],Oranges:["#fff5eb","#fee6ce","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#a63603","#7f2704"],Reds:["#fff5f0","#fee0d2","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#a50f15","#67000d"],Greys:["#ffffff","#f0f0f0","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525","#000000"],PuOr:["#7f3b08","#b35806","#e08214","#fdb863","#fee0b6","#f7f7f7","#d8daeb","#b2abd2","#8073ac","#542788","#2d004b"],BrBG:["#543005","#8c510a","#bf812d","#dfc27d","#f6e8c3","#f5f5f5","#c7eae5","#80cdc1","#35978f","#01665e","#003c30"],PRGn:["#40004b","#762a83","#9970ab","#c2a5cf","#e7d4e8","#f7f7f7","#d9f0d3","#a6dba0","#5aae61","#1b7837","#00441b"],PiYG:["#8e0152","#c51b7d","#de77ae","#f1b6da","#fde0ef","#f7f7f7","#e6f5d0","#b8e186","#7fbc41","#4d9221","#276419"],RdBu:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#f7f7f7","#d1e5f0","#92c5de","#4393c3","#2166ac","#053061"],RdGy:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#ffffff","#e0e0e0","#bababa","#878787","#4d4d4d","#1a1a1a"],RdYlBu:["#a50026","#d73027","#f46d43","#fdae61","#fee090","#ffffbf","#e0f3f8","#abd9e9","#74add1","#4575b4","#313695"],Spectral:["#9e0142","#d53e4f","#f46d43","#fdae61","#fee08b","#ffffbf","#e6f598","#abdda4","#66c2a5","#3288bd","#5e4fa2"],RdYlGn:["#a50026","#d73027","#f46d43","#fdae61","#fee08b","#ffffbf","#d9ef8b","#a6d96a","#66bd63","#1a9850","#006837"]}},{}],"/Users/gpriday/Downloads/trianglify-master 2/lib/pattern.js":[function(e,r,n){(function(n){function t(r,t){function a(){var e=f.createElementNS("http://www.w3.org/2000/svg","svg");return e.setAttribute("width",t.width),e.setAttribute("height",t.height),r.forEach(function(r){var n=f.createElementNS("http://www.w3.org/2000/svg","path");n.setAttribute("d","M"+r[1].join("L")+"Z"),n.setAttribute("fill",r[0]),n.setAttribute("stroke",r[0]),n.setAttribute("stroke-width",t.stroke_width),e.appendChild(n)}),e}function o(a){if("undefined"!=typeof n)try{e("canvas")}catch(o){throw Error("The optional node-canvas dependency is needed for Trianglify to render using canvas in node.")}return a||(a=f.createElement("canvas")),a.setAttribute("width",t.width),a.setAttribute("height",t.height),ctx=a.getContext("2d"),ctx.canvas.width=t.width,ctx.canvas.height=t.height,r.forEach(function(e){ctx.fillStyle=ctx.strokeStyle=e[0],ctx.lineWidth=t.stroke_width,ctx.beginPath(),ctx.moveTo.apply(ctx,e[1][0]),ctx.lineTo.apply(ctx,e[1][1]),ctx.lineTo.apply(ctx,e[1][2]),ctx.fill(),ctx.stroke()}),a}function i(){return o().toDataURL("image/png")}return{polys:r,opts:t,svg:a,canvas:o,png:i}}var f="undefined"!=typeof document?document:e("jsdom").jsdom("<html/>");r.exports=t}).call(this,e("_process"))},{_process:"/Users/gpriday/Downloads/trianglify-master 2/node_modules/browserify/node_modules/process/browser.js",canvas:"/Users/gpriday/Downloads/trianglify-master 2/node_modules/browserify/node_modules/browser-resolve/empty.js",jsdom:"/Users/gpriday/Downloads/trianglify-master 2/node_modules/browserify/node_modules/browser-resolve/empty.js"}],"/Users/gpriday/Downloads/trianglify-master 2/node_modules/browserify/node_modules/browser-resolve/empty.js":[function(e,r,n){},{}],"/Users/gpriday/Downloads/trianglify-master 2/node_modules/browserify/node_modules/process/browser.js":[function(e,r,n){function t(){if(!i){i=!0;for(var e,r=o.length;r;){e=o,o=[];for(var n=-1;++n<r;)e[n]();r=o.length}i=!1}}function f(){}var a=r.exports={},o=[],i=!1;a.nextTick=function(e){o.push(e),i||setTimeout(t,0)},a.title="browser",a.browser=!0,a.env={},a.argv=[],a.version="",a.versions={},a.on=f,a.addListener=f,a.once=f,a.off=f,a.removeListener=f,a.removeAllListeners=f,a.emit=f,a.binding=function(e){throw new Error("process.binding is not supported")},a.cwd=function(){return"/"},a.chdir=function(e){throw new Error("process.chdir is not supported")},a.umask=function(){return 0}},{}],"/Users/gpriday/Downloads/trianglify-master 2/node_modules/chroma-js/chroma.js":[function(r,n,t){(function(){var r,f,a,o,i,s,c,u,d,l,b,h,g,p,m,y,w,v,x,_,k,j,M,N,D,U,A,P,z,G,E,B,I,q,R,S,O,C,T;l=function(e,n,t,f){return new r(e,n,t,f)},"undefined"!=typeof n&&null!==n&&null!=n.exports&&(n.exports=l),"function"==typeof e&&e.amd?e([],function(){return l}):(q="undefined"!=typeof t&&null!==t?t:this,q.chroma=l),l.color=function(e,n,t,f){return new r(e,n,t,f)},l.hsl=function(e,n,t,f){return new r(e,n,t,f,"hsl")},l.hsv=function(e,n,t,f){return new r(e,n,t,f,"hsv")},l.rgb=function(e,n,t,f){return new r(e,n,t,f,"rgb")},l.hex=function(e){return new r(e)},l.css=function(e){return new r(e)},l.lab=function(e,n,t){return new r(e,n,t,"lab")},l.lch=function(e,n,t){return new r(e,n,t,"lch")},l.hsi=function(e,n,t){return new r(e,n,t,"hsi")},l.gl=function(e,n,t,f){return new r(255*e,255*n,255*t,f,"gl")},l.interpolate=function(e,n,t,f){return null==e||null==n?"#000":("string"===R(e)&&(e=new r(e)),"string"===R(n)&&(n=new r(n)),e.interpolate(t,n,f))},l.mix=l.interpolate,l.contrast=function(e,n){var t,f;return"string"===R(e)&&(e=new r(e)),"string"===R(n)&&(n=new r(n)),t=e.luminance(),f=n.luminance(),t>f?(t+.05)/(f+.05):(f+.05)/(t+.05)},l.luminance=function(e){return l(e).luminance()},l._Color=r,r=function(){function e(){var e,r,n,t,f,a,o,i,s,c,u,d,l,h,g,p;for(f=this,n=[],c=0,u=arguments.length;u>c;c++)r=arguments[c],null!=r&&n.push(r);if(0===n.length)d=[255,0,255,1,"rgb"],o=d[0],i=d[1],s=d[2],e=d[3],t=d[4];else if("array"===R(n[0])){if(3===n[0].length)l=n[0],o=l[0],i=l[1],s=l[2],e=1;else{if(4!==n[0].length)throw"unknown input argument";h=n[0],o=h[0],i=h[1],s=h[2],e=h[3]}t=null!=(g=n[1])?g:"rgb"}else"string"===R(n[0])?(o=n[0],t="hex"):"object"===R(n[0])?(p=n[0]._rgb,o=p[0],i=p[1],s=p[2],e=p[3],t="rgb"):n.length>=3&&(o=n[0],i=n[1],s=n[2]);3===n.length?(t="rgb",e=1):4===n.length?"string"===R(n[3])?(t=n[3],e=1):"number"===R(n[3])&&(t="rgb",e=n[3]):5===n.length&&(e=n[3],t=n[4]),null==e&&(e=1),"rgb"===t?f._rgb=[o,i,s,e]:"gl"===t?f._rgb=[255*o,255*i,255*s,e]:"hsl"===t?(f._rgb=w(o,i,s),f._rgb[3]=e):"hsv"===t?(f._rgb=v(o,i,s),f._rgb[3]=e):"hex"===t?f._rgb=m(o):"lab"===t?(f._rgb=_(o,i,s),f._rgb[3]=e):"lch"===t?(f._rgb=M(o,i,s),f._rgb[3]=e):"hsi"===t&&(f._rgb=y(o,i,s),f._rgb[3]=e),a=b(f._rgb)}return e.prototype.rgb=function(){return this._rgb.slice(0,3)},e.prototype.rgba=function(){return this._rgb},e.prototype.hex=function(){return A(this._rgb)},e.prototype.toString=function(){return this.name()},e.prototype.hsl=function(){return z(this._rgb)},e.prototype.hsv=function(){return G(this._rgb)},e.prototype.lab=function(){return E(this._rgb)},e.prototype.lch=function(){return B(this._rgb)},e.prototype.hsi=function(){return P(this._rgb)},e.prototype.gl=function(){return[this._rgb[0]/255,this._rgb[1]/255,this._rgb[2]/255,this._rgb[3]]},e.prototype.luminance=function(r,n){var t,f,a,o;return null==n&&(n="rgb"),arguments.length?(0===r&&(this._rgb=[0,0,0,this._rgb[3]]),1===r&&(this._rgb=[255,255,255,this._rgb[3]]),t=D(this._rgb),f=1e-7,a=20,o=function(e,t){var i,s;return s=e.interpolate(.5,t,n),i=s.luminance(),Math.abs(r-i)<f||!a--?s:i>r?o(e,s):o(s,t)},this._rgb=(t>r?o(new e("black"),this):o(this,new e("white"))).rgba(),this):D(this._rgb)},e.prototype.name=function(){var e,r;e=this.hex();for(r in l.colors)if(e===l.colors[r])return r;return e},e.prototype.alpha=function(e){return arguments.length?(this._rgb[3]=e,this):this._rgb[3]},e.prototype.css=function(e){var r,n,t,f;return null==e&&(e="rgb"),n=this,t=n._rgb,3===e.length&&t[3]<1&&(e+="a"),"rgb"===e?e+"("+t.slice(0,3).map(Math.round).join(",")+")":"rgba"===e?e+"("+t.slice(0,3).map(Math.round).join(",")+","+t[3]+")":"hsl"===e||"hsla"===e?(r=n.hsl(),f=function(e){return Math.round(100*e)/100},r[0]=f(r[0]),r[1]=f(100*r[1])+"%",r[2]=f(100*r[2])+"%",4===e.length&&(r[3]=t[3]),e+"("+r.join(",")+")"):void 0},e.prototype.interpolate=function(r,n,t){var f,a,o,i,s,c,u,d,l,b,h,g,p,m;if(d=this,null==t&&(t="rgb"),"string"===R(n)&&(n=new e(n)),"hsl"===t||"hsv"===t||"lch"===t||"hsi"===t)"hsl"===t?(p=d.hsl(),m=n.hsl()):"hsv"===t?(p=d.hsv(),m=n.hsv()):"hsi"===t?(p=d.hsi(),m=n.hsi()):"lch"===t&&(p=d.lch(),m=n.lch()),"h"===t.substr(0,1)?(o=p[0],h=p[1],c=p[2],i=m[0],g=m[1],u=m[2]):(c=p[0],h=p[1],o=p[2],u=m[0],g=m[1],i=m[2]),isNaN(o)||isNaN(i)?isNaN(o)?isNaN(i)?a=Number.NaN:(a=i,1!==c&&0!==c||"hsv"===t||(b=g)):(a=o,1!==u&&0!==u||"hsv"===t||(b=h)):(f=i>o&&i-o>180?i-(o+360):o>i&&o-i>180?i+360-o:i-o,a=o+r*f),null==b&&(b=h+r*(g-h)),s=c+r*(u-c),l="h"===t.substr(0,1)?new e(a,b,s,t):new e(s,b,a,t);else if("rgb"===t)p=d._rgb,m=n._rgb,l=new e(p[0]+r*(m[0]-p[0]),p[1]+r*(m[1]-p[1]),p[2]+r*(m[2]-p[2]),t);else{if("lab"!==t)throw"color mode "+t+" is not supported";p=d.lab(),m=n.lab(),l=new e(p[0]+r*(m[0]-p[0]),p[1]+r*(m[1]-p[1]),p[2]+r*(m[2]-p[2]),t)}return l.alpha(d.alpha()+r*(n.alpha()-d.alpha())),l},e.prototype.premultiply=function(){var e,r;return r=this.rgb(),e=this.alpha(),l(r[0]*e,r[1]*e,r[2]*e,e)},e.prototype.darken=function(e){var r,n;return null==e&&(e=20),n=this,r=n.lch(),r[0]-=e,l.lch(r).alpha(n.alpha())},e.prototype.darker=function(e){return this.darken(e)},e.prototype.brighten=function(e){return null==e&&(e=20),this.darken(-e)},e.prototype.brighter=function(e){return this.brighten(e)},e.prototype.saturate=function(e){var r,n;return null==e&&(e=20),n=this,r=n.lch(),r[1]+=e,l.lch(r).alpha(n.alpha())},e.prototype.desaturate=function(e){return null==e&&(e=20),this.saturate(-e)},e}(),b=function(e){var r;for(r in e)3>r?(e[r]<0&&(e[r]=0),e[r]>255&&(e[r]=255)):3===r&&(e[r]<0&&(e[r]=0),e[r]>1&&(e[r]=1));return e},p=function(e){var r,n,t,f,a,o,i,s;if(e=e.toLowerCase(),null!=l.colors&&l.colors[e])return m(l.colors[e]);if(t=e.match(/rgb\(\s*(\-?\d+),\s*(\-?\d+)\s*,\s*(\-?\d+)\s*\)/)){for(f=t.slice(1,4),n=a=0;2>=a;n=++a)f[n]=+f[n];f[3]=1}else if(t=e.match(/rgba\(\s*(\-?\d+),\s*(\-?\d+)\s*,\s*(\-?\d+)\s*,\s*([01]|[01]?\.\d+)\)/))for(f=t.slice(1,5),n=o=0;3>=o;n=++o)f[n]=+f[n];else if(t=e.match(/rgb\(\s*(\-?\d+(?:\.\d+)?)%,\s*(\-?\d+(?:\.\d+)?)%\s*,\s*(\-?\d+(?:\.\d+)?)%\s*\)/)){for(f=t.slice(1,4),n=i=0;2>=i;n=++i)f[n]=Math.round(2.55*f[n]);f[3]=1}else if(t=e.match(/rgba\(\s*(\-?\d+(?:\.\d+)?)%,\s*(\-?\d+(?:\.\d+)?)%\s*,\s*(\-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)/)){for(f=t.slice(1,5),n=s=0;2>=s;n=++s)f[n]=Math.round(2.55*f[n]);f[3]=+f[3]}else(t=e.match(/hsl\(\s*(\-?\d+(?:\.\d+)?),\s*(\-?\d+(?:\.\d+)?)%\s*,\s*(\-?\d+(?:\.\d+)?)%\s*\)/))?(r=t.slice(1,4),r[1]*=.01,r[2]*=.01,f=w(r),f[3]=1):(t=e.match(/hsla\(\s*(\-?\d+(?:\.\d+)?),\s*(\-?\d+(?:\.\d+)?)%\s*,\s*(\-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)/))&&(r=t.slice(1,4),r[1]*=.01,r[2]*=.01,f=w(r),f[3]=+t[4]);return f},m=function(e){var r,n,t,f,a,o;if(e.match(/^#?([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/))return(4===e.length||7===e.length)&&(e=e.substr(1)),3===e.length&&(e=e.split(""),e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]),o=parseInt(e,16),f=o>>16,t=o>>8&255,n=255&o,[f,t,n,1];if(e.match(/^#?([A-Fa-f0-9]{8})$/))return 9===e.length&&(e=e.substr(1)),o=parseInt(e,16),f=o>>24&255,t=o>>16&255,n=o>>8&255,r=255&o,[f,t,n,r];if(a=p(e))return a;throw"unknown color: "+e},y=function(e,r,n){var t,f,i,s;return s=S(arguments),e=s[0],r=s[1],n=s[2],e/=360,1/3>e?(t=(1-r)/3,i=(1+r*g(o*e)/g(a-o*e))/3,f=1-(t+i)):2/3>e?(e-=1/3,i=(1-r)/3,f=(1+r*g(o*e)/g(a-o*e))/3,t=1-(i+f)):(e-=2/3,f=(1-r)/3,t=(1+r*g(o*e)/g(a-o*e))/3,i=1-(f+t)),i=N(n*i*3),f=N(n*f*3),t=N(n*t*3),[255*i,255*f,255*t]},w=function(){var e,r,n,t,f,a,o,i,s,c,u,d,l,b;if(l=S(arguments),t=l[0],i=l[1],a=l[2],0===i)o=n=e=255*a;else{for(u=[0,0,0],r=[0,0,0],c=.5>a?a*(1+i):a+i-a*i,s=2*a-c,t/=360,u[0]=t+1/3,u[1]=t,u[2]=t-1/3,f=d=0;2>=d;f=++d)u[f]<0&&(u[f]+=1),u[f]>1&&(u[f]-=1),r[f]=6*u[f]<1?s+6*(c-s)*u[f]:2*u[f]<1?c:3*u[f]<2?s+(c-s)*(2/3-u[f])*6:s;b=[Math.round(255*r[0]),Math.round(255*r[1]),Math.round(255*r[2])],o=b[0],n=b[1],e=b[2]}return[o,n,e]},v=function(){var e,r,n,t,f,a,o,i,s,c,u,d,l,b,h,g,p,m;if(d=S(arguments),t=d[0],s=d[1],u=d[2],u*=255,0===s)i=n=e=u;else switch(360===t&&(t=0),t>360&&(t-=360),0>t&&(t+=360),t/=60,f=Math.floor(t),r=t-f,a=u*(1-s),o=u*(1-s*r),c=u*(1-s*(1-r)),f){case 0:l=[u,c,a],i=l[0],n=l[1],e=l[2];break;case 1:b=[o,u,a],i=b[0],n=b[1],e=b[2];break;case 2:h=[a,u,c],i=h[0],n=h[1],e=h[2];break;case 3:g=[a,o,u],i=g[0],n=g[1],e=g[2];break;case 4:p=[c,a,u],i=p[0],n=p[1],e=p[2];break;case 5:m=[u,a,o],i=m[0],n=m[1],e=m[2]}return i=Math.round(i),n=Math.round(n),e=Math.round(e),[i,n,e]},f=18,i=.95047,s=1,c=1.08883,x=function(){var e,r,n,t,f,a;return a=S(arguments),f=a[0],e=a[1],r=a[2],n=Math.sqrt(e*e+r*r),t=Math.atan2(r,e)/Math.PI*180,[f,n,t]},_=function(e,r,n){var t,f,a,o,u,d,l;return void 0!==e&&3===e.length&&(d=e,e=d[0],r=d[1],n=d[2]),void 0!==e&&3===e.length&&(l=e,e=l[0],r=l[1],n=l[2]),o=(e+16)/116,a=o+r/500,u=o-n/200,a=k(a)*i,o=k(o)*s,u=k(u)*c,f=C(3.2404542*a-1.5371385*o-.4985314*u),t=C(-.969266*a+1.8760108*o+.041556*u),n=C(.0556434*a-.2040259*o+1.0572252*u),[N(f,0,255),N(t,0,255),N(n,0,255),1]},k=function(e){return e>.206893034?e*e*e:(e-4/29)/7.787037},C=function(e){return Math.round(255*(.00304>=e?12.92*e:1.055*Math.pow(e,1/2.4)-.055))},j=function(){var e,r,n,t;return t=S(arguments),n=t[0],e=t[1],r=t[2],r=r*Math.PI/180,[n,Math.cos(r)*e,Math.sin(r)*e]},M=function(e,r,n){var t,f,a,o,i,s,c;return s=j(e,r,n),t=s[0],f=s[1],a=s[2],c=_(t,f,a),i=c[0],o=c[1],a=c[2],[N(i,0,255),N(o,0,255),N(a,0,255)]},D=function(e,r,n){var t;return t=S(arguments),e=t[0],r=t[1],n=t[2],e=U(e),r=U(r),n=U(n),.2126*e+.7152*r+.0722*n},U=function(e){return e/=255,.03928>=e?e/12.92:Math.pow((e+.055)/1.055,2.4)},A=function(){var e,r,n,t,f,a;return a=S(arguments),n=a[0],r=a[1],e=a[2],f=n<<16|r<<8|e,t="000000"+f.toString(16),"#"+t.substr(t.length-6)},P=function(){var e,r,n,t,f,a,o,i,s;return s=S(arguments),o=s[0],n=s[1],r=s[2],e=2*Math.PI,o/=255,n/=255,r/=255,a=Math.min(o,n,r),f=(o+n+r)/3,i=1-a/f,0===i?t=0:(t=(o-n+(o-r))/2,t/=Math.sqrt((o-n)*(o-n)+(o-r)*(n-r)),t=Math.acos(t),r>n&&(t=e-t),t/=e),[360*t,i,f]},z=function(e,r,n){var t,f,a,o,i,s;return void 0!==e&&e.length>=3&&(s=e,e=s[0],r=s[1],n=s[2]),e/=255,r/=255,n/=255,o=Math.min(e,r,n),a=Math.max(e,r,n),f=(a+o)/2,a===o?(i=0,t=Number.NaN):i=.5>f?(a-o)/(a+o):(a-o)/(2-a-o),e===a?t=(r-n)/(a-o):r===a?t=2+(n-e)/(a-o):n===a&&(t=4+(e-r)/(a-o)),t*=60,0>t&&(t+=360),[t,i,f]},G=function(){var e,r,n,t,f,a,o,i,s,c;return c=S(arguments),o=c[0],n=c[1],e=c[2],a=Math.min(o,n,e),f=Math.max(o,n,e),r=f-a,s=f/255,0===f?(t=Number.NaN,i=0):(i=r/f,o===f&&(t=(n-e)/r),n===f&&(t=2+(e-o)/r),e===f&&(t=4+(o-n)/r),t*=60,0>t&&(t+=360)),[t,i,s]},E=function(){var e,r,n,t,f,a,o;return o=S(arguments),n=o[0],r=o[1],e=o[2],n=I(n),r=I(r),e=I(e),t=O((.4124564*n+.3575761*r+.1804375*e)/i),f=O((.2126729*n+.7151522*r+.072175*e)/s),a=O((.0193339*n+.119192*r+.9503041*e)/c),[116*f-16,500*(t-f),200*(f-a)]},I=function(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)},O=function(e){return e>.008856?Math.pow(e,1/3):7.787037*e+4/29},B=function(){var e,r,n,t,f,a,o;return a=S(arguments),f=a[0],n=a[1],r=a[2],o=E(f,n,r),t=o[0],e=o[1],r=o[2],x(t,e,r)},l.scale=function(e,r){var n,t,f,a,o,i,s,c,u,d,b,h,g,p,m,y,w,v,x,_,k;return y="rgb",w=l("#ccc"),k=0,g=!1,h=[0,1],d=[],x=!1,_=[],m=0,p=1,b=!1,v=0,u={},i=function(e,r){var n,t,f,a,i,s,c;if(null==e&&(e=["#ddd","#222"]),null!=e&&"string"===R(e)&&null!=(null!=(i=l.brewer)?i[e]:void 0)&&(e=l.brewer[e]),"array"===R(e)){for(e=e.slice(0),n=f=0,s=e.length-1;s>=0?s>=f:f>=s;n=s>=0?++f:--f)t=e[n],"string"===R(t)&&(e[n]=l(t));if(null!=r)_=r;else for(_=[],n=a=0,c=e.length-1;c>=0?c>=a:a>=c;n=c>=0?++a:--a)_.push(n/(e.length-1))}return o(),d=e},s=function(e){return null==e&&(e=[]),h=e,m=e[0],p=e[e.length-1],o(),v=2===e.length?0:e.length-1},f=function(e){var r,n;if(null!=h){for(n=h.length-1,r=0;n>r&&e>=h[r];)r++;return r-1}return 0},c=function(e){return e},n=function(e){var r,n,t,a,o;return o=e,h.length>2&&(a=h.length-1,r=f(e),t=h[0]+(h[1]-h[0])*(0+.5*k),n=h[a-1]+(h[a]-h[a-1])*(1-.5*k),o=m+(h[r]+.5*(h[r+1]-h[r])-t)/(n-t)*(p-m)),o},a=function(e,r){var n,t,a,o,i,s,b,g,x;if(null==r&&(r=!1),isNaN(e))return w;if(r?b=e:h.length>2?(n=f(e),b=n/(v-1)):(b=a=m!==p?(e-m)/(p-m):0,b=a=(e-m)/(p-m),b=Math.min(1,Math.max(0,b))),r||(b=c(b)),i=Math.floor(1e4*b),u[i])t=u[i];else{if("array"===R(d))for(o=g=0,x=_.length-1;x>=0?x>=g:g>=x;o=x>=0?++g:--g){if(s=_[o],s>=b){t=d[o];break}if(b>=s&&o===_.length-1){t=d[o];break}if(b>s&&b<_[o+1]){b=(b-s)/(_[o+1]-s),t=l.interpolate(d[o],d[o+1],b,y);break}}else"function"===R(d)&&(t=d(b));u[i]=t}return t},o=function(){return u={}},i(e,r),t=function(e){var r;return r=a(e),x&&r[x]?r[x]():r},t.domain=function(e,r,n,f){var a;return null==n&&(n="e"),arguments.length?(null!=r&&(a=l.analyze(e,f),e=0===r?[a.min,a.max]:l.limits(a,n,r)),s(e),t):h},t.mode=function(e){return arguments.length?(y=e,o(),t):y},t.range=function(e,r){return i(e,r),t},t.out=function(e){return x=e,t},t.spread=function(e){return arguments.length?(k=e,t):k},t.correctLightness=function(e){return arguments.length?(b=e,o(),c=b?function(e){var r,n,t,f,o,i,s,c,u;for(r=a(0,!0).lab()[0],n=a(1,!0).lab()[0],s=r>n,t=a(e,!0).lab()[0],o=r+(n-r)*e,f=t-o,c=0,u=1,i=20;Math.abs(f)>.01&&i-->0;)!function(){return s&&(f*=-1),0>f?(c=e,e+=.5*(u-e)):(u=e,e+=.5*(c-e)),t=a(e,!0).lab()[0],f=t-o}();return e}:function(e){return e},t):b},t.colors=function(r){var n,f,a,o,i,s;if(null==r&&(r="hex"),e=[],f=[],h.length>2)for(n=a=1,s=h.length;s>=1?s>a:a>s;n=s>=1?++a:--a)f.push(.5*(h[n-1]+h[n]));else f=h;for(o=0,i=f.length;i>o;o++)n=f[o],e.push(t(n)[r]());return e},t},null==(T=l.scales)&&(l.scales={}),l.scales.cool=function(){return l.scale([l.hsl(180,1,.9),l.hsl(250,.7,.4)])},l.scales.hot=function(){return l.scale(["#000","#f00","#ff0","#fff"],[0,.25,.75,1]).mode("rgb")},l.analyze=function(e,r,n){var t,f,a,o,i,s,c;if(a={min:Number.MAX_VALUE,max:-1*Number.MAX_VALUE,sum:0,values:[],count:0},null==n&&(n=function(){return!0}),t=function(e){null==e||isNaN(e)||(a.values.push(e),a.sum+=e,e<a.min&&(a.min=e),e>a.max&&(a.max=e),a.count+=1)},i=function(e,f){return n(e,f)?t(null!=r&&"function"===R(r)?r(e):null!=r&&"string"===R(r)||"number"===R(r)?e[r]:e):void 0},"array"===R(e))for(s=0,c=e.length;c>s;s++)o=e[s],i(o);else for(f in e)o=e[f],i(o,f);return a.domain=[a.min,a.max],a.limits=function(e,r){return l.limits(a,e,r)},a},l.limits=function(e,r,n){var t,f,a,o,i,s,c,u,d,b,h,g,p,m,y,w,v,x,_,k,j,M,N,D,U,A,P,z,G,E,B,I,q,S,O,C,T,Y,L,F,V,X,W,$,Z,H,J,K,Q,ee,re,ne,te,fe,ae,oe;if(null==r&&(r="equal"),null==n&&(n=7),"array"===R(e)&&(e=l.analyze(e)),p=e.min,h=e.max,N=e.sum,A=e.values.sort(function(e,r){return e-r}),b=[],"c"===r.substr(0,1)&&(b.push(p),b.push(h)),"e"===r.substr(0,1)){for(b.push(p),c=P=1,T=n-1;T>=1?T>=P:P>=T;c=T>=1?++P:--P)b.push(p+c/n*(h-p));b.push(h)}else if("l"===r.substr(0,1)){if(0>=p)throw"Logarithmic scales are only possible for values > 0";for(m=Math.LOG10E*Math.log(p),g=Math.LOG10E*Math.log(h),b.push(p),c=z=1,$=n-1;$>=1?$>=z:z>=$;c=$>=1?++z:--z)b.push(Math.pow(10,m+c/n*(g-m)));b.push(h)}else if("q"===r.substr(0,1)){for(b.push(p),c=G=1,Z=n-1;Z>=1?Z>=G:G>=Z;c=Z>=1?++G:--G)_=A.length*c/n,k=Math.floor(_),k===_?b.push(A[k]):(j=_-k,b.push(A[k]*j+A[k+1]*(1-j)));b.push(h)}else if("k"===r.substr(0,1)){for(w=A.length,t=new Array(w),i=new Array(n),M=!0,v=0,a=null,a=[],a.push(p),c=E=1,H=n-1;H>=1?H>=E:E>=H;c=H>=1?++E:--E)a.push(p+c/n*(h-p));for(a.push(h);M;){for(u=B=0,J=n-1;J>=0?J>=B:B>=J;u=J>=0?++B:--B)i[u]=0;for(c=I=0,K=w-1;K>=0?K>=I:I>=K;c=K>=0?++I:--I){for(U=A[c],y=Number.MAX_VALUE,u=q=0,Q=n-1;Q>=0?Q>=q:q>=Q;u=Q>=0?++q:--q)s=Math.abs(a[u]-U),y>s&&(y=s,f=u);i[f]++,t[c]=f}for(x=new Array(n),u=S=0,ee=n-1;ee>=0?ee>=S:S>=ee;u=ee>=0?++S:--S)x[u]=null;for(c=O=0,re=w-1;re>=0?re>=O:O>=re;c=re>=0?++O:--O)o=t[c],null===x[o]?x[o]=A[c]:x[o]+=A[c];for(u=C=0,Y=n-1;Y>=0?Y>=C:C>=Y;u=Y>=0?++C:--C)x[u]*=1/i[u];for(M=!1,u=ne=0,L=n-1;L>=0?L>=ne:ne>=L;u=L>=0?++ne:--ne)if(x[u]!==a[c]){M=!0;break}a=x,v++,v>200&&(M=!1)}for(d={},u=te=0,F=n-1;F>=0?F>=te:te>=F;u=F>=0?++te:--te)d[u]=[];for(c=fe=0,V=w-1;V>=0?V>=fe:fe>=V;c=V>=0?++fe:--fe)o=t[c],d[o].push(A[c]);for(D=[],u=ae=0,X=n-1;X>=0?X>=ae:ae>=X;u=X>=0?++ae:--ae)D.push(d[u][0]),D.push(d[u][d[u].length-1]);for(D=D.sort(function(e,r){return e-r}),b.push(D[0]),c=oe=1,W=D.length-1;W>=oe;c=oe+=2)isNaN(D[c])||b.push(D[c])}return b},l.brewer=d={OrRd:["#fff7ec","#fee8c8","#fdd49e","#fdbb84","#fc8d59","#ef6548","#d7301f","#b30000","#7f0000"],PuBu:["#fff7fb","#ece7f2","#d0d1e6","#a6bddb","#74a9cf","#3690c0","#0570b0","#045a8d","#023858"],BuPu:["#f7fcfd","#e0ecf4","#bfd3e6","#9ebcda","#8c96c6","#8c6bb1","#88419d","#810f7c","#4d004b"],Oranges:["#fff5eb","#fee6ce","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#a63603","#7f2704"],BuGn:["#f7fcfd","#e5f5f9","#ccece6","#99d8c9","#66c2a4","#41ae76","#238b45","#006d2c","#00441b"],YlOrBr:["#ffffe5","#fff7bc","#fee391","#fec44f","#fe9929","#ec7014","#cc4c02","#993404","#662506"],YlGn:["#ffffe5","#f7fcb9","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#006837","#004529"],Reds:["#fff5f0","#fee0d2","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#a50f15","#67000d"],RdPu:["#fff7f3","#fde0dd","#fcc5c0","#fa9fb5","#f768a1","#dd3497","#ae017e","#7a0177","#49006a"],Greens:["#f7fcf5","#e5f5e0","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#006d2c","#00441b"],YlGnBu:["#ffffd9","#edf8b1","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#253494","#081d58"],Purples:["#fcfbfd","#efedf5","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#54278f","#3f007d"],GnBu:["#f7fcf0","#e0f3db","#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#0868ac","#084081"],Greys:["#ffffff","#f0f0f0","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525","#000000"],YlOrRd:["#ffffcc","#ffeda0","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#bd0026","#800026"],PuRd:["#f7f4f9","#e7e1ef","#d4b9da","#c994c7","#df65b0","#e7298a","#ce1256","#980043","#67001f"],Blues:["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#08519c","#08306b"],PuBuGn:["#fff7fb","#ece2f0","#d0d1e6","#a6bddb","#67a9cf","#3690c0","#02818a","#016c59","#014636"],Spectral:["#9e0142","#d53e4f","#f46d43","#fdae61","#fee08b","#ffffbf","#e6f598","#abdda4","#66c2a5","#3288bd","#5e4fa2"],RdYlGn:["#a50026","#d73027","#f46d43","#fdae61","#fee08b","#ffffbf","#d9ef8b","#a6d96a","#66bd63","#1a9850","#006837"],RdBu:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#f7f7f7","#d1e5f0","#92c5de","#4393c3","#2166ac","#053061"],PiYG:["#8e0152","#c51b7d","#de77ae","#f1b6da","#fde0ef","#f7f7f7","#e6f5d0","#b8e186","#7fbc41","#4d9221","#276419"],PRGn:["#40004b","#762a83","#9970ab","#c2a5cf","#e7d4e8","#f7f7f7","#d9f0d3","#a6dba0","#5aae61","#1b7837","#00441b"],RdYlBu:["#a50026","#d73027","#f46d43","#fdae61","#fee090","#ffffbf","#e0f3f8","#abd9e9","#74add1","#4575b4","#313695"],BrBG:["#543005","#8c510a","#bf812d","#dfc27d","#f6e8c3","#f5f5f5","#c7eae5","#80cdc1","#35978f","#01665e","#003c30"],RdGy:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#ffffff","#e0e0e0","#bababa","#878787","#4d4d4d","#1a1a1a"],PuOr:["#7f3b08","#b35806","#e08214","#fdb863","#fee0b6","#f7f7f7","#d8daeb","#b2abd2","#8073ac","#542788","#2d004b"],Set2:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854","#ffd92f","#e5c494","#b3b3b3"],Accent:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0","#f0027f","#bf5b17","#666666"],Set1:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33","#a65628","#f781bf","#999999"],Set3:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd","#ccebc5","#ffed6f"],Dark2:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e","#e6ab02","#a6761d","#666666"],Paired:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6","#6a3d9a","#ffff99","#b15928"],Pastel2:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9","#fff2ae","#f1e2cc","#cccccc"],Pastel1:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc","#e5d8bd","#fddaec","#f2f2f2"]},l.colors=h={indigo:"#4b0082",gold:"#ffd700",hotpink:"#ff69b4",firebrick:"#b22222",indianred:"#cd5c5c",yellow:"#ffff00",mistyrose:"#ffe4e1",darkolivegreen:"#556b2f",olive:"#808000",darkseagreen:"#8fbc8f",pink:"#ffc0cb",tomato:"#ff6347",lightcoral:"#f08080",orangered:"#ff4500",navajowhite:"#ffdead",lime:"#00ff00",palegreen:"#98fb98",darkslategrey:"#2f4f4f",greenyellow:"#adff2f",burlywood:"#deb887",seashell:"#fff5ee",mediumspringgreen:"#00fa9a",fuchsia:"#ff00ff",papayawhip:"#ffefd5",blanchedalmond:"#ffebcd",chartreuse:"#7fff00",dimgray:"#696969",black:"#000000",peachpuff:"#ffdab9",springgreen:"#00ff7f",aquamarine:"#7fffd4",white:"#ffffff",orange:"#ffa500",lightsalmon:"#ffa07a",darkslategray:"#2f4f4f",brown:"#a52a2a",ivory:"#fffff0",dodgerblue:"#1e90ff",peru:"#cd853f",lawngreen:"#7cfc00",chocolate:"#d2691e",crimson:"#dc143c",forestgreen:"#228b22",darkgrey:"#a9a9a9",lightseagreen:"#20b2aa",cyan:"#00ffff",mintcream:"#f5fffa",silver:"#c0c0c0",antiquewhite:"#faebd7",mediumorchid:"#ba55d3",skyblue:"#87ceeb",gray:"#808080",darkturquoise:"#00ced1",goldenrod:"#daa520",darkgreen:"#006400",floralwhite:"#fffaf0",darkviolet:"#9400d3",darkgray:"#a9a9a9",moccasin:"#ffe4b5",saddlebrown:"#8b4513",grey:"#808080",darkslateblue:"#483d8b",lightskyblue:"#87cefa",lightpink:"#ffb6c1",mediumvioletred:"#c71585",slategrey:"#708090",red:"#ff0000",deeppink:"#ff1493",limegreen:"#32cd32",darkmagenta:"#8b008b",palegoldenrod:"#eee8aa",plum:"#dda0dd",turquoise:"#40e0d0",lightgrey:"#d3d3d3",lightgoldenrodyellow:"#fafad2",darkgoldenrod:"#b8860b",lavender:"#e6e6fa",maroon:"#800000",yellowgreen:"#9acd32",sandybrown:"#f4a460",thistle:"#d8bfd8",violet:"#ee82ee",navy:"#000080",magenta:"#ff00ff",dimgrey:"#696969",tan:"#d2b48c",rosybrown:"#bc8f8f",olivedrab:"#6b8e23",blue:"#0000ff",lightblue:"#add8e6",ghostwhite:"#f8f8ff",honeydew:"#f0fff0",cornflowerblue:"#6495ed",slateblue:"#6a5acd",linen:"#faf0e6",darkblue:"#00008b",powderblue:"#b0e0e6",seagreen:"#2e8b57",darkkhaki:"#bdb76b",snow:"#fffafa",sienna:"#a0522d",mediumblue:"#0000cd",royalblue:"#4169e1",lightcyan:"#e0ffff",green:"#008000",mediumpurple:"#9370db",midnightblue:"#191970",cornsilk:"#fff8dc",paleturquoise:"#afeeee",bisque:"#ffe4c4",slategray:"#708090",darkcyan:"#008b8b",khaki:"#f0e68c",wheat:"#f5deb3",teal:"#008080",darkorchid:"#9932cc",deepskyblue:"#00bfff",salmon:"#fa8072",darkred:"#8b0000",steelblue:"#4682b4",palevioletred:"#db7093",lightslategray:"#778899",aliceblue:"#f0f8ff",lightslategrey:"#778899",lightgreen:"#90ee90",orchid:"#da70d6",gainsboro:"#dcdcdc",mediumseagreen:"#3cb371",lightgray:"#d3d3d3",mediumturquoise:"#48d1cc",lemonchiffon:"#fffacd",cadetblue:"#5f9ea0",lightyellow:"#ffffe0",lavenderblush:"#fff0f5",coral:"#ff7f50",purple:"#800080",aqua:"#00ffff",whitesmoke:"#f5f5f5",mediumslateblue:"#7b68ee",darkorange:"#ff8c00",mediumaquamarine:"#66cdaa",darksalmon:"#e9967a",beige:"#f5f5dc",blueviolet:"#8a2be2",azure:"#f0ffff",lightsteelblue:"#b0c4de",oldlace:"#fdf5e6"},R=function(){var e,r,n,t,f;for(e={},f="Boolean Number String Function Array Date RegExp Undefined Null".split(" "),n=0,t=f.length;t>n;n++)r=f[n],e["[object "+r+"]"]=r.toLowerCase();return function(r){var n;return n=Object.prototype.toString.call(r),e[n]||"object"}}(),N=function(e,r,n){return null==r&&(r=0),null==n&&(n=1),r>e&&(e=r),e>n&&(e=n),e},S=function(e){return e.length>=3?e:e[0]},o=2*Math.PI,a=Math.PI/3,g=Math.cos,u=function(e){var r,n,t,f,a,o,i,s,c,d,b;return e=function(){var r,n,t;for(t=[],r=0,n=e.length;n>r;r++)f=e[r],t.push(l(f));return t}(),2===e.length?(c=function(){var r,n,t;for(t=[],r=0,n=e.length;n>r;r++)f=e[r],
2
- t.push(f.lab());return t}(),a=c[0],o=c[1],r=function(e){var r,n;return n=function(){var n,t;for(t=[],r=n=0;2>=n;r=++n)t.push(a[r]+e*(o[r]-a[r]));return t}(),l.lab.apply(l,n)}):3===e.length?(d=function(){var r,n,t;for(t=[],r=0,n=e.length;n>r;r++)f=e[r],t.push(f.lab());return t}(),a=d[0],o=d[1],i=d[2],r=function(e){var r,n;return n=function(){var n,t;for(t=[],r=n=0;2>=n;r=++n)t.push((1-e)*(1-e)*a[r]+2*(1-e)*e*o[r]+e*e*i[r]);return t}(),l.lab.apply(l,n)}):4===e.length?(b=function(){var r,n,t;for(t=[],r=0,n=e.length;n>r;r++)f=e[r],t.push(f.lab());return t}(),a=b[0],o=b[1],i=b[2],s=b[3],r=function(e){var r,n;return n=function(){var n,t;for(t=[],r=n=0;2>=n;r=++n)t.push((1-e)*(1-e)*(1-e)*a[r]+3*(1-e)*(1-e)*e*o[r]+3*(1-e)*e*e*i[r]+e*e*e*s[r]);return t}(),l.lab.apply(l,n)}):5===e.length&&(n=u(e.slice(0,3)),t=u(e.slice(2,5)),r=function(e){return.5>e?n(2*e):t(2*(e-.5))}),r},l.interpolate.bezier=u}).call(this)},{}],"/Users/gpriday/Downloads/trianglify-master 2/node_modules/delaunay-fast/delaunay.js":[function(e,r,n){var t;!function(){"use strict";function e(e){var r,n,t,f,a,o,i=Number.POSITIVE_INFINITY,s=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY,u=Number.NEGATIVE_INFINITY;for(r=e.length;r--;)e[r][0]<i&&(i=e[r][0]),e[r][0]>c&&(c=e[r][0]),e[r][1]<s&&(s=e[r][1]),e[r][1]>u&&(u=e[r][1]);return n=c-i,t=u-s,f=Math.max(n,t),a=i+.5*n,o=s+.5*t,[[a-20*f,o-f],[a,o+20*f],[a+20*f,o-f]]}function n(e,r,n,t){var f,o,i,s,c,u,d,l,b,h,g=e[r][0],p=e[r][1],m=e[n][0],y=e[n][1],w=e[t][0],v=e[t][1],x=Math.abs(p-y),_=Math.abs(y-v);if(a>x&&a>_)throw new Error("Eek! Coincident points!");return a>x?(s=-((w-m)/(v-y)),u=(m+w)/2,l=(y+v)/2,f=(m+g)/2,o=s*(f-u)+l):a>_?(i=-((m-g)/(y-p)),c=(g+m)/2,d=(p+y)/2,f=(w+m)/2,o=i*(f-c)+d):(i=-((m-g)/(y-p)),s=-((w-m)/(v-y)),c=(g+m)/2,u=(m+w)/2,d=(p+y)/2,l=(y+v)/2,f=(i*c-s*u+l-d)/(i-s),o=x>_?i*(f-c)+d:s*(f-u)+l),b=m-f,h=y-o,{i:r,j:n,k:t,x:f,y:o,r:b*b+h*h}}function f(e){var r,n,t,f,a,o;for(n=e.length;n;)for(f=e[--n],t=e[--n],r=n;r;)if(o=e[--r],a=e[--r],t===a&&f===o||t===o&&f===a){e.splice(n,2),e.splice(r,2);break}}var a=1/1048576;t={triangulate:function(r,t){var o,i,s,c,u,d,l,b,h,g,p,m,y=r.length;if(3>y)return[];if(r=r.slice(0),t)for(o=y;o--;)r[o]=r[o][t];for(s=new Array(y),o=y;o--;)s[o]=o;for(s.sort(function(e,n){return r[n][0]-r[e][0]}),c=e(r),r.push(c[0],c[1],c[2]),u=[n(r,y+0,y+1,y+2)],d=[],l=[],o=s.length;o--;l.length=0){for(m=s[o],i=u.length;i--;)b=r[m][0]-u[i].x,b>0&&b*b>u[i].r?(d.push(u[i]),u.splice(i,1)):(h=r[m][1]-u[i].y,b*b+h*h-u[i].r>a||(l.push(u[i].i,u[i].j,u[i].j,u[i].k,u[i].k,u[i].i),u.splice(i,1)));for(f(l),i=l.length;i;)p=l[--i],g=l[--i],u.push(n(r,g,p,m))}for(o=u.length;o--;)d.push(u[o]);for(u.length=0,o=d.length;o--;)d[o].i<y&&d[o].j<y&&d[o].k<y&&u.push(d[o].i,d[o].j,d[o].k);return u},contains:function(e,r){if(r[0]<e[0][0]&&r[0]<e[1][0]&&r[0]<e[2][0]||r[0]>e[0][0]&&r[0]>e[1][0]&&r[0]>e[2][0]||r[1]<e[0][1]&&r[1]<e[1][1]&&r[1]<e[2][1]||r[1]>e[0][1]&&r[1]>e[1][1]&&r[1]>e[2][1])return null;var n=e[1][0]-e[0][0],t=e[2][0]-e[0][0],f=e[1][1]-e[0][1],a=e[2][1]-e[0][1],o=n*a-t*f;if(0===o)return null;var i=(a*(r[0]-e[0][0])-t*(r[1]-e[0][1]))/o,s=(n*(r[1]-e[0][1])-f*(r[0]-e[0][0]))/o;return 0>i||0>s||i+s>1?null:[i,s]}},"undefined"!=typeof r&&(r.exports=t)}()},{}],"/Users/gpriday/Downloads/trianglify-master 2/node_modules/seedrandom/index.js":[function(e,r,n){var t=e("./lib/alea"),f=e("./lib/xor128"),a=e("./lib/xorwow"),o=e("./lib/xorshift7"),i=e("./lib/xor4096"),s=e("./lib/tychei"),c=e("./seedrandom");c.alea=t,c.xor128=f,c.xorwow=a,c.xorshift7=o,c.xor4096=i,c.tychei=s,r.exports=c},{"./lib/alea":"/Users/gpriday/Downloads/trianglify-master 2/node_modules/seedrandom/lib/alea.js","./lib/tychei":"/Users/gpriday/Downloads/trianglify-master 2/node_modules/seedrandom/lib/tychei.js","./lib/xor128":"/Users/gpriday/Downloads/trianglify-master 2/node_modules/seedrandom/lib/xor128.js","./lib/xor4096":"/Users/gpriday/Downloads/trianglify-master 2/node_modules/seedrandom/lib/xor4096.js","./lib/xorshift7":"/Users/gpriday/Downloads/trianglify-master 2/node_modules/seedrandom/lib/xorshift7.js","./lib/xorwow":"/Users/gpriday/Downloads/trianglify-master 2/node_modules/seedrandom/lib/xorwow.js","./seedrandom":"/Users/gpriday/Downloads/trianglify-master 2/node_modules/seedrandom/seedrandom.js"}],"/Users/gpriday/Downloads/trianglify-master 2/node_modules/seedrandom/lib/alea.js":[function(r,n,t){!function(e,r,n){function t(e){var r=this,n=o();r.next=function(){var e=2091639*r.s0+2.3283064365386963e-10*r.c;return r.s0=r.s1,r.s1=r.s2,r.s2=e-(r.c=0|e)},r.c=1,r.s0=n(" "),r.s1=n(" "),r.s2=n(" "),r.s0-=n(e),r.s0<0&&(r.s0+=1),r.s1-=n(e),r.s1<0&&(r.s1+=1),r.s2-=n(e),r.s2<0&&(r.s2+=1),n=null}function f(e,r){return r.c=e.c,r.s0=e.s0,r.s1=e.s1,r.s2=e.s2,r}function a(e,r){var n=new t(e),a=r&&r.state,o=n.next;return o.int32=function(){return 4294967296*n.next()|0},o["double"]=function(){return o()+1.1102230246251565e-16*(2097152*o()|0)},o.quick=o,a&&("object"==typeof a&&f(a,n),o.state=function(){return f(n,{})}),o}function o(){var e=4022871197,r=function(r){r=r.toString();for(var n=0;n<r.length;n++){e+=r.charCodeAt(n);var t=.02519603282416938*e;e=t>>>0,t-=e,t*=e,e=t>>>0,t-=e,e+=4294967296*t}return 2.3283064365386963e-10*(e>>>0)};return r}r&&r.exports?r.exports=a:n&&n.amd?n(function(){return a}):this.alea=a}(this,"object"==typeof n&&n,"function"==typeof e&&e)},{}],"/Users/gpriday/Downloads/trianglify-master 2/node_modules/seedrandom/lib/tychei.js":[function(r,n,t){!function(e,r,n){function t(e){var r=this,n="";r.next=function(){var e=r.b,n=r.c,t=r.d,f=r.a;return e=e<<25^e>>>7^n,n=n-t|0,t=t<<24^t>>>8^f,f=f-e|0,r.b=e=e<<20^e>>>12^n,r.c=n=n-t|0,r.d=t<<16^n>>>16^f,r.a=f-e|0},r.a=0,r.b=0,r.c=-1640531527,r.d=1367130551,e===Math.floor(e)?(r.a=e/4294967296|0,r.b=0|e):n+=e;for(var t=0;t<n.length+20;t++)r.b^=0|n.charCodeAt(t),r.next()}function f(e,r){return r.a=e.a,r.b=e.b,r.c=e.c,r.d=e.d,r}function a(e,r){var n=new t(e),a=r&&r.state,o=function(){return(n.next()>>>0)/4294967296};return o["double"]=function(){do var e=n.next()>>>11,r=(n.next()>>>0)/4294967296,t=(e+r)/(1<<21);while(0===t);return t},o.int32=n.next,o.quick=o,a&&("object"==typeof a&&f(a,n),o.state=function(){return f(n,{})}),o}r&&r.exports?r.exports=a:n&&n.amd?n(function(){return a}):this.tychei=a}(this,"object"==typeof n&&n,"function"==typeof e&&e)},{}],"/Users/gpriday/Downloads/trianglify-master 2/node_modules/seedrandom/lib/xor128.js":[function(r,n,t){!function(e,r,n){function t(e){var r=this,n="";r.x=0,r.y=0,r.z=0,r.w=0,r.next=function(){var e=r.x^r.x<<11;return r.x=r.y,r.y=r.z,r.z=r.w,r.w^=r.w>>>19^e^e>>>8},e===(0|e)?r.x=e:n+=e;for(var t=0;t<n.length+64;t++)r.x^=0|n.charCodeAt(t),r.next()}function f(e,r){return r.x=e.x,r.y=e.y,r.z=e.z,r.w=e.w,r}function a(e,r){var n=new t(e),a=r&&r.state,o=function(){return(n.next()>>>0)/4294967296};return o["double"]=function(){do var e=n.next()>>>11,r=(n.next()>>>0)/4294967296,t=(e+r)/(1<<21);while(0===t);return t},o.int32=n.next,o.quick=o,a&&("object"==typeof a&&f(a,n),o.state=function(){return f(n,{})}),o}r&&r.exports?r.exports=a:n&&n.amd?n(function(){return a}):this.xor128=a}(this,"object"==typeof n&&n,"function"==typeof e&&e)},{}],"/Users/gpriday/Downloads/trianglify-master 2/node_modules/seedrandom/lib/xor4096.js":[function(r,n,t){!function(e,r,n){function t(e){function r(e,r){var n,t,f,a,o,i=[],s=128;for(r===(0|r)?(t=r,r=null):(r+="\x00",t=0,s=Math.max(s,r.length)),f=0,a=-32;s>a;++a)r&&(t^=r.charCodeAt((a+32)%r.length)),0===a&&(o=t),t^=t<<10,t^=t>>>15,t^=t<<4,t^=t>>>13,a>=0&&(o=o+1640531527|0,n=i[127&a]^=t+o,f=0==n?f+1:0);for(f>=128&&(i[127&(r&&r.length||0)]=-1),f=127,a=512;a>0;--a)t=i[f+34&127],n=i[f=f+1&127],t^=t<<13,n^=n<<17,t^=t>>>15,n^=n>>>12,i[f]=t^n;e.w=o,e.X=i,e.i=f}var n=this;n.next=function(){var e,r,t=n.w,f=n.X,a=n.i;return n.w=t=t+1640531527|0,r=f[a+34&127],e=f[a=a+1&127],r^=r<<13,e^=e<<17,r^=r>>>15,e^=e>>>12,r=f[a]=r^e,n.i=a,r+(t^t>>>16)|0},r(n,e)}function f(e,r){return r.i=e.i,r.w=e.w,r.X=e.X.slice(),r}function a(e,r){null==e&&(e=+new Date);var n=new t(e),a=r&&r.state,o=function(){return(n.next()>>>0)/4294967296};return o["double"]=function(){do var e=n.next()>>>11,r=(n.next()>>>0)/4294967296,t=(e+r)/(1<<21);while(0===t);return t},o.int32=n.next,o.quick=o,a&&(a.X&&f(a,n),o.state=function(){return f(n,{})}),o}r&&r.exports?r.exports=a:n&&n.amd?n(function(){return a}):this.xor4096=a}(this,"object"==typeof n&&n,"function"==typeof e&&e)},{}],"/Users/gpriday/Downloads/trianglify-master 2/node_modules/seedrandom/lib/xorshift7.js":[function(r,n,t){!function(e,r,n){function t(e){function r(e,r){var n,t,f=[];if(r===(0|r))t=f[0]=r;else for(r=""+r,n=0;n<r.length;++n)f[7&n]=f[7&n]<<15^r.charCodeAt(n)+f[n+1&7]<<13;for(;f.length<8;)f.push(0);for(n=0;8>n&&0===f[n];++n);for(t=8==n?f[7]=-1:f[n],e.x=f,e.i=0,n=256;n>0;--n)e.next()}var n=this;n.next=function(){var e,r,t=n.x,f=n.i;return e=t[f],e^=e>>>7,r=e^e<<24,e=t[f+1&7],r^=e^e>>>10,e=t[f+3&7],r^=e^e>>>3,e=t[f+4&7],r^=e^e<<7,e=t[f+7&7],e^=e<<13,r^=e^e<<9,t[f]=r,n.i=f+1&7,r},r(n,e)}function f(e,r){return r.x=e.x.slice(),r.i=e.i,r}function a(e,r){null==e&&(e=+new Date);var n=new t(e),a=r&&r.state,o=function(){return(n.next()>>>0)/4294967296};return o["double"]=function(){do var e=n.next()>>>11,r=(n.next()>>>0)/4294967296,t=(e+r)/(1<<21);while(0===t);return t},o.int32=n.next,o.quick=o,a&&(a.x&&f(a,n),o.state=function(){return f(n,{})}),o}r&&r.exports?r.exports=a:n&&n.amd?n(function(){return a}):this.xorshift7=a}(this,"object"==typeof n&&n,"function"==typeof e&&e)},{}],"/Users/gpriday/Downloads/trianglify-master 2/node_modules/seedrandom/lib/xorwow.js":[function(r,n,t){!function(e,r,n){function t(e){var r=this,n="";r.next=function(){var e=r.x^r.x>>>2;return r.x=r.y,r.y=r.z,r.z=r.w,r.w=r.v,(r.d=r.d+362437|0)+(r.v=r.v^r.v<<4^(e^e<<1))|0},r.x=0,r.y=0,r.z=0,r.w=0,r.v=0,e===(0|e)?r.x=e:n+=e;for(var t=0;t<n.length+64;t++)r.x^=0|n.charCodeAt(t),t==n.length&&(r.d=r.x<<10^r.x>>>4),r.next()}function f(e,r){return r.x=e.x,r.y=e.y,r.z=e.z,r.w=e.w,r.v=e.v,r.d=e.d,r}function a(e,r){var n=new t(e),a=r&&r.state,o=function(){return(n.next()>>>0)/4294967296};return o["double"]=function(){do var e=n.next()>>>11,r=(n.next()>>>0)/4294967296,t=(e+r)/(1<<21);while(0===t);return t},o.int32=n.next,o.quick=o,a&&("object"==typeof a&&f(a,n),o.state=function(){return f(n,{})}),o}r&&r.exports?r.exports=a:n&&n.amd?n(function(){return a}):this.xorwow=a}(this,"object"==typeof n&&n,"function"==typeof e&&e)},{}],"/Users/gpriday/Downloads/trianglify-master 2/node_modules/seedrandom/seedrandom.js":[function(r,n,t){!function(t,f){function a(e,r,n){var a=[];r=1==r?{entropy:!0}:r||{};var l=c(s(r.entropy?[e,d(t)]:null==e?u():e,3),a),b=new o(a),p=function(){for(var e=b.g(g),r=y,n=0;w>e;)e=(e+n)*h,r*=h,n=b.g(1);for(;e>=v;)e/=2,r/=2,n>>>=1;return(e+n)/r};return p.int32=function(){return 0|b.g(4)},p.quick=function(){return b.g(4)/4294967296},p["double"]=p,c(d(b.S),t),(r.pass||n||function(e,r,n,t){return t&&(t.S&&i(t,b),e.state=function(){return i(b,{})}),n?(f[m]=e,r):e})(p,l,"global"in r?r.global:this==f,r.state)}function o(e){var r,n=e.length,t=this,f=0,a=t.i=t.j=0,o=t.S=[];for(n||(e=[n++]);h>f;)o[f]=f++;for(f=0;h>f;f++)o[f]=o[a=x&a+e[f%n]+(r=o[f])],o[a]=r;(t.g=function(e){for(var r,n=0,f=t.i,a=t.j,o=t.S;e--;)r=o[f=x&f+1],n=n*h+o[x&(o[f]=o[a=x&a+r])+(o[a]=r)];return t.i=f,t.j=a,n})(h)}function i(e,r){return r.i=e.i,r.j=e.j,r.S=e.S.slice(),r}function s(e,r){var n,t=[],f=typeof e;if(r&&"object"==f)for(n in e)try{t.push(s(e[n],r-1))}catch(a){}return t.length?t:"string"==f?e:e+"\x00"}function c(e,r){for(var n,t=e+"",f=0;f<t.length;)r[x&f]=x&(n^=19*r[x&f])+t.charCodeAt(f++);return d(r)}function u(){try{if(l)return d(l.randomBytes(h));var e=new Uint8Array(h);return(b.crypto||b.msCrypto).getRandomValues(e),d(e)}catch(r){var n=b.navigator,f=n&&n.plugins;return[+new Date,b,f,b.screen,d(t)]}}function d(e){return String.fromCharCode.apply(0,e)}var l,b=this,h=256,g=6,p=52,m="random",y=f.pow(h,g),w=f.pow(2,p),v=2*w,x=h-1;if(f["seed"+m]=a,c(f.random(),t),"object"==typeof n&&n.exports){n.exports=a;try{l=r("crypto")}catch(_){}}else"function"==typeof e&&e.amd&&e(function(){return a})}([],Math)},{crypto:!1}]},{},["./lib/trianglify.js"])("./lib/trianglify.js")});
1
+ !function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var r;r="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,r.Trianglify=e()}}(function(){var e;return function r(e,n,t){function f(o,i){if(!n[o]){if(!e[o]){var s="function"==typeof require&&require;if(!i&&s)return s(o,!0);if(a)return a(o,!0);var c=new Error("Cannot find module '"+o+"'");throw c.code="MODULE_NOT_FOUND",c}var u=n[o]={exports:{}};e[o][0].call(u.exports,function(r){var n=e[o][1][r];return f(n?n:r)},u,u.exports,r,e,n,t)}return n[o].exports}for(var a="function"==typeof require&&require,o=0;o<t.length;o++)f(t[o]);return f}({"./lib/trianglify.js":[function(e,r,n){function t(e){function r(e,r,n){return(e-r[0])*(n[1]-n[0])/(r[1]-r[0])+n[0]}function n(n,t){for(var f=[],a=-y;n+y>a;a+=e.cell_size)for(var o=-w;t+w>o;o+=e.cell_size){var i=a+e.cell_size/2+r(rand(),[0,1],[-v,v]),s=o+e.cell_size/2+r(rand(),[0,1],[-v,v]);f.push([i,s].map(Math.floor))}return f}function t(e){return{x:(e[0][0]+e[1][0]+e[2][0])/3,y:(e[0][1]+e[1][1]+e[2][1])/3}}function i(){if(e.palette instanceof Array)return e.palette[Math.floor(rand()*e.palette.length)];var r=Object.keys(e.palette);return e.palette[r[Math.floor(rand()*r.length)]]}function u(e,r){var n={};for(var t in e)n[t]=e[t];for(t in r){if(!e.hasOwnProperty(t))throw new Error(t+" is not a configuration option for Trianglify. Check your spelling?");n[t]=r[t]}return n}if(e=u(c,e),rand=a(e.seed),"random"===e.x_colors&&(e.x_colors=i()),"random"===e.y_colors&&(e.y_colors=i()),"match_x"===e.y_colors&&(e.y_colors=e.x_colors),!(e.width>0&&e.height>0))throw new Error("Width and height must be numbers greater than 0");if(e.cell_size<2)throw new Error("Cell size must be greater than 2.");var d;if(e.color_function)d=function(r,n){return o(e.color_function(r,n))};else{var l=o.scale(e.x_colors).mode(e.color_space),b=o.scale(e.y_colors).mode(e.color_space);d=function(r,n){return o.interpolate(l(r),b(n),.5,e.color_space)}}for(var h=e.width,g=e.height,p=Math.floor((h+4*e.cell_size)/e.cell_size),m=Math.floor((g+4*e.cell_size)/e.cell_size),y=(p*e.cell_size-h)/2,w=(m*e.cell_size-g)/2,v=e.cell_size*e.variance/2,x=function(e){return r(e,[-y,h+y],[0,1])},_=function(e){return r(e,[-w,g+w],[0,1])},k=n(h,g),j=f.triangulate(k),M=[],N=function(e){return k[e]},D=0;D<j.length;D+=3){var U=[j[D],j[D+1],j[D+2]].map(N),A=t(U),P=d(x(A.x),_(A.y)).hex();M.push([P,U])}return s(M,e)}var f=e("delaunay-fast"),a=e("seedrandom"),o=e("chroma-js"),i=e("./colorbrewer"),s=e("./pattern"),c={width:600,height:400,cell_size:75,variance:.75,seed:null,x_colors:"random",y_colors:"match_x",palette:i,color_space:"lab",color_function:null,stroke_width:1.51};t.colorbrewer=i,t.defaults=c,r.exports=t},{"./colorbrewer":"/Users/gpriday/Downloads/trianglify-master 2/lib/colorbrewer.js","./pattern":"/Users/gpriday/Downloads/trianglify-master 2/lib/pattern.js","chroma-js":"/Users/gpriday/Downloads/trianglify-master 2/node_modules/chroma-js/chroma.js","delaunay-fast":"/Users/gpriday/Downloads/trianglify-master 2/node_modules/delaunay-fast/delaunay.js",seedrandom:"/Users/gpriday/Downloads/trianglify-master 2/node_modules/seedrandom/index.js"}],"/Users/gpriday/Downloads/trianglify-master 2/lib/colorbrewer.js":[function(e,r,n){r.exports={YlGn:["#ffffe5","#f7fcb9","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#006837","#004529"],YlGnBu:["#ffffd9","#edf8b1","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#253494","#081d58"],GnBu:["#f7fcf0","#e0f3db","#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#0868ac","#084081"],BuGn:["#f7fcfd","#e5f5f9","#ccece6","#99d8c9","#66c2a4","#41ae76","#238b45","#006d2c","#00441b"],PuBuGn:["#fff7fb","#ece2f0","#d0d1e6","#a6bddb","#67a9cf","#3690c0","#02818a","#016c59","#014636"],PuBu:["#fff7fb","#ece7f2","#d0d1e6","#a6bddb","#74a9cf","#3690c0","#0570b0","#045a8d","#023858"],BuPu:["#f7fcfd","#e0ecf4","#bfd3e6","#9ebcda","#8c96c6","#8c6bb1","#88419d","#810f7c","#4d004b"],RdPu:["#fff7f3","#fde0dd","#fcc5c0","#fa9fb5","#f768a1","#dd3497","#ae017e","#7a0177","#49006a"],PuRd:["#f7f4f9","#e7e1ef","#d4b9da","#c994c7","#df65b0","#e7298a","#ce1256","#980043","#67001f"],OrRd:["#fff7ec","#fee8c8","#fdd49e","#fdbb84","#fc8d59","#ef6548","#d7301f","#b30000","#7f0000"],YlOrRd:["#ffffcc","#ffeda0","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#bd0026","#800026"],YlOrBr:["#ffffe5","#fff7bc","#fee391","#fec44f","#fe9929","#ec7014","#cc4c02","#993404","#662506"],Purples:["#fcfbfd","#efedf5","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#54278f","#3f007d"],Blues:["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#08519c","#08306b"],Greens:["#f7fcf5","#e5f5e0","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#006d2c","#00441b"],Oranges:["#fff5eb","#fee6ce","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#a63603","#7f2704"],Reds:["#fff5f0","#fee0d2","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#a50f15","#67000d"],Greys:["#ffffff","#f0f0f0","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525","#000000"],PuOr:["#7f3b08","#b35806","#e08214","#fdb863","#fee0b6","#f7f7f7","#d8daeb","#b2abd2","#8073ac","#542788","#2d004b"],BrBG:["#543005","#8c510a","#bf812d","#dfc27d","#f6e8c3","#f5f5f5","#c7eae5","#80cdc1","#35978f","#01665e","#003c30"],PRGn:["#40004b","#762a83","#9970ab","#c2a5cf","#e7d4e8","#f7f7f7","#d9f0d3","#a6dba0","#5aae61","#1b7837","#00441b"],PiYG:["#8e0152","#c51b7d","#de77ae","#f1b6da","#fde0ef","#f7f7f7","#e6f5d0","#b8e186","#7fbc41","#4d9221","#276419"],RdBu:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#f7f7f7","#d1e5f0","#92c5de","#4393c3","#2166ac","#053061"],RdGy:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#ffffff","#e0e0e0","#bababa","#878787","#4d4d4d","#1a1a1a"],RdYlBu:["#a50026","#d73027","#f46d43","#fdae61","#fee090","#ffffbf","#e0f3f8","#abd9e9","#74add1","#4575b4","#313695"],Spectral:["#9e0142","#d53e4f","#f46d43","#fdae61","#fee08b","#ffffbf","#e6f598","#abdda4","#66c2a5","#3288bd","#5e4fa2"],RdYlGn:["#a50026","#d73027","#f46d43","#fdae61","#fee08b","#ffffbf","#d9ef8b","#a6d96a","#66bd63","#1a9850","#006837"]}},{}],"/Users/gpriday/Downloads/trianglify-master 2/lib/pattern.js":[function(e,r,n){(function(n){function t(r,t){function a(){var e=f.createElementNS("http://www.w3.org/2000/svg","svg");return e.setAttribute("width",t.width),e.setAttribute("height",t.height),r.forEach(function(r){var n=f.createElementNS("http://www.w3.org/2000/svg","path");n.setAttribute("d","M"+r[1].join("L")+"Z"),n.setAttribute("fill",r[0]),n.setAttribute("stroke",r[0]),n.setAttribute("stroke-width",t.stroke_width),e.appendChild(n)}),e}function o(a){if("undefined"!=typeof n)try{e("canvas")}catch(o){throw Error("The optional node-canvas dependency is needed for Trianglify to render using canvas in node.")}return a||(a=f.createElement("canvas")),a.setAttribute("width",t.width),a.setAttribute("height",t.height),ctx=a.getContext("2d"),ctx.canvas.width=t.width,ctx.canvas.height=t.height,r.forEach(function(e){ctx.fillStyle=ctx.strokeStyle=e[0],ctx.lineWidth=t.stroke_width,ctx.beginPath(),ctx.moveTo.apply(ctx,e[1][0]),ctx.lineTo.apply(ctx,e[1][1]),ctx.lineTo.apply(ctx,e[1][2]),ctx.fill(),ctx.stroke()}),a}function i(){return o().toDataURL("image/png")}return{polys:r,opts:t,svg:a,canvas:o,png:i}}var f="undefined"!=typeof document?document:e("jsdom").jsdom("<html/>");r.exports=t}).call(this,e("_process"))},{_process:"/Users/gpriday/Downloads/trianglify-master 2/node_modules/browserify/node_modules/process/browser.js",canvas:"/Users/gpriday/Downloads/trianglify-master 2/node_modules/browserify/node_modules/browser-resolve/empty.js",jsdom:"/Users/gpriday/Downloads/trianglify-master 2/node_modules/browserify/node_modules/browser-resolve/empty.js"}],"/Users/gpriday/Downloads/trianglify-master 2/node_modules/browserify/node_modules/browser-resolve/empty.js":[function(e,r,n){},{}],"/Users/gpriday/Downloads/trianglify-master 2/node_modules/browserify/node_modules/process/browser.js":[function(e,r,n){function t(){if(!i){i=!0;for(var e,r=o.length;r;){e=o,o=[];for(var n=-1;++n<r;)e[n]();r=o.length}i=!1}}function f(){}var a=r.exports={},o=[],i=!1;a.nextTick=function(e){o.push(e),i||setTimeout(t,0)},a.title="browser",a.browser=!0,a.env={},a.argv=[],a.version="",a.versions={},a.on=f,a.addListener=f,a.once=f,a.off=f,a.removeListener=f,a.removeAllListeners=f,a.emit=f,a.binding=function(e){throw new Error("process.binding is not supported")},a.cwd=function(){return"/"},a.chdir=function(e){throw new Error("process.chdir is not supported")},a.umask=function(){return 0}},{}],"/Users/gpriday/Downloads/trianglify-master 2/node_modules/chroma-js/chroma.js":[function(r,n,t){(function(){var r,f,a,o,i,s,c,u,d,l,b,h,g,p,m,y,w,v,x,_,k,j,M,N,D,U,A,P,z,G,E,B,I,q,R,S,O,C,T;l=function(e,n,t,f){return new r(e,n,t,f)},"undefined"!=typeof n&&null!==n&&null!=n.exports&&(n.exports=l),"function"==typeof e&&e.amd?e([],function(){return l}):(q="undefined"!=typeof t&&null!==t?t:this,q.chroma=l),l.color=function(e,n,t,f){return new r(e,n,t,f)},l.hsl=function(e,n,t,f){return new r(e,n,t,f,"hsl")},l.hsv=function(e,n,t,f){return new r(e,n,t,f,"hsv")},l.rgb=function(e,n,t,f){return new r(e,n,t,f,"rgb")},l.hex=function(e){return new r(e)},l.css=function(e){return new r(e)},l.lab=function(e,n,t){return new r(e,n,t,"lab")},l.lch=function(e,n,t){return new r(e,n,t,"lch")},l.hsi=function(e,n,t){return new r(e,n,t,"hsi")},l.gl=function(e,n,t,f){return new r(255*e,255*n,255*t,f,"gl")},l.interpolate=function(e,n,t,f){return null==e||null==n?"#000":("string"===R(e)&&(e=new r(e)),"string"===R(n)&&(n=new r(n)),e.interpolate(t,n,f))},l.mix=l.interpolate,l.contrast=function(e,n){var t,f;return"string"===R(e)&&(e=new r(e)),"string"===R(n)&&(n=new r(n)),t=e.luminance(),f=n.luminance(),t>f?(t+.05)/(f+.05):(f+.05)/(t+.05)},l.luminance=function(e){return l(e).luminance()},l._Color=r,r=function(){function e(){var e,r,n,t,f,a,o,i,s,c,u,d,l,h,g,p;for(f=this,n=[],c=0,u=arguments.length;u>c;c++)r=arguments[c],null!=r&&n.push(r);if(0===n.length)d=[255,0,255,1,"rgb"],o=d[0],i=d[1],s=d[2],e=d[3],t=d[4];else if("array"===R(n[0])){if(3===n[0].length)l=n[0],o=l[0],i=l[1],s=l[2],e=1;else{if(4!==n[0].length)throw"unknown input argument";h=n[0],o=h[0],i=h[1],s=h[2],e=h[3]}t=null!=(g=n[1])?g:"rgb"}else"string"===R(n[0])?(o=n[0],t="hex"):"object"===R(n[0])?(p=n[0]._rgb,o=p[0],i=p[1],s=p[2],e=p[3],t="rgb"):n.length>=3&&(o=n[0],i=n[1],s=n[2]);3===n.length?(t="rgb",e=1):4===n.length?"string"===R(n[3])?(t=n[3],e=1):"number"===R(n[3])&&(t="rgb",e=n[3]):5===n.length&&(e=n[3],t=n[4]),null==e&&(e=1),"rgb"===t?f._rgb=[o,i,s,e]:"gl"===t?f._rgb=[255*o,255*i,255*s,e]:"hsl"===t?(f._rgb=w(o,i,s),f._rgb[3]=e):"hsv"===t?(f._rgb=v(o,i,s),f._rgb[3]=e):"hex"===t?f._rgb=m(o):"lab"===t?(f._rgb=_(o,i,s),f._rgb[3]=e):"lch"===t?(f._rgb=M(o,i,s),f._rgb[3]=e):"hsi"===t&&(f._rgb=y(o,i,s),f._rgb[3]=e),a=b(f._rgb)}return e.prototype.rgb=function(){return this._rgb.slice(0,3)},e.prototype.rgba=function(){return this._rgb},e.prototype.hex=function(){return A(this._rgb)},e.prototype.toString=function(){return this.name()},e.prototype.hsl=function(){return z(this._rgb)},e.prototype.hsv=function(){return G(this._rgb)},e.prototype.lab=function(){return E(this._rgb)},e.prototype.lch=function(){return B(this._rgb)},e.prototype.hsi=function(){return P(this._rgb)},e.prototype.gl=function(){return[this._rgb[0]/255,this._rgb[1]/255,this._rgb[2]/255,this._rgb[3]]},e.prototype.luminance=function(r,n){var t,f,a,o;return null==n&&(n="rgb"),arguments.length?(0===r&&(this._rgb=[0,0,0,this._rgb[3]]),1===r&&(this._rgb=[255,255,255,this._rgb[3]]),t=D(this._rgb),f=1e-7,a=20,o=function(e,t){var i,s;return s=e.interpolate(.5,t,n),i=s.luminance(),Math.abs(r-i)<f||!a--?s:i>r?o(e,s):o(s,t)},this._rgb=(t>r?o(new e("black"),this):o(this,new e("white"))).rgba(),this):D(this._rgb)},e.prototype.name=function(){var e,r;e=this.hex();for(r in l.colors)if(e===l.colors[r])return r;return e},e.prototype.alpha=function(e){return arguments.length?(this._rgb[3]=e,this):this._rgb[3]},e.prototype.css=function(e){var r,n,t,f;return null==e&&(e="rgb"),n=this,t=n._rgb,3===e.length&&t[3]<1&&(e+="a"),"rgb"===e?e+"("+t.slice(0,3).map(Math.round).join(",")+")":"rgba"===e?e+"("+t.slice(0,3).map(Math.round).join(",")+","+t[3]+")":"hsl"===e||"hsla"===e?(r=n.hsl(),f=function(e){return Math.round(100*e)/100},r[0]=f(r[0]),r[1]=f(100*r[1])+"%",r[2]=f(100*r[2])+"%",4===e.length&&(r[3]=t[3]),e+"("+r.join(",")+")"):void 0},e.prototype.interpolate=function(r,n,t){var f,a,o,i,s,c,u,d,l,b,h,g,p,m;if(d=this,null==t&&(t="rgb"),"string"===R(n)&&(n=new e(n)),"hsl"===t||"hsv"===t||"lch"===t||"hsi"===t)"hsl"===t?(p=d.hsl(),m=n.hsl()):"hsv"===t?(p=d.hsv(),m=n.hsv()):"hsi"===t?(p=d.hsi(),m=n.hsi()):"lch"===t&&(p=d.lch(),m=n.lch()),"h"===t.substr(0,1)?(o=p[0],h=p[1],c=p[2],i=m[0],g=m[1],u=m[2]):(c=p[0],h=p[1],o=p[2],u=m[0],g=m[1],i=m[2]),isNaN(o)||isNaN(i)?isNaN(o)?isNaN(i)?a=Number.NaN:(a=i,1!==c&&0!==c||"hsv"===t||(b=g)):(a=o,1!==u&&0!==u||"hsv"===t||(b=h)):(f=i>o&&i-o>180?i-(o+360):o>i&&o-i>180?i+360-o:i-o,a=o+r*f),null==b&&(b=h+r*(g-h)),s=c+r*(u-c),l="h"===t.substr(0,1)?new e(a,b,s,t):new e(s,b,a,t);else if("rgb"===t)p=d._rgb,m=n._rgb,l=new e(p[0]+r*(m[0]-p[0]),p[1]+r*(m[1]-p[1]),p[2]+r*(m[2]-p[2]),t);else{if("lab"!==t)throw"color mode "+t+" is not supported";p=d.lab(),m=n.lab(),l=new e(p[0]+r*(m[0]-p[0]),p[1]+r*(m[1]-p[1]),p[2]+r*(m[2]-p[2]),t)}return l.alpha(d.alpha()+r*(n.alpha()-d.alpha())),l},e.prototype.premultiply=function(){var e,r;return r=this.rgb(),e=this.alpha(),l(r[0]*e,r[1]*e,r[2]*e,e)},e.prototype.darken=function(e){var r,n;return null==e&&(e=20),n=this,r=n.lch(),r[0]-=e,l.lch(r).alpha(n.alpha())},e.prototype.darker=function(e){return this.darken(e)},e.prototype.brighten=function(e){return null==e&&(e=20),this.darken(-e)},e.prototype.brighter=function(e){return this.brighten(e)},e.prototype.saturate=function(e){var r,n;return null==e&&(e=20),n=this,r=n.lch(),r[1]+=e,l.lch(r).alpha(n.alpha())},e.prototype.desaturate=function(e){return null==e&&(e=20),this.saturate(-e)},e}(),b=function(e){var r;for(r in e)3>r?(e[r]<0&&(e[r]=0),e[r]>255&&(e[r]=255)):3===r&&(e[r]<0&&(e[r]=0),e[r]>1&&(e[r]=1));return e},p=function(e){var r,n,t,f,a,o,i,s;if(e=e.toLowerCase(),null!=l.colors&&l.colors[e])return m(l.colors[e]);if(t=e.match(/rgb\(\s*(\-?\d+),\s*(\-?\d+)\s*,\s*(\-?\d+)\s*\)/)){for(f=t.slice(1,4),n=a=0;2>=a;n=++a)f[n]=+f[n];f[3]=1}else if(t=e.match(/rgba\(\s*(\-?\d+),\s*(\-?\d+)\s*,\s*(\-?\d+)\s*,\s*([01]|[01]?\.\d+)\)/))for(f=t.slice(1,5),n=o=0;3>=o;n=++o)f[n]=+f[n];else if(t=e.match(/rgb\(\s*(\-?\d+(?:\.\d+)?)%,\s*(\-?\d+(?:\.\d+)?)%\s*,\s*(\-?\d+(?:\.\d+)?)%\s*\)/)){for(f=t.slice(1,4),n=i=0;2>=i;n=++i)f[n]=Math.round(2.55*f[n]);f[3]=1}else if(t=e.match(/rgba\(\s*(\-?\d+(?:\.\d+)?)%,\s*(\-?\d+(?:\.\d+)?)%\s*,\s*(\-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)/)){for(f=t.slice(1,5),n=s=0;2>=s;n=++s)f[n]=Math.round(2.55*f[n]);f[3]=+f[3]}else(t=e.match(/hsl\(\s*(\-?\d+(?:\.\d+)?),\s*(\-?\d+(?:\.\d+)?)%\s*,\s*(\-?\d+(?:\.\d+)?)%\s*\)/))?(r=t.slice(1,4),r[1]*=.01,r[2]*=.01,f=w(r),f[3]=1):(t=e.match(/hsla\(\s*(\-?\d+(?:\.\d+)?),\s*(\-?\d+(?:\.\d+)?)%\s*,\s*(\-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)/))&&(r=t.slice(1,4),r[1]*=.01,r[2]*=.01,f=w(r),f[3]=+t[4]);return f},m=function(e){var r,n,t,f,a,o;if(e.match(/^#?([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/))return(4===e.length||7===e.length)&&(e=e.substr(1)),3===e.length&&(e=e.split(""),e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]),o=parseInt(e,16),f=o>>16,t=o>>8&255,n=255&o,[f,t,n,1];if(e.match(/^#?([A-Fa-f0-9]{8})$/))return 9===e.length&&(e=e.substr(1)),o=parseInt(e,16),f=o>>24&255,t=o>>16&255,n=o>>8&255,r=255&o,[f,t,n,r];if(a=p(e))return a;throw"unknown color: "+e},y=function(e,r,n){var t,f,i,s;return s=S(arguments),e=s[0],r=s[1],n=s[2],e/=360,1/3>e?(t=(1-r)/3,i=(1+r*g(o*e)/g(a-o*e))/3,f=1-(t+i)):2/3>e?(e-=1/3,i=(1-r)/3,f=(1+r*g(o*e)/g(a-o*e))/3,t=1-(i+f)):(e-=2/3,f=(1-r)/3,t=(1+r*g(o*e)/g(a-o*e))/3,i=1-(f+t)),i=N(n*i*3),f=N(n*f*3),t=N(n*t*3),[255*i,255*f,255*t]},w=function(){var e,r,n,t,f,a,o,i,s,c,u,d,l,b;if(l=S(arguments),t=l[0],i=l[1],a=l[2],0===i)o=n=e=255*a;else{for(u=[0,0,0],r=[0,0,0],c=.5>a?a*(1+i):a+i-a*i,s=2*a-c,t/=360,u[0]=t+1/3,u[1]=t,u[2]=t-1/3,f=d=0;2>=d;f=++d)u[f]<0&&(u[f]+=1),u[f]>1&&(u[f]-=1),6*u[f]<1?r[f]=s+6*(c-s)*u[f]:2*u[f]<1?r[f]=c:3*u[f]<2?r[f]=s+(c-s)*(2/3-u[f])*6:r[f]=s;b=[Math.round(255*r[0]),Math.round(255*r[1]),Math.round(255*r[2])],o=b[0],n=b[1],e=b[2]}return[o,n,e]},v=function(){var e,r,n,t,f,a,o,i,s,c,u,d,l,b,h,g,p,m;if(d=S(arguments),t=d[0],s=d[1],u=d[2],u*=255,0===s)i=n=e=u;else switch(360===t&&(t=0),t>360&&(t-=360),0>t&&(t+=360),t/=60,f=Math.floor(t),r=t-f,a=u*(1-s),o=u*(1-s*r),c=u*(1-s*(1-r)),f){case 0:l=[u,c,a],i=l[0],n=l[1],e=l[2];break;case 1:b=[o,u,a],i=b[0],n=b[1],e=b[2];break;case 2:h=[a,u,c],i=h[0],n=h[1],e=h[2];break;case 3:g=[a,o,u],i=g[0],n=g[1],e=g[2];break;case 4:p=[c,a,u],i=p[0],n=p[1],e=p[2];break;case 5:m=[u,a,o],i=m[0],n=m[1],e=m[2]}return i=Math.round(i),n=Math.round(n),e=Math.round(e),[i,n,e]},f=18,i=.95047,s=1,c=1.08883,x=function(){var e,r,n,t,f,a;return a=S(arguments),f=a[0],e=a[1],r=a[2],n=Math.sqrt(e*e+r*r),t=Math.atan2(r,e)/Math.PI*180,[f,n,t]},_=function(e,r,n){var t,f,a,o,u,d,l;return void 0!==e&&3===e.length&&(d=e,e=d[0],r=d[1],n=d[2]),void 0!==e&&3===e.length&&(l=e,e=l[0],r=l[1],n=l[2]),o=(e+16)/116,a=o+r/500,u=o-n/200,a=k(a)*i,o=k(o)*s,u=k(u)*c,f=C(3.2404542*a-1.5371385*o-.4985314*u),t=C(-.969266*a+1.8760108*o+.041556*u),n=C(.0556434*a-.2040259*o+1.0572252*u),[N(f,0,255),N(t,0,255),N(n,0,255),1]},k=function(e){return e>.206893034?e*e*e:(e-4/29)/7.787037},C=function(e){return Math.round(255*(.00304>=e?12.92*e:1.055*Math.pow(e,1/2.4)-.055))},j=function(){var e,r,n,t;return t=S(arguments),n=t[0],e=t[1],r=t[2],r=r*Math.PI/180,[n,Math.cos(r)*e,Math.sin(r)*e]},M=function(e,r,n){var t,f,a,o,i,s,c;return s=j(e,r,n),t=s[0],f=s[1],a=s[2],c=_(t,f,a),i=c[0],o=c[1],a=c[2],[N(i,0,255),N(o,0,255),N(a,0,255)]},D=function(e,r,n){var t;return t=S(arguments),e=t[0],r=t[1],n=t[2],e=U(e),r=U(r),n=U(n),.2126*e+.7152*r+.0722*n},U=function(e){return e/=255,.03928>=e?e/12.92:Math.pow((e+.055)/1.055,2.4)},A=function(){var e,r,n,t,f,a;return a=S(arguments),n=a[0],r=a[1],e=a[2],f=n<<16|r<<8|e,t="000000"+f.toString(16),"#"+t.substr(t.length-6)},P=function(){var e,r,n,t,f,a,o,i,s;return s=S(arguments),o=s[0],n=s[1],r=s[2],e=2*Math.PI,o/=255,n/=255,r/=255,a=Math.min(o,n,r),f=(o+n+r)/3,i=1-a/f,0===i?t=0:(t=(o-n+(o-r))/2,t/=Math.sqrt((o-n)*(o-n)+(o-r)*(n-r)),t=Math.acos(t),r>n&&(t=e-t),t/=e),[360*t,i,f]},z=function(e,r,n){var t,f,a,o,i,s;return void 0!==e&&e.length>=3&&(s=e,e=s[0],r=s[1],n=s[2]),e/=255,r/=255,n/=255,o=Math.min(e,r,n),a=Math.max(e,r,n),f=(a+o)/2,a===o?(i=0,t=Number.NaN):i=.5>f?(a-o)/(a+o):(a-o)/(2-a-o),e===a?t=(r-n)/(a-o):r===a?t=2+(n-e)/(a-o):n===a&&(t=4+(e-r)/(a-o)),t*=60,0>t&&(t+=360),[t,i,f]},G=function(){var e,r,n,t,f,a,o,i,s,c;return c=S(arguments),o=c[0],n=c[1],e=c[2],a=Math.min(o,n,e),f=Math.max(o,n,e),r=f-a,s=f/255,0===f?(t=Number.NaN,i=0):(i=r/f,o===f&&(t=(n-e)/r),n===f&&(t=2+(e-o)/r),e===f&&(t=4+(o-n)/r),t*=60,0>t&&(t+=360)),[t,i,s]},E=function(){var e,r,n,t,f,a,o;return o=S(arguments),n=o[0],r=o[1],e=o[2],n=I(n),r=I(r),e=I(e),t=O((.4124564*n+.3575761*r+.1804375*e)/i),f=O((.2126729*n+.7151522*r+.072175*e)/s),a=O((.0193339*n+.119192*r+.9503041*e)/c),[116*f-16,500*(t-f),200*(f-a)]},I=function(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)},O=function(e){return e>.008856?Math.pow(e,1/3):7.787037*e+4/29},B=function(){var e,r,n,t,f,a,o;return a=S(arguments),f=a[0],n=a[1],r=a[2],o=E(f,n,r),t=o[0],e=o[1],r=o[2],x(t,e,r)},l.scale=function(e,r){var n,t,f,a,o,i,s,c,u,d,b,h,g,p,m,y,w,v,x,_,k;return y="rgb",w=l("#ccc"),k=0,g=!1,h=[0,1],d=[],x=!1,_=[],m=0,p=1,b=!1,v=0,u={},i=function(e,r){var n,t,f,a,i,s,c;if(null==e&&(e=["#ddd","#222"]),null!=e&&"string"===R(e)&&null!=(null!=(i=l.brewer)?i[e]:void 0)&&(e=l.brewer[e]),"array"===R(e)){for(e=e.slice(0),n=f=0,s=e.length-1;s>=0?s>=f:f>=s;n=s>=0?++f:--f)t=e[n],"string"===R(t)&&(e[n]=l(t));if(null!=r)_=r;else for(_=[],n=a=0,c=e.length-1;c>=0?c>=a:a>=c;n=c>=0?++a:--a)_.push(n/(e.length-1))}return o(),d=e},s=function(e){return null==e&&(e=[]),h=e,m=e[0],p=e[e.length-1],o(),v=2===e.length?0:e.length-1},f=function(e){var r,n;if(null!=h){for(n=h.length-1,r=0;n>r&&e>=h[r];)r++;return r-1}return 0},c=function(e){return e},n=function(e){var r,n,t,a,o;return o=e,h.length>2&&(a=h.length-1,r=f(e),t=h[0]+(h[1]-h[0])*(0+.5*k),n=h[a-1]+(h[a]-h[a-1])*(1-.5*k),o=m+(h[r]+.5*(h[r+1]-h[r])-t)/(n-t)*(p-m)),o},a=function(e,r){var n,t,a,o,i,s,b,g,x;if(null==r&&(r=!1),isNaN(e))return w;if(r?b=e:h.length>2?(n=f(e),b=n/(v-1)):(b=a=m!==p?(e-m)/(p-m):0,b=a=(e-m)/(p-m),b=Math.min(1,Math.max(0,b))),r||(b=c(b)),i=Math.floor(1e4*b),u[i])t=u[i];else{if("array"===R(d))for(o=g=0,x=_.length-1;x>=0?x>=g:g>=x;o=x>=0?++g:--g){if(s=_[o],s>=b){t=d[o];break}if(b>=s&&o===_.length-1){t=d[o];break}if(b>s&&b<_[o+1]){b=(b-s)/(_[o+1]-s),t=l.interpolate(d[o],d[o+1],b,y);break}}else"function"===R(d)&&(t=d(b));u[i]=t}return t},o=function(){return u={}},i(e,r),t=function(e){var r;return r=a(e),x&&r[x]?r[x]():r},t.domain=function(e,r,n,f){var a;return null==n&&(n="e"),arguments.length?(null!=r&&(a=l.analyze(e,f),e=0===r?[a.min,a.max]:l.limits(a,n,r)),s(e),t):h},t.mode=function(e){return arguments.length?(y=e,o(),t):y},t.range=function(e,r){return i(e,r),t},t.out=function(e){return x=e,t},t.spread=function(e){return arguments.length?(k=e,t):k},t.correctLightness=function(e){return arguments.length?(b=e,o(),c=b?function(e){var r,n,t,f,o,i,s,c,u;for(r=a(0,!0).lab()[0],n=a(1,!0).lab()[0],s=r>n,t=a(e,!0).lab()[0],o=r+(n-r)*e,f=t-o,c=0,u=1,i=20;Math.abs(f)>.01&&i-->0;)!function(){return s&&(f*=-1),0>f?(c=e,e+=.5*(u-e)):(u=e,e+=.5*(c-e)),t=a(e,!0).lab()[0],f=t-o}();return e}:function(e){return e},t):b},t.colors=function(r){var n,f,a,o,i,s;if(null==r&&(r="hex"),e=[],f=[],h.length>2)for(n=a=1,s=h.length;s>=1?s>a:a>s;n=s>=1?++a:--a)f.push(.5*(h[n-1]+h[n]));else f=h;for(o=0,i=f.length;i>o;o++)n=f[o],e.push(t(n)[r]());return e},t},null==(T=l.scales)&&(l.scales={}),l.scales.cool=function(){return l.scale([l.hsl(180,1,.9),l.hsl(250,.7,.4)])},l.scales.hot=function(){return l.scale(["#000","#f00","#ff0","#fff"],[0,.25,.75,1]).mode("rgb")},l.analyze=function(e,r,n){var t,f,a,o,i,s,c;if(a={min:Number.MAX_VALUE,max:-1*Number.MAX_VALUE,sum:0,values:[],count:0},null==n&&(n=function(){return!0}),t=function(e){null==e||isNaN(e)||(a.values.push(e),a.sum+=e,e<a.min&&(a.min=e),e>a.max&&(a.max=e),a.count+=1)},i=function(e,f){return n(e,f)?t(null!=r&&"function"===R(r)?r(e):null!=r&&"string"===R(r)||"number"===R(r)?e[r]:e):void 0},"array"===R(e))for(s=0,c=e.length;c>s;s++)o=e[s],i(o);else for(f in e)o=e[f],i(o,f);return a.domain=[a.min,a.max],a.limits=function(e,r){return l.limits(a,e,r)},a},l.limits=function(e,r,n){var t,f,a,o,i,s,c,u,d,b,h,g,p,m,y,w,v,x,_,k,j,M,N,D,U,A,P,z,G,E,B,I,q,S,O,C,T,Y,L,F,V,X,W,$,Z,H,J,K,Q,ee,re,ne,te,fe,ae,oe;if(null==r&&(r="equal"),null==n&&(n=7),"array"===R(e)&&(e=l.analyze(e)),p=e.min,h=e.max,N=e.sum,A=e.values.sort(function(e,r){return e-r}),b=[],"c"===r.substr(0,1)&&(b.push(p),b.push(h)),"e"===r.substr(0,1)){for(b.push(p),c=P=1,T=n-1;T>=1?T>=P:P>=T;c=T>=1?++P:--P)b.push(p+c/n*(h-p));b.push(h)}else if("l"===r.substr(0,1)){if(0>=p)throw"Logarithmic scales are only possible for values > 0";for(m=Math.LOG10E*Math.log(p),g=Math.LOG10E*Math.log(h),b.push(p),c=z=1,$=n-1;$>=1?$>=z:z>=$;c=$>=1?++z:--z)b.push(Math.pow(10,m+c/n*(g-m)));b.push(h)}else if("q"===r.substr(0,1)){for(b.push(p),c=G=1,Z=n-1;Z>=1?Z>=G:G>=Z;c=Z>=1?++G:--G)_=A.length*c/n,k=Math.floor(_),k===_?b.push(A[k]):(j=_-k,b.push(A[k]*j+A[k+1]*(1-j)));b.push(h)}else if("k"===r.substr(0,1)){for(w=A.length,t=new Array(w),i=new Array(n),M=!0,v=0,a=null,a=[],a.push(p),c=E=1,H=n-1;H>=1?H>=E:E>=H;c=H>=1?++E:--E)a.push(p+c/n*(h-p));for(a.push(h);M;){for(u=B=0,J=n-1;J>=0?J>=B:B>=J;u=J>=0?++B:--B)i[u]=0;for(c=I=0,K=w-1;K>=0?K>=I:I>=K;c=K>=0?++I:--I){for(U=A[c],y=Number.MAX_VALUE,u=q=0,Q=n-1;Q>=0?Q>=q:q>=Q;u=Q>=0?++q:--q)s=Math.abs(a[u]-U),y>s&&(y=s,f=u);i[f]++,t[c]=f}for(x=new Array(n),u=S=0,ee=n-1;ee>=0?ee>=S:S>=ee;u=ee>=0?++S:--S)x[u]=null;for(c=O=0,re=w-1;re>=0?re>=O:O>=re;c=re>=0?++O:--O)o=t[c],null===x[o]?x[o]=A[c]:x[o]+=A[c];for(u=C=0,Y=n-1;Y>=0?Y>=C:C>=Y;u=Y>=0?++C:--C)x[u]*=1/i[u];for(M=!1,u=ne=0,L=n-1;L>=0?L>=ne:ne>=L;u=L>=0?++ne:--ne)if(x[u]!==a[c]){M=!0;break}a=x,v++,v>200&&(M=!1)}for(d={},u=te=0,F=n-1;F>=0?F>=te:te>=F;u=F>=0?++te:--te)d[u]=[];for(c=fe=0,V=w-1;V>=0?V>=fe:fe>=V;c=V>=0?++fe:--fe)o=t[c],d[o].push(A[c]);for(D=[],u=ae=0,X=n-1;X>=0?X>=ae:ae>=X;u=X>=0?++ae:--ae)D.push(d[u][0]),D.push(d[u][d[u].length-1]);for(D=D.sort(function(e,r){return e-r}),b.push(D[0]),c=oe=1,W=D.length-1;W>=oe;c=oe+=2)isNaN(D[c])||b.push(D[c])}return b},l.brewer=d={OrRd:["#fff7ec","#fee8c8","#fdd49e","#fdbb84","#fc8d59","#ef6548","#d7301f","#b30000","#7f0000"],PuBu:["#fff7fb","#ece7f2","#d0d1e6","#a6bddb","#74a9cf","#3690c0","#0570b0","#045a8d","#023858"],BuPu:["#f7fcfd","#e0ecf4","#bfd3e6","#9ebcda","#8c96c6","#8c6bb1","#88419d","#810f7c","#4d004b"],Oranges:["#fff5eb","#fee6ce","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#a63603","#7f2704"],BuGn:["#f7fcfd","#e5f5f9","#ccece6","#99d8c9","#66c2a4","#41ae76","#238b45","#006d2c","#00441b"],YlOrBr:["#ffffe5","#fff7bc","#fee391","#fec44f","#fe9929","#ec7014","#cc4c02","#993404","#662506"],YlGn:["#ffffe5","#f7fcb9","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#006837","#004529"],Reds:["#fff5f0","#fee0d2","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#a50f15","#67000d"],RdPu:["#fff7f3","#fde0dd","#fcc5c0","#fa9fb5","#f768a1","#dd3497","#ae017e","#7a0177","#49006a"],Greens:["#f7fcf5","#e5f5e0","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#006d2c","#00441b"],YlGnBu:["#ffffd9","#edf8b1","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#253494","#081d58"],Purples:["#fcfbfd","#efedf5","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#54278f","#3f007d"],GnBu:["#f7fcf0","#e0f3db","#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#0868ac","#084081"],Greys:["#ffffff","#f0f0f0","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525","#000000"],YlOrRd:["#ffffcc","#ffeda0","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#bd0026","#800026"],PuRd:["#f7f4f9","#e7e1ef","#d4b9da","#c994c7","#df65b0","#e7298a","#ce1256","#980043","#67001f"],Blues:["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#08519c","#08306b"],PuBuGn:["#fff7fb","#ece2f0","#d0d1e6","#a6bddb","#67a9cf","#3690c0","#02818a","#016c59","#014636"],Spectral:["#9e0142","#d53e4f","#f46d43","#fdae61","#fee08b","#ffffbf","#e6f598","#abdda4","#66c2a5","#3288bd","#5e4fa2"],RdYlGn:["#a50026","#d73027","#f46d43","#fdae61","#fee08b","#ffffbf","#d9ef8b","#a6d96a","#66bd63","#1a9850","#006837"],RdBu:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#f7f7f7","#d1e5f0","#92c5de","#4393c3","#2166ac","#053061"],PiYG:["#8e0152","#c51b7d","#de77ae","#f1b6da","#fde0ef","#f7f7f7","#e6f5d0","#b8e186","#7fbc41","#4d9221","#276419"],PRGn:["#40004b","#762a83","#9970ab","#c2a5cf","#e7d4e8","#f7f7f7","#d9f0d3","#a6dba0","#5aae61","#1b7837","#00441b"],RdYlBu:["#a50026","#d73027","#f46d43","#fdae61","#fee090","#ffffbf","#e0f3f8","#abd9e9","#74add1","#4575b4","#313695"],BrBG:["#543005","#8c510a","#bf812d","#dfc27d","#f6e8c3","#f5f5f5","#c7eae5","#80cdc1","#35978f","#01665e","#003c30"],RdGy:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#ffffff","#e0e0e0","#bababa","#878787","#4d4d4d","#1a1a1a"],PuOr:["#7f3b08","#b35806","#e08214","#fdb863","#fee0b6","#f7f7f7","#d8daeb","#b2abd2","#8073ac","#542788","#2d004b"],Set2:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854","#ffd92f","#e5c494","#b3b3b3"],Accent:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0","#f0027f","#bf5b17","#666666"],Set1:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33","#a65628","#f781bf","#999999"],Set3:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd","#ccebc5","#ffed6f"],Dark2:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e","#e6ab02","#a6761d","#666666"],Paired:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6","#6a3d9a","#ffff99","#b15928"],Pastel2:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9","#fff2ae","#f1e2cc","#cccccc"],Pastel1:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc","#e5d8bd","#fddaec","#f2f2f2"]},l.colors=h={indigo:"#4b0082",gold:"#ffd700",hotpink:"#ff69b4",firebrick:"#b22222",indianred:"#cd5c5c",yellow:"#ffff00",mistyrose:"#ffe4e1",darkolivegreen:"#556b2f",olive:"#808000",darkseagreen:"#8fbc8f",pink:"#ffc0cb",tomato:"#ff6347",lightcoral:"#f08080",orangered:"#ff4500",navajowhite:"#ffdead",lime:"#00ff00",palegreen:"#98fb98",darkslategrey:"#2f4f4f",greenyellow:"#adff2f",burlywood:"#deb887",seashell:"#fff5ee",mediumspringgreen:"#00fa9a",fuchsia:"#ff00ff",papayawhip:"#ffefd5",blanchedalmond:"#ffebcd",chartreuse:"#7fff00",dimgray:"#696969",black:"#000000",peachpuff:"#ffdab9",springgreen:"#00ff7f",aquamarine:"#7fffd4",white:"#ffffff",orange:"#ffa500",lightsalmon:"#ffa07a",darkslategray:"#2f4f4f",brown:"#a52a2a",ivory:"#fffff0",dodgerblue:"#1e90ff",peru:"#cd853f",lawngreen:"#7cfc00",chocolate:"#d2691e",crimson:"#dc143c",forestgreen:"#228b22",darkgrey:"#a9a9a9",lightseagreen:"#20b2aa",cyan:"#00ffff",mintcream:"#f5fffa",silver:"#c0c0c0",antiquewhite:"#faebd7",mediumorchid:"#ba55d3",skyblue:"#87ceeb",gray:"#808080",darkturquoise:"#00ced1",goldenrod:"#daa520",darkgreen:"#006400",floralwhite:"#fffaf0",darkviolet:"#9400d3",darkgray:"#a9a9a9",moccasin:"#ffe4b5",saddlebrown:"#8b4513",grey:"#808080",darkslateblue:"#483d8b",lightskyblue:"#87cefa",lightpink:"#ffb6c1",mediumvioletred:"#c71585",slategrey:"#708090",red:"#ff0000",deeppink:"#ff1493",limegreen:"#32cd32",darkmagenta:"#8b008b",palegoldenrod:"#eee8aa",plum:"#dda0dd",turquoise:"#40e0d0",lightgrey:"#d3d3d3",lightgoldenrodyellow:"#fafad2",darkgoldenrod:"#b8860b",lavender:"#e6e6fa",maroon:"#800000",yellowgreen:"#9acd32",sandybrown:"#f4a460",thistle:"#d8bfd8",violet:"#ee82ee",navy:"#000080",magenta:"#ff00ff",dimgrey:"#696969",tan:"#d2b48c",rosybrown:"#bc8f8f",olivedrab:"#6b8e23",blue:"#0000ff",lightblue:"#add8e6",ghostwhite:"#f8f8ff",honeydew:"#f0fff0",cornflowerblue:"#6495ed",slateblue:"#6a5acd",linen:"#faf0e6",darkblue:"#00008b",powderblue:"#b0e0e6",seagreen:"#2e8b57",darkkhaki:"#bdb76b",snow:"#fffafa",sienna:"#a0522d",mediumblue:"#0000cd",royalblue:"#4169e1",lightcyan:"#e0ffff",green:"#008000",mediumpurple:"#9370db",midnightblue:"#191970",cornsilk:"#fff8dc",paleturquoise:"#afeeee",bisque:"#ffe4c4",slategray:"#708090",darkcyan:"#008b8b",khaki:"#f0e68c",wheat:"#f5deb3",teal:"#008080",darkorchid:"#9932cc",deepskyblue:"#00bfff",salmon:"#fa8072",darkred:"#8b0000",steelblue:"#4682b4",palevioletred:"#db7093",lightslategray:"#778899",aliceblue:"#f0f8ff",lightslategrey:"#778899",lightgreen:"#90ee90",orchid:"#da70d6",gainsboro:"#dcdcdc",mediumseagreen:"#3cb371",lightgray:"#d3d3d3",mediumturquoise:"#48d1cc",lemonchiffon:"#fffacd",cadetblue:"#5f9ea0",lightyellow:"#ffffe0",lavenderblush:"#fff0f5",coral:"#ff7f50",purple:"#800080",aqua:"#00ffff",whitesmoke:"#f5f5f5",mediumslateblue:"#7b68ee",darkorange:"#ff8c00",mediumaquamarine:"#66cdaa",darksalmon:"#e9967a",beige:"#f5f5dc",blueviolet:"#8a2be2",azure:"#f0ffff",lightsteelblue:"#b0c4de",oldlace:"#fdf5e6"},R=function(){var e,r,n,t,f;for(e={},f="Boolean Number String Function Array Date RegExp Undefined Null".split(" "),n=0,t=f.length;t>n;n++)r=f[n],e["[object "+r+"]"]=r.toLowerCase();return function(r){var n;return n=Object.prototype.toString.call(r),e[n]||"object"}}(),N=function(e,r,n){return null==r&&(r=0),null==n&&(n=1),r>e&&(e=r),e>n&&(e=n),e},S=function(e){return e.length>=3?e:e[0]},o=2*Math.PI,a=Math.PI/3,g=Math.cos,u=function(e){var r,n,t,f,a,o,i,s,c,d,b;return e=function(){var r,n,t;for(t=[],r=0,n=e.length;n>r;r++)f=e[r],t.push(l(f));return t}(),2===e.length?(c=function(){var r,n,t;for(t=[],r=0,
2
+ n=e.length;n>r;r++)f=e[r],t.push(f.lab());return t}(),a=c[0],o=c[1],r=function(e){var r,n;return n=function(){var n,t;for(t=[],r=n=0;2>=n;r=++n)t.push(a[r]+e*(o[r]-a[r]));return t}(),l.lab.apply(l,n)}):3===e.length?(d=function(){var r,n,t;for(t=[],r=0,n=e.length;n>r;r++)f=e[r],t.push(f.lab());return t}(),a=d[0],o=d[1],i=d[2],r=function(e){var r,n;return n=function(){var n,t;for(t=[],r=n=0;2>=n;r=++n)t.push((1-e)*(1-e)*a[r]+2*(1-e)*e*o[r]+e*e*i[r]);return t}(),l.lab.apply(l,n)}):4===e.length?(b=function(){var r,n,t;for(t=[],r=0,n=e.length;n>r;r++)f=e[r],t.push(f.lab());return t}(),a=b[0],o=b[1],i=b[2],s=b[3],r=function(e){var r,n;return n=function(){var n,t;for(t=[],r=n=0;2>=n;r=++n)t.push((1-e)*(1-e)*(1-e)*a[r]+3*(1-e)*(1-e)*e*o[r]+3*(1-e)*e*e*i[r]+e*e*e*s[r]);return t}(),l.lab.apply(l,n)}):5===e.length&&(n=u(e.slice(0,3)),t=u(e.slice(2,5)),r=function(e){return.5>e?n(2*e):t(2*(e-.5))}),r},l.interpolate.bezier=u}).call(this)},{}],"/Users/gpriday/Downloads/trianglify-master 2/node_modules/delaunay-fast/delaunay.js":[function(e,r,n){var t;!function(){"use strict";function e(e){var r,n,t,f,a,o,i=Number.POSITIVE_INFINITY,s=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY,u=Number.NEGATIVE_INFINITY;for(r=e.length;r--;)e[r][0]<i&&(i=e[r][0]),e[r][0]>c&&(c=e[r][0]),e[r][1]<s&&(s=e[r][1]),e[r][1]>u&&(u=e[r][1]);return n=c-i,t=u-s,f=Math.max(n,t),a=i+.5*n,o=s+.5*t,[[a-20*f,o-f],[a,o+20*f],[a+20*f,o-f]]}function n(e,r,n,t){var f,o,i,s,c,u,d,l,b,h,g=e[r][0],p=e[r][1],m=e[n][0],y=e[n][1],w=e[t][0],v=e[t][1],x=Math.abs(p-y),_=Math.abs(y-v);if(a>x&&a>_)throw new Error("Eek! Coincident points!");return a>x?(s=-((w-m)/(v-y)),u=(m+w)/2,l=(y+v)/2,f=(m+g)/2,o=s*(f-u)+l):a>_?(i=-((m-g)/(y-p)),c=(g+m)/2,d=(p+y)/2,f=(w+m)/2,o=i*(f-c)+d):(i=-((m-g)/(y-p)),s=-((w-m)/(v-y)),c=(g+m)/2,u=(m+w)/2,d=(p+y)/2,l=(y+v)/2,f=(i*c-s*u+l-d)/(i-s),o=x>_?i*(f-c)+d:s*(f-u)+l),b=m-f,h=y-o,{i:r,j:n,k:t,x:f,y:o,r:b*b+h*h}}function f(e){var r,n,t,f,a,o;for(n=e.length;n;)for(f=e[--n],t=e[--n],r=n;r;)if(o=e[--r],a=e[--r],t===a&&f===o||t===o&&f===a){e.splice(n,2),e.splice(r,2);break}}var a=1/1048576;t={triangulate:function(r,t){var o,i,s,c,u,d,l,b,h,g,p,m,y=r.length;if(3>y)return[];if(r=r.slice(0),t)for(o=y;o--;)r[o]=r[o][t];for(s=new Array(y),o=y;o--;)s[o]=o;for(s.sort(function(e,n){return r[n][0]-r[e][0]}),c=e(r),r.push(c[0],c[1],c[2]),u=[n(r,y+0,y+1,y+2)],d=[],l=[],o=s.length;o--;l.length=0){for(m=s[o],i=u.length;i--;)b=r[m][0]-u[i].x,b>0&&b*b>u[i].r?(d.push(u[i]),u.splice(i,1)):(h=r[m][1]-u[i].y,b*b+h*h-u[i].r>a||(l.push(u[i].i,u[i].j,u[i].j,u[i].k,u[i].k,u[i].i),u.splice(i,1)));for(f(l),i=l.length;i;)p=l[--i],g=l[--i],u.push(n(r,g,p,m))}for(o=u.length;o--;)d.push(u[o]);for(u.length=0,o=d.length;o--;)d[o].i<y&&d[o].j<y&&d[o].k<y&&u.push(d[o].i,d[o].j,d[o].k);return u},contains:function(e,r){if(r[0]<e[0][0]&&r[0]<e[1][0]&&r[0]<e[2][0]||r[0]>e[0][0]&&r[0]>e[1][0]&&r[0]>e[2][0]||r[1]<e[0][1]&&r[1]<e[1][1]&&r[1]<e[2][1]||r[1]>e[0][1]&&r[1]>e[1][1]&&r[1]>e[2][1])return null;var n=e[1][0]-e[0][0],t=e[2][0]-e[0][0],f=e[1][1]-e[0][1],a=e[2][1]-e[0][1],o=n*a-t*f;if(0===o)return null;var i=(a*(r[0]-e[0][0])-t*(r[1]-e[0][1]))/o,s=(n*(r[1]-e[0][1])-f*(r[0]-e[0][0]))/o;return 0>i||0>s||i+s>1?null:[i,s]}},"undefined"!=typeof r&&(r.exports=t)}()},{}],"/Users/gpriday/Downloads/trianglify-master 2/node_modules/seedrandom/index.js":[function(e,r,n){var t=e("./lib/alea"),f=e("./lib/xor128"),a=e("./lib/xorwow"),o=e("./lib/xorshift7"),i=e("./lib/xor4096"),s=e("./lib/tychei"),c=e("./seedrandom");c.alea=t,c.xor128=f,c.xorwow=a,c.xorshift7=o,c.xor4096=i,c.tychei=s,r.exports=c},{"./lib/alea":"/Users/gpriday/Downloads/trianglify-master 2/node_modules/seedrandom/lib/alea.js","./lib/tychei":"/Users/gpriday/Downloads/trianglify-master 2/node_modules/seedrandom/lib/tychei.js","./lib/xor128":"/Users/gpriday/Downloads/trianglify-master 2/node_modules/seedrandom/lib/xor128.js","./lib/xor4096":"/Users/gpriday/Downloads/trianglify-master 2/node_modules/seedrandom/lib/xor4096.js","./lib/xorshift7":"/Users/gpriday/Downloads/trianglify-master 2/node_modules/seedrandom/lib/xorshift7.js","./lib/xorwow":"/Users/gpriday/Downloads/trianglify-master 2/node_modules/seedrandom/lib/xorwow.js","./seedrandom":"/Users/gpriday/Downloads/trianglify-master 2/node_modules/seedrandom/seedrandom.js"}],"/Users/gpriday/Downloads/trianglify-master 2/node_modules/seedrandom/lib/alea.js":[function(r,n,t){!function(e,r,n){function t(e){var r=this,n=o();r.next=function(){var e=2091639*r.s0+2.3283064365386963e-10*r.c;return r.s0=r.s1,r.s1=r.s2,r.s2=e-(r.c=0|e)},r.c=1,r.s0=n(" "),r.s1=n(" "),r.s2=n(" "),r.s0-=n(e),r.s0<0&&(r.s0+=1),r.s1-=n(e),r.s1<0&&(r.s1+=1),r.s2-=n(e),r.s2<0&&(r.s2+=1),n=null}function f(e,r){return r.c=e.c,r.s0=e.s0,r.s1=e.s1,r.s2=e.s2,r}function a(e,r){var n=new t(e),a=r&&r.state,o=n.next;return o.int32=function(){return 4294967296*n.next()|0},o["double"]=function(){return o()+1.1102230246251565e-16*(2097152*o()|0)},o.quick=o,a&&("object"==typeof a&&f(a,n),o.state=function(){return f(n,{})}),o}function o(){var e=4022871197,r=function(r){r=r.toString();for(var n=0;n<r.length;n++){e+=r.charCodeAt(n);var t=.02519603282416938*e;e=t>>>0,t-=e,t*=e,e=t>>>0,t-=e,e+=4294967296*t}return 2.3283064365386963e-10*(e>>>0)};return r}r&&r.exports?r.exports=a:n&&n.amd?n(function(){return a}):this.alea=a}(this,"object"==typeof n&&n,"function"==typeof e&&e)},{}],"/Users/gpriday/Downloads/trianglify-master 2/node_modules/seedrandom/lib/tychei.js":[function(r,n,t){!function(e,r,n){function t(e){var r=this,n="";r.next=function(){var e=r.b,n=r.c,t=r.d,f=r.a;return e=e<<25^e>>>7^n,n=n-t|0,t=t<<24^t>>>8^f,f=f-e|0,r.b=e=e<<20^e>>>12^n,r.c=n=n-t|0,r.d=t<<16^n>>>16^f,r.a=f-e|0},r.a=0,r.b=0,r.c=-1640531527,r.d=1367130551,e===Math.floor(e)?(r.a=e/4294967296|0,r.b=0|e):n+=e;for(var t=0;t<n.length+20;t++)r.b^=0|n.charCodeAt(t),r.next()}function f(e,r){return r.a=e.a,r.b=e.b,r.c=e.c,r.d=e.d,r}function a(e,r){var n=new t(e),a=r&&r.state,o=function(){return(n.next()>>>0)/4294967296};return o["double"]=function(){do var e=n.next()>>>11,r=(n.next()>>>0)/4294967296,t=(e+r)/(1<<21);while(0===t);return t},o.int32=n.next,o.quick=o,a&&("object"==typeof a&&f(a,n),o.state=function(){return f(n,{})}),o}r&&r.exports?r.exports=a:n&&n.amd?n(function(){return a}):this.tychei=a}(this,"object"==typeof n&&n,"function"==typeof e&&e)},{}],"/Users/gpriday/Downloads/trianglify-master 2/node_modules/seedrandom/lib/xor128.js":[function(r,n,t){!function(e,r,n){function t(e){var r=this,n="";r.x=0,r.y=0,r.z=0,r.w=0,r.next=function(){var e=r.x^r.x<<11;return r.x=r.y,r.y=r.z,r.z=r.w,r.w^=r.w>>>19^e^e>>>8},e===(0|e)?r.x=e:n+=e;for(var t=0;t<n.length+64;t++)r.x^=0|n.charCodeAt(t),r.next()}function f(e,r){return r.x=e.x,r.y=e.y,r.z=e.z,r.w=e.w,r}function a(e,r){var n=new t(e),a=r&&r.state,o=function(){return(n.next()>>>0)/4294967296};return o["double"]=function(){do var e=n.next()>>>11,r=(n.next()>>>0)/4294967296,t=(e+r)/(1<<21);while(0===t);return t},o.int32=n.next,o.quick=o,a&&("object"==typeof a&&f(a,n),o.state=function(){return f(n,{})}),o}r&&r.exports?r.exports=a:n&&n.amd?n(function(){return a}):this.xor128=a}(this,"object"==typeof n&&n,"function"==typeof e&&e)},{}],"/Users/gpriday/Downloads/trianglify-master 2/node_modules/seedrandom/lib/xor4096.js":[function(r,n,t){!function(e,r,n){function t(e){function r(e,r){var n,t,f,a,o,i=[],s=128;for(r===(0|r)?(t=r,r=null):(r+="\x00",t=0,s=Math.max(s,r.length)),f=0,a=-32;s>a;++a)r&&(t^=r.charCodeAt((a+32)%r.length)),0===a&&(o=t),t^=t<<10,t^=t>>>15,t^=t<<4,t^=t>>>13,a>=0&&(o=o+1640531527|0,n=i[127&a]^=t+o,f=0==n?f+1:0);for(f>=128&&(i[127&(r&&r.length||0)]=-1),f=127,a=512;a>0;--a)t=i[f+34&127],n=i[f=f+1&127],t^=t<<13,n^=n<<17,t^=t>>>15,n^=n>>>12,i[f]=t^n;e.w=o,e.X=i,e.i=f}var n=this;n.next=function(){var e,r,t=n.w,f=n.X,a=n.i;return n.w=t=t+1640531527|0,r=f[a+34&127],e=f[a=a+1&127],r^=r<<13,e^=e<<17,r^=r>>>15,e^=e>>>12,r=f[a]=r^e,n.i=a,r+(t^t>>>16)|0},r(n,e)}function f(e,r){return r.i=e.i,r.w=e.w,r.X=e.X.slice(),r}function a(e,r){null==e&&(e=+new Date);var n=new t(e),a=r&&r.state,o=function(){return(n.next()>>>0)/4294967296};return o["double"]=function(){do var e=n.next()>>>11,r=(n.next()>>>0)/4294967296,t=(e+r)/(1<<21);while(0===t);return t},o.int32=n.next,o.quick=o,a&&(a.X&&f(a,n),o.state=function(){return f(n,{})}),o}r&&r.exports?r.exports=a:n&&n.amd?n(function(){return a}):this.xor4096=a}(this,"object"==typeof n&&n,"function"==typeof e&&e)},{}],"/Users/gpriday/Downloads/trianglify-master 2/node_modules/seedrandom/lib/xorshift7.js":[function(r,n,t){!function(e,r,n){function t(e){function r(e,r){var n,t,f=[];if(r===(0|r))t=f[0]=r;else for(r=""+r,n=0;n<r.length;++n)f[7&n]=f[7&n]<<15^r.charCodeAt(n)+f[n+1&7]<<13;for(;f.length<8;)f.push(0);for(n=0;8>n&&0===f[n];++n);for(t=8==n?f[7]=-1:f[n],e.x=f,e.i=0,n=256;n>0;--n)e.next()}var n=this;n.next=function(){var e,r,t=n.x,f=n.i;return e=t[f],e^=e>>>7,r=e^e<<24,e=t[f+1&7],r^=e^e>>>10,e=t[f+3&7],r^=e^e>>>3,e=t[f+4&7],r^=e^e<<7,e=t[f+7&7],e^=e<<13,r^=e^e<<9,t[f]=r,n.i=f+1&7,r},r(n,e)}function f(e,r){return r.x=e.x.slice(),r.i=e.i,r}function a(e,r){null==e&&(e=+new Date);var n=new t(e),a=r&&r.state,o=function(){return(n.next()>>>0)/4294967296};return o["double"]=function(){do var e=n.next()>>>11,r=(n.next()>>>0)/4294967296,t=(e+r)/(1<<21);while(0===t);return t},o.int32=n.next,o.quick=o,a&&(a.x&&f(a,n),o.state=function(){return f(n,{})}),o}r&&r.exports?r.exports=a:n&&n.amd?n(function(){return a}):this.xorshift7=a}(this,"object"==typeof n&&n,"function"==typeof e&&e)},{}],"/Users/gpriday/Downloads/trianglify-master 2/node_modules/seedrandom/lib/xorwow.js":[function(r,n,t){!function(e,r,n){function t(e){var r=this,n="";r.next=function(){var e=r.x^r.x>>>2;return r.x=r.y,r.y=r.z,r.z=r.w,r.w=r.v,(r.d=r.d+362437|0)+(r.v=r.v^r.v<<4^(e^e<<1))|0},r.x=0,r.y=0,r.z=0,r.w=0,r.v=0,e===(0|e)?r.x=e:n+=e;for(var t=0;t<n.length+64;t++)r.x^=0|n.charCodeAt(t),t==n.length&&(r.d=r.x<<10^r.x>>>4),r.next()}function f(e,r){return r.x=e.x,r.y=e.y,r.z=e.z,r.w=e.w,r.v=e.v,r.d=e.d,r}function a(e,r){var n=new t(e),a=r&&r.state,o=function(){return(n.next()>>>0)/4294967296};return o["double"]=function(){do var e=n.next()>>>11,r=(n.next()>>>0)/4294967296,t=(e+r)/(1<<21);while(0===t);return t},o.int32=n.next,o.quick=o,a&&("object"==typeof a&&f(a,n),o.state=function(){return f(n,{})}),o}r&&r.exports?r.exports=a:n&&n.amd?n(function(){return a}):this.xorwow=a}(this,"object"==typeof n&&n,"function"==typeof e&&e)},{}],"/Users/gpriday/Downloads/trianglify-master 2/node_modules/seedrandom/seedrandom.js":[function(r,n,t){!function(t,f){function a(e,r,n){var a=[];r=1==r?{entropy:!0}:r||{};var l=c(s(r.entropy?[e,d(t)]:null==e?u():e,3),a),b=new o(a),p=function(){for(var e=b.g(g),r=y,n=0;w>e;)e=(e+n)*h,r*=h,n=b.g(1);for(;e>=v;)e/=2,r/=2,n>>>=1;return(e+n)/r};return p.int32=function(){return 0|b.g(4)},p.quick=function(){return b.g(4)/4294967296},p["double"]=p,c(d(b.S),t),(r.pass||n||function(e,r,n,t){return t&&(t.S&&i(t,b),e.state=function(){return i(b,{})}),n?(f[m]=e,r):e})(p,l,"global"in r?r.global:this==f,r.state)}function o(e){var r,n=e.length,t=this,f=0,a=t.i=t.j=0,o=t.S=[];for(n||(e=[n++]);h>f;)o[f]=f++;for(f=0;h>f;f++)o[f]=o[a=x&a+e[f%n]+(r=o[f])],o[a]=r;(t.g=function(e){for(var r,n=0,f=t.i,a=t.j,o=t.S;e--;)r=o[f=x&f+1],n=n*h+o[x&(o[f]=o[a=x&a+r])+(o[a]=r)];return t.i=f,t.j=a,n})(h)}function i(e,r){return r.i=e.i,r.j=e.j,r.S=e.S.slice(),r}function s(e,r){var n,t=[],f=typeof e;if(r&&"object"==f)for(n in e)try{t.push(s(e[n],r-1))}catch(a){}return t.length?t:"string"==f?e:e+"\x00"}function c(e,r){for(var n,t=e+"",f=0;f<t.length;)r[x&f]=x&(n^=19*r[x&f])+t.charCodeAt(f++);return d(r)}function u(){try{if(l)return d(l.randomBytes(h));var e=new Uint8Array(h);return(b.crypto||b.msCrypto).getRandomValues(e),d(e)}catch(r){var n=b.navigator,f=n&&n.plugins;return[+new Date,b,f,b.screen,d(t)]}}function d(e){return String.fromCharCode.apply(0,e)}var l,b=this,h=256,g=6,p=52,m="random",y=f.pow(h,g),w=f.pow(2,p),v=2*w,x=h-1;if(f["seed"+m]=a,c(f.random(),t),"object"==typeof n&&n.exports){n.exports=a;try{l=r("crypto")}catch(_){}}else"function"==typeof e&&e.amd&&e(function(){return a})}([],Math)},{crypto:!1}]},{},["./lib/trianglify.js"])("./lib/trianglify.js")});
base/inc.php CHANGED
@@ -146,7 +146,7 @@ function siteorigin_widget_preview_widget_action(){
146
  ?>
147
  <html>
148
  <head>
149
- <title><?php _e('Widget Preview', 'siteorigin-widgets') ?></title>
150
  <?php
151
  wp_print_scripts();
152
  wp_print_styles();
@@ -308,4 +308,26 @@ function siteorigin_widgets_font_families( ){
308
  function siteorigin_widgets_tinymce_admin_print_styles() {
309
  wp_enqueue_style( 'editor-buttons' );
310
  }
311
- add_action( 'admin_print_styles', 'siteorigin_widgets_tinymce_admin_print_styles' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
146
  ?>
147
  <html>
148
  <head>
149
+ <title><?php _e('Widget Preview', 'so-widgets-bundle') ?></title>
150
  <?php
151
  wp_print_scripts();
152
  wp_print_styles();
308
  function siteorigin_widgets_tinymce_admin_print_styles() {
309
  wp_enqueue_style( 'editor-buttons' );
310
  }
311
+ add_action( 'admin_print_styles', 'siteorigin_widgets_tinymce_admin_print_styles' );
312
+
313
+ /**
314
+ * Get list of supported measurements
315
+ *
316
+ * @return array
317
+ */
318
+ function siteorigin_widgets_get_measurements_list() {
319
+ $measurements = array(
320
+ 'px',
321
+ '%',
322
+ 'in',
323
+ 'cm',
324
+ 'mm',
325
+ 'em',
326
+ 'ex',
327
+ 'pt',
328
+ 'pc',
329
+ );
330
+
331
+ // Allow themes and plugins to trim or enhance the list.
332
+ return apply_filters('siteorigin_widgets_get_measurements_list', $measurements);
333
+ }
base/inc/fields/base.class.php CHANGED
@@ -101,6 +101,26 @@ abstract class SiteOrigin_Widget_Field_Base {
101
  * @var string
102
  */
103
  protected $sanitize;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
104
 
105
 
106
  /* ============================================================================================================== */
@@ -137,9 +157,12 @@ abstract class SiteOrigin_Widget_Field_Base {
137
  * @param $element_name string The name to be used as the name attribute of the wrapping HTML element.
138
  * @param $field_options array Configuration for the field.
139
  *
 
 
 
140
  * @throws InvalidArgumentException
141
  */
142
- public function __construct( $base_name, $element_id, $element_name, $field_options ) {
143
  if( isset( $field_options['type'] ) ) {
144
  $this->type = $field_options['type'];
145
  }
@@ -153,15 +176,21 @@ abstract class SiteOrigin_Widget_Field_Base {
153
  $this->field_options = $field_options;
154
  $this->javascript_variables = array();
155
 
 
 
 
 
 
 
 
 
156
  $this->initialize();
157
  }
158
 
159
  /**
160
- * Initialization function which may be overridden if required, in which case, it is recommended that the parent
161
- * class' function is still called using `parent::initialize();`.
162
  */
163
  protected function initialize() {
164
- $this->init_options();
165
  }
166
 
167
  /**
101
  * @var string
102
  */
103
  protected $sanitize;
104
+ /**
105
+ * Reference to the parent widget required for creating child fields.
106
+ *
107
+ * @access private
108
+ * @var SiteOrigin_Widget
109
+ */
110
+ protected $for_widget;
111
+ /**
112
+ * An array of field names of parent containers.
113
+ *
114
+ * @var array
115
+ */
116
+ protected $parent_container;
117
+ /**
118
+ * Whether or not this field contains other fields.
119
+ *
120
+ * @access protected
121
+ * @var boolean
122
+ */
123
+ protected $is_container;
124
 
125
 
126
  /* ============================================================================================================== */
157
  * @param $element_name string The name to be used as the name attribute of the wrapping HTML element.
158
  * @param $field_options array Configuration for the field.
159
  *
160
+ * @param SiteOrigin_Widget $for_widget
161
+ * @param array $parent_container
162
+ *
163
  * @throws InvalidArgumentException
164
  */
165
+ public function __construct( $base_name, $element_id, $element_name, $field_options, $for_widget = null, $parent_container = array() ) {
166
  if( isset( $field_options['type'] ) ) {
167
  $this->type = $field_options['type'];
168
  }
176
  $this->field_options = $field_options;
177
  $this->javascript_variables = array();
178
 
179
+ $this->for_widget = $for_widget;
180
+ $this->parent_container = $parent_container;
181
+
182
+ $this->init();
183
+ }
184
+
185
+ private function init() {
186
+ $this->init_options();
187
  $this->initialize();
188
  }
189
 
190
  /**
191
+ * Initialization function which may be overridden if required.
 
192
  */
193
  protected function initialize() {
 
194
  }
195
 
196
  /**
base/inc/fields/container-base.class.php CHANGED
@@ -21,19 +21,6 @@ abstract class SiteOrigin_Widget_Field_Container_Base extends SiteOrigin_Widget_
21
  * @var array
22
  */
23
  protected $sub_fields;
24
- /**
25
- * Reference to the parent widget required for creating child fields.
26
- *
27
- * @access private
28
- * @var SiteOrigin_Widget
29
- */
30
- protected $for_widget;
31
- /**
32
- * An array of field names of parent containers.
33
- *
34
- * @var array
35
- */
36
- protected $parent_container;
37
  /**
38
  * Whether or not this container's fields should initially be hidden.
39
  *
@@ -56,13 +43,6 @@ abstract class SiteOrigin_Widget_Field_Container_Base extends SiteOrigin_Widget_
56
  */
57
  protected $collapsible = true;
58
 
59
- public function __construct( $base_name, $element_id, $element_name, $field_options, SiteOrigin_Widget $for_widget, $parent_container = array() ) {
60
- parent::__construct( $base_name, $element_id, $element_name, $field_options );
61
-
62
- $this->for_widget = $for_widget;
63
- $this->parent_container = $parent_container;
64
- }
65
-
66
  protected function render_before_field( $value, $instance ) {
67
  if( ! empty( $value[ 'so_field_container_state' ] ) ) {
68
  $this->state = $value[ 'so_field_container_state' ];
21
  * @var array
22
  */
23
  protected $sub_fields;
 
 
 
 
 
 
 
 
 
 
 
 
 
24
  /**
25
  * Whether or not this container's fields should initially be hidden.
26
  *
43
  */
44
  protected $collapsible = true;
45
 
 
 
 
 
 
 
 
46
  protected function render_before_field( $value, $instance ) {
47
  if( ! empty( $value[ 'so_field_container_state' ] ) ) {
48
  $this->state = $value[ 'so_field_container_state' ];
base/inc/fields/css/so-measurement-field.css ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ .siteorigin-widget-form .siteorigin-widget-field input[type="text"].siteorigin-widget-input-measurement {
2
+ float: left;
3
+ max-width: 58px;
4
+ margin: 1px;
5
+ height: 28px;
6
+ vertical-align: middle;
7
+ }
base/inc/fields/factory.class.php CHANGED
@@ -33,12 +33,7 @@ class SiteOrigin_Widget_Field_Factory {
33
  );
34
  }
35
 
36
- if( $this->is_container_type( $field_options['type'] ) ) {
37
- return new $field_class( $field_name, $element_id, $element_name, $field_options, $for_widget, $for_repeater );
38
- }
39
- else {
40
- return new $field_class( $field_name, $element_id, $element_name, $field_options );
41
- }
42
  }
43
 
44
  private function get_field_class_name( $field_type ) {
@@ -63,13 +58,4 @@ class SiteOrigin_Widget_Field_Factory {
63
  private function get_class_prefixes() {
64
  return apply_filters( 'siteorigin_widgets_field_class_prefixes', array( 'SiteOrigin_Widget_Field_' ) );
65
  }
66
-
67
- private function get_container_types() {
68
- return apply_filters( 'siteorigin_widgets_field_container_types', array( 'section', 'widget', 'repeater', 'media' ) );
69
- }
70
-
71
- private function is_container_type( $type ) {
72
- $container_types = SiteOrigin_Widget_Field_Factory::get_container_types();
73
- return in_array( $type, $container_types );
74
- }
75
  }
33
  );
34
  }
35
 
36
+ return new $field_class( $field_name, $element_id, $element_name, $field_options, $for_widget, $for_repeater );
 
 
 
 
 
37
  }
38
 
39
  private function get_field_class_name( $field_type ) {
58
  private function get_class_prefixes() {
59
  return apply_filters( 'siteorigin_widgets_field_class_prefixes', array( 'SiteOrigin_Widget_Field_' ) );
60
  }
 
 
 
 
 
 
 
 
 
61
  }
base/inc/fields/font.class.php CHANGED
@@ -14,7 +14,7 @@ class SiteOrigin_Widget_Field_Font extends SiteOrigin_Widget_Field_Base {
14
  ?>
15
  <div class="siteorigin-widget-font-selector siteorigin-widget-field-subcontainer">
16
  <select name="<?php echo esc_attr( $this->element_name ) ?>" id="<?php echo esc_attr( $this->element_id ) ?>" class="siteorigin-widget-input">
17
- <option value="default" selected="selected"><?php esc_html_e( 'Use theme font', 'siteorigin-widgets' ) ?></option>
18
  <?php foreach( $widget_font_families as $key => $val ) : ?>
19
  <option value="<?php echo esc_attr( $key ) ?>" <?php selected( $key, $value ) ?>><?php echo esc_html( $val ) ?></option>
20
  <?php endforeach; ?>
14
  ?>
15
  <div class="siteorigin-widget-font-selector siteorigin-widget-field-subcontainer">
16
  <select name="<?php echo esc_attr( $this->element_name ) ?>" id="<?php echo esc_attr( $this->element_id ) ?>" class="siteorigin-widget-input">
17
+ <option value="default" selected="selected"><?php esc_html_e( 'Use theme font', 'so-widgets-bundle' ) ?></option>
18
  <?php foreach( $widget_font_families as $key => $val ) : ?>
19
  <option value="<?php echo esc_attr( $key ) ?>" <?php selected( $key, $value ) ?>><?php echo esc_html( $val ) ?></option>
20
  <?php endforeach; ?>
base/inc/fields/icon.class.php CHANGED
@@ -15,7 +15,7 @@ class SiteOrigin_Widget_Field_Icon extends SiteOrigin_Widget_Field_Base {
15
 
16
  <div class="siteorigin-widget-icon-selector-current">
17
  <div class="siteorigin-widget-icon"><span></span></div>
18
- <label><?php _e('Choose Icon', 'siteorigin-widgets') ?></label>
19
  </div>
20
 
21
  <div class="siteorigin-widget-icon-selector siteorigin-widget-field-subcontainer">
15
 
16
  <div class="siteorigin-widget-icon-selector-current">
17
  <div class="siteorigin-widget-icon"><span></span></div>
18
+ <label><?php _e('Choose Icon', 'so-widgets-bundle') ?></label>
19
  </div>
20
 
21
  <div class="siteorigin-widget-icon-selector siteorigin-widget-field-subcontainer">
base/inc/fields/js/so-tinymce-field.js CHANGED
@@ -81,6 +81,15 @@
81
  $container.find('.quicktags-toolbar').remove();
82
  quicktags(tinyMCEPreInit.qtInit[id]);
83
  //}
 
 
 
 
 
 
 
 
 
84
  });
85
  QTags._buttonsInit();
86
  }
81
  $container.find('.quicktags-toolbar').remove();
82
  quicktags(tinyMCEPreInit.qtInit[id]);
83
  //}
84
+
85
+ $(this).on( 'click', function(event) {
86
+
87
+ var $target = $(event.target);
88
+ if ( $target.hasClass( 'wp-switch-editor' ) ) {
89
+ mode = $target.hasClass( 'switch-tmce' ) ? 'tmce' : 'html';
90
+ $(this).find('+ .siteorigin-widget-tinymce-selected-editor').val(mode);
91
+ }
92
+ });
93
  });
94
  QTags._buttonsInit();
95
  }
base/inc/fields/js/so-tinymce-field.min.js CHANGED
@@ -1 +1 @@
1
- !function(e){var t=function(i){"undefined"!=typeof tinyMCEPreInit?(tinyMCEPreInit.mceInit.hasOwnProperty("undefined")&&delete tinyMCEPreInit.mceInit.undefined,tinyMCEPreInit.qtInit.hasOwnProperty("undefined")&&delete tinyMCEPreInit.qtInit.undefined,QTags.instances.hasOwnProperty("undefined")&&delete QTags.instances.undefined,e(i).find("> .siteorigin-widget-field-type-tinymce > .siteorigin-widget-tinymce-container").each(function(t,i){var n=e(i),r=n.find("textarea"),o=r.attr("id");if("undefined"!=typeof tinymce){if(o.indexOf("__i__")>-1)return;var d=n.data("mceSettings"),a=n.data("widgetIdBase"),s=r.attr("name").replace(/\[\d\]/g,""),c=/[a-zA-Z0-9\-]+(?:\[[a-zA-Z0-9]+\])?\[(.*)\]/.exec(s)[1],f=new RegExp("widget-"+a+"-.*-"+c.replace(/\]\[/g,"-")+"[-d]*");for(var g in tinyMCEPreInit.mceInit)g.match(f)&&(d=e.extend({},tinyMCEPreInit.mceInit[g],d));var m,u=tinymce.get(o);null!=u&&(m=u.getContent(),u.remove());var l=function(e){e.on("change",function(){tinymce.get(o).save(),r.trigger("change"),r.val(window.switchEditors.pre_wpautop(e.getContent()))}),e.on("init",function(){m&&e.setContent(m)}),r.on("keyup",function(){e.setContent(window.switchEditors.wpautop(r.val()))})};d=e.extend({},d,{selector:"#"+o,setup:l}),tinyMCEPreInit.mceInit[o]=d;var y=n.find("div#wp-"+o+"-wrap");if(y.hasClass("tmce-active"))if(e("#"+o).is(":visible"))tinymce.init(tinyMCEPreInit.mceInit[o]);else var I=setInterval(function(){e("#"+o).is(":visible")&&(tinymce.init(tinyMCEPreInit.mceInit[o]),clearInterval(I))},500)}var p=n.data("qtSettings");p=e.extend({},tinyMCEPreInit.qtInit["siteorigin-widget-input-tinymce-field"],p,{id:o}),tinyMCEPreInit.qtInit[o]=p,n.find(".quicktags-toolbar").remove(),quicktags(tinyMCEPreInit.qtInit[o])}),QTags._buttonsInit()):setTimeout(function(){t(i)},500)};e(document).on("sowsetupform",function(i){var n=e(i.target);n.is(".siteorigin-widget-field-repeater-item-form")?n.is(":visible")?t(n):n.on("slideToggleOpenComplete",function(){n.is(":visible")&&(t(n),n.off("slideToggleOpenComplete"))}):t(n)}),e(document).on("sortstop",function(i,n){n.item.is(".siteorigin-widget-field-repeater-item")?n.item.find("> .siteorigin-widget-field-repeater-item-form").each(function(){t(e(this))}):t(n.item.find(".siteorigin-widget-form"))})}(jQuery);
1
+ !function(e){var t=function(i){"undefined"!=typeof tinyMCEPreInit?(tinyMCEPreInit.mceInit.hasOwnProperty("undefined")&&delete tinyMCEPreInit.mceInit.undefined,tinyMCEPreInit.qtInit.hasOwnProperty("undefined")&&delete tinyMCEPreInit.qtInit.undefined,QTags.instances.hasOwnProperty("undefined")&&delete QTags.instances.undefined,e(i).find("> .siteorigin-widget-field-type-tinymce > .siteorigin-widget-tinymce-container").each(function(t,i){var n=e(i),r=n.find("textarea"),o=r.attr("id");if("undefined"!=typeof tinymce){if(o.indexOf("__i__")>-1)return;var d=n.data("mceSettings"),s=n.data("widgetIdBase"),a=r.attr("name").replace(/\[\d\]/g,""),c=/[a-zA-Z0-9\-]+(?:\[[a-zA-Z0-9]+\])?\[(.*)\]/.exec(a)[1],f=new RegExp("widget-"+s+"-.*-"+c.replace(/\]\[/g,"-")+"[-d]*");for(var g in tinyMCEPreInit.mceInit)g.match(f)&&(d=e.extend({},tinyMCEPreInit.mceInit[g],d));var m,l=tinymce.get(o);null!=l&&(m=l.getContent(),l.remove());var u=function(e){e.on("change",function(){tinymce.get(o).save(),r.trigger("change"),r.val(window.switchEditors.pre_wpautop(e.getContent()))}),e.on("init",function(){m&&e.setContent(m)}),r.on("keyup",function(){e.setContent(window.switchEditors.wpautop(r.val()))})};d=e.extend({},d,{selector:"#"+o,setup:u}),tinyMCEPreInit.mceInit[o]=d;var y=n.find("div#wp-"+o+"-wrap");if(y.hasClass("tmce-active"))if(e("#"+o).is(":visible"))tinymce.init(tinyMCEPreInit.mceInit[o]);else var p=setInterval(function(){e("#"+o).is(":visible")&&(tinymce.init(tinyMCEPreInit.mceInit[o]),clearInterval(p))},500)}var I=n.data("qtSettings");I=e.extend({},tinyMCEPreInit.qtInit["siteorigin-widget-input-tinymce-field"],I,{id:o}),tinyMCEPreInit.qtInit[o]=I,n.find(".quicktags-toolbar").remove(),quicktags(tinyMCEPreInit.qtInit[o]),e(this).on("click",function(t){var i=e(t.target);i.hasClass("wp-switch-editor")&&(mode=i.hasClass("switch-tmce")?"tmce":"html",e(this).find("+ .siteorigin-widget-tinymce-selected-editor").val(mode))})}),QTags._buttonsInit()):setTimeout(function(){t(i)},500)};e(document).on("sowsetupform",function(i){var n=e(i.target);n.is(".siteorigin-widget-field-repeater-item-form")?n.is(":visible")?t(n):n.on("slideToggleOpenComplete",function(){n.is(":visible")&&(t(n),n.off("slideToggleOpenComplete"))}):t(n)}),e(document).on("sortstop",function(i,n){n.item.is(".siteorigin-widget-field-repeater-item")?n.item.find("> .siteorigin-widget-field-repeater-item-form").each(function(){t(e(this))}):t(n.item.find(".siteorigin-widget-form"))})}(jQuery);
base/inc/fields/link.class.php CHANGED
@@ -8,16 +8,16 @@ class SiteOrigin_Widget_Field_Link extends SiteOrigin_Widget_Field_Text_Input_Ba
8
  protected function render_before_field( $value, $instance ) {
9
  parent::render_before_field( $value, $instance );
10
  ?>
11
- <a href="#" class="select-content-button button-secondary"><?php esc_html_e('Select Content', 'siteorigin-widgets') ?></a>
12
  <div class="existing-content-selector">
13
 
14
  <input type="text" class="content-text-search"
15
- placeholder="<?php esc_attr_e('Search Content', 'siteorigin-widgets') ?>"/>
16
 
17
  <ul class="posts"></ul>
18
 
19
  <div class="buttons">
20
- <a href="#" class="button-close button-secondary"><?php esc_html_e('Close', 'siteorigin-widgets') ?></a>
21
  </div>
22
  </div>
23
  <div class="url-input-wrapper">
8
  protected function render_before_field( $value, $instance ) {
9
  parent::render_before_field( $value, $instance );
10
  ?>
11
+ <a href="#" class="select-content-button button-secondary"><?php esc_html_e('Select Content', 'so-widgets-bundle') ?></a>
12
  <div class="existing-content-selector">
13
 
14
  <input type="text" class="content-text-search"
15
+ placeholder="<?php esc_attr_e('Search Content', 'so-widgets-bundle') ?>"/>
16
 
17
  <ul class="posts"></ul>
18
 
19
  <div class="buttons">
20
+ <a href="#" class="button-close button-secondary"><?php esc_html_e('Close', 'so-widgets-bundle') ?></a>
21
  </div>
22
  </div>
23
  <div class="url-input-wrapper">
base/inc/fields/measurement.class.php ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Class SiteOrigin_Widget_Field_Measurement
5
+ */
6
+ class SiteOrigin_Widget_Field_Measurement extends SiteOrigin_Widget_Field_Text_Input_Base {
7
+
8
+ protected function get_input_classes() {
9
+ $input_classes = parent::get_input_classes();
10
+ $input_classes[] = 'siteorigin-widget-input-measurement';
11
+ return $input_classes;
12
+ }
13
+
14
+ protected function render_after_field( $value, $instance ) {
15
+ $unit_name = $this->get_unit_field_name( $this->base_name );
16
+ $unit = ! empty( $instance[ $unit_name ] ) ? $instance[ $unit_name ] : '';
17
+ ?>
18
+ <select class="sow-measurement-select-unit"
19
+ name="<?php echo esc_attr( $this->for_widget->so_get_field_name( $this->base_name . '_unit', $this->parent_container ) ) ?>">
20
+ <?php foreach ( siteorigin_widgets_get_measurements_list() as $measurement ):?>
21
+ <option value="<?php echo esc_attr( $measurement ) ?>" <?php selected( $measurement, $unit, true ); ?>><?php echo esc_html( $measurement ) ?></option>
22
+ <?php endforeach?>
23
+ </select>
24
+ <div class="clear"></div>
25
+ <?php
26
+ //Still want the default description, if there is one.
27
+ parent::render_after_field( $value, $instance );
28
+ }
29
+
30
+ public function enqueue_scripts() {
31
+ wp_enqueue_style( 'so-measurement-field', plugin_dir_url(__FILE__) . 'css/so-measurement-field.css', array(), SOW_BUNDLE_VERSION );
32
+ }
33
+
34
+
35
+ protected function sanitize_field_input( $value ) {
36
+ return ( $value === '' ) ? false : (float) $value;
37
+ }
38
+
39
+ public function sanitize_instance( $instance ) {
40
+ $unit_name = $this->get_unit_field_name( $this->base_name );
41
+ if( ! empty( $instance[ $unit_name ] ) ) {
42
+ $units = siteorigin_widgets_get_measurements_list();
43
+ $instance[ $unit_name ] = in_array( $instance[ $unit_name ], $units ) ? $instance[ $unit_name ] : 'px';
44
+ esc_url_raw( $instance[ $unit_name ] );
45
+ }
46
+ return $instance;
47
+ }
48
+
49
+ public function get_unit_field_name( $base_name ) {
50
+ $v_name = $base_name;
51
+ if( strpos($v_name, '][') !== false ) {
52
+ // Remove this splitter
53
+ $v_name = substr( $v_name, strpos($v_name, '][') + 2 );
54
+ }
55
+ return $v_name . '_unit';
56
+ }
57
+ }
base/inc/fields/media.class.php CHANGED
@@ -36,27 +36,6 @@ class SiteOrigin_Widget_Field_Media extends SiteOrigin_Widget_Field_Base {
36
  * @var bool
37
  */
38
  protected $fallback;
39
- /**
40
- * Reference to the containing widget required for creating the fallback subfield.
41
- *
42
- * @access private
43
- * @var SiteOrigin_Widget
44
- */
45
- private $for_widget;
46
- /**
47
- * An array of field names of parent repeaters.
48
- *
49
- * @var array
50
- */
51
- private $parent_repeater;
52
-
53
- public function __construct( $base_name, $element_id, $element_name, $field_options, $for_widget, $parent_container = array() ) {
54
- parent::__construct( $base_name, $element_id, $element_name, $field_options );
55
-
56
- $this->for_widget = $for_widget;
57
- $this->parent_repeater = $parent_container;
58
-
59
- }
60
 
61
  protected function get_default_options() {
62
  return array(
@@ -99,7 +78,7 @@ class SiteOrigin_Widget_Field_Media extends SiteOrigin_Widget_Field_Base {
99
  <?php echo esc_html( $this->choose ) ?>
100
  </a>
101
  </div>
102
- <a href="#" class="media-remove-button <?php if( empty( $value ) ) echo 'remove-hide'; ?>"><?php esc_html_e( 'Remove', 'siteorigin-widgets' ) ?></a>
103
 
104
  <input type="hidden" value="<?php echo esc_attr( is_array( $value ) ? '-1' : $value ) ?>" name="<?php echo esc_attr( $this->element_name ) ?>" class="siteorigin-widget-input" />
105
 
@@ -112,8 +91,8 @@ class SiteOrigin_Widget_Field_Media extends SiteOrigin_Widget_Field_Base {
112
  $fallback_url = !empty( $instance[ $fallback_name ] ) ? $instance[ $fallback_name ] : '';
113
  ?>
114
  <input type="text" value="<?php echo esc_url( $fallback_url ) ?>"
115
- placeholder="<?php esc_attr_e( 'External URL', 'siteorigin-widgets' ) ?>"
116
- name="<?php echo esc_attr( $this->for_widget->so_get_field_name( $this->base_name . '_fallback', $this->parent_repeater ) ) ?>"
117
  class="media-fallback-external siteorigin-widget-input" />
118
  <div class="clear"></div>
119
  <?php
@@ -135,7 +114,7 @@ class SiteOrigin_Widget_Field_Media extends SiteOrigin_Widget_Field_Base {
135
  public function sanitize_instance( $instance ) {
136
  $fallback_name = $this->get_fallback_field_name( $this->base_name );
137
  if( !empty( $this->fallback ) && !empty( $instance[ $fallback_name ] ) ) {
138
- $instance[ $fallback_name ] = esc_url_raw( $instance[ $fallback_name ] );
139
  }
140
  return $instance;
141
  }
36
  * @var bool
37
  */
38
  protected $fallback;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
39
 
40
  protected function get_default_options() {
41
  return array(
78
  <?php echo esc_html( $this->choose ) ?>
79
  </a>
80
  </div>
81
+ <a href="#" class="media-remove-button <?php if( empty( $value ) ) echo 'remove-hide'; ?>"><?php esc_html_e( 'Remove', 'so-widgets-bundle' ) ?></a>
82
 
83
  <input type="hidden" value="<?php echo esc_attr( is_array( $value ) ? '-1' : $value ) ?>" name="<?php echo esc_attr( $this->element_name ) ?>" class="siteorigin-widget-input" />
84
 
91
  $fallback_url = !empty( $instance[ $fallback_name ] ) ? $instance[ $fallback_name ] : '';
92
  ?>
93
  <input type="text" value="<?php echo esc_url( $fallback_url ) ?>"
94
+ placeholder="<?php esc_attr_e( 'External URL', 'so-widgets-bundle' ) ?>"
95
+ name="<?php echo esc_attr( $this->for_widget->so_get_field_name( $this->base_name . '_fallback', $this->parent_container ) ) ?>"
96
  class="media-fallback-external siteorigin-widget-input" />
97
  <div class="clear"></div>
98
  <?php
114
  public function sanitize_instance( $instance ) {
115
  $fallback_name = $this->get_fallback_field_name( $this->base_name );
116
  if( !empty( $this->fallback ) && !empty( $instance[ $fallback_name ] ) ) {
117
+ $instance[ $fallback_name ] = sow_esc_url_raw( $instance[ $fallback_name ] );
118
  }
119
  return $instance;
120
  }
base/inc/fields/repeater.class.php CHANGED
@@ -90,7 +90,7 @@ class SiteOrigin_Widget_Field_Repeater extends SiteOrigin_Widget_Field_Container
90
  ?>
91
  </div>
92
  <?php if( empty( $this->readonly ) ) : ?>
93
- <div class="siteorigin-widget-field-repeater-add"><?php esc_html_e( 'Add', 'siteorigin-widgets' ) ?></div>
94
  <?php endif; ?>
95
  <?php
96
  ob_start();
90
  ?>
91
  </div>
92
  <?php if( empty( $this->readonly ) ) : ?>
93
+ <div class="siteorigin-widget-field-repeater-add"><?php esc_html_e( 'Add', 'so-widgets-bundle' ) ?></div>
94
  <?php endif; ?>
95
  <?php
96
  ob_start();
base/inc/fields/tinymce.class.php CHANGED
@@ -15,6 +15,13 @@ class SiteOrigin_Widget_Field_TinyMCE extends SiteOrigin_Widget_Field_Text_Input
15
  * @var string
16
  */
17
  protected $default_editor = 'tinymce';
 
 
 
 
 
 
 
18
  /**
19
  * The editor initial height. Overrides rows if it is set.
20
  *
@@ -31,8 +38,9 @@ class SiteOrigin_Widget_Field_TinyMCE extends SiteOrigin_Widget_Field_Text_Input
31
  protected $button_filters;
32
 
33
  protected function initialize() {
34
- parent::initialize();
35
-
 
36
  add_filter( 'mce_buttons', array( $this, 'mce_buttons_filter' ), 10, 2 );
37
  add_filter( 'quicktags_settings', array( $this, 'quicktags_settings' ), 10, 2 );
38
 
@@ -44,6 +52,14 @@ class SiteOrigin_Widget_Field_TinyMCE extends SiteOrigin_Widget_Field_Text_Input
44
  }
45
  }
46
 
 
 
 
 
 
 
 
 
47
  if( class_exists( 'WC_Shortcodes_Admin' ) ) {
48
  $screen = get_current_screen();
49
  if( !is_null( $screen ) && $screen->id != 'widgets' ) {
@@ -58,8 +74,9 @@ class SiteOrigin_Widget_Field_TinyMCE extends SiteOrigin_Widget_Field_Text_Input
58
  return $plugins;
59
  }
60
  $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
61
- if( file_exists( plugin_dir_path('woocommerce-shortcodes.php') ) ) {
62
- $plugins['woocommerce_shortcodes'] = plugins_url( 'woocommerce-shortcodes/assets/js/editor' . $suffix . '.js' );
 
63
  }
64
  return $plugins;
65
  }
@@ -72,6 +89,40 @@ class SiteOrigin_Widget_Field_TinyMCE extends SiteOrigin_Widget_Field_Text_Input
72
  return $buttons;
73
  }
74
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
75
  /**
76
  * @param $name
77
  * @param $arguments
@@ -107,11 +158,23 @@ class SiteOrigin_Widget_Field_TinyMCE extends SiteOrigin_Widget_Field_Text_Input
107
  return $settings;
108
  }
109
 
 
 
 
 
 
 
 
 
 
 
 
 
110
  protected function render_field( $value, $instance ) {
111
 
112
  $settings = array(
113
  'textarea_name' => esc_attr( $this->element_name ),
114
- 'default_editor' => $this->default_editor,
115
  'textarea_rows' => $this->rows,
116
  'editor_class' => 'siteorigin-widget-input',
117
  'tinymce' => array(
@@ -131,12 +194,16 @@ class SiteOrigin_Widget_Field_TinyMCE extends SiteOrigin_Widget_Field_Text_Input
131
  wp_editor( $value, esc_attr( $this->element_id ), $settings )
132
  ?>
133
  </div>
 
 
 
 
134
  <?php
135
 
136
- if( $this->default_editor == 'html' ) {
137
  remove_filter( 'the_editor_content', 'wp_htmledit_pre' );
138
  }
139
- if( $this->default_editor == 'tinymce' ) {
140
  remove_filter( 'the_editor_content', 'wp_richedit_pre' );
141
  }
142
  }
@@ -148,11 +215,29 @@ class SiteOrigin_Widget_Field_TinyMCE extends SiteOrigin_Widget_Field_Text_Input
148
 
149
  protected function sanitize_field_input( $value ) {
150
  if( current_user_can( 'unfiltered_html' ) ) {
151
- $sanitized_value = preg_replace('/<\s*?script[^>]*?>[\s\S]*?<\s*\/\s*script\s*>/mi', '', $value);
152
  } else {
153
  $sanitized_value = wp_kses_post( $value );
154
  }
155
  $sanitized_value = balanceTags( $sanitized_value , true );
156
  return $sanitized_value;
157
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
158
  }
15
  * @var string
16
  */
17
  protected $default_editor = 'tinymce';
18
+ /**
19
+ * The last editor selected by the user.
20
+ *
21
+ * @access protected
22
+ * @var string
23
+ */
24
+ protected $selected_editor;
25
  /**
26
  * The editor initial height. Overrides rows if it is set.
27
  *
38
  protected $button_filters;
39
 
40
  protected function initialize() {
41
+ if ( ! is_admin() ) {
42
+ return;
43
+ }
44
  add_filter( 'mce_buttons', array( $this, 'mce_buttons_filter' ), 10, 2 );
45
  add_filter( 'quicktags_settings', array( $this, 'quicktags_settings' ), 10, 2 );
46
 
52
  }
53
  }
54
 
55
+ if( class_exists( 'WC_Shortcodes_TinyMCE_Buttons' ) ) {
56
+ $screen = get_current_screen();
57
+ if( !is_null( $screen ) && $screen->id != 'widgets' ) {
58
+ add_filter( 'mce_external_plugins', array( $this, 'add_wpc_shortcode_plugin' ), 15 );
59
+ add_filter( 'mce_buttons', array( $this, 'register_wpc_shortcode_button' ), 15 );
60
+ }
61
+ }
62
+
63
  if( class_exists( 'WC_Shortcodes_Admin' ) ) {
64
  $screen = get_current_screen();
65
  if( !is_null( $screen ) && $screen->id != 'widgets' ) {
74
  return $plugins;
75
  }
76
  $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
77
+ $editor_path = 'woocommerce-shortcodes/assets/js/editor' . $suffix . '.js';
78
+ if( file_exists( WP_PLUGIN_DIR . '/' . $editor_path ) ) {
79
+ $plugins['woocommerce_shortcodes'] = plugins_url( $editor_path );
80
  }
81
  return $plugins;
82
  }
89
  return $buttons;
90
  }
91
 
92
+ function add_wpc_shortcode_plugin( $plugins ) {
93
+ global $wp_version;
94
+ $ver = WC_SHORTCODES_VERSION;
95
+ $wp_ver_gte_3_9 = version_compare( $wp_version, '3.9', '>=' );
96
+
97
+ if( ! isset( $plugins['wpc_shortcodes'] ) ) {
98
+ $shortcodes_filename = $wp_ver_gte_3_9 ? 'shortcodes-tinymce-4' : 'shortcodes_tinymce';
99
+ $shortcodes_path = 'wc-shortcodes/includes/mce/js/' . $shortcodes_filename . '.js';
100
+ if( file_exists( WP_PLUGIN_DIR . '/' . $shortcodes_path ) ) {
101
+ $plugins['wpc_shortcodes'] = plugins_url( $shortcodes_path . '?ver=' . $ver );
102
+ }
103
+ }
104
+
105
+ if( ! isset( $plugins['wpc_font_awesome'] ) ) {
106
+ $fontawesome_filename = $wp_ver_gte_3_9 ? 'font-awesome-tinymce-4' : 'font_awesome_tinymce';
107
+ $fontawesome_path = 'wc-shortcodes/includes/mce/js/' . $fontawesome_filename . '.js';
108
+ if( file_exists( WP_PLUGIN_DIR . '/' . $fontawesome_path ) ) {
109
+ $plugins['wpc_font_awesome'] = plugins_url( $fontawesome_path . '?ver=' . $ver );
110
+ }
111
+ }
112
+
113
+ return $plugins;
114
+ }
115
+
116
+ function register_wpc_shortcode_button( $buttons ) {
117
+ if( ! in_array( 'wpc_shortcodes_button', $buttons ) ) {
118
+ array_push( $buttons, 'wpc_shortcodes_button' );
119
+ }
120
+ if( ! in_array( 'wpcfontAwesomeGlyphSelect', $buttons ) ) {
121
+ array_push( $buttons, 'wpcfontAwesomeGlyphSelect' );
122
+ }
123
+ return $buttons;
124
+ }
125
+
126
  /**
127
  * @param $name
128
  * @param $arguments
158
  return $settings;
159
  }
160
 
161
+ protected function render_before_field( $value, $instance ) {
162
+ $selected_editor_name = $this->get_selected_editor_field_name( $this->base_name );
163
+ if( ! empty( $instance[ $selected_editor_name ] ) ) {
164
+ $this->selected_editor = $instance[ $selected_editor_name ];
165
+ }
166
+ else {
167
+ $this->selected_editor = $this->default_editor;
168
+ }
169
+ parent::render_before_field( $value, $instance );
170
+ }
171
+
172
+
173
  protected function render_field( $value, $instance ) {
174
 
175
  $settings = array(
176
  'textarea_name' => esc_attr( $this->element_name ),
177
+ 'default_editor' => $this->selected_editor,
178
  'textarea_rows' => $this->rows,
179
  'editor_class' => 'siteorigin-widget-input',
180
  'tinymce' => array(
194
  wp_editor( $value, esc_attr( $this->element_id ), $settings )
195
  ?>
196
  </div>
197
+ <input type="hidden"
198
+ name="<?php echo esc_attr( $this->for_widget->so_get_field_name( $this->base_name . '_selected_editor', $this->parent_container) ) ?>"
199
+ class="siteorigin-widget-input siteorigin-widget-tinymce-selected-editor"
200
+ value="<?php echo esc_attr( $this->selected_editor ) ?>"/>
201
  <?php
202
 
203
+ if( $this->selected_editor == 'html' ) {
204
  remove_filter( 'the_editor_content', 'wp_htmledit_pre' );
205
  }
206
+ if( $this->selected_editor == 'tinymce' ) {
207
  remove_filter( 'the_editor_content', 'wp_richedit_pre' );
208
  }
209
  }
215
 
216
  protected function sanitize_field_input( $value ) {
217
  if( current_user_can( 'unfiltered_html' ) ) {
218
+ $sanitized_value = $value;
219
  } else {
220
  $sanitized_value = wp_kses_post( $value );
221
  }
222
  $sanitized_value = balanceTags( $sanitized_value , true );
223
  return $sanitized_value;
224
  }
225
+
226
+ public function sanitize_instance( $instance ) {
227
+ $selected_editor_name = $this->get_selected_editor_field_name( $this->base_name );
228
+ $selected_editor = $instance[ $selected_editor_name ];
229
+ if( ! empty( $selected_editor ) ) {
230
+ $instance[ $selected_editor_name ] = in_array( $selected_editor, array( 'tinymce', 'tmce', 'html' ) ) ? $selected_editor : $this->default_editor;
231
+ }
232
+ return $instance;
233
+ }
234
+
235
+ public function get_selected_editor_field_name( $base_name ) {
236
+ $v_name = $base_name;
237
+ if( strpos($v_name, '][') !== false ) {
238
+ // Remove this splitter
239
+ $v_name = substr( $v_name, strpos($v_name, '][') + 2 );
240
+ }
241
+ return $v_name . '_selected_editor';
242
+ }
243
  }
base/inc/post-selector.php CHANGED
@@ -26,7 +26,7 @@ function siteorigin_widget_post_selector_admin_form_field( $value, $field_name )
26
  <input type="hidden" value="<?php echo esc_attr( $value ) ?>" name="<?php echo $field_name ?>" class="siteorigin-widget-input" />
27
  <a href="#" class="sow-select-posts button button-secondary">
28
  <span class="sow-current-count"><?php echo esc_html( siteorigin_widget_post_selector_count_posts( $value ) )?></span>
29
- <?php esc_html_e( 'Build posts query', 'siteorigin-widgets' ) ?>
30
  </a>
31
  <?php
32
  }
26
  <input type="hidden" value="<?php echo esc_attr( $value ) ?>" name="<?php echo $field_name ?>" class="siteorigin-widget-input" />
27
  <a href="#" class="sow-select-posts button button-secondary">
28
  <span class="sow-current-count"><?php echo esc_html( siteorigin_widget_post_selector_count_posts( $value ) )?></span>
29
+ <?php esc_html_e( 'Build posts query', 'so-widgets-bundle' ) ?>
30
  </a>
31
  <?php
32
  }
base/js/admin.min.js CHANGED
@@ -1 +1 @@
1
- !function(e){e.fn.sowSetupForm=function(){return e(this).each(function(i,t){var n,a,r=e(t),s=!0,o=r.find("input[name]");if(o.length&&-1!==o.attr("name").indexOf("__i__"))return this;if(r.is(".siteorigin-widget-form-main")){if(r.data("sow-form-setup")===!0)return!0;if(e("body").hasClass("widgets-php")&&!r.is(":visible")&&0===r.closest(".panel-dialog").length)return!0;r.on("sowstatechange",function(i,t,n){r.find("[data-state-handler]").each(function(){var i=e(this),a=e.extend({},i.data("state-handler"),s?i.data("state-handler-initial"):{});if(0===Object.keys(a).length)return!0;var r,o,d,l,f,c,g={},u=window.sowForms.getRepeaterId(i);if(u!==!1){var p={};for(var m in a)p[m.replace("{$repeater}",u)]=a[m];a=p}for(var m in a)if(f=!1,r=m.match(/^([a-zA-Z0-9_-]+)(\[([a-zA-Z0-9_\-,]+)\])?(\[\])?$/),null!==r){if(o={group:"default",name:"",multi:!1},void 0!==r[2]?(o.group=r[1],o.name=r[3]):o.name=r[0],o.multi=void 0!==r[4],"_else"===o.group)o.group=o.name,o.name="",f=o.group===t&&"undefined"==typeof g[o.group];else{c=o.name.split(",").map(function(e){return e.trim()});for(var w=0;w<c.length&&!(f=o.group===t&&c[w]===n);w++);}if(f){d=a[m],o.multi||(d=[d]);for(var w=0;w<d.length;w++)l="undefined"!=typeof d[w][1]&&Boolean(d[w][1])?i.find(d[w][1]):i,l[d[w][0]].apply(l,"undefined"!=typeof d[w][2]?d[w][2]:[]);g[o.group]=!0}}})}),r.sowSetupPreview(),n=r}else n=r.closest(".siteorigin-widget-form-main");a=n.find("> .siteorigin-widgets-form-id").val();var d=r.find("> .siteorigin-widget-field");d.find("> .siteorigin-widget-section").sowSetupForm(),d.filter(".siteorigin-widget-field-type-widget:not(:has(> .siteorigin-widget-section))").sowSetupForm(),d.find(".siteorigin-widget-input").each(function(i,t){null===e(t).data("original-name")&&e(t).data("original-name",e(t).attr("name"))}),d.find("> .siteorigin-widget-field-repeater").sowSetupRepeater(),r.find(".siteorigin-widget-field-repeater-item").sowSetupRepeaterItems(),d.find("> .siteorigin-widget-input-color").wpColorPicker(),d.find("> .media-field-wrapper").each(function(){var i=e(this),t=i.closest(".siteorigin-widget-field");i.find("a.media-upload-button").click(function(i){if("undefined"!=typeof wp.media){var n=e(this),a=e(this).closest(".siteorigin-widget-field"),r=e(this).data("frame");return r?(r.open(),!1):(r=wp.media({title:n.data("choose"),library:{type:n.data("library").split(",").map(function(e){return e.trim()})},button:{text:n.data("update"),close:!1}}),n.data("frame",r),r.on("select",function(){var e=r.state().get("selection").first().attributes;a.find(".current .title").html(e.title);var i=a.find("input[type=hidden]");i.val(e.id),i.trigger("change"),"undefined"!=typeof e.sizes?"undefined"!=typeof e.sizes.thumbnail?a.find(".current .thumbnail").attr("src",e.sizes.thumbnail.url).fadeIn():a.find(".current .thumbnail").attr("src",e.sizes.full.url).fadeIn():a.find(".current .thumbnail").attr("src",e.icon).fadeIn(),t.find(".media-remove-button").removeClass("remove-hide"),r.close()}),r.open(),!1)}}),i.find(".current").mouseenter(function(){var i=e(this).find(".title");""!==i.html()&&i.fadeIn("fast")}).mouseleave(function(){e(this).find(".title").clearQueue().fadeOut("fast")}),t.find("a.media-remove-button").click(function(i){i.preventDefault(),t.find(".current .title").html(""),t.find("input[type=hidden]").val(""),t.find(".current .thumbnail").fadeOut("fast"),e(this).addClass("remove-hide")})}),d.filter(".siteorigin-widget-field-type-widget, .siteorigin-widget-field-type-section").find("> label").click(function(){e(this);e(this).toggleClass("siteorigin-widget-section-visible"),e(this).siblings(".siteorigin-widget-section").slideToggle(function(){e(window).resize(),e(this).find("> .siteorigin-widget-field-container-state").val(e(this).is(":visible")?"open":"closed")})});var l={};d.filter(".siteorigin-widget-field-type-icon").each(function(){var i=e(this),t=i.find(".siteorigin-widget-icon-selector"),n=t.find(".siteorigin-widget-icon-icon"),a=i.find(".siteorigin-widget-icon-selector-current");a.click(function(){t.slideToggle()});var r=function(){var i=t.find("select.siteorigin-widget-icon-family").val(),r=t.find(".siteorigin-widget-icon-icons");if("undefined"!=typeof l[i]){r.empty(),0===e("#siteorigin-widget-font-"+i).length&&e("<link rel='stylesheet' type='text/css'>").attr("id","siteorigin-widget-font-"+i).attr("href",l[i].style_uri).appendTo("head");for(var s in l[i].icons){var o=e('<div data-sow-icon="'+l[i].icons[s]+'"/>').attr("data-value",i+"-"+s).addClass("sow-icon-"+i).addClass("siteorigin-widget-icon-icons-icon").click(function(){var s=e(this);s.hasClass("siteorigin-widget-active")?(s.removeClass("siteorigin-widget-active"),n.val(""),a.find("span").hide()):(r.find(".siteorigin-widget-icon-icons-icon").removeClass("siteorigin-widget-active"),s.addClass("siteorigin-widget-active"),n.val(s.data("value")),a.find("span").show().attr("data-sow-icon",s.attr("data-sow-icon")).attr("class","").addClass("sow-icon-"+i)),n.trigger("change"),t.slideUp()});r.append(o),n.val()===i+"-"+s&&(o.hasClass("siteorigin-widget-active")||o.click(),o.addClass("siteorigin-widget-active"))}r.prepend(r.find(".siteorigin-widget-active"))}},s=function(){var i=t.find("select.siteorigin-widget-icon-family").val();"undefined"!=typeof i&&""!==i&&("undefined"==typeof l[i]?e.getJSON(soWidgets.ajaxurl,{action:"siteorigin_widgets_get_icons",family:t.find("select.siteorigin-widget-icon-family").val()},function(e){l[i]=e,r()}):r())};s(),t.find("select.siteorigin-widget-icon-family").change(function(){t.find(".siteorigin-widget-icon-icons").empty(),s()})}),d.filter(".siteorigin-widget-field-type-slider").each(function(){var i=e(this),t=i.find('input[type="number"]'),n=i.find(".siteorigin-widget-value-slider");n.slider({max:parseInt(t.attr("max")),min:parseInt(t.attr("min")),value:parseInt(t.val()),slide:function(e,n){t.val(parseInt(n.value)),i.find(".siteorigin-widget-slider-value").html(n.value)}})}),d.filter(".siteorigin-widget-field-type-link").each(function(){var i=e(this),t=null,n=function(){null!==t&&t.abort();var n=i.find(".content-text-search").val(),a=i.find("ul.posts").empty().addClass("loading");e.get(soWidgets.ajaxurl,{action:"so_widgets_search_posts",query:n},function(i){for(var t=0;t<i.length;t++)""===i[t].post_title&&(i[t].post_title="&nbsp;"),a.append(e("<li>").addClass("post").html(i[t].post_title+"<span>("+i[t].post_type+")</span>").data(i[t]));a.removeClass("loading")})};i.find(".select-content-button, .button-close").click(function(t){t.preventDefault(),e(this).blur();var a=i.find(".existing-content-selector");a.toggle(),a.is(":visible")&&0===a.find("ul.posts li").length&&n()}),i.on("click",".posts li",function(t){t.preventDefault();var n=e(this);i.find("input.siteorigin-widget-input").val("post: "+n.data("ID")),i.find(".existing-content-selector").toggle()});var a=null;i.find(".content-text-search").keyup(function(){null!==a&&clearTimeout(a),a=setTimeout(function(){n()},500)})});var f=function(){var i=e(this),t=i.closest("[data-state-emitter]").data("state-emitter");if("undefined"!=typeof t){var a=function(t,n){if("undefined"==typeof sowEmitters[t.callback]||"_"===t.callback.substr(0,1))return n;var a=window.sowForms.getRepeaterId(i);return a!==!1&&(t.args=t.args.map(function(e){return e.replace("{$repeater}",a)})),e.extend(n,sowEmitters[t.callback](i.val(),t.args))},r={"default":""};"undefined"==typeof t.length&&(t=[t]);for(var s=0;s<t.length;s++)r=a(t[s],r);var o=n.data("states");"undefined"==typeof o&&(o={"default":""});for(var d in r)("undefined"==typeof o[d]||r[d]!==o[d])&&(o[d]=r[d],n.trigger("sowstatechange",[d,r[d]]));n.data("states",o)}};d.filter("[data-state-emitter]").each(function(){e(this).find(".siteorigin-widget-input").on("keyup change",f),e(this).find(".siteorigin-widget-input").each(function(){var i=e(this);i.is(":radio")?i.is(":checked")&&f.call(i[0]):f.call(i[0])})}),r.trigger("sowsetupform",d).data("sow-form-setup",!0),r.find(".siteorigin-widget-field-repeater-item").trigger("updateFieldPositions"),s=!1})},e.fn.sowSetupPreview=function(){var i=e(this),t=i.siblings(".siteorigin-widget-preview");t.find("> a").click(function(t){t.preventDefault();var n={};i.find("*[name]").each(function(){var i=e(this),t=/[a-zA-Z0-9\-]+\[[a-zA-Z0-9]+\]\[(.*)\]/.exec(i.attr("name"));if(void 0===t)return!0;t=t[1];var a=t.split("][");a=a.map(function(e){return!isNaN(parseFloat(e))&&isFinite(e)?parseInt(e):e});for(var r=n,s=0;s<a.length;s++)s===a.length-1?"checkbox"===i.attr("type")?r[a[s]]=i.is(":checked")?""!==i.val()?i.val():!0:!1:"radio"===i.attr("type")?i.is(":checked")&&(r[a[s]]=""!==i.val()?i.val():!0):r[a[s]]=i.val():("undefined"==typeof r[a[s]]&&(r[a[s]]={}),r=r[a[s]])});var a=e(e("#so-widgets-bundle-tpl-preview-dialog").html().trim()).appendTo("body");a.find('input[name="data"]').val(JSON.stringify(n)),a.find('input[name="class"]').val(i.data("class")),a.find("iframe").on("load",function(){e(this).css("visibility","visible")}),a.find("form").submit(),a.find(".close").click(function(){a.remove()})})},e.fn.sowSetupRepeater=function(){return e(this).each(function(i,t){var n=e(t),a=n.find(".siteorigin-widget-field-repeater-items"),r=n.data("repeater-name");a.bind("updateFieldPositions",function(){var i=e(this),t=i.find("> .siteorigin-widget-field-repeater-item");t.each(function(i,t){e(t).find(".siteorigin-widget-input").each(function(t,n){var a=e(n).data("repeater-positions");"undefined"==typeof a&&(a={}),a[r]=i,e(n).data("repeater-positions",a)})}),i.find(".siteorigin-widget-input").each(function(i,t){var n=e(t).data("repeater-positions"),a=e(t);if("undefined"!=typeof n){var r=a.data("original-name");if("undefined"==typeof r&&(a.data("original-name",a.attr("name")),r=a.attr("name")),!r)return;for(var s in n)r=r.replace("#"+s+"#",n[s]);e(t).attr("name",r)}});var a=n.data("scroll-count")?parseInt(n.data("scroll-count")):0;if(a>0&&t.length>a){var s=t.first().outerHeight();i.css("max-height",s*a).css("overflow","auto")}else i.css("max-height","").css("overflow","")}),a.sortable({handle:".siteorigin-widget-field-repeater-item-top",items:"> .siteorigin-widget-field-repeater-item",update:function(){a.trigger("updateFieldPositions")}}),a.trigger("updateFieldPositions"),n.find("> .siteorigin-widget-field-repeater-add").disableSelection().click(function(i){i.preventDefault(),n.closest(".siteorigin-widget-field-repeater").sowAddRepeaterItem().find("> .siteorigin-widget-field-repeater-items").slideDown("fast",function(){e(window).resize()})}),n.find("> .siteorigin-widget-field-repeater-top > .siteorigin-widget-field-repeater-expend").click(function(e){e.preventDefault(),n.closest(".siteorigin-widget-field-repeater").find("> .siteorigin-widget-field-repeater-items").slideToggle("fast")})})},e.fn.sowAddRepeaterItem=function(){return e(this).each(function(i,t){var n=e(t),a=n.find("> .siteorigin-widget-field-repeater-items").children().length+1,r=e("<div>"+n.find("> .siteorigin-widget-field-repeater-item-html").html()+"</div>");r.find("[data-name]").each(function(){var i=e(this);0===i.closest(".siteorigin-widget-field-repeater-item-html").length&&i.attr("name",e(this).data("name"))});var s=r.html().replace(/_id_/g,a),o="undefined"!=typeof n.attr("readonly"),d=e('<div class="siteorigin-widget-field-repeater-item ui-draggable" />').append(e('<div class="siteorigin-widget-field-repeater-item-top" />').append(e('<div class="siteorigin-widget-field-expand" />')).append(o?"":e('<div class="siteorigin-widget-field-copy" />')).append(o?"":e('<div class="siteorigin-widget-field-remove" />')).append(e("<h4 />").html(n.data("item-name")))).append(e('<div class="siteorigin-widget-field-repeater-item-form" />').html(s));n.find("> .siteorigin-widget-field-repeater-items").append(d).sortable("refresh").trigger("updateFieldPositions"),d.sowSetupRepeaterItems(),d.hide().slideDown("fast",function(){e(window).resize()})})},e.fn.sowRemoveRepeaterItem=function(){return e(this).each(function(i,t){var n=e(this).closest(".siteorigin-widget-field-repeater-items");e(this).remove(),n.sortable("refresh").trigger("updateFieldPositions")})},e.fn.sowSetupRepeaterItems=function(){return e(this).each(function(i,t){var n=e(t);if("undefined"==typeof n.data("sowrepeater-actions-setup")){var a=n.closest(".siteorigin-widget-field-repeater"),r=n.find("> .siteorigin-widget-field-repeater-item-top"),s=a.data("item-label");if(s&&s.selector){var o=function(){var e=s.hasOwnProperty("valueMethod")&&s.valueMethod?s.valueMethod:"val",i=n.find(s.selector)[e]();i&&(i.length>80&&(i=i.substr(0,79)+"..."),r.find("h4").text(i))};o();var d=s.hasOwnProperty("updateEvent")&&s.updateEvent?s.updateEvent:"change";n.bind(d,o)}r.click(function(i){"siteorigin-widget-field-remove"!==i.target.className&&"siteorigin-widget-field-copy"!==i.target.className&&(i.preventDefault(),e(this).closest(".siteorigin-widget-field-repeater-item").find(".siteorigin-widget-field-repeater-item-form").eq(0).slideToggle("fast",function(){e(this).trigger(e(this).is(":visible")?"slideToggleOpenComplete":"slideToggleCloseComplete")}))}),r.find(".siteorigin-widget-field-remove").click(function(i){if(i.preventDefault(),confirm(soWidgets.sure)){var t=e(this).closest(".siteorigin-widget-field-repeater-items");e(this).closest(".siteorigin-widget-field-repeater-item").slideUp("fast",function(){e(this).remove(),t.sortable("refresh").trigger("updateFieldPositions"),e(window).resize()})}}),r.find(".siteorigin-widget-field-copy").click(function(i){i.preventDefault();var t=e(this).closest(".siteorigin-widget-form-main"),a=e(this).closest(".siteorigin-widget-field-repeater-item"),r=a.clone(),s=a.closest(".siteorigin-widget-field-repeater-items"),o=s.children().length,d={};r.find("*[name]").each(function(){var i=e(this),s=i.attr("id"),l=i.attr("name");if(i.is("textarea")&&i.parent().is(".wp-editor-container")&&"undefined"!=typeof tinymce){i.parent().empty().append(i),i.css("display","");var f=tinymce.get(s);f&&i.val(f.getContent())}else if(i.is(".wp-color-picker")){var c=i.closest(".wp-picker-container"),g=i.closest(".siteorigin-widget-field");c.remove(),g.append(i.remove())}else{var u=a.find('[name="'+l+'"]');u.length&&null!=u.val()&&i.val(u.val())}if(s){var p=s.replace(/-\d+$/,"");d[p]||(d[p]=t.find(".siteorigin-widget-input[id^="+p+"]").not("[id*=_id_]").length+1);var m=p+"-"+d[p]++;i.attr("id",m),r.find("label[for="+s+"]").attr("for",m),r.find("[id*="+s+"]").each(function(){var i=e(this).attr("id"),t=i.replace(s,m);e(this).attr("id",t)}),"undefined"!=typeof tinymce&&tinymce.get(m)&&tinymce.get(m).remove()}var w=a.parents(".siteorigin-widget-field-repeater").length,v=e("body");(v.hasClass("wp-customizer")||v.hasClass("widgets-php"))&&0==n.closest(".panel-dialog").length&&(w+=1);var h=l.replace(new RegExp("((?:.*?\\[\\d+\\]){"+(w-1).toString()+"})?(.*?\\[)\\d+(\\])"),"$1$2"+o.toString()+"$3");i.attr("name",h),i.data("original-name",h)}),s.append(r).sortable("refresh").trigger("updateFieldPositions"),r.sowSetupRepeaterItems(),r.hide().slideDown("fast",function(){e(window).resize()})}),n.find("> .siteorigin-widget-field-repeater-item-form").sowSetupForm(),n.data("sowrepeater-actions-setup",!0)}})};var i={getRepeaterId:function(e){"undefined"==typeof this.id&&(this.id=1);var i=e.closest(".siteorigin-widget-field-repeater-item");if(i.length){var t=i.data("item-id");return void 0===t&&(t=this.id++),i.data("item-id",t),t}return!1},getWidgetFieldVariable:function(e,i,t){var n=window.sow_field_javascript_variables[e];i=i.replace(/\[#.*?#\]/g,"");for(var a=/[a-zA-Z0-9\-]+(?:\[c?[0-9]+\])?\[(.*)\]/.exec(i)[1],r=a.split("]["),s=r.length?n:null;r.length;)s=s[r.shift()];return s[t]},fetchWidgetVariable:function(i,t,n){window.sowVars=window.sowVars||{},"undefined"==typeof window.sowVars[t]?e.post(soWidgets.ajaxurl,{action:"sow_get_javascript_variables",widget:t,key:i},function(e){window.sowVars[t]=e,n(window.sowVars[t][i])}):n(window.sowVars[t][i])}};window.sowForms=i,e(".widgets-holder-wrap").on("click",".widget:has(.siteorigin-widget-form-main) .widget-top",function(){var i=e(this).closest(".widget").find(".siteorigin-widget-form-main");setTimeout(function(){i.sowSetupForm()},200)}),e("body").hasClass("wp-customizer")&&e(document).on("widget-added",function(e,i){i.find(".siteorigin-widget-form").sowSetupForm()}),e(document).on("dialogopen",function(i){e(i.target).find(".siteorigin-widget-form-main").sowSetupForm()}),e(document).trigger("sowadminloaded")}(jQuery);var sowEmitters={_match:function(e,i){"undefined"==typeof i&&(i=".*");var t=new RegExp("^([a-zA-Z0-9_-]+)(\\[([a-zA-Z0-9_-]+)\\])? *: *("+i+") *$"),n=t.exec(e);if(null===n)return!1;var a="",r="default";return void 0!==n[3]?(r=n[1],a=n[3]):a=n[1],{match:n[4].trim(),group:r,state:a}},_checker:function(e,i,t,n){var a={};"undefined"==typeof i.length&&(i=[i]);for(var r,s=0;s<i.length;s++)r=sowEmitters._match(i[s],t),r!==!1&&("_true"===r.match||n(e,i,r.match))&&(a[r.group]=r.state);return a},select:function(e,i){"undefined"==typeof i.length&&(i=[i]);for(var t={},n=0;n<i.length;n++)""===i[n]&&(i[n]="default"),t[i[n]]=e;return t},conditional:function(val,args){return sowEmitters._checker(val,args,"[^;{}]*",function(val,args,match){return eval(match)})},"in":function(e,i){return sowEmitters._checker(e,i,"[^;{}]*",function(e,i,t){return-1!==t.split(",").map(function(e){return e.trim()}).indexOf(e)})}};
1
+ !function(e){e.fn.sowSetupForm=function(){return e(this).each(function(i,t){var n,a,r=e(t),s=!0,o=r.find("input[name]");if(o.length&&-1!==o.attr("name").indexOf("__i__"))return this;if(r.is(".siteorigin-widget-form-main")){if(r.data("sow-form-setup")===!0)return!0;if(e("body").hasClass("widgets-php")&&!r.is(":visible")&&0===r.closest(".panel-dialog").length)return!0;r.on("sowstatechange",function(i,t,n){r.find("[data-state-handler]").each(function(){var i=e(this),a=e.extend({},i.data("state-handler"),s?i.data("state-handler-initial"):{});if(0===Object.keys(a).length)return!0;var r,o,d,l,f,g,c={},u=window.sowForms.getRepeaterId(i);if(u!==!1){var p={};for(var m in a)p[m.replace("{$repeater}",u)]=a[m];a=p}for(var m in a)if(f=!1,r=m.match(/^([a-zA-Z0-9_-]+)(\[([a-zA-Z0-9_\-,]+)\])?(\[\])?$/),null!==r){if(o={group:"default",name:"",multi:!1},void 0!==r[2]?(o.group=r[1],o.name=r[3]):o.name=r[0],o.multi=void 0!==r[4],"_else"===o.group)o.group=o.name,o.name="",f=o.group===t&&"undefined"==typeof c[o.group];else{g=o.name.split(",").map(function(e){return e.trim()});for(var w=0;w<g.length&&!(f=o.group===t&&g[w]===n);w++);}if(f){d=a[m],o.multi||(d=[d]);for(var w=0;w<d.length;w++)l="undefined"!=typeof d[w][1]&&Boolean(d[w][1])?i.find(d[w][1]):i,l[d[w][0]].apply(l,"undefined"!=typeof d[w][2]?d[w][2]:[]);c[o.group]=!0}}})}),r.sowSetupPreview(),n=r}else n=r.closest(".siteorigin-widget-form-main");a=n.find("> .siteorigin-widgets-form-id").val();var d=r.find("> .siteorigin-widget-field");d.find("> .siteorigin-widget-section").sowSetupForm(),d.filter(".siteorigin-widget-field-type-widget:not(:has(> .siteorigin-widget-section))").sowSetupForm(),d.find(".siteorigin-widget-input").each(function(i,t){null===e(t).data("original-name")&&e(t).data("original-name",e(t).attr("name"))}),d.find("> .siteorigin-widget-field-repeater").sowSetupRepeater(),r.find(".siteorigin-widget-field-repeater-item").sowSetupRepeaterItems(),d.find("> .siteorigin-widget-input-color").wpColorPicker(),d.find("> .media-field-wrapper").each(function(){var i=e(this),t=i.closest(".siteorigin-widget-field");i.find("a.media-upload-button").click(function(i){if("undefined"!=typeof wp.media){var n=e(this),a=e(this).closest(".siteorigin-widget-field"),r=e(this).data("frame");return r?(r.open(),!1):(r=wp.media({title:n.data("choose"),library:{type:n.data("library").split(",").map(function(e){return e.trim()})},button:{text:n.data("update"),close:!1}}),n.data("frame",r),r.on("select",function(){var e=r.state().get("selection").first().attributes;a.find(".current .title").html(e.title);var i=a.find("input[type=hidden]");i.val(e.id),i.trigger("change"),"undefined"!=typeof e.sizes?"undefined"!=typeof e.sizes.thumbnail?a.find(".current .thumbnail").attr("src",e.sizes.thumbnail.url).fadeIn():a.find(".current .thumbnail").attr("src",e.sizes.full.url).fadeIn():a.find(".current .thumbnail").attr("src",e.icon).fadeIn(),t.find(".media-remove-button").removeClass("remove-hide"),r.close()}),r.open(),!1)}}),i.find(".current").mouseenter(function(){var i=e(this).find(".title");""!==i.html()&&i.fadeIn("fast")}).mouseleave(function(){e(this).find(".title").clearQueue().fadeOut("fast")}),t.find("a.media-remove-button").click(function(i){i.preventDefault(),t.find(".current .title").html(""),t.find("input[type=hidden]").val(""),t.find(".current .thumbnail").fadeOut("fast"),e(this).addClass("remove-hide")})}),d.filter(".siteorigin-widget-field-type-widget, .siteorigin-widget-field-type-section").find("> label").click(function(){e(this);e(this).toggleClass("siteorigin-widget-section-visible"),e(this).siblings(".siteorigin-widget-section").slideToggle(function(){e(window).resize(),e(this).find("> .siteorigin-widget-field-container-state").val(e(this).is(":visible")?"open":"closed")})});var l={};d.filter(".siteorigin-widget-field-type-icon").each(function(){var i=e(this),t=i.find(".siteorigin-widget-icon-selector"),n=t.find(".siteorigin-widget-icon-icon"),a=i.find(".siteorigin-widget-icon-selector-current");a.click(function(){t.slideToggle()});var r=function(){var i=t.find("select.siteorigin-widget-icon-family").val(),r=t.find(".siteorigin-widget-icon-icons");if("undefined"!=typeof l[i]){r.empty(),0===e("#siteorigin-widget-font-"+i).length&&e("<link rel='stylesheet' type='text/css'>").attr("id","siteorigin-widget-font-"+i).attr("href",l[i].style_uri).appendTo("head");for(var s in l[i].icons){var o=e('<div data-sow-icon="'+l[i].icons[s]+'"/>').attr("data-value",i+"-"+s).addClass("sow-icon-"+i).addClass("siteorigin-widget-icon-icons-icon").click(function(){var s=e(this);s.hasClass("siteorigin-widget-active")?(s.removeClass("siteorigin-widget-active"),n.val(""),a.find("span").hide()):(r.find(".siteorigin-widget-icon-icons-icon").removeClass("siteorigin-widget-active"),s.addClass("siteorigin-widget-active"),n.val(s.data("value")),a.find("span").show().attr("data-sow-icon",s.attr("data-sow-icon")).attr("class","").addClass("sow-icon-"+i)),n.trigger("change"),t.slideUp()});r.append(o),n.val()===i+"-"+s&&(o.hasClass("siteorigin-widget-active")||o.click(),o.addClass("siteorigin-widget-active"))}r.prepend(r.find(".siteorigin-widget-active"))}},s=function(){var i=t.find("select.siteorigin-widget-icon-family").val();"undefined"!=typeof i&&""!==i&&("undefined"==typeof l[i]?e.getJSON(soWidgets.ajaxurl,{action:"siteorigin_widgets_get_icons",family:t.find("select.siteorigin-widget-icon-family").val()},function(e){l[i]=e,r()}):r())};s(),t.find("select.siteorigin-widget-icon-family").change(function(){t.find(".siteorigin-widget-icon-icons").empty(),s()})}),d.filter(".siteorigin-widget-field-type-slider").each(function(){var i=e(this),t=i.find('input[type="number"]'),n=i.find(".siteorigin-widget-value-slider");n.slider({max:parseInt(t.attr("max")),min:parseInt(t.attr("min")),value:parseInt(t.val()),slide:function(e,n){t.val(parseInt(n.value)),i.find(".siteorigin-widget-slider-value").html(n.value)}})}),d.filter(".siteorigin-widget-field-type-link").each(function(){var i=e(this),t=null,n=function(){null!==t&&t.abort();var n=i.find(".content-text-search").val(),a=i.find("ul.posts").empty().addClass("loading");e.get(soWidgets.ajaxurl,{action:"so_widgets_search_posts",query:n},function(i){for(var t=0;t<i.length;t++)""===i[t].post_title&&(i[t].post_title="&nbsp;"),a.append(e("<li>").addClass("post").html(i[t].post_title+"<span>("+i[t].post_type+")</span>").data(i[t]));a.removeClass("loading")})};i.find(".select-content-button, .button-close").click(function(t){t.preventDefault(),e(this).blur();var a=i.find(".existing-content-selector");a.toggle(),a.is(":visible")&&0===a.find("ul.posts li").length&&n()}),i.on("click",".posts li",function(t){t.preventDefault();var n=e(this);i.find("input.siteorigin-widget-input").val("post: "+n.data("ID")),i.find(".existing-content-selector").toggle()});var a=null;i.find(".content-text-search").keyup(function(){null!==a&&clearTimeout(a),a=setTimeout(function(){n()},500)})});var f=function(){var i=e(this),t=i.closest("[data-state-emitter]").data("state-emitter");if("undefined"!=typeof t){var a=function(t,n){if("undefined"==typeof sowEmitters[t.callback]||"_"===t.callback.substr(0,1))return n;var a=window.sowForms.getRepeaterId(i);return a!==!1&&(t.args=t.args.map(function(e){return e.replace("{$repeater}",a)})),e.extend(n,sowEmitters[t.callback](i.val(),t.args))},r={"default":""};"undefined"==typeof t.length&&(t=[t]);for(var s=0;s<t.length;s++)r=a(t[s],r);var o=n.data("states");"undefined"==typeof o&&(o={"default":""});for(var d in r)("undefined"==typeof o[d]||r[d]!==o[d])&&(o[d]=r[d],n.trigger("sowstatechange",[d,r[d]]));n.data("states",o)}};d.filter("[data-state-emitter]").each(function(){e(this).find(".siteorigin-widget-input").on("keyup change",f),e(this).find(".siteorigin-widget-input").each(function(){var i=e(this);i.is(":radio")?i.is(":checked")&&f.call(i[0]):f.call(i[0])})}),r.trigger("sowsetupform",d).data("sow-form-setup",!0),r.find(".siteorigin-widget-field-repeater-item").trigger("updateFieldPositions"),s=!1})},e.fn.sowSetupPreview=function(){var i=e(this),t=i.siblings(".siteorigin-widget-preview");t.find("> a").click(function(t){t.preventDefault();var n={};i.find("*[name]").each(function(){var i=e(this),t=/[a-zA-Z0-9\-]+\[[a-zA-Z0-9]+\]\[(.*)\]/.exec(i.attr("name"));if(void 0===t)return!0;t=t[1];var a=t.split("][");a=a.map(function(e){return!isNaN(parseFloat(e))&&isFinite(e)?parseInt(e):e});for(var r=n,s=0;s<a.length;s++)s===a.length-1?"checkbox"===i.attr("type")?i.is(":checked")?r[a[s]]=""!==i.val()?i.val():!0:r[a[s]]=!1:"radio"===i.attr("type")?i.is(":checked")&&(r[a[s]]=""!==i.val()?i.val():!0):r[a[s]]=i.val():("undefined"==typeof r[a[s]]&&(r[a[s]]={}),r=r[a[s]])});var a=e(e("#so-widgets-bundle-tpl-preview-dialog").html().trim()).appendTo("body");a.find('input[name="data"]').val(JSON.stringify(n)),a.find('input[name="class"]').val(i.data("class")),a.find("iframe").on("load",function(){e(this).css("visibility","visible")}),a.find("form").submit(),a.find(".close").click(function(){a.remove()})})},e.fn.sowSetupRepeater=function(){return e(this).each(function(i,t){var n=e(t),a=n.find(".siteorigin-widget-field-repeater-items"),r=n.data("repeater-name");a.bind("updateFieldPositions",function(){var i=e(this),t=i.find("> .siteorigin-widget-field-repeater-item");t.each(function(i,t){e(t).find(".siteorigin-widget-input").each(function(t,n){var a=e(n).data("repeater-positions");"undefined"==typeof a&&(a={}),a[r]=i,e(n).data("repeater-positions",a)})}),i.find(".siteorigin-widget-input").each(function(i,t){var n=e(t).data("repeater-positions"),a=e(t);if("undefined"!=typeof n){var r=a.data("original-name");if("undefined"==typeof r&&(a.data("original-name",a.attr("name")),r=a.attr("name")),!r)return;for(var s in n)r=r.replace("#"+s+"#",n[s]);e(t).attr("name",r)}});var a=n.data("scroll-count")?parseInt(n.data("scroll-count")):0;if(a>0&&t.length>a){var s=t.first().outerHeight();i.css("max-height",s*a).css("overflow","auto")}else i.css("max-height","").css("overflow","")}),a.sortable({handle:".siteorigin-widget-field-repeater-item-top",items:"> .siteorigin-widget-field-repeater-item",update:function(){a.trigger("updateFieldPositions")}}),a.trigger("updateFieldPositions"),n.find("> .siteorigin-widget-field-repeater-add").disableSelection().click(function(i){i.preventDefault(),n.closest(".siteorigin-widget-field-repeater").sowAddRepeaterItem().find("> .siteorigin-widget-field-repeater-items").slideDown("fast",function(){e(window).resize()})}),n.find("> .siteorigin-widget-field-repeater-top > .siteorigin-widget-field-repeater-expend").click(function(e){e.preventDefault(),n.closest(".siteorigin-widget-field-repeater").find("> .siteorigin-widget-field-repeater-items").slideToggle("fast")})})},e.fn.sowAddRepeaterItem=function(){return e(this).each(function(i,t){var n=e(t),a=n.find("> .siteorigin-widget-field-repeater-items").children().length+1,r=e("<div>"+n.find("> .siteorigin-widget-field-repeater-item-html").html()+"</div>");r.find("[data-name]").each(function(){var i=e(this);0===i.closest(".siteorigin-widget-field-repeater-item-html").length&&i.attr("name",e(this).data("name"))});var s=r.html().replace(/_id_/g,a),o="undefined"!=typeof n.attr("readonly"),d=e('<div class="siteorigin-widget-field-repeater-item ui-draggable" />').append(e('<div class="siteorigin-widget-field-repeater-item-top" />').append(e('<div class="siteorigin-widget-field-expand" />')).append(o?"":e('<div class="siteorigin-widget-field-copy" />')).append(o?"":e('<div class="siteorigin-widget-field-remove" />')).append(e("<h4 />").html(n.data("item-name")))).append(e('<div class="siteorigin-widget-field-repeater-item-form" />').html(s));n.find("> .siteorigin-widget-field-repeater-items").append(d).sortable("refresh").trigger("updateFieldPositions"),d.sowSetupRepeaterItems(),d.hide().slideDown("fast",function(){e(window).resize()})})},e.fn.sowRemoveRepeaterItem=function(){return e(this).each(function(i,t){var n=e(this).closest(".siteorigin-widget-field-repeater-items");e(this).remove(),n.sortable("refresh").trigger("updateFieldPositions")})},e.fn.sowSetupRepeaterItems=function(){return e(this).each(function(i,t){var n=e(t);if("undefined"==typeof n.data("sowrepeater-actions-setup")){var a=n.closest(".siteorigin-widget-field-repeater"),r=n.find("> .siteorigin-widget-field-repeater-item-top"),s=a.data("item-label");if(s&&s.selector){var o=function(){var e=s.hasOwnProperty("valueMethod")&&s.valueMethod?s.valueMethod:"val",i=n.find(s.selector)[e]();i&&(i.length>80&&(i=i.substr(0,79)+"..."),r.find("h4").text(i))};o();var d=s.hasOwnProperty("updateEvent")&&s.updateEvent?s.updateEvent:"change";n.bind(d,o)}r.click(function(i){"siteorigin-widget-field-remove"!==i.target.className&&"siteorigin-widget-field-copy"!==i.target.className&&(i.preventDefault(),e(this).closest(".siteorigin-widget-field-repeater-item").find(".siteorigin-widget-field-repeater-item-form").eq(0).slideToggle("fast",function(){e(this).is(":visible")?e(this).trigger("slideToggleOpenComplete"):e(this).trigger("slideToggleCloseComplete")}))}),r.find(".siteorigin-widget-field-remove").click(function(i){if(i.preventDefault(),confirm(soWidgets.sure)){var t=e(this).closest(".siteorigin-widget-field-repeater-items");e(this).closest(".siteorigin-widget-field-repeater-item").slideUp("fast",function(){e(this).remove(),t.sortable("refresh").trigger("updateFieldPositions"),e(window).resize()})}}),r.find(".siteorigin-widget-field-copy").click(function(i){i.preventDefault();var t=e(this).closest(".siteorigin-widget-form-main"),a=e(this).closest(".siteorigin-widget-field-repeater-item"),r=a.clone(),s=a.closest(".siteorigin-widget-field-repeater-items"),o=s.children().length,d={};r.find("*[name]").each(function(){var i=e(this),s=i.attr("id"),l=i.attr("name");if(i.is("textarea")&&i.parent().is(".wp-editor-container")&&"undefined"!=typeof tinymce){i.parent().empty().append(i),i.css("display","");var f=tinymce.get(s);f&&i.val(f.getContent())}else if(i.is(".wp-color-picker")){var g=i.closest(".wp-picker-container"),c=i.closest(".siteorigin-widget-field");g.remove(),c.append(i.remove())}else{var u=a.find('[name="'+l+'"]');u.length&&null!=u.val()&&i.val(u.val())}if(s){var p=s.replace(/-\d+$/,"");d[p]||(d[p]=t.find(".siteorigin-widget-input[id^="+p+"]").not("[id*=_id_]").length+1);var m=p+"-"+d[p]++;i.attr("id",m),r.find("label[for="+s+"]").attr("for",m),r.find("[id*="+s+"]").each(function(){var i=e(this).attr("id"),t=i.replace(s,m);e(this).attr("id",t)}),"undefined"!=typeof tinymce&&tinymce.get(m)&&tinymce.get(m).remove()}var w=a.parents(".siteorigin-widget-field-repeater").length,v=e("body");(v.hasClass("wp-customizer")||v.hasClass("widgets-php"))&&0==n.closest(".panel-dialog").length&&(w+=1);var h=l.replace(new RegExp("((?:.*?\\[\\d+\\]){"+(w-1).toString()+"})?(.*?\\[)\\d+(\\])"),"$1$2"+o.toString()+"$3");i.attr("name",h),i.data("original-name",h)}),s.append(r).sortable("refresh").trigger("updateFieldPositions"),r.sowSetupRepeaterItems(),r.hide().slideDown("fast",function(){e(window).resize()})}),n.find("> .siteorigin-widget-field-repeater-item-form").sowSetupForm(),n.data("sowrepeater-actions-setup",!0)}})};var i={getRepeaterId:function(e){"undefined"==typeof this.id&&(this.id=1);var i=e.closest(".siteorigin-widget-field-repeater-item");if(i.length){var t=i.data("item-id");return void 0===t&&(t=this.id++),i.data("item-id",t),t}return!1},getWidgetFieldVariable:function(e,i,t){var n=window.sow_field_javascript_variables[e];i=i.replace(/\[#.*?#\]/g,"");for(var a=/[a-zA-Z0-9\-]+(?:\[c?[0-9]+\])?\[(.*)\]/.exec(i)[1],r=a.split("]["),s=r.length?n:null;r.length;)s=s[r.shift()];return s[t]},fetchWidgetVariable:function(i,t,n){window.sowVars=window.sowVars||{},"undefined"==typeof window.sowVars[t]?e.post(soWidgets.ajaxurl,{action:"sow_get_javascript_variables",widget:t,key:i},function(e){window.sowVars[t]=e,n(window.sowVars[t][i])}):n(window.sowVars[t][i])}};window.sowForms=i,e(".widgets-holder-wrap").on("click",".widget:has(.siteorigin-widget-form-main) .widget-top",function(){var i=e(this).closest(".widget").find(".siteorigin-widget-form-main");setTimeout(function(){i.sowSetupForm()},200)}),e("body").hasClass("wp-customizer")&&e(document).on("widget-added",function(e,i){i.find(".siteorigin-widget-form").sowSetupForm()}),e(document).on("dialogopen",function(i){e(i.target).find(".siteorigin-widget-form-main").sowSetupForm()}),e(document).trigger("sowadminloaded")}(jQuery);var sowEmitters={_match:function(e,i){"undefined"==typeof i&&(i=".*");var t=new RegExp("^([a-zA-Z0-9_-]+)(\\[([a-zA-Z0-9_-]+)\\])? *: *("+i+") *$"),n=t.exec(e);if(null===n)return!1;var a="",r="default";return void 0!==n[3]?(r=n[1],a=n[3]):a=n[1],{match:n[4].trim(),group:r,state:a}},_checker:function(e,i,t,n){var a={};"undefined"==typeof i.length&&(i=[i]);for(var r,s=0;s<i.length;s++)r=sowEmitters._match(i[s],t),r!==!1&&("_true"===r.match||n(e,i,r.match))&&(a[r.group]=r.state);return a},select:function(e,i){"undefined"==typeof i.length&&(i=[i]);for(var t={},n=0;n<i.length;n++)""===i[n]&&(i[n]="default"),t[i[n]]=e;return t},conditional:function(val,args){return sowEmitters._checker(val,args,"[^;{}]*",function(val,args,match){return eval(match)})},"in":function(e,i){return sowEmitters._checker(e,i,"[^;{}]*",function(e,i,t){return-1!==t.split(",").map(function(e){return e.trim()}).indexOf(e)})}};
base/js/meta-box-manager.min.js CHANGED
@@ -1 +1 @@
1
- !function(t){t("#publish").click(function(e){var a={},i=t("#siteorigin-widgets-meta-box");i.find("*[name]").each(function(){var e=t(this),i=/[a-zA-Z0-9\-]+\[[a-zA-Z0-9]+\]\[(.*)\]/.exec(e.attr("name"));if(i){i=i[1];var n=i.split("][");n=n.map(function(t){return!isNaN(parseFloat(t))&&isFinite(t)?parseInt(t):t});for(var r=a,c=0;c<n.length;c++)c===n.length-1?"checkbox"===e.attr("type")?r[n[c]]=e.is(":checked")?""!==e.val()?e.val():!0:!1:"radio"===e.attr("type")?e.is(":checked")&&(r[n[c]]=""!==e.val()?e.val():!0):r[n[c]]=e.val():("undefined"==typeof r[n[c]]&&(r[n[c]]={}),r=r[n[c]])}}),i.find('input[name="widget_post_meta"]').val(JSON.stringify(a))})}(jQuery);
1
+ !function(t){t("#publish").click(function(e){var a={},i=t("#siteorigin-widgets-meta-box");i.find("*[name]").each(function(){var e=t(this),i=/[a-zA-Z0-9\-]+\[[a-zA-Z0-9]+\]\[(.*)\]/.exec(e.attr("name"));if(i){i=i[1];var n=i.split("][");n=n.map(function(t){return!isNaN(parseFloat(t))&&isFinite(t)?parseInt(t):t});for(var r=a,c=0;c<n.length;c++)c===n.length-1?"checkbox"===e.attr("type")?e.is(":checked")?r[n[c]]=""!==e.val()?e.val():!0:r[n[c]]=!1:"radio"===e.attr("type")?e.is(":checked")&&(r[n[c]]=""!==e.val()?e.val():!0):r[n[c]]=e.val():("undefined"==typeof r[n[c]]&&(r[n[c]]={}),r=r[n[c]])}}),i.find('input[name="widget_post_meta"]').val(JSON.stringify(a))})}(jQuery);
base/js/posts-selector.min.js CHANGED
@@ -1 +1 @@
1
- var soWidgetPostSelector=function(e,t){var s,i,o,n,r,l,d,a;s=self.Post=Backbone.Model.extend({title:null,thumbnail:null,id:null}),i=self.PostCollection=Backbone.Collection.extend({model:s,foundPosts:null,updateWithQuery:function(t){if(""!==t){var s=this;e.post(sowPostsSelectorTpl.ajaxurl,{action:"sow_get_posts",query:t,ignore_pagination:!0},function(e){s.foundPosts=e.found_posts,s.reset(e.posts)})}}}),l=self.Query=Backbone.Model.extend({query:null,syncField:null,post_type:null,terms:null,post_status:null,posts_per_page:null,post__in:null,tax_query:null,orderby:null,order:null,sticky:null,defaults:{post_type:"post",orderby:"post_date",order:"DESC",posts_per_page:"",post_status:"publish",sticky:""},initialize:function(e,t){this.set(this.parseQuery(e.query))},getQuery:function(){var e=[];return"undefined"!=typeof this.get("post_type")&&e.push("post_type="+this.get("post_type")),"undefined"==typeof this.get("post__in")||t.isEmpty(this.get("post__in"))||e.push("post__in="+this.get("post__in").join(",")),"undefined"==typeof this.get("tax_query")||t.isEmpty(this.get("tax_query"))||e.push("tax_query="+this.get("tax_query").join(",")),"undefined"!=typeof this.get("orderby")&&e.push("orderby="+this.get("orderby")),"undefined"!=typeof this.get("order")&&e.push("order="+this.get("order")),"undefined"!=typeof this.get("posts_per_page")&&e.push("posts_per_page="+this.get("posts_per_page")),"undefined"!=typeof this.get("sticky")&&e.push("sticky="+this.get("sticky")),"undefined"!=typeof this.get("additional")&&e.push("additional="+this.get("additional")),e.join("&")},setQuery:function(e){return this.set(this.parseQuery(e)),this},parseQuery:function(e){for(var t,s=/([^&=]+)=?([^&]*)/g,i=/\+/g,o=function(e){return decodeURIComponent(e.replace(i," "))},n={};t=s.exec(e);){var r=o(t[1]),l=o(t[2]);"[]"===r.substring(r.length-2)?(r=r.substring(0,r.length-2),(n[r]||(n[r]=[])).push(l)):n[r]=l}var d={};return n.hasOwnProperty("post_type")&&(d.post_type=n.post_type),n.hasOwnProperty("post__in")&&(d.post__in=n.post__in.split(",")),n.hasOwnProperty("tax_query")&&(d.tax_query=n.tax_query.split(",")),n.hasOwnProperty("orderby")&&(d.orderby=n.orderby),n.hasOwnProperty("order")&&(d.order=n.order),n.hasOwnProperty("posts_per_page")&&(d.posts_per_page=n.posts_per_page),n.hasOwnProperty("sticky")&&(d.sticky=n.sticky),n.hasOwnProperty("additional")&&(d.additional=n.additional),d.query=e,d},sync:function(e,t){if("create"===e){var s=this.syncField.val(),i=this.getQuery();s!==i&&(this.syncField.val(i),this.syncField.trigger("change"))}else this.setQuery(this.syncField.val())},setSyncField:function(e){this.syncField=e}}),a=self.QueryBuilder=Backbone.View.extend({attached:!1,rendered:!1,views:{},activeView:null,events:{"click .media-modal-backdrop, .media-modal-close":"escapeHandler","click .media-toolbar-primary .button":"buttonHandler"},initialize:function(){this.listenTo(this.model,"change",this.queryModelChange);var e=new i;this.views.postSummary=new o({posts:e,el:this.el}),this.views.postSummary.builder=this,this.views.postSummary.posts.updateWithQuery(this.model.getQuery()),this.addSubView("form",new d({el:this.el,model:this.model})),this.addSubView("postsView",new n({el:this.el,posts:e})),this.addSubView("postsSelect",new r({el:this.el,model:this.model})),this.views.form.bind("buttonHandler",this.close,this)},changeModel:function(e){this.model=e,this.render()},render:function(){return this.$el.html(sowPostsSelectorTpl.modal),this.$el.find(".media-toolbar-primary .button").html(this.views[this.activeView].buttonText),this.$el.find(".media-frame-title h1").html(this.views[this.activeView].modalTitle),this.rendered=!0,"postsSelect"!==this.activeView&&this.views.postSummary.render(),this.views[this.activeView].render(),this},close:function(){return this.$el.hide(),this.trigger("close"),this.model.save(),this},open:function(){this.show(),this.setActiveView("form"),this.trigger("open"),this.model.fetch()},save:function(){this.close(),this.model.save(),this.trigger("save")},attach:function(){return this.rendered||this.render(),this.attached||(this.$el.appendTo("body"),this.attached=!0),this},show:function(){this.attach(),this.$el.is(":visible")||this.$el.show()},escapeHandler:function(e){e.preventDefault(),this.close()},buttonHandler:function(e){e.preventDefault(),this.views[this.activeView].buttonHandler().trigger("buttonHandler")},addSubView:function(e,t){this.views[e]=t,t.builder=this,null===this.activeView&&(this.activeView=e)},setActiveView:function(e){this.activeView=e,this.render()},queryModelChange:function(){this.views.postSummary.posts.updateWithQuery(this.model.getQuery())}}),d=self.QueryForm=Backbone.View.extend({buttonText:"Save Query",modalTitle:"Build Posts Query",form:null,initialize:function(e){},render:function(){var t=this;this.form=e('<div class="query-builder-form>"></div>'),this.form.append('<div class="query-builder-form-field">'+sowPostsSelectorTpl.fields.post_type+"</div>"),"undefined"!=typeof this.model.get("post_type")&&this.form.find('select[name="post_type"]').val(this.model.get("post_type")),this.form.append('<div class="query-builder-form-field">'+sowPostsSelectorTpl.fields.post__in+"</div>"),"undefined"!=typeof this.model.get("post__in")&&this.form.find('input[name="post__in"]').val(this.model.get("post__in").join(",")),this.form.append('<div class="query-builder-form-field ui-front">'+sowPostsSelectorTpl.fields.tax_query+"</div>"),"undefined"!=typeof this.model.get("tax_query")&&this.form.find('input[name="tax_query"]').val(this.model.get("tax_query")),this.form.append(e('<div class="query-builder-form-field">'+sowPostsSelectorTpl.fields.orderby+"</div>").disableSelection()),"undefined"!=typeof this.model.get("orderby")&&this.form.find('select[name="orderby"]').val(this.model.get("orderby")),"undefined"!=typeof this.model.get("order")&&this.form.find('input[name="order"]').val(this.model.get("order")),this.form.append('<div class="query-builder-form-field">'+sowPostsSelectorTpl.fields.posts_per_page+"</div>"),"undefined"!=typeof this.model.get("posts_per_page")&&this.form.find('input[name="posts_per_page"]').val(this.model.get("posts_per_page")),this.form.append('<div class="query-builder-form-field">'+sowPostsSelectorTpl.fields.sticky+"</div>"),"undefined"!=typeof this.model.get("sticky")&&this.form.find('select[name="sticky"]').val(this.model.get("sticky")),this.form.append('<div class="query-builder-form-field">'+sowPostsSelectorTpl.fields.additional+"</div>"),"undefined"!=typeof this.model.get("additional")&&this.form.find('input[name="additional"]').val(this.model.get("additional"));var s=this.form.find('input[name="order"]'),i=s.closest(".query-builder-form-field").find(".sow-order-button"),o=function(){"DESC"===s.val()?(i.removeClass("sow-order-button-asc"),i.addClass("sow-order-button-desc")):(i.addClass("sow-order-button-asc"),i.removeClass("sow-order-button-desc"))};return o(),i.click(function(e){return e.preventDefault(),s.val("DESC"===s.val()?"ASC":"DESC"),o(),t.updateModel(),!1}),this.$el.find(".query-builder-content").empty().append(this.form),this.$el.find(".query-builder-form-field select, .query-builder-form-field input").change(function(){t.updateModel()}),this.$el.find(".query-builder-form-field .sow-select-posts").click(function(e){e.preventDefault(),t.builder.setActiveView("postsSelect")}),this.form.find('input[name="tax_query"]').autocomplete({source:function(t,s){e.getJSON(sowPostsSelectorTpl.ajaxurl,{term:t.term.split(/,\s*/).pop(),action:"sow_search_terms"},s)},search:function(){var e=this.value.split(/,\s*/).pop();return e.length<1?!1:void 0},focus:function(){return!1},select:function(e,s){var i=this.value.split(/,\s*/);return i.pop(),i.push(s.item.value),i.push(""),this.value=i.join(", "),t.updateModel(),!1}}),this},updateModel:function(){if(this.model.set("post_type",this.$el.find('*[name="post_type"]').val()),""!==this.$el.find('*[name="post__in"]').val().trim()?this.model.set("post__in",this.$el.find('*[name="post__in"]').val().split(",").map(function(e){return Number(e.trim())})):this.model.set("post__in",[]),""!==this.$el.find('*[name="tax_query"]').val().trim()){var e=this.$el.find('*[name="tax_query"]').val().split(",").map(function(e){return e.trim()});this.model.set("tax_query",t.compact(e))}else this.model.set("tax_query",[]);return this.model.set("orderby",this.$el.find('*[name="orderby"]').val()),this.model.set("order",this.$el.find('*[name="order"]').val()),this.model.set("posts_per_page",this.$el.find('*[name="posts_per_page"]').val()),this.model.set("sticky",this.$el.find('*[name="sticky"]').val()),this.model.set("additional",this.$el.find('*[name="additional"]').val()),this.model.set("query",this.model.getQuery()),this},buttonHandler:function(){return this.updateModel(),this}}),o=self.PostCollectionSummaryView=Backbone.View.extend({template:t.template(sowPostsSelectorTpl.foundPosts),posts:null,initialize:function(e){this.posts=e.posts,this.posts.bind("reset",this.render,this)},render:function(){this.$el.find(".media-toolbar-secondary").html(this.template({foundPosts:this.posts.foundPosts}));var e=this;this.$el.find(".media-toolbar-secondary .preview-query-posts").click(function(t){t.preventDefault(),e.builder.setActiveView("postsView")})}}),n=self.PostCollectionView=Backbone.View.extend({buttonText:"Back",modalTitle:"Current Posts",template:t.template(sowPostsSelectorTpl.postSummary),posts:null,initialize:function(e){this.posts=e.posts},render:function(){var e=this.$el.find(".query-builder-content").empty().append('<div class="sow-current-posts"></div>').find(".sow-current-posts");e=this.$el.find(".query-builder-content");var t=this.template;return this.posts.each(function(s){e.append(t(s.attributes))}),this},buttonHandler:function(){return this.builder.setActiveView("form"),this}}),r=self.PostSelectView=Backbone.View.extend({buttonText:"Finish Selection",modalTitle:"Select Posts",sortable:null,postCache:{},postTemplate:t.template(sowPostsSelectorTpl.postSummary),initialize:function(){this.postCache={}},render:function(){var t=this.model.get("post__in"),s=this.model.get("post_type");this.$el.find(".query-builder-content").empty().html(sowPostsSelectorTpl.selector),this.sortable=this.$el.find(".query-builder-content #sow-post-selector .sow-posts-sortable").sortable({placeholder:"ui-state-highlight",forcePlaceholderSize:!0,items:"> .sow-post-selector-summary"}),this.addPosts(t);var i=this,o=this.$el.find(".query-builder-content #sow-post-selector .sow-search-field");return o.autocomplete({source:function(t,i){t.type=s,t.action="sow_search_posts",e.get(sowPostsSelectorTpl.ajaxurl,t,i)},minLength:0,select:function(t,s){return t.preventDefault(),e(this).val(""),i.addPosts([s.item.value]),!1}}),o.focusin(function(){o.autocomplete("search",o.val())}),this.$el.find(".query-builder-content").on("click",".sow-remove",function(t){t.preventDefault();var s=e(this);s.closest(".sow-post-selector-summary").fadeOut("fast",function(){e(this).remove(),i.sortable.sortable("refresh")})}),this},addPosts:function(s){if("undefined"!=typeof s&&!t.isEmpty(s)){for(var i=[],o=0;o<s.length;o++)"undefined"==typeof this.postCache[s[o]]&&i.push(s[o]);var n=this;t.isEmpty(i)||e.post(sowPostsSelectorTpl.ajaxurl,{action:"sow_get_posts",query:"post_type=_all&posts_per_page=-1&post__in="+i.join(",")},function(e){console.log(e),"undefined"!=typeof e.posts&&t.each(e.posts,function(e,t){n.postCache[e.id]={id:e.id,title:e.title,thumbnail:e.thumbnail,editUrl:e.editUrl}}),n.refreshLoading()});for(var r,o=0;o<s.length;o++)r="undefined"==typeof this.postCache[s[o]]?e(this.postTemplate({id:s[o],title:"",thumbnail:"",editUrl:"#"})).addClass("sow-post-loading"):e(this.postTemplate(this.postCache[s[o]])),r.appendTo(this.sortable);return this.sortable.sortable("refresh"),this}},refreshLoading:function(){var t=this;this.sortable.find(".sow-post-selector-summary.sow-post-loading").each(function(){var s=e(this),i=s.data("id");if("undefined"!=typeof t.postCache[i]){s.removeClass("sow-post-loading");var o=e(t.postTemplate(t.postCache[i]));s.html(o.html())}})},buttonHandler:function(){var s=[];return this.sortable.find(".sow-post-selector-summary").each(function(){s.push(Number(e(this).data("id")))}),this.model.set("post__in",s),t.isEmpty(s)||(this.model.set("post_type","_all"),this.model.set("orderby","post__in")),this.builder.setActiveView("form"),this}});var u=new a({model:new l({query:""})});jQuery(function(e){e("body").on("click",".sow-select-posts",function(t){t.preventDefault();var s=e(this);u.model.setSyncField(s.siblings(".siteorigin-widget-input")),u.model.sync("update"),u.views.postSummary.posts.on("reset",function(e){s.find(".sow-current-count").text(e.foundPosts)}),u.open()})})}(jQuery,_);
1
+ var soWidgetPostSelector=function(e,t){var s,i,o,n,r,l,d,a;s=self.Post=Backbone.Model.extend({title:null,thumbnail:null,id:null}),i=self.PostCollection=Backbone.Collection.extend({model:s,foundPosts:null,updateWithQuery:function(t){if(""!==t){var s=this;e.post(sowPostsSelectorTpl.ajaxurl,{action:"sow_get_posts",query:t,ignore_pagination:!0},function(e){s.foundPosts=e.found_posts,s.reset(e.posts)})}}}),l=self.Query=Backbone.Model.extend({query:null,syncField:null,post_type:null,terms:null,post_status:null,posts_per_page:null,post__in:null,tax_query:null,orderby:null,order:null,sticky:null,defaults:{post_type:"post",orderby:"post_date",order:"DESC",posts_per_page:"",post_status:"publish",sticky:""},initialize:function(e,t){this.set(this.parseQuery(e.query))},getQuery:function(){var e=[];return"undefined"!=typeof this.get("post_type")&&e.push("post_type="+this.get("post_type")),"undefined"==typeof this.get("post__in")||t.isEmpty(this.get("post__in"))||e.push("post__in="+this.get("post__in").join(",")),"undefined"==typeof this.get("tax_query")||t.isEmpty(this.get("tax_query"))||e.push("tax_query="+this.get("tax_query").join(",")),"undefined"!=typeof this.get("orderby")&&e.push("orderby="+this.get("orderby")),"undefined"!=typeof this.get("order")&&e.push("order="+this.get("order")),"undefined"!=typeof this.get("posts_per_page")&&e.push("posts_per_page="+this.get("posts_per_page")),"undefined"!=typeof this.get("sticky")&&e.push("sticky="+this.get("sticky")),"undefined"!=typeof this.get("additional")&&e.push("additional="+this.get("additional")),e.join("&")},setQuery:function(e){return this.set(this.parseQuery(e)),this},parseQuery:function(e){for(var t,s=/([^&=]+)=?([^&]*)/g,i=/\+/g,o=function(e){return decodeURIComponent(e.replace(i," "))},n={};t=s.exec(e);){var r=o(t[1]),l=o(t[2]);"[]"===r.substring(r.length-2)?(r=r.substring(0,r.length-2),(n[r]||(n[r]=[])).push(l)):n[r]=l}var d={};return n.hasOwnProperty("post_type")&&(d.post_type=n.post_type),n.hasOwnProperty("post__in")&&(d.post__in=n.post__in.split(",")),n.hasOwnProperty("tax_query")&&(d.tax_query=n.tax_query.split(",")),n.hasOwnProperty("orderby")&&(d.orderby=n.orderby),n.hasOwnProperty("order")&&(d.order=n.order),n.hasOwnProperty("posts_per_page")&&(d.posts_per_page=n.posts_per_page),n.hasOwnProperty("sticky")&&(d.sticky=n.sticky),n.hasOwnProperty("additional")&&(d.additional=n.additional),d.query=e,d},sync:function(e,t){if("create"===e){var s=this.syncField.val(),i=this.getQuery();s!==i&&(this.syncField.val(i),this.syncField.trigger("change"))}else this.setQuery(this.syncField.val())},setSyncField:function(e){this.syncField=e}}),a=self.QueryBuilder=Backbone.View.extend({attached:!1,rendered:!1,views:{},activeView:null,events:{"click .media-modal-backdrop, .media-modal-close":"escapeHandler","click .media-toolbar-primary .button":"buttonHandler"},initialize:function(){this.listenTo(this.model,"change",this.queryModelChange);var e=new i;this.views.postSummary=new o({posts:e,el:this.el}),this.views.postSummary.builder=this,this.views.postSummary.posts.updateWithQuery(this.model.getQuery()),this.addSubView("form",new d({el:this.el,model:this.model})),this.addSubView("postsView",new n({el:this.el,posts:e})),this.addSubView("postsSelect",new r({el:this.el,model:this.model})),this.views.form.bind("buttonHandler",this.close,this)},changeModel:function(e){this.model=e,this.render()},render:function(){return this.$el.html(sowPostsSelectorTpl.modal),this.$el.find(".media-toolbar-primary .button").html(this.views[this.activeView].buttonText),this.$el.find(".media-frame-title h1").html(this.views[this.activeView].modalTitle),this.rendered=!0,"postsSelect"!==this.activeView&&this.views.postSummary.render(),this.views[this.activeView].render(),this},close:function(){return this.$el.hide(),this.trigger("close"),this.model.save(),this},open:function(){this.show(),this.setActiveView("form"),this.trigger("open"),this.model.fetch()},save:function(){this.close(),this.model.save(),this.trigger("save")},attach:function(){return this.rendered||this.render(),this.attached||(this.$el.appendTo("body"),this.attached=!0),this},show:function(){this.attach(),this.$el.is(":visible")||this.$el.show()},escapeHandler:function(e){e.preventDefault(),this.close()},buttonHandler:function(e){e.preventDefault(),this.views[this.activeView].buttonHandler().trigger("buttonHandler")},addSubView:function(e,t){this.views[e]=t,t.builder=this,null===this.activeView&&(this.activeView=e)},setActiveView:function(e){this.activeView=e,this.render()},queryModelChange:function(){this.views.postSummary.posts.updateWithQuery(this.model.getQuery())}}),d=self.QueryForm=Backbone.View.extend({buttonText:"Save Query",modalTitle:"Build Posts Query",form:null,initialize:function(e){},render:function(){var t=this;this.form=e('<div class="query-builder-form>"></div>'),this.form.append('<div class="query-builder-form-field">'+sowPostsSelectorTpl.fields.post_type+"</div>"),"undefined"!=typeof this.model.get("post_type")&&this.form.find('select[name="post_type"]').val(this.model.get("post_type")),this.form.append('<div class="query-builder-form-field">'+sowPostsSelectorTpl.fields.post__in+"</div>"),"undefined"!=typeof this.model.get("post__in")&&this.form.find('input[name="post__in"]').val(this.model.get("post__in").join(",")),this.form.append('<div class="query-builder-form-field ui-front">'+sowPostsSelectorTpl.fields.tax_query+"</div>"),"undefined"!=typeof this.model.get("tax_query")&&this.form.find('input[name="tax_query"]').val(this.model.get("tax_query")),this.form.append(e('<div class="query-builder-form-field">'+sowPostsSelectorTpl.fields.orderby+"</div>").disableSelection()),"undefined"!=typeof this.model.get("orderby")&&this.form.find('select[name="orderby"]').val(this.model.get("orderby")),"undefined"!=typeof this.model.get("order")&&this.form.find('input[name="order"]').val(this.model.get("order")),this.form.append('<div class="query-builder-form-field">'+sowPostsSelectorTpl.fields.posts_per_page+"</div>"),"undefined"!=typeof this.model.get("posts_per_page")&&this.form.find('input[name="posts_per_page"]').val(this.model.get("posts_per_page")),this.form.append('<div class="query-builder-form-field">'+sowPostsSelectorTpl.fields.sticky+"</div>"),"undefined"!=typeof this.model.get("sticky")&&this.form.find('select[name="sticky"]').val(this.model.get("sticky")),this.form.append('<div class="query-builder-form-field">'+sowPostsSelectorTpl.fields.additional+"</div>"),"undefined"!=typeof this.model.get("additional")&&this.form.find('input[name="additional"]').val(this.model.get("additional"));var s=this.form.find('input[name="order"]'),i=s.closest(".query-builder-form-field").find(".sow-order-button"),o=function(){"DESC"===s.val()?(i.removeClass("sow-order-button-asc"),i.addClass("sow-order-button-desc")):(i.addClass("sow-order-button-asc"),i.removeClass("sow-order-button-desc"))};return o(),i.click(function(e){return e.preventDefault(),"DESC"===s.val()?s.val("ASC"):s.val("DESC"),o(),t.updateModel(),!1}),this.$el.find(".query-builder-content").empty().append(this.form),this.$el.find(".query-builder-form-field select, .query-builder-form-field input").change(function(){t.updateModel()}),this.$el.find(".query-builder-form-field .sow-select-posts").click(function(e){e.preventDefault(),t.builder.setActiveView("postsSelect")}),this.form.find('input[name="tax_query"]').autocomplete({source:function(t,s){e.getJSON(sowPostsSelectorTpl.ajaxurl,{term:t.term.split(/,\s*/).pop(),action:"sow_search_terms"},s)},search:function(){var e=this.value.split(/,\s*/).pop();return e.length<1?!1:void 0},focus:function(){return!1},select:function(e,s){var i=this.value.split(/,\s*/);return i.pop(),i.push(s.item.value),i.push(""),this.value=i.join(", "),t.updateModel(),!1}}),this},updateModel:function(){if(this.model.set("post_type",this.$el.find('*[name="post_type"]').val()),""!==this.$el.find('*[name="post__in"]').val().trim()?this.model.set("post__in",this.$el.find('*[name="post__in"]').val().split(",").map(function(e){return Number(e.trim())})):this.model.set("post__in",[]),""!==this.$el.find('*[name="tax_query"]').val().trim()){var e=this.$el.find('*[name="tax_query"]').val().split(",").map(function(e){return e.trim()});this.model.set("tax_query",t.compact(e))}else this.model.set("tax_query",[]);return this.model.set("orderby",this.$el.find('*[name="orderby"]').val()),this.model.set("order",this.$el.find('*[name="order"]').val()),this.model.set("posts_per_page",this.$el.find('*[name="posts_per_page"]').val()),this.model.set("sticky",this.$el.find('*[name="sticky"]').val()),this.model.set("additional",this.$el.find('*[name="additional"]').val()),this.model.set("query",this.model.getQuery()),this},buttonHandler:function(){return this.updateModel(),this}}),o=self.PostCollectionSummaryView=Backbone.View.extend({template:t.template(sowPostsSelectorTpl.foundPosts),posts:null,initialize:function(e){this.posts=e.posts,this.posts.bind("reset",this.render,this)},render:function(){this.$el.find(".media-toolbar-secondary").html(this.template({foundPosts:this.posts.foundPosts}));var e=this;this.$el.find(".media-toolbar-secondary .preview-query-posts").click(function(t){t.preventDefault(),e.builder.setActiveView("postsView")})}}),n=self.PostCollectionView=Backbone.View.extend({buttonText:"Back",modalTitle:"Current Posts",template:t.template(sowPostsSelectorTpl.postSummary),posts:null,initialize:function(e){this.posts=e.posts},render:function(){var e=this.$el.find(".query-builder-content").empty().append('<div class="sow-current-posts"></div>').find(".sow-current-posts");e=this.$el.find(".query-builder-content");var t=this.template;return this.posts.each(function(s){e.append(t(s.attributes))}),this},buttonHandler:function(){return this.builder.setActiveView("form"),this}}),r=self.PostSelectView=Backbone.View.extend({buttonText:"Finish Selection",modalTitle:"Select Posts",sortable:null,postCache:{},postTemplate:t.template(sowPostsSelectorTpl.postSummary),initialize:function(){this.postCache={}},render:function(){var t=this.model.get("post__in"),s=this.model.get("post_type");this.$el.find(".query-builder-content").empty().html(sowPostsSelectorTpl.selector),this.sortable=this.$el.find(".query-builder-content #sow-post-selector .sow-posts-sortable").sortable({placeholder:"ui-state-highlight",forcePlaceholderSize:!0,items:"> .sow-post-selector-summary"}),this.addPosts(t);var i=this,o=this.$el.find(".query-builder-content #sow-post-selector .sow-search-field");return o.autocomplete({source:function(t,i){t.type=s,t.action="sow_search_posts",e.get(sowPostsSelectorTpl.ajaxurl,t,i)},minLength:0,select:function(t,s){return t.preventDefault(),e(this).val(""),i.addPosts([s.item.value]),!1}}),o.focusin(function(){o.autocomplete("search",o.val())}),this.$el.find(".query-builder-content").on("click",".sow-remove",function(t){t.preventDefault();var s=e(this);s.closest(".sow-post-selector-summary").fadeOut("fast",function(){e(this).remove(),i.sortable.sortable("refresh")})}),this},addPosts:function(s){if("undefined"!=typeof s&&!t.isEmpty(s)){for(var i=[],o=0;o<s.length;o++)"undefined"==typeof this.postCache[s[o]]&&i.push(s[o]);var n=this;t.isEmpty(i)||e.post(sowPostsSelectorTpl.ajaxurl,{action:"sow_get_posts",query:"post_type=_all&posts_per_page=-1&post__in="+i.join(",")},function(e){console.log(e),"undefined"!=typeof e.posts&&t.each(e.posts,function(e,t){n.postCache[e.id]={id:e.id,title:e.title,thumbnail:e.thumbnail,editUrl:e.editUrl}}),n.refreshLoading()});for(var r,o=0;o<s.length;o++)r="undefined"==typeof this.postCache[s[o]]?e(this.postTemplate({id:s[o],title:"",thumbnail:"",editUrl:"#"})).addClass("sow-post-loading"):e(this.postTemplate(this.postCache[s[o]])),r.appendTo(this.sortable);return this.sortable.sortable("refresh"),this}},refreshLoading:function(){var t=this;this.sortable.find(".sow-post-selector-summary.sow-post-loading").each(function(){var s=e(this),i=s.data("id");if("undefined"!=typeof t.postCache[i]){s.removeClass("sow-post-loading");var o=e(t.postTemplate(t.postCache[i]));s.html(o.html())}})},buttonHandler:function(){var s=[];return this.sortable.find(".sow-post-selector-summary").each(function(){s.push(Number(e(this).data("id")))}),this.model.set("post__in",s),t.isEmpty(s)||(this.model.set("post_type","_all"),this.model.set("orderby","post__in")),this.builder.setActiveView("form"),this}});var u=new a({model:new l({query:""})});jQuery(function(e){e("body").on("click",".sow-select-posts",function(t){t.preventDefault();var s=e(this);u.model.setSyncField(s.siblings(".siteorigin-widget-input")),u.model.sync("update"),u.views.postSummary.posts.on("reset",function(e){s.find(".sow-current-count").text(e.foundPosts)}),u.open()})})}(jQuery,_);
base/siteorigin-widget.class.php CHANGED
@@ -327,18 +327,18 @@ abstract class SiteOrigin_Widget extends WP_Widget {
327
  <input type="hidden" name="<?php echo $this->get_field_name('_sow_form_id') ?>" value="<?php echo esc_attr( $instance['_sow_form_id'] ) ?>" class="siteorigin-widgets-form-id" />
328
  </div>
329
  <div class="siteorigin-widget-form-no-styles">
330
- <p><strong><?php _e('This widget has scripts and styles that need to be loaded before you can use it. Please save and reload your current page.', 'siteorigin-widgets') ?></strong></p>
331
- <p><strong><?php _e('You will only need to do this once.', 'siteorigin-widgets') ?></strong></p>
332
  </div>
333
 
334
  <?php if( $this->widget_options['has_preview'] && ! $this->is_customize_preview() ) : ?>
335
  <div class="siteorigin-widget-preview" style="display: none">
336
- <a href="#" class="siteorigin-widget-preview-button button-secondary"><?php _e('Preview', 'siteorigin-widgets') ?></a>
337
  </div>
338
  <?php endif; ?>
339
 
340
  <?php if( !empty( $this->widget_options['help'] ) ) : ?>
341
- <a href="<?php echo sow_esc_url($this->widget_options['help']) ?>" class="siteorigin-widget-help-link siteorigin-panels-help-link" target="_blank"><?php _e('Help', 'siteorigin-widgets') ?></a>
342
  <?php endif; ?>
343
 
344
  <script type="text/javascript">
@@ -407,7 +407,7 @@ abstract class SiteOrigin_Widget extends WP_Widget {
407
  <div class="siteorigin-widgets-preview-modal-overlay"></div>
408
 
409
  <div class="so-widget-toolbar">
410
- <h3><?php _e('Widget Preview', 'siteorigin-widgets') ?></h3>
411
  <div class="close"><span class="dashicons dashicons-arrow-left-alt2"></span></div>
412
  </div>
413
 
@@ -698,6 +698,47 @@ abstract class SiteOrigin_Widget extends WP_Widget {
698
  return call_user_func( array($this, $func), $this->current_instance, $args );
699
  }
700
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
701
  /**
702
  * Utility function to get a field name for a widget field.
703
  *
327
  <input type="hidden" name="<?php echo $this->get_field_name('_sow_form_id') ?>" value="<?php echo esc_attr( $instance['_sow_form_id'] ) ?>" class="siteorigin-widgets-form-id" />
328
  </div>
329
  <div class="siteorigin-widget-form-no-styles">
330
+ <p><strong><?php _e('This widget has scripts and styles that need to be loaded before you can use it. Please save and reload your current page.', 'so-widgets-bundle') ?></strong></p>
331
+ <p><strong><?php _e('You will only need to do this once.', 'so-widgets-bundle') ?></strong></p>
332
  </div>
333
 
334
  <?php if( $this->widget_options['has_preview'] && ! $this->is_customize_preview() ) : ?>
335
  <div class="siteorigin-widget-preview" style="display: none">
336
+ <a href="#" class="siteorigin-widget-preview-button button-secondary"><?php _e('Preview', 'so-widgets-bundle') ?></a>
337
  </div>
338
  <?php endif; ?>
339
 
340
  <?php if( !empty( $this->widget_options['help'] ) ) : ?>
341
+ <a href="<?php echo sow_esc_url($this->widget_options['help']) ?>" class="siteorigin-widget-help-link siteorigin-panels-help-link" target="_blank"><?php _e('Help', 'so-widgets-bundle') ?></a>
342
  <?php endif; ?>
343
 
344
  <script type="text/javascript">
407
  <div class="siteorigin-widgets-preview-modal-overlay"></div>
408
 
409
  <div class="so-widget-toolbar">
410
+ <h3><?php _e('Widget Preview', 'so-widgets-bundle') ?></h3>
411
  <div class="close"><span class="dashicons dashicons-arrow-left-alt2"></span></div>
412
  </div>
413
 
698
  return call_user_func( array($this, $func), $this->current_instance, $args );
699
  }
700
 
701
+ /**
702
+ * Less function for importing Google web fonts.
703
+ *
704
+ * @param $instance
705
+ * @param $args
706
+ *
707
+ * @return string
708
+ */
709
+ function less_import_google_font($instance, $args) {
710
+ if( empty( $instance ) ) return;
711
+
712
+ $fonts = $this->get_google_font_fields($instance);
713
+ $font_imports = array();
714
+
715
+ foreach ( $fonts as $font ) {
716
+ $font_imports[] = siteorigin_widget_get_font( $font );
717
+ }
718
+
719
+ $import_strings = array();
720
+ foreach( $font_imports as $import ) {
721
+ $import_strings[] = !empty($import['css_import']) ? $import['css_import'] : '';
722
+ }
723
+
724
+ // Remove empty and duplicate items from the array
725
+ $import_strings = array_filter($import_strings);
726
+ $import_strings = array_unique($import_strings);
727
+
728
+ return implode("\n", $import_strings);
729
+ }
730
+
731
+ /**
732
+ * Get any font fields which may be used by this widget.
733
+ *
734
+ * @param $instance
735
+ *
736
+ * @return array
737
+ */
738
+ function get_google_font_fields( $instance ) {
739
+ return array();
740
+ }
741
+
742
  /**
743
  * Utility function to get a field name for a widget field.
744
  *
js/jquery.cycle.min.js CHANGED
@@ -1 +1 @@
1
- !function(e){"use strict";function t(e){return(e||"").toLowerCase()}var i="2.1.6";e.fn.cycle=function(i){var n;return 0!==this.length||e.isReady?this.each(function(){var n,s,o,c,l=e(this),r=e.fn.cycle.log;if(!l.data("cycle.opts")){(l.data("cycle-log")===!1||i&&i.log===!1||s&&s.log===!1)&&(r=e.noop),r("--c2 init--"),n=l.data();for(var a in n)n.hasOwnProperty(a)&&/^cycle[A-Z]+/.test(a)&&(c=n[a],o=a.match(/^cycle(.*)/)[1].replace(/^[A-Z]/,t),r(o+":",c,"("+typeof c+")"),n[o]=c);s=e.extend({},e.fn.cycle.defaults,n,i||{}),s.timeoutId=0,s.paused=s.paused||!1,s.container=l,s._maxZ=s.maxZ,s.API=e.extend({_container:l},e.fn.cycle.API),s.API.log=r,s.API.trigger=function(e,t){return s.container.trigger(e,t),s.API},l.data("cycle.opts",s),l.data("cycle.API",s.API),s.API.trigger("cycle-bootstrap",[s,s.API]),s.API.addInitialSlides(),s.API.preInitSlideshow(),s.slides.length&&s.API.initSlideshow()}}):(n={s:this.selector,c:this.context},e.fn.cycle.log("requeuing slideshow (dom not ready)"),e(function(){e(n.s,n.c).cycle(i)}),this)},e.fn.cycle.API={opts:function(){return this._container.data("cycle.opts")},addInitialSlides:function(){var t=this.opts(),i=t.slides;t.slideCount=0,t.slides=e(),i=i.jquery?i:t.container.find(i),t.random&&i.sort(function(){return Math.random()-.5}),t.API.add(i)},preInitSlideshow:function(){var t=this.opts();t.API.trigger("cycle-pre-initialize",[t]);var i=e.fn.cycle.transitions[t.fx];i&&e.isFunction(i.preInit)&&i.preInit(t),t._preInitialized=!0},postInitSlideshow:function(){var t=this.opts();t.API.trigger("cycle-post-initialize",[t]);var i=e.fn.cycle.transitions[t.fx];i&&e.isFunction(i.postInit)&&i.postInit(t)},initSlideshow:function(){var t,i=this.opts(),n=i.container;i.API.calcFirstSlide(),"static"==i.container.css("position")&&i.container.css("position","relative"),e(i.slides[i.currSlide]).css({opacity:1,display:"block",visibility:"visible"}),i.API.stackSlides(i.slides[i.currSlide],i.slides[i.nextSlide],!i.reverse),i.pauseOnHover&&(i.pauseOnHover!==!0&&(n=e(i.pauseOnHover)),n.hover(function(){i.API.pause(!0)},function(){i.API.resume(!0)})),i.timeout&&(t=i.API.getSlideOpts(i.currSlide),i.API.queueTransition(t,t.timeout+i.delay)),i._initialized=!0,i.API.updateView(!0),i.API.trigger("cycle-initialized",[i]),i.API.postInitSlideshow()},pause:function(t){var i=this.opts(),n=i.API.getSlideOpts(),s=i.hoverPaused||i.paused;t?i.hoverPaused=!0:i.paused=!0,s||(i.container.addClass("cycle-paused"),i.API.trigger("cycle-paused",[i]).log("cycle-paused"),n.timeout&&(clearTimeout(i.timeoutId),i.timeoutId=0,i._remainingTimeout-=e.now()-i._lastQueue,(i._remainingTimeout<0||isNaN(i._remainingTimeout))&&(i._remainingTimeout=void 0)))},resume:function(e){var t=this.opts(),i=!t.hoverPaused&&!t.paused;e?t.hoverPaused=!1:t.paused=!1,i||(t.container.removeClass("cycle-paused"),0===t.slides.filter(":animated").length&&t.API.queueTransition(t.API.getSlideOpts(),t._remainingTimeout),t.API.trigger("cycle-resumed",[t,t._remainingTimeout]).log("cycle-resumed"))},add:function(t,i){var n,s=this.opts(),o=s.slideCount,c=!1;"string"==e.type(t)&&(t=e.trim(t)),e(t).each(function(t){var n,o=e(this);i?s.container.prepend(o):s.container.append(o),s.slideCount++,n=s.API.buildSlideOpts(o),s.slides=i?e(o).add(s.slides):s.slides.add(o),s.API.initSlide(n,o,--s._maxZ),o.data("cycle.opts",n),s.API.trigger("cycle-slide-added",[s,n,o])}),s.API.updateView(!0),c=s._preInitialized&&2>o&&s.slideCount>=1,c&&(s._initialized?s.timeout&&(n=s.slides.length,s.nextSlide=s.reverse?n-1:1,s.timeoutId||s.API.queueTransition(s)):s.API.initSlideshow())},calcFirstSlide:function(){var e,t=this.opts();e=parseInt(t.startingSlide||0,10),(e>=t.slides.length||0>e)&&(e=0),t.currSlide=e,t.reverse?(t.nextSlide=e-1,t.nextSlide<0&&(t.nextSlide=t.slides.length-1)):(t.nextSlide=e+1,t.nextSlide==t.slides.length&&(t.nextSlide=0))},calcNextSlide:function(){var e,t=this.opts();t.reverse?(e=t.nextSlide-1<0,t.nextSlide=e?t.slideCount-1:t.nextSlide-1,t.currSlide=e?0:t.nextSlide+1):(e=t.nextSlide+1==t.slides.length,t.nextSlide=e?0:t.nextSlide+1,t.currSlide=e?t.slides.length-1:t.nextSlide-1)},calcTx:function(t,i){var n,s=t;return s._tempFx?n=e.fn.cycle.transitions[s._tempFx]:i&&s.manualFx&&(n=e.fn.cycle.transitions[s.manualFx]),n||(n=e.fn.cycle.transitions[s.fx]),s._tempFx=null,this.opts()._tempFx=null,n||(n=e.fn.cycle.transitions.fade,s.API.log('Transition "'+s.fx+'" not found. Using fade.')),n},prepareTx:function(e,t){var i,n,s,o,c,l=this.opts();return l.slideCount<2?void(l.timeoutId=0):(!e||l.busy&&!l.manualTrump||(l.API.stopTransition(),l.busy=!1,clearTimeout(l.timeoutId),l.timeoutId=0),void(l.busy||(0!==l.timeoutId||e)&&(n=l.slides[l.currSlide],s=l.slides[l.nextSlide],o=l.API.getSlideOpts(l.nextSlide),c=l.API.calcTx(o,e),l._tx=c,e&&void 0!==o.manualSpeed&&(o.speed=o.manualSpeed),l.nextSlide!=l.currSlide&&(e||!l.paused&&!l.hoverPaused&&l.timeout)?(l.API.trigger("cycle-before",[o,n,s,t]),c.before&&c.before(o,n,s,t),i=function(){l.busy=!1,l.container.data("cycle.opts")&&(c.after&&c.after(o,n,s,t),l.API.trigger("cycle-after",[o,n,s,t]),l.API.queueTransition(o),l.API.updateView(!0))},l.busy=!0,c.transition?c.transition(o,n,s,t,i):l.API.doTransition(o,n,s,t,i),l.API.calcNextSlide(),l.API.updateView()):l.API.queueTransition(o))))},doTransition:function(t,i,n,s,o){var c=t,l=e(i),r=e(n),a=function(){r.animate(c.animIn||{opacity:1},c.speed,c.easeIn||c.easing,o)};r.css(c.cssBefore||{}),l.animate(c.animOut||{},c.speed,c.easeOut||c.easing,function(){l.css(c.cssAfter||{}),c.sync||a()}),c.sync&&a()},queueTransition:function(t,i){var n=this.opts(),s=void 0!==i?i:t.timeout;return 0===n.nextSlide&&0===--n.loop?(n.API.log("terminating; loop=0"),n.timeout=0,s?setTimeout(function(){n.API.trigger("cycle-finished",[n])},s):n.API.trigger("cycle-finished",[n]),void(n.nextSlide=n.currSlide)):void 0!==n.continueAuto&&(n.continueAuto===!1||e.isFunction(n.continueAuto)&&n.continueAuto()===!1)?(n.API.log("terminating automatic transitions"),n.timeout=0,void(n.timeoutId&&clearTimeout(n.timeoutId))):void(s&&(n._lastQueue=e.now(),void 0===i&&(n._remainingTimeout=t.timeout),n.paused||n.hoverPaused||(n.timeoutId=setTimeout(function(){n.API.prepareTx(!1,!n.reverse)},s))))},stopTransition:function(){var e=this.opts();e.slides.filter(":animated").length&&(e.slides.stop(!1,!0),e.API.trigger("cycle-transition-stopped",[e])),e._tx&&e._tx.stopTransition&&e._tx.stopTransition(e)},advanceSlide:function(e){var t=this.opts();return clearTimeout(t.timeoutId),t.timeoutId=0,t.nextSlide=t.currSlide+e,t.nextSlide<0?t.nextSlide=t.slides.length-1:t.nextSlide>=t.slides.length&&(t.nextSlide=0),t.API.prepareTx(!0,e>=0),!1},buildSlideOpts:function(i){var n,s,o=this.opts(),c=i.data()||{};for(var l in c)c.hasOwnProperty(l)&&/^cycle[A-Z]+/.test(l)&&(n=c[l],s=l.match(/^cycle(.*)/)[1].replace(/^[A-Z]/,t),o.API.log("["+(o.slideCount-1)+"]",s+":",n,"("+typeof n+")"),c[s]=n);c=e.extend({},e.fn.cycle.defaults,o,c),c.slideNum=o.slideCount;try{delete c.API,delete c.slideCount,delete c.currSlide,delete c.nextSlide,delete c.slides}catch(r){}return c},getSlideOpts:function(t){var i=this.opts();void 0===t&&(t=i.currSlide);var n=i.slides[t],s=e(n).data("cycle.opts");return e.extend({},i,s)},initSlide:function(t,i,n){var s=this.opts();i.css(t.slideCss||{}),n>0&&i.css("zIndex",n),isNaN(t.speed)&&(t.speed=e.fx.speeds[t.speed]||e.fx.speeds._default),t.sync||(t.speed=t.speed/2),i.addClass(s.slideClass)},updateView:function(e,t,i){var n=this.opts();if(n._initialized){var s=n.API.getSlideOpts(),o=n.slides[n.currSlide];!e&&t!==!0&&(n.API.trigger("cycle-update-view-before",[n,s,o]),n.updateView<0)||(n.slideActiveClass&&n.slides.removeClass(n.slideActiveClass).eq(n.currSlide).addClass(n.slideActiveClass),e&&n.hideNonActive&&n.slides.filter(":not(."+n.slideActiveClass+")").css("visibility","hidden"),0===n.updateView&&setTimeout(function(){n.API.trigger("cycle-update-view",[n,s,o,e])},s.speed/(n.sync?2:1)),0!==n.updateView&&n.API.trigger("cycle-update-view",[n,s,o,e]),e&&n.API.trigger("cycle-update-view-after",[n,s,o]))}},getComponent:function(t){var i=this.opts(),n=i[t];return"string"==typeof n?/^\s*[\>|\+|~]/.test(n)?i.container.find(n):e(n):n.jquery?n:e(n)},stackSlides:function(t,i,n){var s=this.opts();t||(t=s.slides[s.currSlide],i=s.slides[s.nextSlide],n=!s.reverse),e(t).css("zIndex",s.maxZ);var o,c=s.maxZ-2,l=s.slideCount;if(n){for(o=s.currSlide+1;l>o;o++)e(s.slides[o]).css("zIndex",c--);for(o=0;o<s.currSlide;o++)e(s.slides[o]).css("zIndex",c--)}else{for(o=s.currSlide-1;o>=0;o--)e(s.slides[o]).css("zIndex",c--);for(o=l-1;o>s.currSlide;o--)e(s.slides[o]).css("zIndex",c--)}e(i).css("zIndex",s.maxZ-1)},getSlideIndex:function(e){return this.opts().slides.index(e)}},e.fn.cycle.log=function(){window.console&&console.log&&console.log("[cycle2] "+Array.prototype.join.call(arguments," "))},e.fn.cycle.version=function(){return"Cycle2: "+i},e.fn.cycle.transitions={custom:{},none:{before:function(e,t,i,n){e.API.stackSlides(i,t,n),e.cssBefore={opacity:1,visibility:"visible",display:"block"}}},fade:{before:function(t,i,n,s){var o=t.API.getSlideOpts(t.nextSlide).slideCss||{};t.API.stackSlides(i,n,s),t.cssBefore=e.extend(o,{opacity:0,visibility:"visible",display:"block"}),t.animIn={opacity:1},t.animOut={opacity:0}}},fadeout:{before:function(t,i,n,s){var o=t.API.getSlideOpts(t.nextSlide).slideCss||{};t.API.stackSlides(i,n,s),t.cssBefore=e.extend(o,{opacity:1,visibility:"visible",display:"block"}),t.animOut={opacity:0}}},scrollHorz:{before:function(e,t,i,n){e.API.stackSlides(t,i,n);var s=e.container.css("overflow","hidden").width();e.cssBefore={left:n?s:-s,top:0,opacity:1,visibility:"visible",display:"block"},e.cssAfter={zIndex:e._maxZ-2,left:0},e.animIn={left:0},e.animOut={left:n?-s:s}}}},e.fn.cycle.defaults={allowWrap:!0,autoSelector:".cycle-slideshow[data-cycle-auto-init!=false]",delay:0,easing:null,fx:"fade",hideNonActive:!0,loop:0,manualFx:void 0,manualSpeed:void 0,manualTrump:!0,maxZ:100,pauseOnHover:!1,reverse:!1,slideActiveClass:"cycle-slide-active",slideClass:"cycle-slide",slideCss:{position:"absolute",top:0,left:0},slides:"> img",speed:500,startingSlide:0,sync:!0,timeout:4e3,updateView:0},e(document).ready(function(){e(e.fn.cycle.defaults.autoSelector).cycle()})}(jQuery),function(e){"use strict";function t(t,n){var s,o,c,l=n.autoHeight;if("container"==l)o=e(n.slides[n.currSlide]).outerHeight(),n.container.height(o);else if(n._autoHeightRatio)n.container.height(n.container.width()/n._autoHeightRatio);else if("calc"===l||"number"==e.type(l)&&l>=0){if(c="calc"===l?i(t,n):l>=n.slides.length?0:l,c==n._sentinelIndex)return;n._sentinelIndex=c,n._sentinel&&n._sentinel.remove(),s=e(n.slides[c].cloneNode(!0)),s.removeAttr("id name rel").find("[id],[name],[rel]").removeAttr("id name rel"),s.css({position:"static",visibility:"hidden",display:"block"}).prependTo(n.container).addClass("cycle-sentinel cycle-slide").removeClass("cycle-slide-active"),s.find("*").css("visibility","hidden"),n._sentinel=s}}function i(t,i){var n=0,s=-1;return i.slides.each(function(t){var i=e(this).height();i>s&&(s=i,n=t)}),n}function n(t,i,n,s,o){var c=e(s).outerHeight();i.container.animate({height:c},i.autoHeightSpeed,i.autoHeightEasing)}function s(i,o){o._autoHeightOnResize&&(e(window).off("resize orientationchange",o._autoHeightOnResize),o._autoHeightOnResize=null),o.container.off("cycle-slide-added cycle-slide-removed",t),o.container.off("cycle-destroyed",s),o.container.off("cycle-before",n),o._sentinel&&(o._sentinel.remove(),o._sentinel=null)}e.extend(e.fn.cycle.defaults,{autoHeight:0,autoHeightSpeed:250,autoHeightEasing:null}),e(document).on("cycle-initialized",function(i,o){function c(){t(i,o)}var l,r=o.autoHeight,a=e.type(r),d=null;("string"===a||"number"===a)&&(o.container.on("cycle-slide-added cycle-slide-removed",t),o.container.on("cycle-destroyed",s),"container"==r?o.container.on("cycle-before",n):"string"===a&&/\d+\:\d+/.test(r)&&(l=r.match(/(\d+)\:(\d+)/),l=l[1]/l[2],o._autoHeightRatio=l),"number"!==a&&(o._autoHeightOnResize=function(){clearTimeout(d),d=setTimeout(c,50)},e(window).on("resize orientationchange",o._autoHeightOnResize)),setTimeout(c,30))})}(jQuery),function(e){"use strict";e.extend(e.fn.cycle.defaults,{caption:"> .cycle-caption",captionTemplate:"{{slideNum}} / {{slideCount}}",overlay:"> .cycle-overlay",overlayTemplate:"<div>{{title}}</div><div>{{desc}}</div>",captionModule:"caption"}),e(document).on("cycle-update-view",function(t,i,n,s){if("caption"===i.captionModule){e.each(["caption","overlay"],function(){var e=this,t=n[e+"Template"],o=i.API.getComponent(e);o.length&&t?(o.html(i.API.tmpl(t,n,i,s)),o.show()):o.hide()})}}),e(document).on("cycle-destroyed",function(t,i){var n;e.each(["caption","overlay"],function(){var e=this,t=i[e+"Template"];i[e]&&t&&(n=i.API.getComponent("caption"),n.empty())})})}(jQuery),function(e){"use strict";var t=e.fn.cycle;e.fn.cycle=function(i){var n,s,o,c=e.makeArray(arguments);return"number"==e.type(i)?this.cycle("goto",i):"string"==e.type(i)?this.each(function(){var l;return n=i,o=e(this).data("cycle.opts"),void 0===o?void t.log('slideshow must be initialized before sending commands; "'+n+'" ignored'):(n="goto"==n?"jump":n,s=o.API[n],e.isFunction(s)?(l=e.makeArray(c),l.shift(),s.apply(o.API,l)):void t.log("unknown command: ",n))}):t.apply(this,arguments)},e.extend(e.fn.cycle,t),e.extend(t.API,{next:function(){var e=this.opts();if(!e.busy||e.manualTrump){var t=e.reverse?-1:1;e.allowWrap===!1&&e.currSlide+t>=e.slideCount||(e.API.advanceSlide(t),e.API.trigger("cycle-next",[e]).log("cycle-next"))}},prev:function(){var e=this.opts();if(!e.busy||e.manualTrump){var t=e.reverse?1:-1;e.allowWrap===!1&&e.currSlide+t<0||(e.API.advanceSlide(t),e.API.trigger("cycle-prev",[e]).log("cycle-prev"))}},destroy:function(){this.stop();var t=this.opts(),i=e.isFunction(e._data)?e._data:e.noop;clearTimeout(t.timeoutId),t.timeoutId=0,t.API.stop(),t.API.trigger("cycle-destroyed",[t]).log("cycle-destroyed"),t.container.removeData(),i(t.container[0],"parsedAttrs",!1),t.retainStylesOnDestroy||(t.container.removeAttr("style"),t.slides.removeAttr("style"),t.slides.removeClass(t.slideActiveClass)),t.slides.each(function(){var n=e(this);n.removeData(),n.removeClass(t.slideClass),i(this,"parsedAttrs",!1)})},jump:function(e,t){var i,n=this.opts();if(!n.busy||n.manualTrump){var s=parseInt(e,10);if(isNaN(s)||0>s||s>=n.slides.length)return void n.API.log("goto: invalid slide index: "+s);if(s==n.currSlide)return void n.API.log("goto: skipping, already on slide",s);n.nextSlide=s,clearTimeout(n.timeoutId),n.timeoutId=0,n.API.log("goto: ",s," (zero-index)"),i=n.currSlide<n.nextSlide,n._tempFx=t,n.API.prepareTx(!0,i)}},stop:function(){var t=this.opts(),i=t.container;clearTimeout(t.timeoutId),t.timeoutId=0,t.API.stopTransition(),t.pauseOnHover&&(t.pauseOnHover!==!0&&(i=e(t.pauseOnHover)),i.off("mouseenter mouseleave")),t.API.trigger("cycle-stopped",[t]).log("cycle-stopped")},reinit:function(){var e=this.opts();e.API.destroy(),e.container.cycle()},remove:function(t){for(var i,n,s=this.opts(),o=[],c=1,l=0;l<s.slides.length;l++)i=s.slides[l],l==t?n=i:(o.push(i),e(i).data("cycle.opts").slideNum=c,c++);n&&(s.slides=e(o),s.slideCount--,e(n).remove(),t==s.currSlide?s.API.advanceSlide(1):t<s.currSlide?s.currSlide--:s.currSlide++,s.API.trigger("cycle-slide-removed",[s,t,n]).log("cycle-slide-removed"),s.API.updateView())}}),e(document).on("click.cycle","[data-cycle-cmd]",function(t){t.preventDefault();var i=e(this),n=i.data("cycle-cmd"),s=i.data("cycle-context")||".cycle-slideshow";e(s).cycle(n,i.data("cycle-arg"))})}(jQuery),function(e){"use strict";function t(t,i){var n;return t._hashFence?void(t._hashFence=!1):(n=window.location.hash.substring(1),void t.slides.each(function(s){if(e(this).data("cycle-hash")==n){if(i===!0)t.startingSlide=s;else{var o=t.currSlide<s;t.nextSlide=s,t.API.prepareTx(!0,o)}return!1}}))}e(document).on("cycle-pre-initialize",function(i,n){t(n,!0),n._onHashChange=function(){t(n,!1)},e(window).on("hashchange",n._onHashChange)}),e(document).on("cycle-update-view",function(e,t,i){i.hash&&"#"+i.hash!=window.location.hash&&(t._hashFence=!0,window.location.hash=i.hash)}),e(document).on("cycle-destroyed",function(t,i){i._onHashChange&&e(window).off("hashchange",i._onHashChange)})}(jQuery),function(e){"use strict";e.extend(e.fn.cycle.defaults,{loader:!1}),e(document).on("cycle-bootstrap",function(t,i){function n(t,n){function o(t){var o;"wait"==i.loader?(l.push(t),0===a&&(l.sort(c),s.apply(i.API,[l,n]),i.container.removeClass("cycle-loading"))):(o=e(i.slides[i.currSlide]),s.apply(i.API,[t,n]),o.show(),i.container.removeClass("cycle-loading"))}function c(e,t){return e.data("index")-t.data("index")}var l=[];if("string"==e.type(t))t=e.trim(t);else if("array"===e.type(t))for(var r=0;r<t.length;r++)t[r]=e(t[r])[0];t=e(t);var a=t.length;a&&(t.css("visibility","hidden").appendTo("body").each(function(t){function c(){0===--r&&(--a,o(d))}var r=0,d=e(this),u=d.is("img")?d:d.find("img");return d.data("index",t),u=u.filter(":not(.cycle-loader-ignore)").filter(':not([src=""])'),u.length?(r=u.length,void u.each(function(){this.complete?c():e(this).load(function(){c()}).on("error",function(){0===--r&&(i.API.log("slide skipped; img not loaded:",this.src),0===--a&&"wait"==i.loader&&s.apply(i.API,[l,n]))})})):(--a,void l.push(d))}),a&&i.container.addClass("cycle-loading"))}var s;i.loader&&(s=i.API.add,i.API.add=n)})}(jQuery),function(e){"use strict";function t(t,i,n){var s,o=t.API.getComponent("pager");o.each(function(){var o=e(this);if(i.pagerTemplate){var c=t.API.tmpl(i.pagerTemplate,i,t,n[0]);s=e(c).appendTo(o)}else s=o.children().eq(t.slideCount-1);s.on(t.pagerEvent,function(e){t.pagerEventBubble||e.preventDefault(),t.API.page(o,e.currentTarget)})})}function i(e,t){var i=this.opts();if(!i.busy||i.manualTrump){var n=e.children().index(t),s=n,o=i.currSlide<s;i.currSlide!=s&&(i.nextSlide=s,i._tempFx=i.pagerFx,i.API.prepareTx(!0,o),i.API.trigger("cycle-pager-activated",[i,e,t]))}}e.extend(e.fn.cycle.defaults,{pager:"> .cycle-pager",pagerActiveClass:"cycle-pager-active",pagerEvent:"click.cycle",pagerEventBubble:void 0,pagerTemplate:"<span>&bull;</span>"}),e(document).on("cycle-bootstrap",function(e,i,n){n.buildPagerLink=t}),e(document).on("cycle-slide-added",function(e,t,n,s){t.pager&&(t.API.buildPagerLink(t,n,s),t.API.page=i)}),e(document).on("cycle-slide-removed",function(t,i,n,s){if(i.pager){var o=i.API.getComponent("pager");o.each(function(){var t=e(this);e(t.children()[n]).remove()})}}),e(document).on("cycle-update-view",function(t,i,n){var s;i.pager&&(s=i.API.getComponent("pager"),s.each(function(){e(this).children().removeClass(i.pagerActiveClass).eq(i.currSlide).addClass(i.pagerActiveClass)}))}),e(document).on("cycle-destroyed",function(e,t){var i=t.API.getComponent("pager");i&&(i.children().off(t.pagerEvent),t.pagerTemplate&&i.empty())})}(jQuery),function(e){"use strict";e.extend(e.fn.cycle.defaults,{next:"> .cycle-next",nextEvent:"click.cycle",disabledClass:"disabled",prev:"> .cycle-prev",prevEvent:"click.cycle",swipe:!1}),e(document).on("cycle-initialized",function(e,t){if(t.API.getComponent("next").on(t.nextEvent,function(e){e.preventDefault(),t.API.next()}),t.API.getComponent("prev").on(t.prevEvent,function(e){e.preventDefault(),t.API.prev()}),t.swipe){var i=t.swipeVert?"swipeUp.cycle":"swipeLeft.cycle swipeleft.cycle",n=t.swipeVert?"swipeDown.cycle":"swipeRight.cycle swiperight.cycle";t.container.on(i,function(e){t._tempFx=t.swipeFx,t.API.next()}),t.container.on(n,function(){t._tempFx=t.swipeFx,t.API.prev()})}}),e(document).on("cycle-update-view",function(e,t,i,n){if(!t.allowWrap){var s=t.disabledClass,o=t.API.getComponent("next"),c=t.API.getComponent("prev"),l=t._prevBoundry||0,r=void 0!==t._nextBoundry?t._nextBoundry:t.slideCount-1;t.currSlide==r?o.addClass(s).prop("disabled",!0):o.removeClass(s).prop("disabled",!1),t.currSlide===l?c.addClass(s).prop("disabled",!0):c.removeClass(s).prop("disabled",!1)}}),e(document).on("cycle-destroyed",function(e,t){t.API.getComponent("prev").off(t.nextEvent),t.API.getComponent("next").off(t.prevEvent),t.container.off("swipeleft.cycle swiperight.cycle swipeLeft.cycle swipeRight.cycle swipeUp.cycle swipeDown.cycle")})}(jQuery),function(e){"use strict";e.extend(e.fn.cycle.defaults,{progressive:!1}),e(document).on("cycle-pre-initialize",function(t,i){if(i.progressive){var n,s,o=i.API,c=o.next,l=o.prev,r=o.prepareTx,a=e.type(i.progressive);if("array"==a)n=i.progressive;else if(e.isFunction(i.progressive))n=i.progressive(i);else if("string"==a){if(s=e(i.progressive),n=e.trim(s.html()),!n)return;if(/^(\[)/.test(n))try{n=e.parseJSON(n)}catch(d){return void o.log("error parsing progressive slides",d)}else n=n.split(new RegExp(s.data("cycle-split")||"\n")),n[n.length-1]||n.pop()}r&&(o.prepareTx=function(e,t){var s,o;return e||0===n.length?void r.apply(i.API,[e,t]):void(t&&i.currSlide==i.slideCount-1?(o=n[0],n=n.slice(1),i.container.one("cycle-slide-added",function(e,t){setTimeout(function(){t.API.advanceSlide(1)},50)}),i.API.add(o)):t||0!==i.currSlide?r.apply(i.API,[e,t]):(s=n.length-1,o=n[s],n=n.slice(0,s),i.container.one("cycle-slide-added",function(e,t){setTimeout(function(){t.currSlide=1,t.API.advanceSlide(-1)},50)}),i.API.add(o,!0)))}),c&&(o.next=function(){var e=this.opts();if(n.length&&e.currSlide==e.slideCount-1){var t=n[0];n=n.slice(1),e.container.one("cycle-slide-added",function(e,t){c.apply(t.API),t.container.removeClass("cycle-loading")}),e.container.addClass("cycle-loading"),e.API.add(t)}else c.apply(e.API)}),l&&(o.prev=function(){var e=this.opts();if(n.length&&0===e.currSlide){var t=n.length-1,i=n[t];n=n.slice(0,t),e.container.one("cycle-slide-added",function(e,t){t.currSlide=1,t.API.advanceSlide(-1),t.container.removeClass("cycle-loading")}),e.container.addClass("cycle-loading"),e.API.add(i,!0)}else l.apply(e.API)})}})}(jQuery),function(e){"use strict";e.extend(e.fn.cycle.defaults,{tmplRegex:"{{((.)?.*?)}}"}),e.extend(e.fn.cycle.API,{tmpl:function(t,i){var n=new RegExp(i.tmplRegex||e.fn.cycle.defaults.tmplRegex,"g"),s=e.makeArray(arguments);return s.shift(),t.replace(n,function(t,i){var n,o,c,l,r=i.split(".");for(n=0;n<s.length;n++)if(c=s[n]){if(r.length>1)for(l=c,o=0;o<r.length;o++)c=l,l=l[r[o]]||i;else l=c[i];if(e.isFunction(l))return l.apply(c,s);if(void 0!==l&&null!==l&&l!=i)return l}return i})}})}(jQuery);
1
+ !function(e){"use strict";function t(e){return(e||"").toLowerCase()}var i="2.1.6";e.fn.cycle=function(i){var n;return 0!==this.length||e.isReady?this.each(function(){var n,s,o,c,l=e(this),r=e.fn.cycle.log;if(!l.data("cycle.opts")){(l.data("cycle-log")===!1||i&&i.log===!1||s&&s.log===!1)&&(r=e.noop),r("--c2 init--"),n=l.data();for(var a in n)n.hasOwnProperty(a)&&/^cycle[A-Z]+/.test(a)&&(c=n[a],o=a.match(/^cycle(.*)/)[1].replace(/^[A-Z]/,t),r(o+":",c,"("+typeof c+")"),n[o]=c);s=e.extend({},e.fn.cycle.defaults,n,i||{}),s.timeoutId=0,s.paused=s.paused||!1,s.container=l,s._maxZ=s.maxZ,s.API=e.extend({_container:l},e.fn.cycle.API),s.API.log=r,s.API.trigger=function(e,t){return s.container.trigger(e,t),s.API},l.data("cycle.opts",s),l.data("cycle.API",s.API),s.API.trigger("cycle-bootstrap",[s,s.API]),s.API.addInitialSlides(),s.API.preInitSlideshow(),s.slides.length&&s.API.initSlideshow()}}):(n={s:this.selector,c:this.context},e.fn.cycle.log("requeuing slideshow (dom not ready)"),e(function(){e(n.s,n.c).cycle(i)}),this)},e.fn.cycle.API={opts:function(){return this._container.data("cycle.opts")},addInitialSlides:function(){var t=this.opts(),i=t.slides;t.slideCount=0,t.slides=e(),i=i.jquery?i:t.container.find(i),t.random&&i.sort(function(){return Math.random()-.5}),t.API.add(i)},preInitSlideshow:function(){var t=this.opts();t.API.trigger("cycle-pre-initialize",[t]);var i=e.fn.cycle.transitions[t.fx];i&&e.isFunction(i.preInit)&&i.preInit(t),t._preInitialized=!0},postInitSlideshow:function(){var t=this.opts();t.API.trigger("cycle-post-initialize",[t]);var i=e.fn.cycle.transitions[t.fx];i&&e.isFunction(i.postInit)&&i.postInit(t)},initSlideshow:function(){var t,i=this.opts(),n=i.container;i.API.calcFirstSlide(),"static"==i.container.css("position")&&i.container.css("position","relative"),e(i.slides[i.currSlide]).css({opacity:1,display:"block",visibility:"visible"}),i.API.stackSlides(i.slides[i.currSlide],i.slides[i.nextSlide],!i.reverse),i.pauseOnHover&&(i.pauseOnHover!==!0&&(n=e(i.pauseOnHover)),n.hover(function(){i.API.pause(!0)},function(){i.API.resume(!0)})),i.timeout&&(t=i.API.getSlideOpts(i.currSlide),i.API.queueTransition(t,t.timeout+i.delay)),i._initialized=!0,i.API.updateView(!0),i.API.trigger("cycle-initialized",[i]),i.API.postInitSlideshow()},pause:function(t){var i=this.opts(),n=i.API.getSlideOpts(),s=i.hoverPaused||i.paused;t?i.hoverPaused=!0:i.paused=!0,s||(i.container.addClass("cycle-paused"),i.API.trigger("cycle-paused",[i]).log("cycle-paused"),n.timeout&&(clearTimeout(i.timeoutId),i.timeoutId=0,i._remainingTimeout-=e.now()-i._lastQueue,(i._remainingTimeout<0||isNaN(i._remainingTimeout))&&(i._remainingTimeout=void 0)))},resume:function(e){var t=this.opts(),i=!t.hoverPaused&&!t.paused;e?t.hoverPaused=!1:t.paused=!1,i||(t.container.removeClass("cycle-paused"),0===t.slides.filter(":animated").length&&t.API.queueTransition(t.API.getSlideOpts(),t._remainingTimeout),t.API.trigger("cycle-resumed",[t,t._remainingTimeout]).log("cycle-resumed"))},add:function(t,i){var n,s=this.opts(),o=s.slideCount,c=!1;"string"==e.type(t)&&(t=e.trim(t)),e(t).each(function(t){var n,o=e(this);i?s.container.prepend(o):s.container.append(o),s.slideCount++,n=s.API.buildSlideOpts(o),i?s.slides=e(o).add(s.slides):s.slides=s.slides.add(o),s.API.initSlide(n,o,--s._maxZ),o.data("cycle.opts",n),s.API.trigger("cycle-slide-added",[s,n,o])}),s.API.updateView(!0),c=s._preInitialized&&2>o&&s.slideCount>=1,c&&(s._initialized?s.timeout&&(n=s.slides.length,s.nextSlide=s.reverse?n-1:1,s.timeoutId||s.API.queueTransition(s)):s.API.initSlideshow())},calcFirstSlide:function(){var e,t=this.opts();e=parseInt(t.startingSlide||0,10),(e>=t.slides.length||0>e)&&(e=0),t.currSlide=e,t.reverse?(t.nextSlide=e-1,t.nextSlide<0&&(t.nextSlide=t.slides.length-1)):(t.nextSlide=e+1,t.nextSlide==t.slides.length&&(t.nextSlide=0))},calcNextSlide:function(){var e,t=this.opts();t.reverse?(e=t.nextSlide-1<0,t.nextSlide=e?t.slideCount-1:t.nextSlide-1,t.currSlide=e?0:t.nextSlide+1):(e=t.nextSlide+1==t.slides.length,t.nextSlide=e?0:t.nextSlide+1,t.currSlide=e?t.slides.length-1:t.nextSlide-1)},calcTx:function(t,i){var n,s=t;return s._tempFx?n=e.fn.cycle.transitions[s._tempFx]:i&&s.manualFx&&(n=e.fn.cycle.transitions[s.manualFx]),n||(n=e.fn.cycle.transitions[s.fx]),s._tempFx=null,this.opts()._tempFx=null,n||(n=e.fn.cycle.transitions.fade,s.API.log('Transition "'+s.fx+'" not found. Using fade.')),n},prepareTx:function(e,t){var i,n,s,o,c,l=this.opts();return l.slideCount<2?void(l.timeoutId=0):(!e||l.busy&&!l.manualTrump||(l.API.stopTransition(),l.busy=!1,clearTimeout(l.timeoutId),l.timeoutId=0),void(l.busy||(0!==l.timeoutId||e)&&(n=l.slides[l.currSlide],s=l.slides[l.nextSlide],o=l.API.getSlideOpts(l.nextSlide),c=l.API.calcTx(o,e),l._tx=c,e&&void 0!==o.manualSpeed&&(o.speed=o.manualSpeed),l.nextSlide!=l.currSlide&&(e||!l.paused&&!l.hoverPaused&&l.timeout)?(l.API.trigger("cycle-before",[o,n,s,t]),c.before&&c.before(o,n,s,t),i=function(){l.busy=!1,l.container.data("cycle.opts")&&(c.after&&c.after(o,n,s,t),l.API.trigger("cycle-after",[o,n,s,t]),l.API.queueTransition(o),l.API.updateView(!0))},l.busy=!0,c.transition?c.transition(o,n,s,t,i):l.API.doTransition(o,n,s,t,i),l.API.calcNextSlide(),l.API.updateView()):l.API.queueTransition(o))))},doTransition:function(t,i,n,s,o){var c=t,l=e(i),r=e(n),a=function(){r.animate(c.animIn||{opacity:1},c.speed,c.easeIn||c.easing,o)};r.css(c.cssBefore||{}),l.animate(c.animOut||{},c.speed,c.easeOut||c.easing,function(){l.css(c.cssAfter||{}),c.sync||a()}),c.sync&&a()},queueTransition:function(t,i){var n=this.opts(),s=void 0!==i?i:t.timeout;return 0===n.nextSlide&&0===--n.loop?(n.API.log("terminating; loop=0"),n.timeout=0,s?setTimeout(function(){n.API.trigger("cycle-finished",[n])},s):n.API.trigger("cycle-finished",[n]),void(n.nextSlide=n.currSlide)):void 0!==n.continueAuto&&(n.continueAuto===!1||e.isFunction(n.continueAuto)&&n.continueAuto()===!1)?(n.API.log("terminating automatic transitions"),n.timeout=0,void(n.timeoutId&&clearTimeout(n.timeoutId))):void(s&&(n._lastQueue=e.now(),void 0===i&&(n._remainingTimeout=t.timeout),n.paused||n.hoverPaused||(n.timeoutId=setTimeout(function(){n.API.prepareTx(!1,!n.reverse)},s))))},stopTransition:function(){var e=this.opts();e.slides.filter(":animated").length&&(e.slides.stop(!1,!0),e.API.trigger("cycle-transition-stopped",[e])),e._tx&&e._tx.stopTransition&&e._tx.stopTransition(e)},advanceSlide:function(e){var t=this.opts();return clearTimeout(t.timeoutId),t.timeoutId=0,t.nextSlide=t.currSlide+e,t.nextSlide<0?t.nextSlide=t.slides.length-1:t.nextSlide>=t.slides.length&&(t.nextSlide=0),t.API.prepareTx(!0,e>=0),!1},buildSlideOpts:function(i){var n,s,o=this.opts(),c=i.data()||{};for(var l in c)c.hasOwnProperty(l)&&/^cycle[A-Z]+/.test(l)&&(n=c[l],s=l.match(/^cycle(.*)/)[1].replace(/^[A-Z]/,t),o.API.log("["+(o.slideCount-1)+"]",s+":",n,"("+typeof n+")"),c[s]=n);c=e.extend({},e.fn.cycle.defaults,o,c),c.slideNum=o.slideCount;try{delete c.API,delete c.slideCount,delete c.currSlide,delete c.nextSlide,delete c.slides}catch(r){}return c},getSlideOpts:function(t){var i=this.opts();void 0===t&&(t=i.currSlide);var n=i.slides[t],s=e(n).data("cycle.opts");return e.extend({},i,s)},initSlide:function(t,i,n){var s=this.opts();i.css(t.slideCss||{}),n>0&&i.css("zIndex",n),isNaN(t.speed)&&(t.speed=e.fx.speeds[t.speed]||e.fx.speeds._default),t.sync||(t.speed=t.speed/2),i.addClass(s.slideClass)},updateView:function(e,t,i){var n=this.opts();if(n._initialized){var s=n.API.getSlideOpts(),o=n.slides[n.currSlide];!e&&t!==!0&&(n.API.trigger("cycle-update-view-before",[n,s,o]),n.updateView<0)||(n.slideActiveClass&&n.slides.removeClass(n.slideActiveClass).eq(n.currSlide).addClass(n.slideActiveClass),e&&n.hideNonActive&&n.slides.filter(":not(."+n.slideActiveClass+")").css("visibility","hidden"),0===n.updateView&&setTimeout(function(){n.API.trigger("cycle-update-view",[n,s,o,e])},s.speed/(n.sync?2:1)),0!==n.updateView&&n.API.trigger("cycle-update-view",[n,s,o,e]),e&&n.API.trigger("cycle-update-view-after",[n,s,o]))}},getComponent:function(t){var i=this.opts(),n=i[t];return"string"==typeof n?/^\s*[\>|\+|~]/.test(n)?i.container.find(n):e(n):n.jquery?n:e(n)},stackSlides:function(t,i,n){var s=this.opts();t||(t=s.slides[s.currSlide],i=s.slides[s.nextSlide],n=!s.reverse),e(t).css("zIndex",s.maxZ);var o,c=s.maxZ-2,l=s.slideCount;if(n){for(o=s.currSlide+1;l>o;o++)e(s.slides[o]).css("zIndex",c--);for(o=0;o<s.currSlide;o++)e(s.slides[o]).css("zIndex",c--)}else{for(o=s.currSlide-1;o>=0;o--)e(s.slides[o]).css("zIndex",c--);for(o=l-1;o>s.currSlide;o--)e(s.slides[o]).css("zIndex",c--)}e(i).css("zIndex",s.maxZ-1)},getSlideIndex:function(e){return this.opts().slides.index(e)}},e.fn.cycle.log=function(){window.console&&console.log&&console.log("[cycle2] "+Array.prototype.join.call(arguments," "))},e.fn.cycle.version=function(){return"Cycle2: "+i},e.fn.cycle.transitions={custom:{},none:{before:function(e,t,i,n){e.API.stackSlides(i,t,n),e.cssBefore={opacity:1,visibility:"visible",display:"block"}}},fade:{before:function(t,i,n,s){var o=t.API.getSlideOpts(t.nextSlide).slideCss||{};t.API.stackSlides(i,n,s),t.cssBefore=e.extend(o,{opacity:0,visibility:"visible",display:"block"}),t.animIn={opacity:1},t.animOut={opacity:0}}},fadeout:{before:function(t,i,n,s){var o=t.API.getSlideOpts(t.nextSlide).slideCss||{};t.API.stackSlides(i,n,s),t.cssBefore=e.extend(o,{opacity:1,visibility:"visible",display:"block"}),t.animOut={opacity:0}}},scrollHorz:{before:function(e,t,i,n){e.API.stackSlides(t,i,n);var s=e.container.css("overflow","hidden").width();e.cssBefore={left:n?s:-s,top:0,opacity:1,visibility:"visible",display:"block"},e.cssAfter={zIndex:e._maxZ-2,left:0},e.animIn={left:0},e.animOut={left:n?-s:s}}}},e.fn.cycle.defaults={allowWrap:!0,autoSelector:".cycle-slideshow[data-cycle-auto-init!=false]",delay:0,easing:null,fx:"fade",hideNonActive:!0,loop:0,manualFx:void 0,manualSpeed:void 0,manualTrump:!0,maxZ:100,pauseOnHover:!1,reverse:!1,slideActiveClass:"cycle-slide-active",slideClass:"cycle-slide",slideCss:{position:"absolute",top:0,left:0},slides:"> img",speed:500,startingSlide:0,sync:!0,timeout:4e3,updateView:0},e(document).ready(function(){e(e.fn.cycle.defaults.autoSelector).cycle()})}(jQuery),function(e){"use strict";function t(t,n){var s,o,c,l=n.autoHeight;if("container"==l)o=e(n.slides[n.currSlide]).outerHeight(),n.container.height(o);else if(n._autoHeightRatio)n.container.height(n.container.width()/n._autoHeightRatio);else if("calc"===l||"number"==e.type(l)&&l>=0){if(c="calc"===l?i(t,n):l>=n.slides.length?0:l,c==n._sentinelIndex)return;n._sentinelIndex=c,n._sentinel&&n._sentinel.remove(),s=e(n.slides[c].cloneNode(!0)),s.removeAttr("id name rel").find("[id],[name],[rel]").removeAttr("id name rel"),s.css({position:"static",visibility:"hidden",display:"block"}).prependTo(n.container).addClass("cycle-sentinel cycle-slide").removeClass("cycle-slide-active"),s.find("*").css("visibility","hidden"),n._sentinel=s}}function i(t,i){var n=0,s=-1;return i.slides.each(function(t){var i=e(this).height();i>s&&(s=i,n=t)}),n}function n(t,i,n,s,o){var c=e(s).outerHeight();i.container.animate({height:c},i.autoHeightSpeed,i.autoHeightEasing)}function s(i,o){o._autoHeightOnResize&&(e(window).off("resize orientationchange",o._autoHeightOnResize),o._autoHeightOnResize=null),o.container.off("cycle-slide-added cycle-slide-removed",t),o.container.off("cycle-destroyed",s),o.container.off("cycle-before",n),o._sentinel&&(o._sentinel.remove(),o._sentinel=null)}e.extend(e.fn.cycle.defaults,{autoHeight:0,autoHeightSpeed:250,autoHeightEasing:null}),e(document).on("cycle-initialized",function(i,o){function c(){t(i,o)}var l,r=o.autoHeight,a=e.type(r),d=null;("string"===a||"number"===a)&&(o.container.on("cycle-slide-added cycle-slide-removed",t),o.container.on("cycle-destroyed",s),"container"==r?o.container.on("cycle-before",n):"string"===a&&/\d+\:\d+/.test(r)&&(l=r.match(/(\d+)\:(\d+)/),l=l[1]/l[2],o._autoHeightRatio=l),"number"!==a&&(o._autoHeightOnResize=function(){clearTimeout(d),d=setTimeout(c,50)},e(window).on("resize orientationchange",o._autoHeightOnResize)),setTimeout(c,30))})}(jQuery),function(e){"use strict";e.extend(e.fn.cycle.defaults,{caption:"> .cycle-caption",captionTemplate:"{{slideNum}} / {{slideCount}}",overlay:"> .cycle-overlay",overlayTemplate:"<div>{{title}}</div><div>{{desc}}</div>",captionModule:"caption"}),e(document).on("cycle-update-view",function(t,i,n,s){if("caption"===i.captionModule){e.each(["caption","overlay"],function(){var e=this,t=n[e+"Template"],o=i.API.getComponent(e);o.length&&t?(o.html(i.API.tmpl(t,n,i,s)),o.show()):o.hide()})}}),e(document).on("cycle-destroyed",function(t,i){var n;e.each(["caption","overlay"],function(){var e=this,t=i[e+"Template"];i[e]&&t&&(n=i.API.getComponent("caption"),n.empty())})})}(jQuery),function(e){"use strict";var t=e.fn.cycle;e.fn.cycle=function(i){var n,s,o,c=e.makeArray(arguments);return"number"==e.type(i)?this.cycle("goto",i):"string"==e.type(i)?this.each(function(){var l;return n=i,o=e(this).data("cycle.opts"),void 0===o?void t.log('slideshow must be initialized before sending commands; "'+n+'" ignored'):(n="goto"==n?"jump":n,s=o.API[n],e.isFunction(s)?(l=e.makeArray(c),l.shift(),s.apply(o.API,l)):void t.log("unknown command: ",n))}):t.apply(this,arguments)},e.extend(e.fn.cycle,t),e.extend(t.API,{next:function(){var e=this.opts();if(!e.busy||e.manualTrump){var t=e.reverse?-1:1;e.allowWrap===!1&&e.currSlide+t>=e.slideCount||(e.API.advanceSlide(t),e.API.trigger("cycle-next",[e]).log("cycle-next"))}},prev:function(){var e=this.opts();if(!e.busy||e.manualTrump){var t=e.reverse?1:-1;e.allowWrap===!1&&e.currSlide+t<0||(e.API.advanceSlide(t),e.API.trigger("cycle-prev",[e]).log("cycle-prev"))}},destroy:function(){this.stop();var t=this.opts(),i=e.isFunction(e._data)?e._data:e.noop;clearTimeout(t.timeoutId),t.timeoutId=0,t.API.stop(),t.API.trigger("cycle-destroyed",[t]).log("cycle-destroyed"),t.container.removeData(),i(t.container[0],"parsedAttrs",!1),t.retainStylesOnDestroy||(t.container.removeAttr("style"),t.slides.removeAttr("style"),t.slides.removeClass(t.slideActiveClass)),t.slides.each(function(){var n=e(this);n.removeData(),n.removeClass(t.slideClass),i(this,"parsedAttrs",!1)})},jump:function(e,t){var i,n=this.opts();if(!n.busy||n.manualTrump){var s=parseInt(e,10);if(isNaN(s)||0>s||s>=n.slides.length)return void n.API.log("goto: invalid slide index: "+s);if(s==n.currSlide)return void n.API.log("goto: skipping, already on slide",s);n.nextSlide=s,clearTimeout(n.timeoutId),n.timeoutId=0,n.API.log("goto: ",s," (zero-index)"),i=n.currSlide<n.nextSlide,n._tempFx=t,n.API.prepareTx(!0,i)}},stop:function(){var t=this.opts(),i=t.container;clearTimeout(t.timeoutId),t.timeoutId=0,t.API.stopTransition(),t.pauseOnHover&&(t.pauseOnHover!==!0&&(i=e(t.pauseOnHover)),i.off("mouseenter mouseleave")),t.API.trigger("cycle-stopped",[t]).log("cycle-stopped")},reinit:function(){var e=this.opts();e.API.destroy(),e.container.cycle()},remove:function(t){for(var i,n,s=this.opts(),o=[],c=1,l=0;l<s.slides.length;l++)i=s.slides[l],l==t?n=i:(o.push(i),e(i).data("cycle.opts").slideNum=c,c++);n&&(s.slides=e(o),s.slideCount--,e(n).remove(),t==s.currSlide?s.API.advanceSlide(1):t<s.currSlide?s.currSlide--:s.currSlide++,s.API.trigger("cycle-slide-removed",[s,t,n]).log("cycle-slide-removed"),s.API.updateView())}}),e(document).on("click.cycle","[data-cycle-cmd]",function(t){t.preventDefault();var i=e(this),n=i.data("cycle-cmd"),s=i.data("cycle-context")||".cycle-slideshow";e(s).cycle(n,i.data("cycle-arg"))})}(jQuery),function(e){"use strict";function t(t,i){var n;return t._hashFence?void(t._hashFence=!1):(n=window.location.hash.substring(1),void t.slides.each(function(s){if(e(this).data("cycle-hash")==n){if(i===!0)t.startingSlide=s;else{var o=t.currSlide<s;t.nextSlide=s,t.API.prepareTx(!0,o)}return!1}}))}e(document).on("cycle-pre-initialize",function(i,n){t(n,!0),n._onHashChange=function(){t(n,!1)},e(window).on("hashchange",n._onHashChange)}),e(document).on("cycle-update-view",function(e,t,i){i.hash&&"#"+i.hash!=window.location.hash&&(t._hashFence=!0,window.location.hash=i.hash)}),e(document).on("cycle-destroyed",function(t,i){i._onHashChange&&e(window).off("hashchange",i._onHashChange)})}(jQuery),function(e){"use strict";e.extend(e.fn.cycle.defaults,{loader:!1}),e(document).on("cycle-bootstrap",function(t,i){function n(t,n){function o(t){var o;"wait"==i.loader?(l.push(t),0===a&&(l.sort(c),s.apply(i.API,[l,n]),i.container.removeClass("cycle-loading"))):(o=e(i.slides[i.currSlide]),s.apply(i.API,[t,n]),o.show(),i.container.removeClass("cycle-loading"))}function c(e,t){return e.data("index")-t.data("index")}var l=[];if("string"==e.type(t))t=e.trim(t);else if("array"===e.type(t))for(var r=0;r<t.length;r++)t[r]=e(t[r])[0];t=e(t);var a=t.length;a&&(t.css("visibility","hidden").appendTo("body").each(function(t){function c(){0===--r&&(--a,o(d))}var r=0,d=e(this),u=d.is("img")?d:d.find("img");return d.data("index",t),u=u.filter(":not(.cycle-loader-ignore)").filter(':not([src=""])'),u.length?(r=u.length,void u.each(function(){this.complete?c():e(this).load(function(){c()}).on("error",function(){0===--r&&(i.API.log("slide skipped; img not loaded:",this.src),0===--a&&"wait"==i.loader&&s.apply(i.API,[l,n]))})})):(--a,void l.push(d))}),a&&i.container.addClass("cycle-loading"))}var s;i.loader&&(s=i.API.add,i.API.add=n)})}(jQuery),function(e){"use strict";function t(t,i,n){var s,o=t.API.getComponent("pager");o.each(function(){var o=e(this);if(i.pagerTemplate){var c=t.API.tmpl(i.pagerTemplate,i,t,n[0]);s=e(c).appendTo(o)}else s=o.children().eq(t.slideCount-1);s.on(t.pagerEvent,function(e){t.pagerEventBubble||e.preventDefault(),t.API.page(o,e.currentTarget)})})}function i(e,t){var i=this.opts();if(!i.busy||i.manualTrump){var n=e.children().index(t),s=n,o=i.currSlide<s;i.currSlide!=s&&(i.nextSlide=s,i._tempFx=i.pagerFx,i.API.prepareTx(!0,o),i.API.trigger("cycle-pager-activated",[i,e,t]))}}e.extend(e.fn.cycle.defaults,{pager:"> .cycle-pager",pagerActiveClass:"cycle-pager-active",pagerEvent:"click.cycle",pagerEventBubble:void 0,pagerTemplate:"<span>&bull;</span>"}),e(document).on("cycle-bootstrap",function(e,i,n){n.buildPagerLink=t}),e(document).on("cycle-slide-added",function(e,t,n,s){t.pager&&(t.API.buildPagerLink(t,n,s),t.API.page=i)}),e(document).on("cycle-slide-removed",function(t,i,n,s){if(i.pager){var o=i.API.getComponent("pager");o.each(function(){var t=e(this);e(t.children()[n]).remove()})}}),e(document).on("cycle-update-view",function(t,i,n){var s;i.pager&&(s=i.API.getComponent("pager"),s.each(function(){e(this).children().removeClass(i.pagerActiveClass).eq(i.currSlide).addClass(i.pagerActiveClass)}))}),e(document).on("cycle-destroyed",function(e,t){var i=t.API.getComponent("pager");i&&(i.children().off(t.pagerEvent),t.pagerTemplate&&i.empty())})}(jQuery),function(e){"use strict";e.extend(e.fn.cycle.defaults,{next:"> .cycle-next",nextEvent:"click.cycle",disabledClass:"disabled",prev:"> .cycle-prev",prevEvent:"click.cycle",swipe:!1}),e(document).on("cycle-initialized",function(e,t){if(t.API.getComponent("next").on(t.nextEvent,function(e){e.preventDefault(),t.API.next()}),t.API.getComponent("prev").on(t.prevEvent,function(e){e.preventDefault(),t.API.prev()}),t.swipe){var i=t.swipeVert?"swipeUp.cycle":"swipeLeft.cycle swipeleft.cycle",n=t.swipeVert?"swipeDown.cycle":"swipeRight.cycle swiperight.cycle";t.container.on(i,function(e){t._tempFx=t.swipeFx,t.API.next()}),t.container.on(n,function(){t._tempFx=t.swipeFx,t.API.prev()})}}),e(document).on("cycle-update-view",function(e,t,i,n){if(!t.allowWrap){var s=t.disabledClass,o=t.API.getComponent("next"),c=t.API.getComponent("prev"),l=t._prevBoundry||0,r=void 0!==t._nextBoundry?t._nextBoundry:t.slideCount-1;t.currSlide==r?o.addClass(s).prop("disabled",!0):o.removeClass(s).prop("disabled",!1),t.currSlide===l?c.addClass(s).prop("disabled",!0):c.removeClass(s).prop("disabled",!1)}}),e(document).on("cycle-destroyed",function(e,t){t.API.getComponent("prev").off(t.nextEvent),t.API.getComponent("next").off(t.prevEvent),t.container.off("swipeleft.cycle swiperight.cycle swipeLeft.cycle swipeRight.cycle swipeUp.cycle swipeDown.cycle")})}(jQuery),function(e){"use strict";e.extend(e.fn.cycle.defaults,{progressive:!1}),e(document).on("cycle-pre-initialize",function(t,i){if(i.progressive){var n,s,o=i.API,c=o.next,l=o.prev,r=o.prepareTx,a=e.type(i.progressive);if("array"==a)n=i.progressive;else if(e.isFunction(i.progressive))n=i.progressive(i);else if("string"==a){if(s=e(i.progressive),n=e.trim(s.html()),!n)return;if(/^(\[)/.test(n))try{n=e.parseJSON(n)}catch(d){return void o.log("error parsing progressive slides",d)}else n=n.split(new RegExp(s.data("cycle-split")||"\n")),n[n.length-1]||n.pop()}r&&(o.prepareTx=function(e,t){var s,o;return e||0===n.length?void r.apply(i.API,[e,t]):void(t&&i.currSlide==i.slideCount-1?(o=n[0],n=n.slice(1),i.container.one("cycle-slide-added",function(e,t){setTimeout(function(){t.API.advanceSlide(1)},50)}),i.API.add(o)):t||0!==i.currSlide?r.apply(i.API,[e,t]):(s=n.length-1,o=n[s],n=n.slice(0,s),i.container.one("cycle-slide-added",function(e,t){setTimeout(function(){t.currSlide=1,t.API.advanceSlide(-1)},50)}),i.API.add(o,!0)))}),c&&(o.next=function(){var e=this.opts();if(n.length&&e.currSlide==e.slideCount-1){var t=n[0];n=n.slice(1),e.container.one("cycle-slide-added",function(e,t){c.apply(t.API),t.container.removeClass("cycle-loading")}),e.container.addClass("cycle-loading"),e.API.add(t)}else c.apply(e.API)}),l&&(o.prev=function(){var e=this.opts();if(n.length&&0===e.currSlide){var t=n.length-1,i=n[t];n=n.slice(0,t),e.container.one("cycle-slide-added",function(e,t){t.currSlide=1,t.API.advanceSlide(-1),t.container.removeClass("cycle-loading")}),e.container.addClass("cycle-loading"),e.API.add(i,!0)}else l.apply(e.API)})}})}(jQuery),function(e){"use strict";e.extend(e.fn.cycle.defaults,{tmplRegex:"{{((.)?.*?)}}"}),e.extend(e.fn.cycle.API,{tmpl:function(t,i){var n=new RegExp(i.tmplRegex||e.fn.cycle.defaults.tmplRegex,"g"),s=e.makeArray(arguments);return s.shift(),t.replace(n,function(t,i){var n,o,c,l,r=i.split(".");for(n=0;n<s.length;n++)if(c=s[n]){if(r.length>1)for(l=c,o=0;o<r.length;o++)c=l,l=l[r[o]]||i;else l=c[i];if(e.isFunction(l))return l.apply(c,s);if(void 0!==l&&null!==l&&l!=i)return l}return i})}})}(jQuery);
js/slider/jquery.slider.min.js CHANGED
@@ -1 +1 @@
1
- var siteoriginSlider={};jQuery(function(e){var i=siteoriginSlider.playSlideVideo=function(i){e(i).find("video").each(function(){"undefined"!=typeof this.play&&this.play()})},t=siteoriginSlider.pauseSlideVideo=function(i){e(i).find("video").each(function(){"undefined"!=typeof this.pause&&this.pause()})},n=siteoriginSlider.setupActiveSlide=function(i,t,n){var s=e(i).find(".cycle-sentinel"),o=e(t),a=o.find("video.sow-background-element");if(void 0==n?s.css("height",o.outerHeight()):s.animate({height:o.outerHeight()},n),a.length){var d=o.outerWidth()/o.outerHeight(),c=a.outerWidth()/a.outerHeight();a.css(d>c?{width:"100%",height:"auto"}:{width:"auto",height:"100%"}),a.css({"margin-left":-Math.ceil(a.width()/2),"margin-top":-Math.ceil(a.height()/2)})}};e(".sow-slider-images").each(function(){var s=e(this),o=s.siblings(".sow-slider-pagination"),a=s.closest(".sow-slider-base"),d=a.find(".sow-slide-nav"),c=s.find(".sow-slider-image"),l=s.data("settings");c.each(function(i,t){var n=e(t),s=n.data("url");n.click(function(i){(i.target==n||e(i.target).is(".sow-slider-image-wrapper"))&&window.open(s.url,s.new_window?"_blank":"_self")})});var r=function(){if(a.show(),s.find(".sow-slider-image").each(function(){var i=e(this);e(window).resize(function(){i.css("height",i.find(".sow-slider-image-wrapper").outerHeight())}).resize()}),s.on({"cycle-after":function(t,s,o,a,d){var c=e(this);i(a),n(c,a)},"cycle-before":function(i,s,a,d,c){var l=e(this);o.find("> li").removeClass("sow-active").eq(s.slideNum-1).addClass("sow-active"),t(a),n(l,d,s.speed)},"cycle-initialized":function(t,a){i(e(this).find(".cycle-slide-active")),n(s,a.slides[0]),o.find(">li").removeClass("sow-active").eq(0).addClass("sow-active"),a.slideCount<=1&&(o.hide(),d.hide()),e(window).resize()}}).cycle({slides:"> .sow-slider-image",speed:l.speed,timeout:l.timeout,swipe:!0,"swipe-fx":"scrollHorz"}),s.find("video.sow-background-element").on("loadeddata",function(){n(s,s.find(".cycle-slide-active"))}),o.add(d).hide(),!a.hasClass("sow-slider-is-mobile")&&c.length>1){var r=!1;a.mouseenter(function(){o.add(d).clearQueue().fadeIn(150),r=!1}).mouseleave(function(){r=!0,setTimeout(function(){r&&o.add(d).clearQueue().fadeOut(150),r=!1},750)})}e(window).resize(function(){n(s,s.find(".cycle-slide-active"))}),o.find("> li > a").click(function(i){i.preventDefault(),s.cycle("goto",e(this).data("goto"))}),d.find("> a").click(function(i){i.preventDefault(),s.cycle(e(this).data("action"))}),a.keydown(function(e){37===e.which?s.cycle("prev"):39===e.which&&s.cycle("next")})},h=s.find("img"),u=0,f=!1;h.each(function(){e(this);this.complete?u++:e(this).one("load",function(){u++,u!==h.length||f||(r(),f=!0)}).attr("src",e(this).attr("src")),u!==h.length||f||(r(),f=!0)}),0===h.length&&r()})});
1
+ var siteoriginSlider={};jQuery(function(e){var i=siteoriginSlider.playSlideVideo=function(i){e(i).find("video").each(function(){"undefined"!=typeof this.play&&this.play()})},t=siteoriginSlider.pauseSlideVideo=function(i){e(i).find("video").each(function(){"undefined"!=typeof this.pause&&this.pause()})},n=siteoriginSlider.setupActiveSlide=function(i,t,n){var s=e(i).find(".cycle-sentinel"),o=e(t),a=o.find("video.sow-background-element");if(void 0==n?s.css("height",o.outerHeight()):s.animate({height:o.outerHeight()},n),a.length){var d=o.outerWidth()/o.outerHeight(),c=a.outerWidth()/a.outerHeight();d>c?a.css({width:"100%",height:"auto"}):a.css({width:"auto",height:"100%"}),a.css({"margin-left":-Math.ceil(a.width()/2),"margin-top":-Math.ceil(a.height()/2)})}};e(".sow-slider-images").each(function(){var s=e(this),o=s.siblings(".sow-slider-pagination"),a=s.closest(".sow-slider-base"),d=a.find(".sow-slide-nav"),c=s.find(".sow-slider-image"),l=s.data("settings");c.each(function(i,t){var n=e(t),s=n.data("url");n.click(function(i){(i.target==n||e(i.target).is(".sow-slider-image-wrapper"))&&window.open(s.url,s.new_window?"_blank":"_self")})});var r=function(){if(a.show(),s.find(".sow-slider-image").each(function(){var i=e(this);e(window).resize(function(){i.css("height",i.find(".sow-slider-image-wrapper").outerHeight())}).resize()}),s.on({"cycle-after":function(t,s,o,a,d){var c=e(this);i(a),n(c,a)},"cycle-before":function(i,s,a,d,c){var l=e(this);o.find("> li").removeClass("sow-active").eq(s.slideNum-1).addClass("sow-active"),t(a),n(l,d,s.speed)},"cycle-initialized":function(t,a){i(e(this).find(".cycle-slide-active")),n(s,a.slides[0]),o.find(">li").removeClass("sow-active").eq(0).addClass("sow-active"),a.slideCount<=1&&(o.hide(),d.hide()),e(window).resize()}}).cycle({slides:"> .sow-slider-image",speed:l.speed,timeout:l.timeout,swipe:!0,"swipe-fx":"scrollHorz"}),s.find("video.sow-background-element").on("loadeddata",function(){n(s,s.find(".cycle-slide-active"))}),o.add(d).hide(),!a.hasClass("sow-slider-is-mobile")&&c.length>1){var r=!1;a.mouseenter(function(){o.add(d).clearQueue().fadeIn(150),r=!1}).mouseleave(function(){r=!0,setTimeout(function(){r&&o.add(d).clearQueue().fadeOut(150),r=!1},750)})}e(window).resize(function(){n(s,s.find(".cycle-slide-active"))}),o.find("> li > a").click(function(i){i.preventDefault(),s.cycle("goto",e(this).data("goto"))}),d.find("> a").click(function(i){i.preventDefault(),s.cycle(e(this).data("action"))}),a.keydown(function(e){37===e.which?s.cycle("prev"):39===e.which&&s.cycle("next")})},h=s.find("img"),u=0,f=!1;h.each(function(){e(this);this.complete?u++:e(this).one("load",function(){u++,u!==h.length||f||(r(),f=!0)}).attr("src",e(this).attr("src")),u!==h.length||f||(r(),f=!0)}),0===h.length&&r()})});
readme.txt CHANGED
@@ -2,7 +2,7 @@
2
  Tags: bundle, widget, button, slider, image, carousel, price table, google maps, tinymce, social links
3
  Requires at least: 3.9
4
  Tested up to: 4.3
5
- Stable tag: 1.5
6
  License: GPLv3 or later
7
  Contributors: gpriday, braam-genis
8
 
@@ -50,6 +50,20 @@ The SiteOrigin Widgets Bundle is the perfect platform to build widgets for your
50
 
51
  == Changelog ==
52
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
53
  = 1.5.1 - October 7 2015 =
54
  * Fixed: Issue with Call To Action widget being missing.
55
 
2
  Tags: bundle, widget, button, slider, image, carousel, price table, google maps, tinymce, social links
3
  Requires at least: 3.9
4
  Tested up to: 4.3
5
+ Stable tag: 1.5.1
6
  License: GPLv3 or later
7
  Contributors: gpriday, braam-genis
8
 
50
 
51
  == Changelog ==
52
 
53
+ = 1.5.2 - November 10 2015 =
54
+ * Removed word break style from headline widget.
55
+ * Fixed image grid URL field.
56
+ * Added more text styling options to features widget.
57
+ * Added measurement field to use in various widgets.
58
+ * Prefix function name in Google Map widget to prevent conflicts.
59
+ * Fixed styling for contact form widget.
60
+ * Fix to allow multiple duplicated contact forms on a single page.
61
+ * Fixed Hero Image widget button shortcode in text mode.
62
+ * TinyMCE fields maintain editor state.
63
+ * Added support for WP Canvas Shortcodes in TinyMCE field.
64
+ * Don't initialize TinyMCE outside the admin.
65
+ * Added more styling to contact form submit button.
66
+
67
  = 1.5.1 - October 7 2015 =
68
  * Fixed: Issue with Call To Action widget being missing.
69
 
so-widgets-bundle.php CHANGED
@@ -2,7 +2,7 @@
2
  /*
3
  Plugin Name: SiteOrigin Widgets Bundle
4
  Description: A collection of all widgets, neatly bundled into a single plugin. It's also a framework to code your own widgets on top of.
5
- Version: 1.5.1
6
  Text Domain: so-widgets-bundle
7
  Domain Path: /languages
8
  Author: SiteOrigin
@@ -12,7 +12,7 @@ License: GPL3
12
  License URI: https://www.gnu.org/licenses/gpl-3.0.txt
13
  */
14
 
15
- define('SOW_BUNDLE_VERSION', '1.5.1');
16
  define('SOW_BUNDLE_JS_SUFFIX', '.min');
17
  define('SOW_BUNDLE_BASE_FILE', __FILE__);
18
 
2
  /*
3
  Plugin Name: SiteOrigin Widgets Bundle
4
  Description: A collection of all widgets, neatly bundled into a single plugin. It's also a framework to code your own widgets on top of.
5
+ Version: 1.5.2
6
  Text Domain: so-widgets-bundle
7
  Domain Path: /languages
8
  Author: SiteOrigin
12
  License URI: https://www.gnu.org/licenses/gpl-3.0.txt
13
  */
14
 
15
+ define('SOW_BUNDLE_VERSION', '1.5.2');
16
  define('SOW_BUNDLE_JS_SUFFIX', '.min');
17
  define('SOW_BUNDLE_BASE_FILE', __FILE__);
18
 
widgets/so-contact-widget/so-contact-widget.php CHANGED
@@ -252,7 +252,7 @@ class SiteOrigin_Widgets_ContactForm_Widget extends SiteOrigin_Widget {
252
  ),
253
  'border_color' => array(
254
  'type' => 'color',
255
- 'label' => __('Error background color', 'so-widgets-bundle'),
256
  'default' => '#ec666a',
257
  ),
258
  'text_color' => array(
@@ -296,7 +296,7 @@ class SiteOrigin_Widgets_ContactForm_Widget extends SiteOrigin_Widget {
296
  ),
297
  'border_color' => array(
298
  'type' => 'color',
299
- 'label' => __('Background color', 'so-widgets-bundle'),
300
  'default' => '#989a9c',
301
  ),
302
  'border_style' => array(
@@ -306,8 +306,17 @@ class SiteOrigin_Widgets_ContactForm_Widget extends SiteOrigin_Widget {
306
  'options' => array(
307
  'none' => __('None', 'so-widgets-bundle'),
308
  'solid' => __('Solid', 'so-widgets-bundle'),
 
 
309
  )
310
  ),
 
 
 
 
 
 
 
311
  'border_radius' => array(
312
  'type' => 'slider',
313
  'label' => __('Border rounding', 'so-widgets-bundle'),
@@ -320,6 +329,11 @@ class SiteOrigin_Widgets_ContactForm_Widget extends SiteOrigin_Widget {
320
  'label' => __('Text color', 'so-widgets-bundle'),
321
  'default' => '#5a5a5a',
322
  ),
 
 
 
 
 
323
  'weight' => array(
324
  'type' => 'select',
325
  'label' => __('Font weight', 'so-widgets-bundle'),
@@ -420,6 +434,9 @@ class SiteOrigin_Widgets_ContactForm_Widget extends SiteOrigin_Widget {
420
  }
421
 
422
  function get_less_variables( $instance ){
 
 
 
423
  $vars = array(
424
  // All the container variables.
425
  'container_background' => $instance['design']['container']['background'],
@@ -440,8 +457,10 @@ class SiteOrigin_Widgets_ContactForm_Widget extends SiteOrigin_Widget {
440
  'submit_background_gradient' => $instance['design']['submit']['background_gradient'] . '%',
441
  'submit_border_color' => $instance['design']['submit']['border_color'],
442
  'submit_border_style' => $instance['design']['submit']['border_style'],
 
443
  'submit_border_radius' => $instance['design']['submit']['border_radius'] . 'px',
444
  'submit_text_color' => $instance['design']['submit']['text_color'],
 
445
  'submit_weight' => $instance['design']['submit']['weight'],
446
  'submit_padding' => $instance['design']['submit']['padding'] . 'px',
447
  'submit_inset_highlight' => $instance['design']['submit']['inset_highlight'] . '%',
@@ -470,14 +489,15 @@ class SiteOrigin_Widgets_ContactForm_Widget extends SiteOrigin_Widget {
470
  * @param $fields
471
  * @param $errors
472
  */
473
- function render_form_fields( $fields, $errors = array() ){
474
 
475
  $field_ids = array();
476
 
477
  foreach( $fields as $i => $field ) {
478
  if( empty( $field['type'] ) ) continue;
479
-
480
- $field_name = $this->name_from_label( !empty($field['label']) ? $field['label'] : $i, $field_ids );
 
481
  $field_id = 'sow-contact-form-field-' . $field_name;
482
 
483
  $value = '';
@@ -566,7 +586,7 @@ class SiteOrigin_Widgets_ContactForm_Widget extends SiteOrigin_Widget {
566
  $field_ids = array();
567
  foreach( $instance['fields'] as $i => $field ) {
568
  if( empty( $field['type'] ) ) continue;
569
- $field_name = $this->name_from_label( !empty($field['label']) ? $field['label'] : $i, $field_ids );
570
  $value = !empty( $post_vars[$field_name] ) ? $post_vars[$field_name] : '';
571
 
572
  if( $field['required']['required'] && empty($value) ) {
252
  ),
253
  'border_color' => array(
254
  'type' => 'color',
255
+ 'label' => __('Error border color', 'so-widgets-bundle'),
256
  'default' => '#ec666a',
257
  ),
258
  'text_color' => array(
296
  ),
297
  'border_color' => array(
298
  'type' => 'color',
299
+ 'label' => __('Border color', 'so-widgets-bundle'),
300
  'default' => '#989a9c',
301
  ),
302
  'border_style' => array(
306
  'options' => array(
307
  'none' => __('None', 'so-widgets-bundle'),
308
  'solid' => __('Solid', 'so-widgets-bundle'),
309
+ 'dotted' => __('Dotted', 'so-widgets-bundle'),
310
+ 'dashed' => __('Dashed', 'so-widgets-bundle'),
311
  )
312
  ),
313
+ 'border_width' => array(
314
+ 'type' => 'slider',
315
+ 'label' => __('Border width', 'so-widgets-bundle'),
316
+ 'default' => 1,
317
+ 'max' => 10,
318
+ 'min' => 0
319
+ ),
320
  'border_radius' => array(
321
  'type' => 'slider',
322
  'label' => __('Border rounding', 'so-widgets-bundle'),
329
  'label' => __('Text color', 'so-widgets-bundle'),
330
  'default' => '#5a5a5a',
331
  ),
332
+ 'font_size' => array(
333
+ 'type' => 'measurement',
334
+ 'label' => __('Font size', 'so-widgets-bundle'),
335
+ 'default' => 'default',
336
+ ),
337
  'weight' => array(
338
  'type' => 'select',
339
  'label' => __('Font weight', 'so-widgets-bundle'),
434
  }
435
 
436
  function get_less_variables( $instance ){
437
+ // Newly added field could cause fatal errors with previously saved forms.
438
+ $font_size = empty( $instance['design']['submit']['font_size'] ) ? 'default' : $instance['design']['submit']['font_size'];
439
+ $font_size_unit = empty( $instance['design']['submit']['font_size_unit'] ) ? 'px' : $instance['design']['submit']['font_size_unit'];
440
  $vars = array(
441
  // All the container variables.
442
  'container_background' => $instance['design']['container']['background'],
457
  'submit_background_gradient' => $instance['design']['submit']['background_gradient'] . '%',
458
  'submit_border_color' => $instance['design']['submit']['border_color'],
459
  'submit_border_style' => $instance['design']['submit']['border_style'],
460
+ 'submit_border_width' => $instance['design']['submit']['border_width'] . 'px',
461
  'submit_border_radius' => $instance['design']['submit']['border_radius'] . 'px',
462
  'submit_text_color' => $instance['design']['submit']['text_color'],
463
+ 'submit_font_size' => $font_size . $font_size_unit,
464
  'submit_weight' => $instance['design']['submit']['weight'],
465
  'submit_padding' => $instance['design']['submit']['padding'] . 'px',
466
  'submit_inset_highlight' => $instance['design']['submit']['inset_highlight'] . '%',
489
  * @param $fields
490
  * @param $errors
491
  */
492
+ function render_form_fields( $fields, $errors = array(), $instance ){
493
 
494
  $field_ids = array();
495
 
496
  foreach( $fields as $i => $field ) {
497
  if( empty( $field['type'] ) ) continue;
498
+ // Using `$instance['_sow_form_id']` to uniquely identify contact form fields across widgets.
499
+ // I.e. if there are many contact form widgets on a page this will prevent field name conflicts.
500
+ $field_name = $this->name_from_label( !empty($field['label']) ? $field['label'] : $i, $field_ids ) . '-' . $instance['_sow_form_id'];
501
  $field_id = 'sow-contact-form-field-' . $field_name;
502
 
503
  $value = '';
586
  $field_ids = array();
587
  foreach( $instance['fields'] as $i => $field ) {
588
  if( empty( $field['type'] ) ) continue;
589
+ $field_name = $this->name_from_label( !empty($field['label']) ? $field['label'] : $i, $field_ids ) . '-' . $instance['_sow_form_id'];
590
  $value = !empty( $post_vars[$field_name] ) ? $post_vars[$field_name] : '';
591
 
592
  if( $field['required']['required'] && empty($value) ) {
widgets/so-contact-widget/styles/default.less CHANGED
@@ -15,7 +15,7 @@
15
  }
16
 
17
  textarea,
18
- input.sow-text-field, {
19
  .box-sizing(border-box);
20
  display: block;
21
  width: 100%;
@@ -93,24 +93,27 @@
93
  @submit_background_gradient: 10%;
94
  @submit_border_color: #989a9c;
95
  @submit_border_style: solid;
 
96
  @submit_border_radius: 3px;
97
  @submit_text_color: #5a5a5a;
 
98
  @submit_weight: 500;
99
  @submit_padding: 10px;
100
 
101
  @submit_inset_highlight: 50%;
102
 
103
  .sow-submit {
104
- color: @submit_text;
105
  .gradient(
106
  lighten(@submit_background_color, @submit_background_gradient),
107
  darken(@submit_background_color, @submit_background_gradient),
108
  lighten(@submit_background_color, @submit_background_gradient)
109
  );
110
 
111
- border: 1px @submit_border_style @submit_border_color;
112
  border-radius: @submit_border_radius;
113
  font-weight: @submit_weight;
 
114
  padding: @submit_padding @submit_padding * 2;
115
  display: inline-block;
116
 
@@ -123,4 +126,4 @@
123
 
124
 
125
  }
126
- }
15
  }
16
 
17
  textarea,
18
+ input.sow-text-field {
19
  .box-sizing(border-box);
20
  display: block;
21
  width: 100%;
93
  @submit_background_gradient: 10%;
94
  @submit_border_color: #989a9c;
95
  @submit_border_style: solid;
96
+ @submit_border_width: 1px;
97
  @submit_border_radius: 3px;
98
  @submit_text_color: #5a5a5a;
99
+ @submit_font_size: default;
100
  @submit_weight: 500;
101
  @submit_padding: 10px;
102
 
103
  @submit_inset_highlight: 50%;
104
 
105
  .sow-submit {
106
+ color: @submit_text_color;
107
  .gradient(
108
  lighten(@submit_background_color, @submit_background_gradient),
109
  darken(@submit_background_color, @submit_background_gradient),
110
  lighten(@submit_background_color, @submit_background_gradient)
111
  );
112
 
113
+ border: @submit_border_width @submit_border_style @submit_border_color;
114
  border-radius: @submit_border_radius;
115
  font-weight: @submit_weight;
116
+ font-size: @submit_font_size;
117
  padding: @submit_padding @submit_padding * 2;
118
  display: inline-block;
119
 
126
 
127
 
128
  }
129
+ }
widgets/so-contact-widget/tpl/default.php CHANGED
@@ -29,7 +29,7 @@ else {
29
  </ul>
30
  <?php endif ?>
31
 
32
- <?php $this->render_form_fields( $instance['fields'], $result['errors'] ) ?>
33
  <input type="hidden" name="instance_hash" value="<?php echo esc_attr($instance_hash) ?>" />
34
 
35
  <?php if( $instance['spam']['recaptcha']['use_captcha'] ) : ?>
29
  </ul>
30
  <?php endif ?>
31
 
32
+ <?php $this->render_form_fields( $instance['fields'], $result['errors'], $instance ) ?>
33
  <input type="hidden" name="instance_hash" value="<?php echo esc_attr($instance_hash) ?>" />
34
 
35
  <?php if( $instance['spam']['recaptcha']['use_captcha'] ) : ?>
widgets/so-features-widget/so-features-widget.php CHANGED
@@ -80,6 +80,76 @@ class SiteOrigin_Widget_Features_Widget extends SiteOrigin_Widget {
80
  ),
81
  ),
82
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
83
  'container_shape' => array(
84
  'type' => 'select',
85
  'label' => __('Container shape', 'so-widgets-bundle'),
@@ -149,7 +219,47 @@ class SiteOrigin_Widget_Features_Widget extends SiteOrigin_Widget {
149
  }
150
 
151
  function get_style_name($instance){
152
- return false;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
153
  }
154
 
155
  function get_template_name($instance){
80
  ),
81
  ),
82
 
83
+ 'fonts' => array(
84
+ 'type' => 'section',
85
+ 'label' => __( 'Fonts', 'so-widgets-bundle' ),
86
+ 'hide' => true,
87
+ 'fields' => array(
88
+ 'title_options' => array(
89
+ 'type' => 'section',
90
+ 'label' => __( 'Title', 'so-widgets-bundle' ),
91
+ 'hide' => true,
92
+ 'fields' => array(
93
+ 'font' => array(
94
+ 'type' => 'font',
95
+ 'label' => __( 'Font', 'so-widgets-bundle' ),
96
+ 'default' => 'default'
97
+ ),
98
+ 'size' => array(
99
+ 'type' => 'measurement',
100
+ 'label' => __( 'Size', 'so-widgets-bundle' ),
101
+ ),
102
+ 'color' => array(
103
+ 'type' => 'color',
104
+ 'label' => __( 'Color', 'so-widgets-bundle' ),
105
+ )
106
+ )
107
+ ),
108
+
109
+ 'text_options' => array(
110
+ 'type' => 'section',
111
+ 'label' => __( 'Text', 'so-widgets-bundle' ),
112
+ 'hide' => true,
113
+ 'fields' => array(
114
+ 'font' => array(
115
+ 'type' => 'font',
116
+ 'label' => __( 'Font', 'so-widgets-bundle' ),
117
+ 'default' => 'default'
118
+ ),
119
+ 'size' => array(
120
+ 'type' => 'measurement',
121
+ 'label' => __( 'Size', 'so-widgets-bundle' ),
122
+ ),
123
+ 'color' => array(
124
+ 'type' => 'color',
125
+ 'label' => __( 'Color', 'so-widgets-bundle' ),
126
+ )
127
+ )
128
+ ),
129
+
130
+ 'more_text_options' => array(
131
+ 'type' => 'section',
132
+ 'label' => __( 'More Link', 'so-widgets-bundle' ),
133
+ 'hide' => true,
134
+ 'fields' => array(
135
+ 'font' => array(
136
+ 'type' => 'font',
137
+ 'label' => __( 'Font', 'so-widgets-bundle' ),
138
+ 'default' => 'default'
139
+ ),
140
+ 'size' => array(
141
+ 'type' => 'measurement',
142
+ 'label' => __( 'Size', 'so-widgets-bundle' ),
143
+ ),
144
+ 'color' => array(
145
+ 'type' => 'color',
146
+ 'label' => __( 'Color', 'so-widgets-bundle' ),
147
+ )
148
+ )
149
+ ),
150
+ ),
151
+ ),
152
+
153
  'container_shape' => array(
154
  'type' => 'select',
155
  'label' => __('Container shape', 'so-widgets-bundle'),
219
  }
220
 
221
  function get_style_name($instance){
222
+ return 'features';
223
+ }
224
+
225
+ function get_less_variables( $instance ) {
226
+ $less_vars = array();
227
+
228
+ $fonts = $instance['fonts'];
229
+ $styleable_text_fields = array( 'title', 'text', 'more_text' );
230
+
231
+ foreach ( $styleable_text_fields as $field_name ) {
232
+
233
+ if ( ! empty( $fonts[$field_name.'_options'] ) ) {
234
+ $styles = $fonts[$field_name.'_options'];
235
+ if ( ! empty( $styles['size'] ) ) {
236
+ $less_vars[$field_name.'_size'] = $styles['size'] . $styles['size_unit'];
237
+ }
238
+ if ( ! empty( $styles['color'] ) ) {
239
+ $less_vars[$field_name.'_color'] = $styles['color'];
240
+ }
241
+ if ( ! empty( $styles['font'] ) ) {
242
+ $font = siteorigin_widget_get_font( $styles['font'] );
243
+ $less_vars[$field_name.'_font'] = $font['family'];
244
+ if ( ! empty( $font['weight'] ) ) {
245
+ $less_vars[$field_name.'_font_weight'] = $font['weight'];
246
+ }
247
+ }
248
+ }
249
+ }
250
+
251
+ return $less_vars;
252
+ }
253
+
254
+ function get_google_font_fields( $instance ) {
255
+
256
+ $fonts = $instance['fonts'];
257
+
258
+ return array(
259
+ $fonts['title_options']['font'],
260
+ $fonts['text_options']['font'],
261
+ $fonts['more_text_options']['font'],
262
+ );
263
  }
264
 
265
  function get_template_name($instance){
widgets/so-features-widget/styles/features.less ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ @import "../../../base/less/mixins";
2
+
3
+ .widget-function('import_google_font');
4
+
5
+ @title_font: default;
6
+ @title_font_weight: 400;
7
+ @title_size: 16px;
8
+ @title_color: #000000;
9
+
10
+ @text_font: default;
11
+ @text_font_weight: 400;
12
+ @text_size: 12px;
13
+ @text_color: #000000;
14
+
15
+ @more_text_font: default;
16
+ @more_text_font_weight: 400;
17
+ @more_text_size: 12px;
18
+ @more_text_color: #000000;
19
+
20
+ .sow-features-list .sow-features-feature {
21
+
22
+ .textwidget {
23
+ > h5 {
24
+ .font(@title_font, @title_font_weight);
25
+ //text-align: @headline_align;
26
+ font-size: @title_size;
27
+ color: @title_color;
28
+ line-height: 1.3;
29
+ }
30
+
31
+ > p {
32
+ .font(@text_font, @text_font_weight);
33
+ //text-align: @headline_align;
34
+ font-size: @text_size;
35
+ color: @text_color;
36
+ line-height: 1.3;
37
+ }
38
+
39
+ > p.sow-more-text {
40
+ .font(@more_text_font, @more_text_font_weight);
41
+ //text-align: @headline_align;
42
+ font-size: @more_text_size;
43
+ color: @more_text_color;
44
+ line-height: 1.3;
45
+ }
46
+ }
47
+ }
widgets/so-google-map-widget/js/js-map.js CHANGED
@@ -2,174 +2,172 @@
2
  * (c) SiteOrigin, freely distributable under the terms of the GPL 2.0 license.
3
  */
4
 
5
- function loadMap($) {
6
- $('.sow-google-map-canvas').each(function () {
7
- var $$ = $(this);
8
- var mapCenter = $$.data('address');
9
- if(!mapCenter) {
10
- var markers = $$.data('marker-positions');
11
- if(markers && markers.length) {
12
- mapCenter = markers[0].place;
 
 
13
  }
14
- }
15
- // We use the geocoder
16
- var geocoder = new google.maps.Geocoder();
17
- geocoder.geocode({'address': mapCenter}, function (results, status) {
18
- if (status == google.maps.GeocoderStatus.OK) {
19
- var zoom = Number($$.data('zoom'));
20
- if ( !zoom ) zoom = 14;
21
-
22
- var userMapTypeId = 'user_map_style';
23
-
24
- var mapOptions = {
25
- zoom: zoom,
26
- scrollwheel: Boolean( $$.data('scroll-zoom') ),
27
- draggable: Boolean( $$.data('draggable') ),
28
- disableDefaultUI: Boolean( $$.data('disable-ui') ),
29
- center: results[0].geometry.location,
30
- mapTypeControlOptions: {
31
- mapTypeIds: [google.maps.MapTypeId.ROADMAP, userMapTypeId]
32
- }
33
- };
34
-
35
- var map = new google.maps.Map($$.get(0), mapOptions);
36
 
37
- var userMapOptions = {
38
- name: $$.data('map-name')
39
- };
40
 
41
- var userMapStyles = $$.data('map-styles');
 
 
42
 
43
- if ( userMapStyles ) {
44
- var userMapType = new google.maps.StyledMapType(userMapStyles, userMapOptions);
45
 
46
- map.mapTypes.set(userMapTypeId, userMapType);
47
- map.setMapTypeId(userMapTypeId);
48
- }
49
 
50
- if ( Boolean( $$.data('marker-at-center' ) ) ) {
 
 
51
 
52
- new google.maps.Marker({
53
- position: results[0].geometry.location,
54
- map: map,
55
- draggable: Boolean( $$.data('markers-draggable') ),
56
- icon: $$.data('marker-icon'),
57
- title: ''
58
- });
59
- }
60
- var markerPositions = $$.data('marker-positions');
61
- if ( markerPositions && markerPositions.length ) {
62
- markerPositions.forEach(
63
- function(mrkr) {
64
- var geocodeMarker = function () {
65
- geocoder.geocode({'address': mrkr.place}, function (res, status) {
66
- if (status == google.maps.GeocoderStatus.OK) {
67
-
68
- var marker = new google.maps.Marker({
69
- position: res[0].geometry.location,
70
- map: map,
71
- draggable: Boolean($$.data('markers-draggable')),
72
- icon: $$.data('marker-icon'),
73
- title: ''
74
- });
75
-
76
- if(mrkr.hasOwnProperty('info') && mrkr.info) {
77
- var infoWindowOptions = { content: mrkr.info };
78
-
79
- if(mrkr.hasOwnProperty('info_max_width') && mrkr.info_max_width) {
80
- infoWindowOptions.maxWidth = mrkr.info_max_width;
81
- }
82
 
83
- var infoDisplay = $$.data('marker-info-display');
84
- infoWindowOptions.disableAutoPan = infoDisplay == 'always';
85
- var infoWindow = new google.maps.InfoWindow(infoWindowOptions);
86
- if( infoDisplay == 'always') {
87
- infoWindow.open(map, marker);
88
- } else {
89
- marker.addListener(infoDisplay, function() {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
90
  infoWindow.open(map, marker);
91
- });
 
 
 
 
92
  }
 
 
 
93
  }
94
- } else if (status == google.maps.GeocoderStatus.OVER_QUERY_LIMIT) {
95
- //try again please
96
- setTimeout(geocodeMarker, Math.random() * 1000, mrkr);
97
- }
98
- });
99
- };
100
- //set random delays of 0 - 1 seconds when geocoding markers to try avoid hitting the query limit
101
- setTimeout(geocodeMarker, Math.random() * 1000, mrkr);
102
- }
103
- );
104
- }
105
-
106
- var directions = $$.data('directions');
107
- if ( directions ) {
108
-
109
- if ( directions.waypoints && directions.waypoints.length ) {
110
- directions.waypoints.map(
111
- function (wypt) {
112
- wypt.stopover = Boolean(wypt.stopover);
113
  }
114
  );
115
  }
116
 
117
- var directionsRenderer = new google.maps.DirectionsRenderer();
118
- directionsRenderer.setMap(map);
119
-
120
- var directionsService = new google.maps.DirectionsService();
121
- directionsService.route({
122
- origin: directions.origin,
123
- destination: directions.destination,
124
- travelMode: directions.travelMode.toUpperCase(),
125
- avoidHighways: Boolean( directions.avoidHighways ),
126
- avoidTolls: Boolean( directions.avoidTolls ),
127
- waypoints: directions.waypoints,
128
- optimizeWaypoints: Boolean( directions.optimizeWaypoints )
129
- },
130
- function(result, status) {
131
- if (status == google.maps.DirectionsStatus.OK) {
132
- directionsRenderer.setDirections(result);
133
  }
134
- });
135
- }
136
 
137
- if(Boolean( $$.data('keep-centered') )) {
138
- var center;
139
- google.maps.event.addDomListener(map, 'idle', function () {
140
- center = map.getCenter();
141
- });
142
- google.maps.event.addDomListener(window, 'resize', function () {
143
- map.setCenter(center);
144
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
145
  }
146
- }
147
- else if (status == google.maps.GeocoderStatus.ZERO_RESULTS) {
148
- $$.append('<div><p><strong>There were no results for the place you entered. Please try another.</strong></p></div>');
149
- }
150
  });
151
- });
152
- }
153
-
154
- function loadApi($) {
155
- var apiKey = $('.sow-google-map-canvas').data('api-key');
156
-
157
- var apiUrl = 'https://maps.googleapis.com/maps/api/js?v=3.exp&callback=initialize';
158
- if(apiKey) {
159
- apiUrl += '&key=' + apiKey;
160
  }
161
- var script = $('<script type="text/javascript" src="' + apiUrl + '">');
162
- $('body').append(script);
163
- }
164
 
165
- function initialize() {
166
- loadMap(window.jQuery);
167
  }
168
 
169
  jQuery(function ($) {
170
  if (window.google && window.google.maps) {
171
- loadMap($);
172
  } else {
173
- loadApi($);
 
 
 
 
 
 
 
174
  }
175
- });
2
  * (c) SiteOrigin, freely distributable under the terms of the GPL 2.0 license.
3
  */
4
 
5
+ var SiteOriginGoogleMap = {
6
+ loadMap: function($) {
7
+ $('.sow-google-map-canvas').each(function () {
8
+ var $$ = $(this);
9
+ var mapCenter = $$.data('address');
10
+ if(!mapCenter) {
11
+ var markers = $$.data('marker-positions');
12
+ if(markers && markers.length) {
13
+ mapCenter = markers[0].place;
14
+ }
15
  }
16
+ // We use the geocoder
17
+ var geocoder = new google.maps.Geocoder();
18
+ geocoder.geocode({'address': mapCenter}, function (results, status) {
19
+ if (status == google.maps.GeocoderStatus.OK) {
20
+ var zoom = Number($$.data('zoom'));
21
+ if ( !zoom ) zoom = 14;
22
+
23
+ var userMapTypeId = 'user_map_style';
24
+
25
+ var mapOptions = {
26
+ zoom: zoom,
27
+ scrollwheel: Boolean( $$.data('scroll-zoom') ),
28
+ draggable: Boolean( $$.data('draggable') ),
29
+ disableDefaultUI: Boolean( $$.data('disable-ui') ),
30
+ center: results[0].geometry.location,
31
+ mapTypeControlOptions: {
32
+ mapTypeIds: [google.maps.MapTypeId.ROADMAP, userMapTypeId]
33
+ }
34
+ };
 
 
 
35
 
36
+ var map = new google.maps.Map($$.get(0), mapOptions);
 
 
37
 
38
+ var userMapOptions = {
39
+ name: $$.data('map-name')
40
+ };
41
 
42
+ var userMapStyles = $$.data('map-styles');
 
43
 
44
+ if ( userMapStyles ) {
45
+ var userMapType = new google.maps.StyledMapType(userMapStyles, userMapOptions);
 
46
 
47
+ map.mapTypes.set(userMapTypeId, userMapType);
48
+ map.setMapTypeId(userMapTypeId);
49
+ }
50
 
51
+ if ( Boolean( $$.data('marker-at-center' ) ) ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
52
 
53
+ new google.maps.Marker({
54
+ position: results[0].geometry.location,
55
+ map: map,
56
+ draggable: Boolean( $$.data('markers-draggable') ),
57
+ icon: $$.data('marker-icon'),
58
+ title: ''
59
+ });
60
+ }
61
+ var markerPositions = $$.data('marker-positions');
62
+ if ( markerPositions && markerPositions.length ) {
63
+ markerPositions.forEach(
64
+ function(mrkr) {
65
+ var geocodeMarker = function () {
66
+ geocoder.geocode({'address': mrkr.place}, function (res, status) {
67
+ if (status == google.maps.GeocoderStatus.OK) {
68
+
69
+ var marker = new google.maps.Marker({
70
+ position: res[0].geometry.location,
71
+ map: map,
72
+ draggable: Boolean($$.data('markers-draggable')),
73
+ icon: $$.data('marker-icon'),
74
+ title: ''
75
+ });
76
+
77
+ if(mrkr.hasOwnProperty('info') && mrkr.info) {
78
+ var infoWindowOptions = { content: mrkr.info };
79
+
80
+ if(mrkr.hasOwnProperty('info_max_width') && mrkr.info_max_width) {
81
+ infoWindowOptions.maxWidth = mrkr.info_max_width;
82
+ }
83
+
84
+ var infoDisplay = $$.data('marker-info-display');
85
+ infoWindowOptions.disableAutoPan = infoDisplay == 'always';
86
+ var infoWindow = new google.maps.InfoWindow(infoWindowOptions);
87
+ if( infoDisplay == 'always') {
88
  infoWindow.open(map, marker);
89
+ } else {
90
+ marker.addListener(infoDisplay, function() {
91
+ infoWindow.open(map, marker);
92
+ });
93
+ }
94
  }
95
+ } else if (status == google.maps.GeocoderStatus.OVER_QUERY_LIMIT) {
96
+ //try again please
97
+ setTimeout(geocodeMarker, Math.random() * 1000, mrkr);
98
  }
99
+ });
100
+ };
101
+ //set random delays of 0 - 1 seconds when geocoding markers to try avoid hitting the query limit
102
+ setTimeout(geocodeMarker, Math.random() * 1000, mrkr);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
103
  }
104
  );
105
  }
106
 
107
+ var directions = $$.data('directions');
108
+ if ( directions ) {
109
+
110
+ if ( directions.waypoints && directions.waypoints.length ) {
111
+ directions.waypoints.map(
112
+ function (wypt) {
113
+ wypt.stopover = Boolean(wypt.stopover);
114
+ }
115
+ );
 
 
 
 
 
 
 
116
  }
 
 
117
 
118
+ var directionsRenderer = new google.maps.DirectionsRenderer();
119
+ directionsRenderer.setMap(map);
120
+
121
+ var directionsService = new google.maps.DirectionsService();
122
+ directionsService.route({
123
+ origin: directions.origin,
124
+ destination: directions.destination,
125
+ travelMode: directions.travelMode.toUpperCase(),
126
+ avoidHighways: Boolean( directions.avoidHighways ),
127
+ avoidTolls: Boolean( directions.avoidTolls ),
128
+ waypoints: directions.waypoints,
129
+ optimizeWaypoints: Boolean( directions.optimizeWaypoints )
130
+ },
131
+ function(result, status) {
132
+ if (status == google.maps.DirectionsStatus.OK) {
133
+ directionsRenderer.setDirections(result);
134
+ }
135
+ });
136
+ }
137
+
138
+ if(Boolean( $$.data('keep-centered') )) {
139
+ var center;
140
+ google.maps.event.addDomListener(map, 'idle', function () {
141
+ center = map.getCenter();
142
+ });
143
+ google.maps.event.addDomListener(window, 'resize', function () {
144
+ map.setCenter(center);
145
+ });
146
+ }
147
  }
148
+ else if (status == google.maps.GeocoderStatus.ZERO_RESULTS) {
149
+ $$.append('<div><p><strong>There were no results for the place you entered. Please try another.</strong></p></div>');
150
+ }
151
+ });
152
  });
 
 
 
 
 
 
 
 
 
153
  }
154
+ };
 
 
155
 
156
+ function soGoogleMapInitialize() {
157
+ SiteOriginGoogleMap.loadMap(window.jQuery);
158
  }
159
 
160
  jQuery(function ($) {
161
  if (window.google && window.google.maps) {
162
+ SiteOriginGoogleMap.loadMap($);
163
  } else {
164
+ var apiKey = $('.sow-google-map-canvas').data('api-key');
165
+
166
+ var apiUrl = 'https://maps.googleapis.com/maps/api/js?v=3.exp&callback=soGoogleMapInitialize';
167
+ if(apiKey) {
168
+ apiUrl += '&key=' + apiKey;
169
+ }
170
+ var script = $('<script type="text/javascript" src="' + apiUrl + '">');
171
+ $('body').append(script);
172
  }
173
+ });
widgets/so-google-map-widget/js/js-map.min.js CHANGED
@@ -1 +1 @@
1
- function loadMap(a){a(".sow-google-map-canvas").each(function(){var e=a(this),o=e.data("address");if(!o){var t=e.data("marker-positions");t&&t.length&&(o=t[0].place)}var n=new google.maps.Geocoder;n.geocode({address:o},function(a,o){if(o==google.maps.GeocoderStatus.OK){var t=Number(e.data("zoom"));t||(t=14);var i="user_map_style",r={zoom:t,scrollwheel:Boolean(e.data("scroll-zoom")),draggable:Boolean(e.data("draggable")),disableDefaultUI:Boolean(e.data("disable-ui")),center:a[0].geometry.location,mapTypeControlOptions:{mapTypeIds:[google.maps.MapTypeId.ROADMAP,i]}},s=new google.maps.Map(e.get(0),r),p={name:e.data("map-name")},d=e.data("map-styles");if(d){var l=new google.maps.StyledMapType(d,p);s.mapTypes.set(i,l),s.setMapTypeId(i)}Boolean(e.data("marker-at-center"))&&new google.maps.Marker({position:a[0].geometry.location,map:s,draggable:Boolean(e.data("markers-draggable")),icon:e.data("marker-icon"),title:""});var g=e.data("marker-positions");g&&g.length&&g.forEach(function(a){var o=function(){n.geocode({address:a.place},function(t,n){if(n==google.maps.GeocoderStatus.OK){var i=new google.maps.Marker({position:t[0].geometry.location,map:s,draggable:Boolean(e.data("markers-draggable")),icon:e.data("marker-icon"),title:""});if(a.hasOwnProperty("info")&&a.info){var r={content:a.info};a.hasOwnProperty("info_max_width")&&a.info_max_width&&(r.maxWidth=a.info_max_width);var p=e.data("marker-info-display");r.disableAutoPan="always"==p;var d=new google.maps.InfoWindow(r);"always"==p?d.open(s,i):i.addListener(p,function(){d.open(s,i)})}}else n==google.maps.GeocoderStatus.OVER_QUERY_LIMIT&&setTimeout(o,1e3*Math.random(),a)})};setTimeout(o,1e3*Math.random(),a)});var m=e.data("directions");if(m){m.waypoints&&m.waypoints.length&&m.waypoints.map(function(a){a.stopover=Boolean(a.stopover)});var c=new google.maps.DirectionsRenderer;c.setMap(s);var v=new google.maps.DirectionsService;v.route({origin:m.origin,destination:m.destination,travelMode:m.travelMode.toUpperCase(),avoidHighways:Boolean(m.avoidHighways),avoidTolls:Boolean(m.avoidTolls),waypoints:m.waypoints,optimizeWaypoints:Boolean(m.optimizeWaypoints)},function(a,e){e==google.maps.DirectionsStatus.OK&&c.setDirections(a)})}if(Boolean(e.data("keep-centered"))){var w;google.maps.event.addDomListener(s,"idle",function(){w=s.getCenter()}),google.maps.event.addDomListener(window,"resize",function(){s.setCenter(w)})}}else o==google.maps.GeocoderStatus.ZERO_RESULTS&&e.append("<div><p><strong>There were no results for the place you entered. Please try another.</strong></p></div>")})})}function loadApi(a){var e=a(".sow-google-map-canvas").data("api-key"),o="https://maps.googleapis.com/maps/api/js?v=3.exp&callback=initialize";e&&(o+="&key="+e);var t=a('<script type="text/javascript" src="'+o+'">');a("body").append(t)}function initialize(){loadMap(window.jQuery)}jQuery(function(a){window.google&&window.google.maps?loadMap(a):loadApi(a)});
1
+ function soGoogleMapInitialize(){SiteOriginGoogleMap.loadMap(window.jQuery)}var SiteOriginGoogleMap={loadMap:function(a){a(".sow-google-map-canvas").each(function(){var e=a(this),o=e.data("address");if(!o){var t=e.data("marker-positions");t&&t.length&&(o=t[0].place)}var n=new google.maps.Geocoder;n.geocode({address:o},function(a,o){if(o==google.maps.GeocoderStatus.OK){var t=Number(e.data("zoom"));t||(t=14);var i="user_map_style",r={zoom:t,scrollwheel:Boolean(e.data("scroll-zoom")),draggable:Boolean(e.data("draggable")),disableDefaultUI:Boolean(e.data("disable-ui")),center:a[0].geometry.location,mapTypeControlOptions:{mapTypeIds:[google.maps.MapTypeId.ROADMAP,i]}},s=new google.maps.Map(e.get(0),r),p={name:e.data("map-name")},l=e.data("map-styles");if(l){var d=new google.maps.StyledMapType(l,p);s.mapTypes.set(i,d),s.setMapTypeId(i)}Boolean(e.data("marker-at-center"))&&new google.maps.Marker({position:a[0].geometry.location,map:s,draggable:Boolean(e.data("markers-draggable")),icon:e.data("marker-icon"),title:""});var g=e.data("marker-positions");g&&g.length&&g.forEach(function(a){var o=function(){n.geocode({address:a.place},function(t,n){if(n==google.maps.GeocoderStatus.OK){var i=new google.maps.Marker({position:t[0].geometry.location,map:s,draggable:Boolean(e.data("markers-draggable")),icon:e.data("marker-icon"),title:""});if(a.hasOwnProperty("info")&&a.info){var r={content:a.info};a.hasOwnProperty("info_max_width")&&a.info_max_width&&(r.maxWidth=a.info_max_width);var p=e.data("marker-info-display");r.disableAutoPan="always"==p;var l=new google.maps.InfoWindow(r);"always"==p?l.open(s,i):i.addListener(p,function(){l.open(s,i)})}}else n==google.maps.GeocoderStatus.OVER_QUERY_LIMIT&&setTimeout(o,1e3*Math.random(),a)})};setTimeout(o,1e3*Math.random(),a)});var m=e.data("directions");if(m){m.waypoints&&m.waypoints.length&&m.waypoints.map(function(a){a.stopover=Boolean(a.stopover)});var c=new google.maps.DirectionsRenderer;c.setMap(s);var v=new google.maps.DirectionsService;v.route({origin:m.origin,destination:m.destination,travelMode:m.travelMode.toUpperCase(),avoidHighways:Boolean(m.avoidHighways),avoidTolls:Boolean(m.avoidTolls),waypoints:m.waypoints,optimizeWaypoints:Boolean(m.optimizeWaypoints)},function(a,e){e==google.maps.DirectionsStatus.OK&&c.setDirections(a)})}if(Boolean(e.data("keep-centered"))){var w;google.maps.event.addDomListener(s,"idle",function(){w=s.getCenter()}),google.maps.event.addDomListener(window,"resize",function(){s.setCenter(w)})}}else o==google.maps.GeocoderStatus.ZERO_RESULTS&&e.append("<div><p><strong>There were no results for the place you entered. Please try another.</strong></p></div>")})})}};jQuery(function(a){if(window.google&&window.google.maps)SiteOriginGoogleMap.loadMap(a);else{var e=a(".sow-google-map-canvas").data("api-key"),o="https://maps.googleapis.com/maps/api/js?v=3.exp&callback=soGoogleMapInitialize";e&&(o+="&key="+e);var t=a('<script type="text/javascript" src="'+o+'">');a("body").append(t)}});
widgets/so-google-map-widget/so-google-map-widget.php CHANGED
@@ -368,7 +368,7 @@ class SiteOrigin_Widget_GoogleMap_Widget extends SiteOrigin_Widget {
368
  'sow-google-map',
369
  plugin_dir_url(__FILE__) . 'js/js-map' . SOW_BUNDLE_JS_SUFFIX . '.js',
370
  array( 'jquery' ),
371
- SOW_BUNDLE_VERSION . mt_rand()
372
  )
373
  )
374
  );
368
  'sow-google-map',
369
  plugin_dir_url(__FILE__) . 'js/js-map' . SOW_BUNDLE_JS_SUFFIX . '.js',
370
  array( 'jquery' ),
371
+ SOW_BUNDLE_VERSION
372
  )
373
  )
374
  );
widgets/so-headline-widget/so-headline-widget.php CHANGED
@@ -49,7 +49,6 @@ class SiteOrigin_Widget_Headline_Widget extends SiteOrigin_Widget {
49
  'color' => array(
50
  'type' => 'color',
51
  'label' => __('Color', 'so-widgets-bundle'),
52
- 'default' => '#000000'
53
  ),
54
  'align' => array(
55
  'type' => 'select',
@@ -94,7 +93,6 @@ class SiteOrigin_Widget_Headline_Widget extends SiteOrigin_Widget {
94
  'color' => array(
95
  'type' => 'color',
96
  'label' => __('Color', 'so-widgets-bundle'),
97
- 'default' => '#000000'
98
  ),
99
  'align' => array(
100
  'type' => 'select',
@@ -217,32 +215,12 @@ class SiteOrigin_Widget_Headline_Widget extends SiteOrigin_Widget {
217
  return $less_vars;
218
  }
219
 
220
- /**
221
- * Less function for importing Google web fonts.
222
- *
223
- * @param $instance
224
- * @param $args
225
- *
226
- * @return string
227
- */
228
- function less_import_google_font($instance, $args) {
229
- if( empty( $instance ) ) return;
230
 
231
- $font_imports = array(
232
- siteorigin_widget_get_font( $instance['headline']['font'] ),
233
- siteorigin_widget_get_font( $instance['sub_headline']['font'] ),
234
  );
235
-
236
- $import_strings = array();
237
- foreach( $font_imports as $import ) {
238
- $import_strings[] = !empty($import['css_import']) ? $import['css_import'] : '';
239
- }
240
-
241
- // Remove empty and duplicate items from the array
242
- $import_strings = array_filter($import_strings);
243
- $import_strings = array_unique($import_strings);
244
-
245
- return implode("\n", $import_strings);
246
  }
247
 
248
  /**
49
  'color' => array(
50
  'type' => 'color',
51
  'label' => __('Color', 'so-widgets-bundle'),
 
52
  ),
53
  'align' => array(
54
  'type' => 'select',
93
  'color' => array(
94
  'type' => 'color',
95
  'label' => __('Color', 'so-widgets-bundle'),
 
96
  ),
97
  'align' => array(
98
  'type' => 'select',
215
  return $less_vars;
216
  }
217
 
218
+ function get_google_font_fields( $instance ) {
 
 
 
 
 
 
 
 
 
219
 
220
+ return array(
221
+ $instance['headline']['font'],
222
+ $instance['sub_headline']['font'],
223
  );
 
 
 
 
 
 
 
 
 
 
 
224
  }
225
 
226
  /**
widgets/so-headline-widget/styles/sow-headline.less CHANGED
@@ -3,13 +3,13 @@
3
  .widget-function('import_google_font');
4
 
5
  @headline_tag: h1;
6
- @headline_font: "Lucida Grande", sans-serif;
7
  @headline_font_weight: 400;
8
  @headline_align: left;
9
  @headline_color: #000000;
10
 
11
  @sub_headline_tag: h3;
12
- @sub_headline_font: "Arial", sans-serif;
13
  @sub_headline_font_weight: 400;
14
  @sub_headline_align: left;
15
  @sub_headline_color: #000000;
@@ -25,7 +25,6 @@
25
  text-align: @headline_align;
26
  color: @headline_color;
27
  line-height: 1.3;
28
- word-break: break-all;
29
  }
30
 
31
  @{sub_headline_tag} {
@@ -33,7 +32,6 @@
33
  text-align: @sub_headline_align;
34
  color: @sub_headline_color;
35
  line-height: 1.3;
36
- word-break: break-all;
37
  }
38
 
39
  .decoration {
3
  .widget-function('import_google_font');
4
 
5
  @headline_tag: h1;
6
+ @headline_font: default;
7
  @headline_font_weight: 400;
8
  @headline_align: left;
9
  @headline_color: #000000;
10
 
11
  @sub_headline_tag: h3;
12
+ @sub_headline_font: default;
13
  @sub_headline_font_weight: 400;
14
  @sub_headline_align: left;
15
  @sub_headline_color: #000000;
25
  text-align: @headline_align;
26
  color: @headline_color;
27
  line-height: 1.3;
 
28
  }
29
 
30
  @{sub_headline_tag} {
32
  text-align: @sub_headline_align;
33
  color: @sub_headline_color;
34
  line-height: 1.3;
 
35
  }
36
 
37
  .decoration {
widgets/so-hero-widget/so-hero-widget.php CHANGED
@@ -250,7 +250,7 @@ class SiteOrigin_Widget_Hero_Widget extends SiteOrigin_Widget_Base_Slider {
250
 
251
  // Add in the button code
252
  $san_content = wp_kses_post($content);
253
- $content = preg_replace('/<(?:p|h\d|em|strong|li|blockquote) *([^>]*)> *\[ *buttons *\] *<\/(?:p|h\d|em|strong|li|blockquote)>/i', '<div class="sow-hero-buttons" $1>' . $button_code . '</div>', $san_content );
254
  return $content;
255
  }
256
 
250
 
251
  // Add in the button code
252
  $san_content = wp_kses_post($content);
253
+ $content = preg_replace('/(?:<(?:p|h\d|em|strong|li|blockquote) *([^>]*)> *)?\[ *buttons *\](:? *<\/(?:p|h\d|em|strong|li|blockquote)>)?/i', '<div class="sow-hero-buttons" $1>' . $button_code . '</div>', $san_content );
254
  return $content;
255
  }
256
 
widgets/so-image-grid-widget/so-image-grid-widget.php CHANGED
@@ -38,8 +38,7 @@ class SiteOrigin_Widgets_ImageGrid_Widget extends SiteOrigin_Widget {
38
  'label' => __('Image title', 'so-widgets-bundle')
39
  ),
40
  'url' => array(
41
- 'type' => 'text',
42
- 'sanitize' => 'url',
43
  'label' => __('URL', 'so-widgets-bundle')
44
  ),
45
  )
38
  'label' => __('Image title', 'so-widgets-bundle')
39
  ),
40
  'url' => array(
41
+ 'type' => 'link',
 
42
  'label' => __('URL', 'so-widgets-bundle')
43
  ),
44
  )
widgets/so-image-grid-widget/tpl/default.php CHANGED
@@ -6,9 +6,11 @@
6
  <?php
7
  foreach( $instance['images'] as $image ) {
8
  echo '<div class="sow-image-grid-image">';
 
9
  echo wp_get_attachment_image( $image['image'], $image['display']['image_size'], false, array(
10
  'title' => $image['title']
11
  ) );
 
12
  echo '</div>';
13
  }
14
  ?>
6
  <?php
7
  foreach( $instance['images'] as $image ) {
8
  echo '<div class="sow-image-grid-image">';
9
+ if ( ! empty( $image['url'] ) ) echo '<a href="' . sow_esc_url( $image['url'] ) . '">';
10
  echo wp_get_attachment_image( $image['image'], $image['display']['image_size'], false, array(
11
  'title' => $image['title']
12
  ) );
13
+ if ( ! empty( $image['url'] ) ) echo '</a>';
14
  echo '</div>';
15
  }
16
  ?>
widgets/so-post-carousel-widget/tpl/base.php CHANGED
@@ -7,15 +7,15 @@ $the_query = new WP_Query( $query );
7
  <div class="sow-carousel-title">
8
  <?php echo $args['before_title'] . esc_html($instance['title']) . $args['after_title'] ?>
9
 
10
- <a href="#" class="sow-carousel-next" title="<?php esc_attr_e('Next', 'siteorigin-widgets') ?>"></a>
11
- <a href="#" class="sow-carousel-previous" title="<?php esc_attr_e('Previous', 'siteorigin-widgets') ?>"></a>
12
  </div>
13
 
14
  <div class="sow-carousel-container">
15
 
16
- <a href="#" class="sow-carousel-previous" title="<?php esc_attr_e('Previous', 'siteorigin-widgets') ?>"></a>
17
 
18
- <a href="#" class="sow-carousel-next" title="<?php esc_attr_e('Next', 'siteorigin-widgets') ?>"></a>
19
 
20
  <div class="sow-carousel-wrapper"
21
  data-query="<?php echo esc_attr($instance['posts']) ?>"
7
  <div class="sow-carousel-title">
8
  <?php echo $args['before_title'] . esc_html($instance['title']) . $args['after_title'] ?>
9
 
10
+ <a href="#" class="sow-carousel-next" title="<?php esc_attr_e('Next', 'so-widgets-bundle') ?>"></a>
11
+ <a href="#" class="sow-carousel-previous" title="<?php esc_attr_e('Previous', 'so-widgets-bundle') ?>"></a>
12
  </div>
13
 
14
  <div class="sow-carousel-container">
15
 
16
+ <a href="#" class="sow-carousel-previous" title="<?php esc_attr_e('Previous', 'so-widgets-bundle') ?>"></a>
17
 
18
+ <a href="#" class="sow-carousel-next" title="<?php esc_attr_e('Next', 'so-widgets-bundle') ?>"></a>
19
 
20
  <div class="sow-carousel-wrapper"
21
  data-query="<?php echo esc_attr($instance['posts']) ?>"
widgets/so-simple-masonry-widget/js/packery.pkgd.min.js CHANGED
@@ -1,3 +1,2 @@
1
  !function(t){function e(){}function i(t){function i(e){e.prototype.option||(e.prototype.option=function(e){t.isPlainObject(e)&&(this.options=t.extend(!0,this.options,e))})}function o(e,i){t.fn[e]=function(o){if("string"==typeof o){for(var s=n.call(arguments,1),a=0,h=this.length;h>a;a++){var p=this[a],u=t.data(p,e);if(u)if(t.isFunction(u[o])&&"_"!==o.charAt(0)){var c=u[o].apply(u,s);if(void 0!==c)return c}else r("no such method '"+o+"' for "+e+" instance");else r("cannot call methods on "+e+" prior to initialization; attempted to call '"+o+"'")}return this}return this.each(function(){var n=t.data(this,e);n?(n.option(o),n._init()):(n=new i(this,o),t.data(this,e,n))})}}if(t){var r="undefined"==typeof console?e:function(t){console.error(t)};return t.bridget=function(t,e){i(e),o(t,e)},t.bridget}}var n=Array.prototype.slice;"function"==typeof define&&define.amd?define("jquery-bridget/jquery.bridget",["jquery"],i):i("object"==typeof exports?require("jquery"):t.jQuery)}(window),function(t){function e(t){return new RegExp("(^|\\s+)"+t+"(\\s+|$)")}function i(t,e){var i=n(t,e)?r:o;i(t,e)}var n,o,r;"classList"in document.documentElement?(n=function(t,e){return t.classList.contains(e)},o=function(t,e){t.classList.add(e)},r=function(t,e){t.classList.remove(e)}):(n=function(t,i){return e(i).test(t.className)},o=function(t,e){n(t,e)||(t.className=t.className+" "+e)},r=function(t,i){t.className=t.className.replace(e(i)," ")});var s={hasClass:n,addClass:o,removeClass:r,toggleClass:i,has:n,add:o,remove:r,toggle:i};"function"==typeof define&&define.amd?define("classie/classie",s):"object"==typeof exports?module.exports=s:t.classie=s}(window),function(t){function e(t){if(t){if("string"==typeof n[t])return t;t=t.charAt(0).toUpperCase()+t.slice(1);for(var e,o=0,r=i.length;r>o;o++)if(e=i[o]+t,"string"==typeof n[e])return e}}var i="Webkit Moz ms Ms O".split(" "),n=document.documentElement.style;"function"==typeof define&&define.amd?define("get-style-property/get-style-property",[],function(){return e}):"object"==typeof exports?module.exports=e:t.getStyleProperty=e}(window),function(t,e){function i(t){var e=parseFloat(t),i=-1===t.indexOf("%")&&!isNaN(e);return i&&e}function n(){}function o(){for(var t={width:0,height:0,innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0},e=0,i=a.length;i>e;e++){var n=a[e];t[n]=0}return t}function r(e){function n(){if(!d){d=!0;var n=t.getComputedStyle;if(p=function(){var t=n?function(t){return n(t,null)}:function(t){return t.currentStyle};return function(e){var i=t(e);return i||s("Style returned "+i+". Are you running this code in a hidden iframe on Firefox? See http://bit.ly/getsizebug1"),i}}(),u=e("boxSizing")){var o=document.createElement("div");o.style.width="200px",o.style.padding="1px 2px 3px 4px",o.style.borderStyle="solid",o.style.borderWidth="1px 2px 3px 4px",o.style[u]="border-box";var r=document.body||document.documentElement;r.appendChild(o);var a=p(o);c=200===i(a.width),r.removeChild(o)}}}function r(t){if(n(),"string"==typeof t&&(t=document.querySelector(t)),t&&"object"==typeof t&&t.nodeType){var e=p(t);if("none"===e.display)return o();var r={};r.width=t.offsetWidth,r.height=t.offsetHeight;for(var s=r.isBorderBox=!(!u||!e[u]||"border-box"!==e[u]),d=0,l=a.length;l>d;d++){var f=a[d],y=e[f];y=h(t,y);var m=parseFloat(y);r[f]=isNaN(m)?0:m}var g=r.paddingLeft+r.paddingRight,v=r.paddingTop+r.paddingBottom,x=r.marginLeft+r.marginRight,E=r.marginTop+r.marginBottom,b=r.borderLeftWidth+r.borderRightWidth,w=r.borderTopWidth+r.borderBottomWidth,_=s&&c,T=i(e.width);T!==!1&&(r.width=T+(_?0:g+b));var z=i(e.height);return z!==!1&&(r.height=z+(_?0:v+w)),r.innerWidth=r.width-(g+b),r.innerHeight=r.height-(v+w),r.outerWidth=r.width+x,r.outerHeight=r.height+E,r}}function h(e,i){if(t.getComputedStyle||-1===i.indexOf("%"))return i;var n=e.style,o=n.left,r=e.runtimeStyle,s=r&&r.left;return s&&(r.left=e.currentStyle.left),n.left=i,i=n.pixelLeft,n.left=o,s&&(r.left=s),i}var p,u,c,d=!1;return r}var s="undefined"==typeof console?n:function(t){console.error(t)},a=["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"];"function"==typeof define&&define.amd?define("get-size/get-size",["get-style-property/get-style-property"],r):"object"==typeof exports?module.exports=r(require("desandro-get-style-property")):t.getSize=r(t.getStyleProperty)}(window),function(t){function e(e){var i=t.event;return i.target=i.target||i.srcElement||e,i}var i=document.documentElement,n=function(){};i.addEventListener?n=function(t,e,i){t.addEventListener(e,i,!1)}:i.attachEvent&&(n=function(t,i,n){t[i+n]=n.handleEvent?function(){var i=e(t);n.handleEvent.call(n,i)}:function(){var i=e(t);n.call(t,i)},t.attachEvent("on"+i,t[i+n])});var o=function(){};i.removeEventListener?o=function(t,e,i){t.removeEventListener(e,i,!1)}:i.detachEvent&&(o=function(t,e,i){t.detachEvent("on"+e,t[e+i]);try{delete t[e+i]}catch(n){t[e+i]=void 0}});var r={bind:n,unbind:o};"function"==typeof define&&define.amd?define("eventie/eventie",r):"object"==typeof exports?module.exports=r:t.eventie=r}(window),function(){function t(){}function e(t,e){for(var i=t.length;i--;)if(t[i].listener===e)return i;return-1}function i(t){return function(){return this[t].apply(this,arguments)}}var n=t.prototype,o=this,r=o.EventEmitter;n.getListeners=function(t){var e,i,n=this._getEvents();if(t instanceof RegExp){e={};for(i in n)n.hasOwnProperty(i)&&t.test(i)&&(e[i]=n[i])}else e=n[t]||(n[t]=[]);return e},n.flattenListeners=function(t){var e,i=[];for(e=0;e<t.length;e+=1)i.push(t[e].listener);return i},n.getListenersAsObject=function(t){var e,i=this.getListeners(t);return i instanceof Array&&(e={},e[t]=i),e||i},n.addListener=function(t,i){var n,o=this.getListenersAsObject(t),r="object"==typeof i;for(n in o)o.hasOwnProperty(n)&&-1===e(o[n],i)&&o[n].push(r?i:{listener:i,once:!1});return this},n.on=i("addListener"),n.addOnceListener=function(t,e){return this.addListener(t,{listener:e,once:!0})},n.once=i("addOnceListener"),n.defineEvent=function(t){return this.getListeners(t),this},n.defineEvents=function(t){for(var e=0;e<t.length;e+=1)this.defineEvent(t[e]);return this},n.removeListener=function(t,i){var n,o,r=this.getListenersAsObject(t);for(o in r)r.hasOwnProperty(o)&&(n=e(r[o],i),-1!==n&&r[o].splice(n,1));return this},n.off=i("removeListener"),n.addListeners=function(t,e){return this.manipulateListeners(!1,t,e)},n.removeListeners=function(t,e){return this.manipulateListeners(!0,t,e)},n.manipulateListeners=function(t,e,i){var n,o,r=t?this.removeListener:this.addListener,s=t?this.removeListeners:this.addListeners;if("object"!=typeof e||e instanceof RegExp)for(n=i.length;n--;)r.call(this,e,i[n]);else for(n in e)e.hasOwnProperty(n)&&(o=e[n])&&("function"==typeof o?r.call(this,n,o):s.call(this,n,o));return this},n.removeEvent=function(t){var e,i=typeof t,n=this._getEvents();if("string"===i)delete n[t];else if(t instanceof RegExp)for(e in n)n.hasOwnProperty(e)&&t.test(e)&&delete n[e];else delete this._events;return this},n.removeAllListeners=i("removeEvent"),n.emitEvent=function(t,e){var i,n,o,r,s=this.getListenersAsObject(t);for(o in s)if(s.hasOwnProperty(o))for(n=s[o].length;n--;)i=s[o][n],i.once===!0&&this.removeListener(t,i.listener),r=i.listener.apply(this,e||[]),r===this._getOnceReturnValue()&&this.removeListener(t,i.listener);return this},n.trigger=i("emitEvent"),n.emit=function(t){var e=Array.prototype.slice.call(arguments,1);return this.emitEvent(t,e)},n.setOnceReturnValue=function(t){return this._onceReturnValue=t,this},n._getOnceReturnValue=function(){return this.hasOwnProperty("_onceReturnValue")?this._onceReturnValue:!0},n._getEvents=function(){return this._events||(this._events={})},t.noConflict=function(){return o.EventEmitter=r,t},"function"==typeof define&&define.amd?define("eventEmitter/EventEmitter",[],function(){return t}):"object"==typeof module&&module.exports?module.exports=t:o.EventEmitter=t}.call(this),function(t){function e(t){"function"==typeof t&&(e.isReady?t():s.push(t))}function i(t){var i="readystatechange"===t.type&&"complete"!==r.readyState;e.isReady||i||n()}function n(){e.isReady=!0;for(var t=0,i=s.length;i>t;t++){var n=s[t];n()}}function o(o){return"complete"===r.readyState?n():(o.bind(r,"DOMContentLoaded",i),o.bind(r,"readystatechange",i),o.bind(t,"load",i)),e}var r=t.document,s=[];e.isReady=!1,"function"==typeof define&&define.amd?define("doc-ready/doc-ready",["eventie/eventie"],o):"object"==typeof exports?module.exports=o(require("eventie")):t.docReady=o(t.eventie)}(window),function(t){function e(t,e){return t[s](e)}function i(t){if(!t.parentNode){var e=document.createDocumentFragment();e.appendChild(t)}}function n(t,e){i(t);for(var n=t.parentNode.querySelectorAll(e),o=0,r=n.length;r>o;o++)if(n[o]===t)return!0;return!1}function o(t,n){return i(t),e(t,n)}var r,s=function(){if(t.matches)return"matches";if(t.matchesSelector)return"matchesSelector";for(var e=["webkit","moz","ms","o"],i=0,n=e.length;n>i;i++){var o=e[i],r=o+"MatchesSelector";if(t[r])return r}}();if(s){var a=document.createElement("div"),h=e(a,"div");r=h?e:o}else r=n;"function"==typeof define&&define.amd?define("matches-selector/matches-selector",[],function(){return r}):"object"==typeof exports?module.exports=r:window.matchesSelector=r}(Element.prototype),function(t,e){"function"==typeof define&&define.amd?define("fizzy-ui-utils/utils",["doc-ready/doc-ready","matches-selector/matches-selector"],function(i,n){return e(t,i,n)}):"object"==typeof exports?module.exports=e(t,require("doc-ready"),require("desandro-matches-selector")):t.fizzyUIUtils=e(t,t.docReady,t.matchesSelector)}(window,function(t,e,i){var n={};n.extend=function(t,e){for(var i in e)t[i]=e[i];return t},n.modulo=function(t,e){return(t%e+e)%e};var o=Object.prototype.toString;n.isArray=function(t){return"[object Array]"==o.call(t)},n.makeArray=function(t){var e=[];if(n.isArray(t))e=t;else if(t&&"number"==typeof t.length)for(var i=0,o=t.length;o>i;i++)e.push(t[i]);else e.push(t);return e},n.indexOf=Array.prototype.indexOf?function(t,e){return t.indexOf(e)}:function(t,e){for(var i=0,n=t.length;n>i;i++)if(t[i]===e)return i;return-1},n.removeFrom=function(t,e){var i=n.indexOf(t,e);-1!=i&&t.splice(i,1)},n.isElement="function"==typeof HTMLElement||"object"==typeof HTMLElement?function(t){return t instanceof HTMLElement}:function(t){return t&&"object"==typeof t&&1==t.nodeType&&"string"==typeof t.nodeName},n.setText=function(){function t(t,i){e=e||(void 0!==document.documentElement.textContent?"textContent":"innerText"),t[e]=i}var e;return t}(),n.getParent=function(t,e){for(;t!=document.body;)if(t=t.parentNode,i(t,e))return t},n.getQueryElement=function(t){return"string"==typeof t?document.querySelector(t):t},n.handleEvent=function(t){var e="on"+t.type;this[e]&&this[e](t)},n.filterFindElements=function(t,e){t=n.makeArray(t);for(var o=[],r=0,s=t.length;s>r;r++){var a=t[r];if(n.isElement(a))if(e){i(a,e)&&o.push(a);for(var h=a.querySelectorAll(e),p=0,u=h.length;u>p;p++)o.push(h[p])}else o.push(a)}return o},n.debounceMethod=function(t,e,i){var n=t.prototype[e],o=e+"Timeout";t.prototype[e]=function(){var t=this[o];t&&clearTimeout(t);var e=arguments,r=this;this[o]=setTimeout(function(){n.apply(r,e),delete r[o]},i||100)}},n.toDashed=function(t){return t.replace(/(.)([A-Z])/g,function(t,e,i){return e+"-"+i}).toLowerCase()};var r=t.console;return n.htmlInit=function(i,o){e(function(){for(var e=n.toDashed(o),s=document.querySelectorAll(".js-"+e),a="data-"+e+"-options",h=0,p=s.length;p>h;h++){var u,c=s[h],d=c.getAttribute(a);try{u=d&&JSON.parse(d)}catch(l){r&&r.error("Error parsing "+a+" on "+c.nodeName.toLowerCase()+(c.id?"#"+c.id:"")+": "+l);continue}var f=new i(c,u),y=t.jQuery;y&&y.data(c,o,f)}})},n}),function(t,e){"function"==typeof define&&define.amd?define("outlayer/item",["eventEmitter/EventEmitter","get-size/get-size","get-style-property/get-style-property","fizzy-ui-utils/utils"],function(i,n,o,r){return e(t,i,n,o,r)}):"object"==typeof exports?module.exports=e(t,require("wolfy87-eventemitter"),require("get-size"),require("desandro-get-style-property"),require("fizzy-ui-utils")):(t.Outlayer={},t.Outlayer.Item=e(t,t.EventEmitter,t.getSize,t.getStyleProperty,t.fizzyUIUtils))}(window,function(t,e,i,n,o){function r(t){for(var e in t)return!1;return e=null,!0}function s(t,e){t&&(this.element=t,this.layout=e,this.position={x:0,y:0},this._create())}function a(t){return t.replace(/([A-Z])/g,function(t){return"-"+t.toLowerCase()})}var h=t.getComputedStyle,p=h?function(t){return h(t,null)}:function(t){return t.currentStyle},u=n("transition"),c=n("transform"),d=u&&c,l=!!n("perspective"),f={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"otransitionend",transition:"transitionend"}[u],y=["transform","transition","transitionDuration","transitionProperty"],m=function(){for(var t={},e=0,i=y.length;i>e;e++){var o=y[e],r=n(o);r&&r!==o&&(t[o]=r)}return t}();o.extend(s.prototype,e.prototype),s.prototype._create=function(){this._transn={ingProperties:{},clean:{},onEnd:{}},this.css({position:"absolute"})},s.prototype.handleEvent=function(t){var e="on"+t.type;this[e]&&this[e](t)},s.prototype.getSize=function(){this.size=i(this.element)},s.prototype.css=function(t){var e=this.element.style;for(var i in t){var n=m[i]||i;e[n]=t[i]}},s.prototype.getPosition=function(){var t=p(this.element),e=this.layout.options,i=e.isOriginLeft,n=e.isOriginTop,o=t[i?"left":"right"],r=t[n?"top":"bottom"],s=this.layout.size,a=-1!=o.indexOf("%")?parseFloat(o)/100*s.width:parseInt(o,10),h=-1!=r.indexOf("%")?parseFloat(r)/100*s.height:parseInt(r,10);a=isNaN(a)?0:a,h=isNaN(h)?0:h,a-=i?s.paddingLeft:s.paddingRight,h-=n?s.paddingTop:s.paddingBottom,this.position.x=a,this.position.y=h},s.prototype.layoutPosition=function(){var t=this.layout.size,e=this.layout.options,i={},n=e.isOriginLeft?"paddingLeft":"paddingRight",o=e.isOriginLeft?"left":"right",r=e.isOriginLeft?"right":"left",s=this.position.x+t[n];i[o]=this.getXValue(s),i[r]="";var a=e.isOriginTop?"paddingTop":"paddingBottom",h=e.isOriginTop?"top":"bottom",p=e.isOriginTop?"bottom":"top",u=this.position.y+t[a];i[h]=this.getYValue(u),i[p]="",this.css(i),this.emitEvent("layout",[this])},s.prototype.getXValue=function(t){var e=this.layout.options;return e.percentPosition&&!e.isHorizontal?t/this.layout.size.width*100+"%":t+"px"},s.prototype.getYValue=function(t){var e=this.layout.options;return e.percentPosition&&e.isHorizontal?t/this.layout.size.height*100+"%":t+"px"},s.prototype._transitionTo=function(t,e){this.getPosition();var i=this.position.x,n=this.position.y,o=parseInt(t,10),r=parseInt(e,10),s=o===this.position.x&&r===this.position.y;if(this.setPosition(t,e),s&&!this.isTransitioning)return void this.layoutPosition();var a=t-i,h=e-n,p={};p.transform=this.getTranslate(a,h),this.transition({to:p,onTransitionEnd:{transform:this.layoutPosition},isCleaning:!0})},s.prototype.getTranslate=function(t,e){var i=this.layout.options;return t=i.isOriginLeft?t:-t,e=i.isOriginTop?e:-e,l?"translate3d("+t+"px, "+e+"px, 0)":"translate("+t+"px, "+e+"px)"},s.prototype.goTo=function(t,e){this.setPosition(t,e),this.layoutPosition()},s.prototype.moveTo=d?s.prototype._transitionTo:s.prototype.goTo,s.prototype.setPosition=function(t,e){this.position.x=parseInt(t,10),this.position.y=parseInt(e,10)},s.prototype._nonTransition=function(t){this.css(t.to),t.isCleaning&&this._removeStyles(t.to);for(var e in t.onTransitionEnd)t.onTransitionEnd[e].call(this)},s.prototype._transition=function(t){if(!parseFloat(this.layout.options.transitionDuration))return void this._nonTransition(t);var e=this._transn;for(var i in t.onTransitionEnd)e.onEnd[i]=t.onTransitionEnd[i];for(i in t.to)e.ingProperties[i]=!0,t.isCleaning&&(e.clean[i]=!0);if(t.from){this.css(t.from);var n=this.element.offsetHeight;n=null}this.enableTransition(t.to),this.css(t.to),this.isTransitioning=!0};var g="opacity,"+a(m.transform||"transform");s.prototype.enableTransition=function(){this.isTransitioning||(this.css({transitionProperty:g,transitionDuration:this.layout.options.transitionDuration}),this.element.addEventListener(f,this,!1))},s.prototype.transition=s.prototype[u?"_transition":"_nonTransition"],s.prototype.onwebkitTransitionEnd=function(t){this.ontransitionend(t)},s.prototype.onotransitionend=function(t){this.ontransitionend(t)};var v={"-webkit-transform":"transform","-moz-transform":"transform","-o-transform":"transform"};s.prototype.ontransitionend=function(t){if(t.target===this.element){var e=this._transn,i=v[t.propertyName]||t.propertyName;if(delete e.ingProperties[i],r(e.ingProperties)&&this.disableTransition(),i in e.clean&&(this.element.style[t.propertyName]="",delete e.clean[i]),i in e.onEnd){var n=e.onEnd[i];n.call(this),delete e.onEnd[i]}this.emitEvent("transitionEnd",[this])}},s.prototype.disableTransition=function(){this.removeTransitionStyles(),this.element.removeEventListener(f,this,!1),this.isTransitioning=!1},s.prototype._removeStyles=function(t){var e={};for(var i in t)e[i]="";this.css(e)};var x={transitionProperty:"",transitionDuration:""};return s.prototype.removeTransitionStyles=function(){this.css(x)},s.prototype.removeElem=function(){this.element.parentNode.removeChild(this.element),this.css({display:""}),this.emitEvent("remove",[this])},s.prototype.remove=function(){if(!u||!parseFloat(this.layout.options.transitionDuration))return void this.removeElem();var t=this;this.once("transitionEnd",function(){t.removeElem()}),this.hide()},s.prototype.reveal=function(){delete this.isHidden,this.css({display:""});var t=this.layout.options,e={},i=this.getHideRevealTransitionEndProperty("visibleStyle");e[i]=this.onRevealTransitionEnd,this.transition({from:t.hiddenStyle,to:t.visibleStyle,isCleaning:!0,onTransitionEnd:e})},s.prototype.onRevealTransitionEnd=function(){this.isHidden||this.emitEvent("reveal")},s.prototype.getHideRevealTransitionEndProperty=function(t){var e=this.layout.options[t];if(e.opacity)return"opacity";for(var i in e)return i},s.prototype.hide=function(){this.isHidden=!0,this.css({display:""});var t=this.layout.options,e={},i=this.getHideRevealTransitionEndProperty("hiddenStyle");e[i]=this.onHideTransitionEnd,this.transition({from:t.visibleStyle,to:t.hiddenStyle,isCleaning:!0,onTransitionEnd:e})},s.prototype.onHideTransitionEnd=function(){this.isHidden&&(this.css({display:"none"}),this.emitEvent("hide"))},s.prototype.destroy=function(){this.css({position:"",left:"",right:"",top:"",bottom:"",transition:"",transform:""})},s}),function(t,e){"function"==typeof define&&define.amd?define("outlayer/outlayer",["eventie/eventie","eventEmitter/EventEmitter","get-size/get-size","fizzy-ui-utils/utils","./item"],function(i,n,o,r,s){return e(t,i,n,o,r,s)}):"object"==typeof exports?module.exports=e(t,require("eventie"),require("wolfy87-eventemitter"),require("get-size"),require("fizzy-ui-utils"),require("./item")):t.Outlayer=e(t,t.eventie,t.EventEmitter,t.getSize,t.fizzyUIUtils,t.Outlayer.Item)}(window,function(t,e,i,n,o,r){function s(t,e){var i=o.getQueryElement(t);if(!i)return void(a&&a.error("Bad element for "+this.constructor.namespace+": "+(i||t)));this.element=i,h&&(this.$element=h(this.element)),this.options=o.extend({},this.constructor.defaults),this.option(e);var n=++u;this.element.outlayerGUID=n,c[n]=this,this._create(),this.options.isInitLayout&&this.layout()}var a=t.console,h=t.jQuery,p=function(){},u=0,c={};return s.namespace="outlayer",s.Item=r,s.defaults={containerStyle:{position:"relative"},isInitLayout:!0,isOriginLeft:!0,isOriginTop:!0,isResizeBound:!0,isResizingContainer:!0,transitionDuration:"0.4s",hiddenStyle:{opacity:0,transform:"scale(0.001)"},visibleStyle:{opacity:1,transform:"scale(1)"}},o.extend(s.prototype,i.prototype),s.prototype.option=function(t){o.extend(this.options,t)},s.prototype._create=function(){this.reloadItems(),this.stamps=[],this.stamp(this.options.stamp),o.extend(this.element.style,this.options.containerStyle),this.options.isResizeBound&&this.bindResize()},s.prototype.reloadItems=function(){this.items=this._itemize(this.element.children)},s.prototype._itemize=function(t){for(var e=this._filterFindItemElements(t),i=this.constructor.Item,n=[],o=0,r=e.length;r>o;o++){var s=e[o],a=new i(s,this);n.push(a)}return n},s.prototype._filterFindItemElements=function(t){return o.filterFindElements(t,this.options.itemSelector)},s.prototype.getItemElements=function(){for(var t=[],e=0,i=this.items.length;i>e;e++)t.push(this.items[e].element);return t},s.prototype.layout=function(){this._resetLayout(),this._manageStamps();var t=void 0!==this.options.isLayoutInstant?this.options.isLayoutInstant:!this._isLayoutInited;this.layoutItems(this.items,t),this._isLayoutInited=!0},s.prototype._init=s.prototype.layout,s.prototype._resetLayout=function(){this.getSize()},s.prototype.getSize=function(){this.size=n(this.element)},s.prototype._getMeasurement=function(t,e){var i,r=this.options[t];r?("string"==typeof r?i=this.element.querySelector(r):o.isElement(r)&&(i=r),this[t]=i?n(i)[e]:r):this[t]=0},s.prototype.layoutItems=function(t,e){t=this._getItemsForLayout(t),this._layoutItems(t,e),this._postLayout()},s.prototype._getItemsForLayout=function(t){for(var e=[],i=0,n=t.length;n>i;i++){var o=t[i];o.isIgnored||e.push(o)}return e},s.prototype._layoutItems=function(t,e){if(this._emitCompleteOnItems("layout",t),t&&t.length){for(var i=[],n=0,o=t.length;o>n;n++){var r=t[n],s=this._getItemLayoutPosition(r);s.item=r,s.isInstant=e||r.isLayoutInstant,i.push(s)}this._processLayoutQueue(i)}},s.prototype._getItemLayoutPosition=function(){return{x:0,y:0}},s.prototype._processLayoutQueue=function(t){for(var e=0,i=t.length;i>e;e++){var n=t[e];this._positionItem(n.item,n.x,n.y,n.isInstant)}},s.prototype._positionItem=function(t,e,i,n){n?t.goTo(e,i):t.moveTo(e,i)},s.prototype._postLayout=function(){this.resizeContainer()},s.prototype.resizeContainer=function(){if(this.options.isResizingContainer){var t=this._getContainerSize();t&&(this._setContainerMeasure(t.width,!0),this._setContainerMeasure(t.height,!1))}},s.prototype._getContainerSize=p,s.prototype._setContainerMeasure=function(t,e){if(void 0!==t){var i=this.size;i.isBorderBox&&(t+=e?i.paddingLeft+i.paddingRight+i.borderLeftWidth+i.borderRightWidth:i.paddingBottom+i.paddingTop+i.borderTopWidth+i.borderBottomWidth),t=Math.max(t,0),this.element.style[e?"width":"height"]=t+"px"}},s.prototype._emitCompleteOnItems=function(t,e){function i(){o.dispatchEvent(t+"Complete",null,[e])}function n(){s++,s===r&&i()}var o=this,r=e.length;if(!e||!r)return void i();for(var s=0,a=0,h=e.length;h>a;a++){var p=e[a];p.once(t,n)}},s.prototype.dispatchEvent=function(t,e,i){var n=e?[e].concat(i):i;if(this.emitEvent(t,n),h)if(this.$element=this.$element||h(this.element),e){var o=h.Event(e);o.type=t,this.$element.trigger(o,i)}else this.$element.trigger(t,i)},s.prototype.ignore=function(t){var e=this.getItem(t);e&&(e.isIgnored=!0)},s.prototype.unignore=function(t){var e=this.getItem(t);e&&delete e.isIgnored},s.prototype.stamp=function(t){if(t=this._find(t)){this.stamps=this.stamps.concat(t);for(var e=0,i=t.length;i>e;e++){var n=t[e];this.ignore(n)}}},s.prototype.unstamp=function(t){if(t=this._find(t))for(var e=0,i=t.length;i>e;e++){var n=t[e];o.removeFrom(this.stamps,n),this.unignore(n)}},s.prototype._find=function(t){return t?("string"==typeof t&&(t=this.element.querySelectorAll(t)),t=o.makeArray(t)):void 0},s.prototype._manageStamps=function(){if(this.stamps&&this.stamps.length){this._getBoundingRect();for(var t=0,e=this.stamps.length;e>t;t++){var i=this.stamps[t];this._manageStamp(i)}}},s.prototype._getBoundingRect=function(){var t=this.element.getBoundingClientRect(),e=this.size;this._boundingRect={left:t.left+e.paddingLeft+e.borderLeftWidth,top:t.top+e.paddingTop+e.borderTopWidth,right:t.right-(e.paddingRight+e.borderRightWidth),bottom:t.bottom-(e.paddingBottom+e.borderBottomWidth)}},s.prototype._manageStamp=p,s.prototype._getElementOffset=function(t){var e=t.getBoundingClientRect(),i=this._boundingRect,o=n(t),r={left:e.left-i.left-o.marginLeft,top:e.top-i.top-o.marginTop,right:i.right-e.right-o.marginRight,bottom:i.bottom-e.bottom-o.marginBottom};return r},s.prototype.handleEvent=function(t){var e="on"+t.type;this[e]&&this[e](t)},s.prototype.bindResize=function(){this.isResizeBound||(e.bind(t,"resize",this),this.isResizeBound=!0)},s.prototype.unbindResize=function(){this.isResizeBound&&e.unbind(t,"resize",this),this.isResizeBound=!1},s.prototype.onresize=function(){function t(){e.resize(),delete e.resizeTimeout}this.resizeTimeout&&clearTimeout(this.resizeTimeout);var e=this;this.resizeTimeout=setTimeout(t,100)},s.prototype.resize=function(){this.isResizeBound&&this.needsResizeLayout()&&this.layout()},s.prototype.needsResizeLayout=function(){var t=n(this.element),e=this.size&&t;return e&&t.innerWidth!==this.size.innerWidth},s.prototype.addItems=function(t){var e=this._itemize(t);return e.length&&(this.items=this.items.concat(e)),e},s.prototype.appended=function(t){var e=this.addItems(t);e.length&&(this.layoutItems(e,!0),this.reveal(e))},s.prototype.prepended=function(t){var e=this._itemize(t);if(e.length){var i=this.items.slice(0);this.items=e.concat(i),this._resetLayout(),this._manageStamps(),this.layoutItems(e,!0),this.reveal(e),this.layoutItems(i)}},s.prototype.reveal=function(t){this._emitCompleteOnItems("reveal",t);for(var e=t&&t.length,i=0;e&&e>i;i++){var n=t[i];n.reveal()}},s.prototype.hide=function(t){this._emitCompleteOnItems("hide",t);for(var e=t&&t.length,i=0;e&&e>i;i++){var n=t[i];n.hide()}},s.prototype.revealItemElements=function(t){var e=this.getItems(t);this.reveal(e)},s.prototype.hideItemElements=function(t){var e=this.getItems(t);this.hide(e)},s.prototype.getItem=function(t){for(var e=0,i=this.items.length;i>e;e++){var n=this.items[e];if(n.element===t)return n}},s.prototype.getItems=function(t){t=o.makeArray(t);for(var e=[],i=0,n=t.length;n>i;i++){var r=t[i],s=this.getItem(r);s&&e.push(s)}return e},s.prototype.remove=function(t){var e=this.getItems(t);if(this._emitCompleteOnItems("remove",e),e&&e.length)for(var i=0,n=e.length;n>i;i++){var r=e[i];r.remove(),o.removeFrom(this.items,r)}},s.prototype.destroy=function(){var t=this.element.style;t.height="",t.position="",t.width="";for(var e=0,i=this.items.length;i>e;e++){var n=this.items[e];n.destroy()}this.unbindResize();var o=this.element.outlayerGUID;delete c[o],delete this.element.outlayerGUID,h&&h.removeData(this.element,this.constructor.namespace)},s.data=function(t){t=o.getQueryElement(t);var e=t&&t.outlayerGUID;return e&&c[e]},s.create=function(t,e){function i(){s.apply(this,arguments)}return Object.create?i.prototype=Object.create(s.prototype):o.extend(i.prototype,s.prototype),i.prototype.constructor=i,i.defaults=o.extend({},s.defaults),o.extend(i.defaults,e),i.prototype.settings={},i.namespace=t,i.data=s.data,i.Item=function(){r.apply(this,arguments)},i.Item.prototype=new r,o.htmlInit(i,t),h&&h.bridget&&h.bridget(t,i),i},s.Item=r,s}),function(t,e){"function"==typeof define&&define.amd?define("packery/js/rect",e):"object"==typeof exports?module.exports=e():(t.Packery=t.Packery||{},t.Packery.Rect=e())}(window,function(){function t(e){for(var i in t.defaults)this[i]=t.defaults[i];for(i in e)this[i]=e[i]}var e=window.Packery=function(){};return e.Rect=t,t.defaults={x:0,y:0,width:0,height:0},t.prototype.contains=function(t){var e=t.width||0,i=t.height||0;return this.x<=t.x&&this.y<=t.y&&this.x+this.width>=t.x+e&&this.y+this.height>=t.y+i},t.prototype.overlaps=function(t){var e=this.x+this.width,i=this.y+this.height,n=t.x+t.width,o=t.y+t.height;return this.x<n&&e>t.x&&this.y<o&&i>t.y},t.prototype.getMaximalFreeRects=function(e){if(!this.overlaps(e))return!1;var i,n=[],o=this.x+this.width,r=this.y+this.height,s=e.x+e.width,a=e.y+e.height;return this.y<e.y&&(i=new t({x:this.x,y:this.y,width:this.width,height:e.y-this.y}),n.push(i)),o>s&&(i=new t({x:s,y:this.y,width:o-s,height:this.height}),n.push(i)),r>a&&(i=new t({x:this.x,y:a,width:this.width,height:r-a}),n.push(i)),this.x<e.x&&(i=new t({x:this.x,y:this.y,width:e.x-this.x,height:this.height}),n.push(i)),n},t.prototype.canFit=function(t){return this.width>=t.width&&this.height>=t.height},t}),function(t,e){if("function"==typeof define&&define.amd)define("packery/js/packer",["./rect"],e);else if("object"==typeof exports)module.exports=e(require("./rect"));else{var i=t.Packery=t.Packery||{};i.Packer=e(i.Rect)}}(window,function(t){function e(t,e,i){this.width=t||0,this.height=e||0,this.sortDirection=i||"downwardLeftToRight",this.reset()}e.prototype.reset=function(){this.spaces=[],this.newSpaces=[];var e=new t({x:0,y:0,width:this.width,height:this.height});this.spaces.push(e),this.sorter=i[this.sortDirection]||i.downwardLeftToRight},e.prototype.pack=function(t){for(var e=0,i=this.spaces.length;i>e;e++){var n=this.spaces[e];if(n.canFit(t)){this.placeInSpace(t,n);break}}},e.prototype.placeInSpace=function(t,e){t.x=e.x,t.y=e.y,this.placed(t)},e.prototype.placed=function(t){for(var e=[],i=0,n=this.spaces.length;n>i;i++){var o=this.spaces[i],r=o.getMaximalFreeRects(t);r?e.push.apply(e,r):e.push(o)}this.spaces=e,this.mergeSortSpaces()},e.prototype.mergeSortSpaces=function(){e.mergeRects(this.spaces),this.spaces.sort(this.sorter)},e.prototype.addSpace=function(t){this.spaces.push(t),this.mergeSortSpaces()},e.mergeRects=function(t){for(var e=0,i=t.length;i>e;e++){var n=t[e];if(n){var o=t.slice(0);o.splice(e,1);for(var r=0,s=0,a=o.length;a>s;s++){var h=o[s],p=e>s?0:1;n.contains(h)&&(t.splice(s+p-r,1),r++)}}}return t};var i={downwardLeftToRight:function(t,e){return t.y-e.y||t.x-e.x},rightwardTopToBottom:function(t,e){return t.x-e.x||t.y-e.y}};return e}),function(t,e){"function"==typeof define&&define.amd?define("packery/js/item",["get-style-property/get-style-property","outlayer/outlayer","./rect"],e):"object"==typeof exports?module.exports=e(require("desandro-get-style-property"),require("outlayer"),require("./rect")):t.Packery.Item=e(t.getStyleProperty,t.Outlayer,t.Packery.Rect)}(window,function(t,e,i){var n=t("transform"),o=function(){e.Item.apply(this,arguments)};o.prototype=new e.Item;var r=o.prototype._create;return o.prototype._create=function(){r.call(this),this.rect=new i,this.placeRect=new i},o.prototype.dragStart=function(){this.getPosition(),this.removeTransitionStyles(),this.isTransitioning&&n&&(this.element.style[n]="none"),this.getSize(),this.isPlacing=!0,this.needsPositioning=!1,this.positionPlaceRect(this.position.x,this.position.y),this.isTransitioning=!1,this.didDrag=!1},o.prototype.dragMove=function(t,e){this.didDrag=!0;var i=this.layout.size;t-=i.paddingLeft,e-=i.paddingTop,this.positionPlaceRect(t,e)},o.prototype.dragStop=function(){this.getPosition();var t=this.position.x!=this.placeRect.x,e=this.position.y!=this.placeRect.y;this.needsPositioning=t||e,this.didDrag=!1},o.prototype.positionPlaceRect=function(t,e,i){this.placeRect.x=this.getPlaceRectCoord(t,!0),this.placeRect.y=this.getPlaceRectCoord(e,!1,i)},o.prototype.getPlaceRectCoord=function(t,e,i){var n=e?"Width":"Height",o=this.size["outer"+n],r=this.layout[e?"columnWidth":"rowHeight"],s=this.layout.size["inner"+n];e||(s=Math.max(s,this.layout.maxY),this.layout.rowHeight||(s-=this.layout.gutter));var a;if(r){r+=this.layout.gutter,s+=e?this.layout.gutter:0,t=Math.round(t/r);var h;h=this.layout.options.isHorizontal?e?"ceil":"floor":e?"floor":"ceil";var p=Math[h](s/r);p-=Math.ceil(o/r),a=p}else a=s-o;return t=i?t:Math.min(t,a),t*=r||1,Math.max(0,t)},o.prototype.copyPlaceRectPosition=function(){this.rect.x=this.placeRect.x,this.rect.y=this.placeRect.y},o.prototype.removeElem=function(){this.element.parentNode.removeChild(this.element),this.layout.packer.addSpace(this.rect),this.emitEvent("remove",[this])},o}),function(t,e){"function"==typeof define&&define.amd?define(["classie/classie","get-size/get-size","outlayer/outlayer","packery/js/rect","packery/js/packer","packery/js/item"],e):"object"==typeof exports?module.exports=e(require("desandro-classie"),require("get-size"),require("outlayer"),require("./rect"),require("./packer"),require("./item")):t.Packery=e(t.classie,t.getSize,t.Outlayer,t.Packery.Rect,t.Packery.Packer,t.Packery.Item);
2
-
3
  }(window,function(t,e,i,n,o,r){function s(t,e){return t.position.y-e.position.y||t.position.x-e.position.x}function a(t,e){return t.position.x-e.position.x||t.position.y-e.position.y}n.prototype.canFit=function(t){return this.width>=t.width-1&&this.height>=t.height-1};var h=i.create("packery");return h.Item=r,h.prototype._create=function(){i.prototype._create.call(this),this.packer=new o,this.stamp(this.options.stamped);var t=this;this.handleDraggabilly={dragStart:function(){t.itemDragStart(this.element)},dragMove:function(){t.itemDragMove(this.element,this.position.x,this.position.y)},dragEnd:function(){t.itemDragEnd(this.element)}},this.handleUIDraggable={start:function(e,i){i&&t.itemDragStart(e.currentTarget)},drag:function(e,i){i&&t.itemDragMove(e.currentTarget,i.position.left,i.position.top)},stop:function(e,i){i&&t.itemDragEnd(e.currentTarget)}}},h.prototype._resetLayout=function(){this.getSize(),this._getMeasurements();var t=this.packer;this.options.isHorizontal?(t.width=Number.POSITIVE_INFINITY,t.height=this.size.innerHeight+this.gutter,t.sortDirection="rightwardTopToBottom"):(t.width=this.size.innerWidth+this.gutter,t.height=Number.POSITIVE_INFINITY,t.sortDirection="downwardLeftToRight"),t.reset(),this.maxY=0,this.maxX=0},h.prototype._getMeasurements=function(){this._getMeasurement("columnWidth","width"),this._getMeasurement("rowHeight","height"),this._getMeasurement("gutter","width")},h.prototype._getItemLayoutPosition=function(t){return this._packItem(t),t.rect},h.prototype._packItem=function(t){this._setRectSize(t.element,t.rect),this.packer.pack(t.rect),this._setMaxXY(t.rect)},h.prototype._setMaxXY=function(t){this.maxX=Math.max(t.x+t.width,this.maxX),this.maxY=Math.max(t.y+t.height,this.maxY)},h.prototype._setRectSize=function(t,i){var n=e(t),o=n.outerWidth,r=n.outerHeight;(o||r)&&(o=this._applyGridGutter(o,this.columnWidth),r=this._applyGridGutter(r,this.rowHeight)),i.width=Math.min(o,this.packer.width),i.height=Math.min(r,this.packer.height)},h.prototype._applyGridGutter=function(t,e){if(!e)return t+this.gutter;e+=this.gutter;var i=t%e,n=i&&1>i?"round":"ceil";return t=Math[n](t/e)*e},h.prototype._getContainerSize=function(){return this.options.isHorizontal?{width:this.maxX-this.gutter}:{height:this.maxY-this.gutter}},h.prototype._manageStamp=function(t){var e,i=this.getItem(t);if(i&&i.isPlacing)e=i.placeRect;else{var o=this._getElementOffset(t);e=new n({x:this.options.isOriginLeft?o.left:o.right,y:this.options.isOriginTop?o.top:o.bottom})}this._setRectSize(t,e),this.packer.placed(e),this._setMaxXY(e)},h.prototype.sortItemsByPosition=function(){var t=this.options.isHorizontal?a:s;this.items.sort(t)},h.prototype.fit=function(t,e,i){var n=this.getItem(t);n&&(this._getMeasurements(),this.stamp(n.element),n.getSize(),n.isPlacing=!0,e=void 0===e?n.rect.x:e,i=void 0===i?n.rect.y:i,n.positionPlaceRect(e,i,!0),this._bindFitEvents(n),n.moveTo(n.placeRect.x,n.placeRect.y),this.layout(),this.unstamp(n.element),this.sortItemsByPosition(),n.isPlacing=!1,n.copyPlaceRectPosition())},h.prototype._bindFitEvents=function(t){function e(){n++,2==n&&i.dispatchEvent("fitComplete",null,[t])}var i=this,n=0;t.on("layout",function(){return e(),!0}),this.on("layoutComplete",function(){return e(),!0})},h.prototype.resize=function(){var t=e(this.element),i=this.size&&t,n=this.options.isHorizontal?"innerHeight":"innerWidth";i&&t[n]==this.size[n]||this.layout()},h.prototype.itemDragStart=function(t){this.stamp(t);var e=this.getItem(t);e&&e.dragStart()},h.prototype.itemDragMove=function(t,e,i){function n(){r.layout(),delete r.dragTimeout}var o=this.getItem(t);o&&o.dragMove(e,i);var r=this;this.clearDragTimeout(),this.dragTimeout=setTimeout(n,40)},h.prototype.clearDragTimeout=function(){this.dragTimeout&&clearTimeout(this.dragTimeout)},h.prototype.itemDragEnd=function(e){var i,n=this.getItem(e);if(n&&(i=n.didDrag,n.dragStop()),!n||!i&&!n.needsPositioning)return void this.unstamp(e);t.add(n.element,"is-positioning-post-drag");var o=this._getDragEndLayoutComplete(e,n);n.needsPositioning?(n.on("layout",o),n.moveTo(n.placeRect.x,n.placeRect.y)):n&&n.copyPlaceRectPosition(),this.clearDragTimeout(),this.on("layoutComplete",o),this.layout()},h.prototype._getDragEndLayoutComplete=function(e,i){var n=i&&i.needsPositioning,o=0,r=n?2:1,s=this;return function(){return o++,o!=r?!0:(i&&(t.remove(i.element,"is-positioning-post-drag"),i.isPlacing=!1,i.copyPlaceRectPosition()),s.unstamp(e),s.sortItemsByPosition(),n&&s.dispatchEvent("dragItemPositioned",null,[i]),!0)}},h.prototype.bindDraggabillyEvents=function(t){t.on("dragStart",this.handleDraggabilly.dragStart),t.on("dragMove",this.handleDraggabilly.dragMove),t.on("dragEnd",this.handleDraggabilly.dragEnd)},h.prototype.bindUIDraggableEvents=function(t){t.on("dragstart",this.handleUIDraggable.start).on("drag",this.handleUIDraggable.drag).on("dragstop",this.handleUIDraggable.stop)},h.Rect=n,h.Packer=o,h});
1
  !function(t){function e(){}function i(t){function i(e){e.prototype.option||(e.prototype.option=function(e){t.isPlainObject(e)&&(this.options=t.extend(!0,this.options,e))})}function o(e,i){t.fn[e]=function(o){if("string"==typeof o){for(var s=n.call(arguments,1),a=0,h=this.length;h>a;a++){var p=this[a],u=t.data(p,e);if(u)if(t.isFunction(u[o])&&"_"!==o.charAt(0)){var c=u[o].apply(u,s);if(void 0!==c)return c}else r("no such method '"+o+"' for "+e+" instance");else r("cannot call methods on "+e+" prior to initialization; attempted to call '"+o+"'")}return this}return this.each(function(){var n=t.data(this,e);n?(n.option(o),n._init()):(n=new i(this,o),t.data(this,e,n))})}}if(t){var r="undefined"==typeof console?e:function(t){console.error(t)};return t.bridget=function(t,e){i(e),o(t,e)},t.bridget}}var n=Array.prototype.slice;"function"==typeof define&&define.amd?define("jquery-bridget/jquery.bridget",["jquery"],i):i("object"==typeof exports?require("jquery"):t.jQuery)}(window),function(t){function e(t){return new RegExp("(^|\\s+)"+t+"(\\s+|$)")}function i(t,e){var i=n(t,e)?r:o;i(t,e)}var n,o,r;"classList"in document.documentElement?(n=function(t,e){return t.classList.contains(e)},o=function(t,e){t.classList.add(e)},r=function(t,e){t.classList.remove(e)}):(n=function(t,i){return e(i).test(t.className)},o=function(t,e){n(t,e)||(t.className=t.className+" "+e)},r=function(t,i){t.className=t.className.replace(e(i)," ")});var s={hasClass:n,addClass:o,removeClass:r,toggleClass:i,has:n,add:o,remove:r,toggle:i};"function"==typeof define&&define.amd?define("classie/classie",s):"object"==typeof exports?module.exports=s:t.classie=s}(window),function(t){function e(t){if(t){if("string"==typeof n[t])return t;t=t.charAt(0).toUpperCase()+t.slice(1);for(var e,o=0,r=i.length;r>o;o++)if(e=i[o]+t,"string"==typeof n[e])return e}}var i="Webkit Moz ms Ms O".split(" "),n=document.documentElement.style;"function"==typeof define&&define.amd?define("get-style-property/get-style-property",[],function(){return e}):"object"==typeof exports?module.exports=e:t.getStyleProperty=e}(window),function(t,e){function i(t){var e=parseFloat(t),i=-1===t.indexOf("%")&&!isNaN(e);return i&&e}function n(){}function o(){for(var t={width:0,height:0,innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0},e=0,i=a.length;i>e;e++){var n=a[e];t[n]=0}return t}function r(e){function n(){if(!d){d=!0;var n=t.getComputedStyle;if(p=function(){var t=n?function(t){return n(t,null)}:function(t){return t.currentStyle};return function(e){var i=t(e);return i||s("Style returned "+i+". Are you running this code in a hidden iframe on Firefox? See http://bit.ly/getsizebug1"),i}}(),u=e("boxSizing")){var o=document.createElement("div");o.style.width="200px",o.style.padding="1px 2px 3px 4px",o.style.borderStyle="solid",o.style.borderWidth="1px 2px 3px 4px",o.style[u]="border-box";var r=document.body||document.documentElement;r.appendChild(o);var a=p(o);c=200===i(a.width),r.removeChild(o)}}}function r(t){if(n(),"string"==typeof t&&(t=document.querySelector(t)),t&&"object"==typeof t&&t.nodeType){var e=p(t);if("none"===e.display)return o();var r={};r.width=t.offsetWidth,r.height=t.offsetHeight;for(var s=r.isBorderBox=!(!u||!e[u]||"border-box"!==e[u]),d=0,l=a.length;l>d;d++){var f=a[d],y=e[f];y=h(t,y);var m=parseFloat(y);r[f]=isNaN(m)?0:m}var g=r.paddingLeft+r.paddingRight,v=r.paddingTop+r.paddingBottom,x=r.marginLeft+r.marginRight,E=r.marginTop+r.marginBottom,b=r.borderLeftWidth+r.borderRightWidth,w=r.borderTopWidth+r.borderBottomWidth,_=s&&c,T=i(e.width);T!==!1&&(r.width=T+(_?0:g+b));var z=i(e.height);return z!==!1&&(r.height=z+(_?0:v+w)),r.innerWidth=r.width-(g+b),r.innerHeight=r.height-(v+w),r.outerWidth=r.width+x,r.outerHeight=r.height+E,r}}function h(e,i){if(t.getComputedStyle||-1===i.indexOf("%"))return i;var n=e.style,o=n.left,r=e.runtimeStyle,s=r&&r.left;return s&&(r.left=e.currentStyle.left),n.left=i,i=n.pixelLeft,n.left=o,s&&(r.left=s),i}var p,u,c,d=!1;return r}var s="undefined"==typeof console?n:function(t){console.error(t)},a=["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"];"function"==typeof define&&define.amd?define("get-size/get-size",["get-style-property/get-style-property"],r):"object"==typeof exports?module.exports=r(require("desandro-get-style-property")):t.getSize=r(t.getStyleProperty)}(window),function(t){function e(e){var i=t.event;return i.target=i.target||i.srcElement||e,i}var i=document.documentElement,n=function(){};i.addEventListener?n=function(t,e,i){t.addEventListener(e,i,!1)}:i.attachEvent&&(n=function(t,i,n){t[i+n]=n.handleEvent?function(){var i=e(t);n.handleEvent.call(n,i)}:function(){var i=e(t);n.call(t,i)},t.attachEvent("on"+i,t[i+n])});var o=function(){};i.removeEventListener?o=function(t,e,i){t.removeEventListener(e,i,!1)}:i.detachEvent&&(o=function(t,e,i){t.detachEvent("on"+e,t[e+i]);try{delete t[e+i]}catch(n){t[e+i]=void 0}});var r={bind:n,unbind:o};"function"==typeof define&&define.amd?define("eventie/eventie",r):"object"==typeof exports?module.exports=r:t.eventie=r}(window),function(){function t(){}function e(t,e){for(var i=t.length;i--;)if(t[i].listener===e)return i;return-1}function i(t){return function(){return this[t].apply(this,arguments)}}var n=t.prototype,o=this,r=o.EventEmitter;n.getListeners=function(t){var e,i,n=this._getEvents();if(t instanceof RegExp){e={};for(i in n)n.hasOwnProperty(i)&&t.test(i)&&(e[i]=n[i])}else e=n[t]||(n[t]=[]);return e},n.flattenListeners=function(t){var e,i=[];for(e=0;e<t.length;e+=1)i.push(t[e].listener);return i},n.getListenersAsObject=function(t){var e,i=this.getListeners(t);return i instanceof Array&&(e={},e[t]=i),e||i},n.addListener=function(t,i){var n,o=this.getListenersAsObject(t),r="object"==typeof i;for(n in o)o.hasOwnProperty(n)&&-1===e(o[n],i)&&o[n].push(r?i:{listener:i,once:!1});return this},n.on=i("addListener"),n.addOnceListener=function(t,e){return this.addListener(t,{listener:e,once:!0})},n.once=i("addOnceListener"),n.defineEvent=function(t){return this.getListeners(t),this},n.defineEvents=function(t){for(var e=0;e<t.length;e+=1)this.defineEvent(t[e]);return this},n.removeListener=function(t,i){var n,o,r=this.getListenersAsObject(t);for(o in r)r.hasOwnProperty(o)&&(n=e(r[o],i),-1!==n&&r[o].splice(n,1));return this},n.off=i("removeListener"),n.addListeners=function(t,e){return this.manipulateListeners(!1,t,e)},n.removeListeners=function(t,e){return this.manipulateListeners(!0,t,e)},n.manipulateListeners=function(t,e,i){var n,o,r=t?this.removeListener:this.addListener,s=t?this.removeListeners:this.addListeners;if("object"!=typeof e||e instanceof RegExp)for(n=i.length;n--;)r.call(this,e,i[n]);else for(n in e)e.hasOwnProperty(n)&&(o=e[n])&&("function"==typeof o?r.call(this,n,o):s.call(this,n,o));return this},n.removeEvent=function(t){var e,i=typeof t,n=this._getEvents();if("string"===i)delete n[t];else if(t instanceof RegExp)for(e in n)n.hasOwnProperty(e)&&t.test(e)&&delete n[e];else delete this._events;return this},n.removeAllListeners=i("removeEvent"),n.emitEvent=function(t,e){var i,n,o,r,s=this.getListenersAsObject(t);for(o in s)if(s.hasOwnProperty(o))for(n=s[o].length;n--;)i=s[o][n],i.once===!0&&this.removeListener(t,i.listener),r=i.listener.apply(this,e||[]),r===this._getOnceReturnValue()&&this.removeListener(t,i.listener);return this},n.trigger=i("emitEvent"),n.emit=function(t){var e=Array.prototype.slice.call(arguments,1);return this.emitEvent(t,e)},n.setOnceReturnValue=function(t){return this._onceReturnValue=t,this},n._getOnceReturnValue=function(){return this.hasOwnProperty("_onceReturnValue")?this._onceReturnValue:!0},n._getEvents=function(){return this._events||(this._events={})},t.noConflict=function(){return o.EventEmitter=r,t},"function"==typeof define&&define.amd?define("eventEmitter/EventEmitter",[],function(){return t}):"object"==typeof module&&module.exports?module.exports=t:o.EventEmitter=t}.call(this),function(t){function e(t){"function"==typeof t&&(e.isReady?t():s.push(t))}function i(t){var i="readystatechange"===t.type&&"complete"!==r.readyState;e.isReady||i||n()}function n(){e.isReady=!0;for(var t=0,i=s.length;i>t;t++){var n=s[t];n()}}function o(o){return"complete"===r.readyState?n():(o.bind(r,"DOMContentLoaded",i),o.bind(r,"readystatechange",i),o.bind(t,"load",i)),e}var r=t.document,s=[];e.isReady=!1,"function"==typeof define&&define.amd?define("doc-ready/doc-ready",["eventie/eventie"],o):"object"==typeof exports?module.exports=o(require("eventie")):t.docReady=o(t.eventie)}(window),function(t){function e(t,e){return t[s](e)}function i(t){if(!t.parentNode){var e=document.createDocumentFragment();e.appendChild(t)}}function n(t,e){i(t);for(var n=t.parentNode.querySelectorAll(e),o=0,r=n.length;r>o;o++)if(n[o]===t)return!0;return!1}function o(t,n){return i(t),e(t,n)}var r,s=function(){if(t.matches)return"matches";if(t.matchesSelector)return"matchesSelector";for(var e=["webkit","moz","ms","o"],i=0,n=e.length;n>i;i++){var o=e[i],r=o+"MatchesSelector";if(t[r])return r}}();if(s){var a=document.createElement("div"),h=e(a,"div");r=h?e:o}else r=n;"function"==typeof define&&define.amd?define("matches-selector/matches-selector",[],function(){return r}):"object"==typeof exports?module.exports=r:window.matchesSelector=r}(Element.prototype),function(t,e){"function"==typeof define&&define.amd?define("fizzy-ui-utils/utils",["doc-ready/doc-ready","matches-selector/matches-selector"],function(i,n){return e(t,i,n)}):"object"==typeof exports?module.exports=e(t,require("doc-ready"),require("desandro-matches-selector")):t.fizzyUIUtils=e(t,t.docReady,t.matchesSelector)}(window,function(t,e,i){var n={};n.extend=function(t,e){for(var i in e)t[i]=e[i];return t},n.modulo=function(t,e){return(t%e+e)%e};var o=Object.prototype.toString;n.isArray=function(t){return"[object Array]"==o.call(t)},n.makeArray=function(t){var e=[];if(n.isArray(t))e=t;else if(t&&"number"==typeof t.length)for(var i=0,o=t.length;o>i;i++)e.push(t[i]);else e.push(t);return e},n.indexOf=Array.prototype.indexOf?function(t,e){return t.indexOf(e)}:function(t,e){for(var i=0,n=t.length;n>i;i++)if(t[i]===e)return i;return-1},n.removeFrom=function(t,e){var i=n.indexOf(t,e);-1!=i&&t.splice(i,1)},n.isElement="function"==typeof HTMLElement||"object"==typeof HTMLElement?function(t){return t instanceof HTMLElement}:function(t){return t&&"object"==typeof t&&1==t.nodeType&&"string"==typeof t.nodeName},n.setText=function(){function t(t,i){e=e||(void 0!==document.documentElement.textContent?"textContent":"innerText"),t[e]=i}var e;return t}(),n.getParent=function(t,e){for(;t!=document.body;)if(t=t.parentNode,i(t,e))return t},n.getQueryElement=function(t){return"string"==typeof t?document.querySelector(t):t},n.handleEvent=function(t){var e="on"+t.type;this[e]&&this[e](t)},n.filterFindElements=function(t,e){t=n.makeArray(t);for(var o=[],r=0,s=t.length;s>r;r++){var a=t[r];if(n.isElement(a))if(e){i(a,e)&&o.push(a);for(var h=a.querySelectorAll(e),p=0,u=h.length;u>p;p++)o.push(h[p])}else o.push(a)}return o},n.debounceMethod=function(t,e,i){var n=t.prototype[e],o=e+"Timeout";t.prototype[e]=function(){var t=this[o];t&&clearTimeout(t);var e=arguments,r=this;this[o]=setTimeout(function(){n.apply(r,e),delete r[o]},i||100)}},n.toDashed=function(t){return t.replace(/(.)([A-Z])/g,function(t,e,i){return e+"-"+i}).toLowerCase()};var r=t.console;return n.htmlInit=function(i,o){e(function(){for(var e=n.toDashed(o),s=document.querySelectorAll(".js-"+e),a="data-"+e+"-options",h=0,p=s.length;p>h;h++){var u,c=s[h],d=c.getAttribute(a);try{u=d&&JSON.parse(d)}catch(l){r&&r.error("Error parsing "+a+" on "+c.nodeName.toLowerCase()+(c.id?"#"+c.id:"")+": "+l);continue}var f=new i(c,u),y=t.jQuery;y&&y.data(c,o,f)}})},n}),function(t,e){"function"==typeof define&&define.amd?define("outlayer/item",["eventEmitter/EventEmitter","get-size/get-size","get-style-property/get-style-property","fizzy-ui-utils/utils"],function(i,n,o,r){return e(t,i,n,o,r)}):"object"==typeof exports?module.exports=e(t,require("wolfy87-eventemitter"),require("get-size"),require("desandro-get-style-property"),require("fizzy-ui-utils")):(t.Outlayer={},t.Outlayer.Item=e(t,t.EventEmitter,t.getSize,t.getStyleProperty,t.fizzyUIUtils))}(window,function(t,e,i,n,o){function r(t){for(var e in t)return!1;return e=null,!0}function s(t,e){t&&(this.element=t,this.layout=e,this.position={x:0,y:0},this._create())}function a(t){return t.replace(/([A-Z])/g,function(t){return"-"+t.toLowerCase()})}var h=t.getComputedStyle,p=h?function(t){return h(t,null)}:function(t){return t.currentStyle},u=n("transition"),c=n("transform"),d=u&&c,l=!!n("perspective"),f={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"otransitionend",transition:"transitionend"}[u],y=["transform","transition","transitionDuration","transitionProperty"],m=function(){for(var t={},e=0,i=y.length;i>e;e++){var o=y[e],r=n(o);r&&r!==o&&(t[o]=r)}return t}();o.extend(s.prototype,e.prototype),s.prototype._create=function(){this._transn={ingProperties:{},clean:{},onEnd:{}},this.css({position:"absolute"})},s.prototype.handleEvent=function(t){var e="on"+t.type;this[e]&&this[e](t)},s.prototype.getSize=function(){this.size=i(this.element)},s.prototype.css=function(t){var e=this.element.style;for(var i in t){var n=m[i]||i;e[n]=t[i]}},s.prototype.getPosition=function(){var t=p(this.element),e=this.layout.options,i=e.isOriginLeft,n=e.isOriginTop,o=t[i?"left":"right"],r=t[n?"top":"bottom"],s=this.layout.size,a=-1!=o.indexOf("%")?parseFloat(o)/100*s.width:parseInt(o,10),h=-1!=r.indexOf("%")?parseFloat(r)/100*s.height:parseInt(r,10);a=isNaN(a)?0:a,h=isNaN(h)?0:h,a-=i?s.paddingLeft:s.paddingRight,h-=n?s.paddingTop:s.paddingBottom,this.position.x=a,this.position.y=h},s.prototype.layoutPosition=function(){var t=this.layout.size,e=this.layout.options,i={},n=e.isOriginLeft?"paddingLeft":"paddingRight",o=e.isOriginLeft?"left":"right",r=e.isOriginLeft?"right":"left",s=this.position.x+t[n];i[o]=this.getXValue(s),i[r]="";var a=e.isOriginTop?"paddingTop":"paddingBottom",h=e.isOriginTop?"top":"bottom",p=e.isOriginTop?"bottom":"top",u=this.position.y+t[a];i[h]=this.getYValue(u),i[p]="",this.css(i),this.emitEvent("layout",[this])},s.prototype.getXValue=function(t){var e=this.layout.options;return e.percentPosition&&!e.isHorizontal?t/this.layout.size.width*100+"%":t+"px"},s.prototype.getYValue=function(t){var e=this.layout.options;return e.percentPosition&&e.isHorizontal?t/this.layout.size.height*100+"%":t+"px"},s.prototype._transitionTo=function(t,e){this.getPosition();var i=this.position.x,n=this.position.y,o=parseInt(t,10),r=parseInt(e,10),s=o===this.position.x&&r===this.position.y;if(this.setPosition(t,e),s&&!this.isTransitioning)return void this.layoutPosition();var a=t-i,h=e-n,p={};p.transform=this.getTranslate(a,h),this.transition({to:p,onTransitionEnd:{transform:this.layoutPosition},isCleaning:!0})},s.prototype.getTranslate=function(t,e){var i=this.layout.options;return t=i.isOriginLeft?t:-t,e=i.isOriginTop?e:-e,l?"translate3d("+t+"px, "+e+"px, 0)":"translate("+t+"px, "+e+"px)"},s.prototype.goTo=function(t,e){this.setPosition(t,e),this.layoutPosition()},s.prototype.moveTo=d?s.prototype._transitionTo:s.prototype.goTo,s.prototype.setPosition=function(t,e){this.position.x=parseInt(t,10),this.position.y=parseInt(e,10)},s.prototype._nonTransition=function(t){this.css(t.to),t.isCleaning&&this._removeStyles(t.to);for(var e in t.onTransitionEnd)t.onTransitionEnd[e].call(this)},s.prototype._transition=function(t){if(!parseFloat(this.layout.options.transitionDuration))return void this._nonTransition(t);var e=this._transn;for(var i in t.onTransitionEnd)e.onEnd[i]=t.onTransitionEnd[i];for(i in t.to)e.ingProperties[i]=!0,t.isCleaning&&(e.clean[i]=!0);if(t.from){this.css(t.from);var n=this.element.offsetHeight;n=null}this.enableTransition(t.to),this.css(t.to),this.isTransitioning=!0};var g="opacity,"+a(m.transform||"transform");s.prototype.enableTransition=function(){this.isTransitioning||(this.css({transitionProperty:g,transitionDuration:this.layout.options.transitionDuration}),this.element.addEventListener(f,this,!1))},s.prototype.transition=s.prototype[u?"_transition":"_nonTransition"],s.prototype.onwebkitTransitionEnd=function(t){this.ontransitionend(t)},s.prototype.onotransitionend=function(t){this.ontransitionend(t)};var v={"-webkit-transform":"transform","-moz-transform":"transform","-o-transform":"transform"};s.prototype.ontransitionend=function(t){if(t.target===this.element){var e=this._transn,i=v[t.propertyName]||t.propertyName;if(delete e.ingProperties[i],r(e.ingProperties)&&this.disableTransition(),i in e.clean&&(this.element.style[t.propertyName]="",delete e.clean[i]),i in e.onEnd){var n=e.onEnd[i];n.call(this),delete e.onEnd[i]}this.emitEvent("transitionEnd",[this])}},s.prototype.disableTransition=function(){this.removeTransitionStyles(),this.element.removeEventListener(f,this,!1),this.isTransitioning=!1},s.prototype._removeStyles=function(t){var e={};for(var i in t)e[i]="";this.css(e)};var x={transitionProperty:"",transitionDuration:""};return s.prototype.removeTransitionStyles=function(){this.css(x)},s.prototype.removeElem=function(){this.element.parentNode.removeChild(this.element),this.css({display:""}),this.emitEvent("remove",[this])},s.prototype.remove=function(){if(!u||!parseFloat(this.layout.options.transitionDuration))return void this.removeElem();var t=this;this.once("transitionEnd",function(){t.removeElem()}),this.hide()},s.prototype.reveal=function(){delete this.isHidden,this.css({display:""});var t=this.layout.options,e={},i=this.getHideRevealTransitionEndProperty("visibleStyle");e[i]=this.onRevealTransitionEnd,this.transition({from:t.hiddenStyle,to:t.visibleStyle,isCleaning:!0,onTransitionEnd:e})},s.prototype.onRevealTransitionEnd=function(){this.isHidden||this.emitEvent("reveal")},s.prototype.getHideRevealTransitionEndProperty=function(t){var e=this.layout.options[t];if(e.opacity)return"opacity";for(var i in e)return i},s.prototype.hide=function(){this.isHidden=!0,this.css({display:""});var t=this.layout.options,e={},i=this.getHideRevealTransitionEndProperty("hiddenStyle");e[i]=this.onHideTransitionEnd,this.transition({from:t.visibleStyle,to:t.hiddenStyle,isCleaning:!0,onTransitionEnd:e})},s.prototype.onHideTransitionEnd=function(){this.isHidden&&(this.css({display:"none"}),this.emitEvent("hide"))},s.prototype.destroy=function(){this.css({position:"",left:"",right:"",top:"",bottom:"",transition:"",transform:""})},s}),function(t,e){"function"==typeof define&&define.amd?define("outlayer/outlayer",["eventie/eventie","eventEmitter/EventEmitter","get-size/get-size","fizzy-ui-utils/utils","./item"],function(i,n,o,r,s){return e(t,i,n,o,r,s)}):"object"==typeof exports?module.exports=e(t,require("eventie"),require("wolfy87-eventemitter"),require("get-size"),require("fizzy-ui-utils"),require("./item")):t.Outlayer=e(t,t.eventie,t.EventEmitter,t.getSize,t.fizzyUIUtils,t.Outlayer.Item)}(window,function(t,e,i,n,o,r){function s(t,e){var i=o.getQueryElement(t);if(!i)return void(a&&a.error("Bad element for "+this.constructor.namespace+": "+(i||t)));this.element=i,h&&(this.$element=h(this.element)),this.options=o.extend({},this.constructor.defaults),this.option(e);var n=++u;this.element.outlayerGUID=n,c[n]=this,this._create(),this.options.isInitLayout&&this.layout()}var a=t.console,h=t.jQuery,p=function(){},u=0,c={};return s.namespace="outlayer",s.Item=r,s.defaults={containerStyle:{position:"relative"},isInitLayout:!0,isOriginLeft:!0,isOriginTop:!0,isResizeBound:!0,isResizingContainer:!0,transitionDuration:"0.4s",hiddenStyle:{opacity:0,transform:"scale(0.001)"},visibleStyle:{opacity:1,transform:"scale(1)"}},o.extend(s.prototype,i.prototype),s.prototype.option=function(t){o.extend(this.options,t)},s.prototype._create=function(){this.reloadItems(),this.stamps=[],this.stamp(this.options.stamp),o.extend(this.element.style,this.options.containerStyle),this.options.isResizeBound&&this.bindResize()},s.prototype.reloadItems=function(){this.items=this._itemize(this.element.children)},s.prototype._itemize=function(t){for(var e=this._filterFindItemElements(t),i=this.constructor.Item,n=[],o=0,r=e.length;r>o;o++){var s=e[o],a=new i(s,this);n.push(a)}return n},s.prototype._filterFindItemElements=function(t){return o.filterFindElements(t,this.options.itemSelector)},s.prototype.getItemElements=function(){for(var t=[],e=0,i=this.items.length;i>e;e++)t.push(this.items[e].element);return t},s.prototype.layout=function(){this._resetLayout(),this._manageStamps();var t=void 0!==this.options.isLayoutInstant?this.options.isLayoutInstant:!this._isLayoutInited;this.layoutItems(this.items,t),this._isLayoutInited=!0},s.prototype._init=s.prototype.layout,s.prototype._resetLayout=function(){this.getSize()},s.prototype.getSize=function(){this.size=n(this.element)},s.prototype._getMeasurement=function(t,e){var i,r=this.options[t];r?("string"==typeof r?i=this.element.querySelector(r):o.isElement(r)&&(i=r),this[t]=i?n(i)[e]:r):this[t]=0},s.prototype.layoutItems=function(t,e){t=this._getItemsForLayout(t),this._layoutItems(t,e),this._postLayout()},s.prototype._getItemsForLayout=function(t){for(var e=[],i=0,n=t.length;n>i;i++){var o=t[i];o.isIgnored||e.push(o)}return e},s.prototype._layoutItems=function(t,e){if(this._emitCompleteOnItems("layout",t),t&&t.length){for(var i=[],n=0,o=t.length;o>n;n++){var r=t[n],s=this._getItemLayoutPosition(r);s.item=r,s.isInstant=e||r.isLayoutInstant,i.push(s)}this._processLayoutQueue(i)}},s.prototype._getItemLayoutPosition=function(){return{x:0,y:0}},s.prototype._processLayoutQueue=function(t){for(var e=0,i=t.length;i>e;e++){var n=t[e];this._positionItem(n.item,n.x,n.y,n.isInstant)}},s.prototype._positionItem=function(t,e,i,n){n?t.goTo(e,i):t.moveTo(e,i)},s.prototype._postLayout=function(){this.resizeContainer()},s.prototype.resizeContainer=function(){if(this.options.isResizingContainer){var t=this._getContainerSize();t&&(this._setContainerMeasure(t.width,!0),this._setContainerMeasure(t.height,!1))}},s.prototype._getContainerSize=p,s.prototype._setContainerMeasure=function(t,e){if(void 0!==t){var i=this.size;i.isBorderBox&&(t+=e?i.paddingLeft+i.paddingRight+i.borderLeftWidth+i.borderRightWidth:i.paddingBottom+i.paddingTop+i.borderTopWidth+i.borderBottomWidth),t=Math.max(t,0),this.element.style[e?"width":"height"]=t+"px"}},s.prototype._emitCompleteOnItems=function(t,e){function i(){o.dispatchEvent(t+"Complete",null,[e])}function n(){s++,s===r&&i()}var o=this,r=e.length;if(!e||!r)return void i();for(var s=0,a=0,h=e.length;h>a;a++){var p=e[a];p.once(t,n)}},s.prototype.dispatchEvent=function(t,e,i){var n=e?[e].concat(i):i;if(this.emitEvent(t,n),h)if(this.$element=this.$element||h(this.element),e){var o=h.Event(e);o.type=t,this.$element.trigger(o,i)}else this.$element.trigger(t,i)},s.prototype.ignore=function(t){var e=this.getItem(t);e&&(e.isIgnored=!0)},s.prototype.unignore=function(t){var e=this.getItem(t);e&&delete e.isIgnored},s.prototype.stamp=function(t){if(t=this._find(t)){this.stamps=this.stamps.concat(t);for(var e=0,i=t.length;i>e;e++){var n=t[e];this.ignore(n)}}},s.prototype.unstamp=function(t){if(t=this._find(t))for(var e=0,i=t.length;i>e;e++){var n=t[e];o.removeFrom(this.stamps,n),this.unignore(n)}},s.prototype._find=function(t){return t?("string"==typeof t&&(t=this.element.querySelectorAll(t)),t=o.makeArray(t)):void 0},s.prototype._manageStamps=function(){if(this.stamps&&this.stamps.length){this._getBoundingRect();for(var t=0,e=this.stamps.length;e>t;t++){var i=this.stamps[t];this._manageStamp(i)}}},s.prototype._getBoundingRect=function(){var t=this.element.getBoundingClientRect(),e=this.size;this._boundingRect={left:t.left+e.paddingLeft+e.borderLeftWidth,top:t.top+e.paddingTop+e.borderTopWidth,right:t.right-(e.paddingRight+e.borderRightWidth),bottom:t.bottom-(e.paddingBottom+e.borderBottomWidth)}},s.prototype._manageStamp=p,s.prototype._getElementOffset=function(t){var e=t.getBoundingClientRect(),i=this._boundingRect,o=n(t),r={left:e.left-i.left-o.marginLeft,top:e.top-i.top-o.marginTop,right:i.right-e.right-o.marginRight,bottom:i.bottom-e.bottom-o.marginBottom};return r},s.prototype.handleEvent=function(t){var e="on"+t.type;this[e]&&this[e](t)},s.prototype.bindResize=function(){this.isResizeBound||(e.bind(t,"resize",this),this.isResizeBound=!0)},s.prototype.unbindResize=function(){this.isResizeBound&&e.unbind(t,"resize",this),this.isResizeBound=!1},s.prototype.onresize=function(){function t(){e.resize(),delete e.resizeTimeout}this.resizeTimeout&&clearTimeout(this.resizeTimeout);var e=this;this.resizeTimeout=setTimeout(t,100)},s.prototype.resize=function(){this.isResizeBound&&this.needsResizeLayout()&&this.layout()},s.prototype.needsResizeLayout=function(){var t=n(this.element),e=this.size&&t;return e&&t.innerWidth!==this.size.innerWidth},s.prototype.addItems=function(t){var e=this._itemize(t);return e.length&&(this.items=this.items.concat(e)),e},s.prototype.appended=function(t){var e=this.addItems(t);e.length&&(this.layoutItems(e,!0),this.reveal(e))},s.prototype.prepended=function(t){var e=this._itemize(t);if(e.length){var i=this.items.slice(0);this.items=e.concat(i),this._resetLayout(),this._manageStamps(),this.layoutItems(e,!0),this.reveal(e),this.layoutItems(i)}},s.prototype.reveal=function(t){this._emitCompleteOnItems("reveal",t);for(var e=t&&t.length,i=0;e&&e>i;i++){var n=t[i];n.reveal()}},s.prototype.hide=function(t){this._emitCompleteOnItems("hide",t);for(var e=t&&t.length,i=0;e&&e>i;i++){var n=t[i];n.hide()}},s.prototype.revealItemElements=function(t){var e=this.getItems(t);this.reveal(e)},s.prototype.hideItemElements=function(t){var e=this.getItems(t);this.hide(e)},s.prototype.getItem=function(t){for(var e=0,i=this.items.length;i>e;e++){var n=this.items[e];if(n.element===t)return n}},s.prototype.getItems=function(t){t=o.makeArray(t);for(var e=[],i=0,n=t.length;n>i;i++){var r=t[i],s=this.getItem(r);s&&e.push(s)}return e},s.prototype.remove=function(t){var e=this.getItems(t);if(this._emitCompleteOnItems("remove",e),e&&e.length)for(var i=0,n=e.length;n>i;i++){var r=e[i];r.remove(),o.removeFrom(this.items,r)}},s.prototype.destroy=function(){var t=this.element.style;t.height="",t.position="",t.width="";for(var e=0,i=this.items.length;i>e;e++){var n=this.items[e];n.destroy()}this.unbindResize();var o=this.element.outlayerGUID;delete c[o],delete this.element.outlayerGUID,h&&h.removeData(this.element,this.constructor.namespace)},s.data=function(t){t=o.getQueryElement(t);var e=t&&t.outlayerGUID;return e&&c[e]},s.create=function(t,e){function i(){s.apply(this,arguments)}return Object.create?i.prototype=Object.create(s.prototype):o.extend(i.prototype,s.prototype),i.prototype.constructor=i,i.defaults=o.extend({},s.defaults),o.extend(i.defaults,e),i.prototype.settings={},i.namespace=t,i.data=s.data,i.Item=function(){r.apply(this,arguments)},i.Item.prototype=new r,o.htmlInit(i,t),h&&h.bridget&&h.bridget(t,i),i},s.Item=r,s}),function(t,e){"function"==typeof define&&define.amd?define("packery/js/rect",e):"object"==typeof exports?module.exports=e():(t.Packery=t.Packery||{},t.Packery.Rect=e())}(window,function(){function t(e){for(var i in t.defaults)this[i]=t.defaults[i];for(i in e)this[i]=e[i]}var e=window.Packery=function(){};return e.Rect=t,t.defaults={x:0,y:0,width:0,height:0},t.prototype.contains=function(t){var e=t.width||0,i=t.height||0;return this.x<=t.x&&this.y<=t.y&&this.x+this.width>=t.x+e&&this.y+this.height>=t.y+i},t.prototype.overlaps=function(t){var e=this.x+this.width,i=this.y+this.height,n=t.x+t.width,o=t.y+t.height;return this.x<n&&e>t.x&&this.y<o&&i>t.y},t.prototype.getMaximalFreeRects=function(e){if(!this.overlaps(e))return!1;var i,n=[],o=this.x+this.width,r=this.y+this.height,s=e.x+e.width,a=e.y+e.height;return this.y<e.y&&(i=new t({x:this.x,y:this.y,width:this.width,height:e.y-this.y}),n.push(i)),o>s&&(i=new t({x:s,y:this.y,width:o-s,height:this.height}),n.push(i)),r>a&&(i=new t({x:this.x,y:a,width:this.width,height:r-a}),n.push(i)),this.x<e.x&&(i=new t({x:this.x,y:this.y,width:e.x-this.x,height:this.height}),n.push(i)),n},t.prototype.canFit=function(t){return this.width>=t.width&&this.height>=t.height},t}),function(t,e){if("function"==typeof define&&define.amd)define("packery/js/packer",["./rect"],e);else if("object"==typeof exports)module.exports=e(require("./rect"));else{var i=t.Packery=t.Packery||{};i.Packer=e(i.Rect)}}(window,function(t){function e(t,e,i){this.width=t||0,this.height=e||0,this.sortDirection=i||"downwardLeftToRight",this.reset()}e.prototype.reset=function(){this.spaces=[],this.newSpaces=[];var e=new t({x:0,y:0,width:this.width,height:this.height});this.spaces.push(e),this.sorter=i[this.sortDirection]||i.downwardLeftToRight},e.prototype.pack=function(t){for(var e=0,i=this.spaces.length;i>e;e++){var n=this.spaces[e];if(n.canFit(t)){this.placeInSpace(t,n);break}}},e.prototype.placeInSpace=function(t,e){t.x=e.x,t.y=e.y,this.placed(t)},e.prototype.placed=function(t){for(var e=[],i=0,n=this.spaces.length;n>i;i++){var o=this.spaces[i],r=o.getMaximalFreeRects(t);r?e.push.apply(e,r):e.push(o)}this.spaces=e,this.mergeSortSpaces()},e.prototype.mergeSortSpaces=function(){e.mergeRects(this.spaces),this.spaces.sort(this.sorter)},e.prototype.addSpace=function(t){this.spaces.push(t),this.mergeSortSpaces()},e.mergeRects=function(t){for(var e=0,i=t.length;i>e;e++){var n=t[e];if(n){var o=t.slice(0);o.splice(e,1);for(var r=0,s=0,a=o.length;a>s;s++){var h=o[s],p=e>s?0:1;n.contains(h)&&(t.splice(s+p-r,1),r++)}}}return t};var i={downwardLeftToRight:function(t,e){return t.y-e.y||t.x-e.x},rightwardTopToBottom:function(t,e){return t.x-e.x||t.y-e.y}};return e}),function(t,e){"function"==typeof define&&define.amd?define("packery/js/item",["get-style-property/get-style-property","outlayer/outlayer","./rect"],e):"object"==typeof exports?module.exports=e(require("desandro-get-style-property"),require("outlayer"),require("./rect")):t.Packery.Item=e(t.getStyleProperty,t.Outlayer,t.Packery.Rect)}(window,function(t,e,i){var n=t("transform"),o=function(){e.Item.apply(this,arguments)};o.prototype=new e.Item;var r=o.prototype._create;return o.prototype._create=function(){r.call(this),this.rect=new i,this.placeRect=new i},o.prototype.dragStart=function(){this.getPosition(),this.removeTransitionStyles(),this.isTransitioning&&n&&(this.element.style[n]="none"),this.getSize(),this.isPlacing=!0,this.needsPositioning=!1,this.positionPlaceRect(this.position.x,this.position.y),this.isTransitioning=!1,this.didDrag=!1},o.prototype.dragMove=function(t,e){this.didDrag=!0;var i=this.layout.size;t-=i.paddingLeft,e-=i.paddingTop,this.positionPlaceRect(t,e)},o.prototype.dragStop=function(){this.getPosition();var t=this.position.x!=this.placeRect.x,e=this.position.y!=this.placeRect.y;this.needsPositioning=t||e,this.didDrag=!1},o.prototype.positionPlaceRect=function(t,e,i){this.placeRect.x=this.getPlaceRectCoord(t,!0),this.placeRect.y=this.getPlaceRectCoord(e,!1,i)},o.prototype.getPlaceRectCoord=function(t,e,i){var n=e?"Width":"Height",o=this.size["outer"+n],r=this.layout[e?"columnWidth":"rowHeight"],s=this.layout.size["inner"+n];e||(s=Math.max(s,this.layout.maxY),this.layout.rowHeight||(s-=this.layout.gutter));var a;if(r){r+=this.layout.gutter,s+=e?this.layout.gutter:0,t=Math.round(t/r);var h;h=this.layout.options.isHorizontal?e?"ceil":"floor":e?"floor":"ceil";var p=Math[h](s/r);p-=Math.ceil(o/r),a=p}else a=s-o;return t=i?t:Math.min(t,a),t*=r||1,Math.max(0,t)},o.prototype.copyPlaceRectPosition=function(){this.rect.x=this.placeRect.x,this.rect.y=this.placeRect.y},o.prototype.removeElem=function(){this.element.parentNode.removeChild(this.element),this.layout.packer.addSpace(this.rect),this.emitEvent("remove",[this])},o}),function(t,e){"function"==typeof define&&define.amd?define(["classie/classie","get-size/get-size","outlayer/outlayer","packery/js/rect","packery/js/packer","packery/js/item"],e):"object"==typeof exports?module.exports=e(require("desandro-classie"),require("get-size"),require("outlayer"),require("./rect"),require("./packer"),require("./item")):t.Packery=e(t.classie,t.getSize,t.Outlayer,t.Packery.Rect,t.Packery.Packer,t.Packery.Item);
 
2
  }(window,function(t,e,i,n,o,r){function s(t,e){return t.position.y-e.position.y||t.position.x-e.position.x}function a(t,e){return t.position.x-e.position.x||t.position.y-e.position.y}n.prototype.canFit=function(t){return this.width>=t.width-1&&this.height>=t.height-1};var h=i.create("packery");return h.Item=r,h.prototype._create=function(){i.prototype._create.call(this),this.packer=new o,this.stamp(this.options.stamped);var t=this;this.handleDraggabilly={dragStart:function(){t.itemDragStart(this.element)},dragMove:function(){t.itemDragMove(this.element,this.position.x,this.position.y)},dragEnd:function(){t.itemDragEnd(this.element)}},this.handleUIDraggable={start:function(e,i){i&&t.itemDragStart(e.currentTarget)},drag:function(e,i){i&&t.itemDragMove(e.currentTarget,i.position.left,i.position.top)},stop:function(e,i){i&&t.itemDragEnd(e.currentTarget)}}},h.prototype._resetLayout=function(){this.getSize(),this._getMeasurements();var t=this.packer;this.options.isHorizontal?(t.width=Number.POSITIVE_INFINITY,t.height=this.size.innerHeight+this.gutter,t.sortDirection="rightwardTopToBottom"):(t.width=this.size.innerWidth+this.gutter,t.height=Number.POSITIVE_INFINITY,t.sortDirection="downwardLeftToRight"),t.reset(),this.maxY=0,this.maxX=0},h.prototype._getMeasurements=function(){this._getMeasurement("columnWidth","width"),this._getMeasurement("rowHeight","height"),this._getMeasurement("gutter","width")},h.prototype._getItemLayoutPosition=function(t){return this._packItem(t),t.rect},h.prototype._packItem=function(t){this._setRectSize(t.element,t.rect),this.packer.pack(t.rect),this._setMaxXY(t.rect)},h.prototype._setMaxXY=function(t){this.maxX=Math.max(t.x+t.width,this.maxX),this.maxY=Math.max(t.y+t.height,this.maxY)},h.prototype._setRectSize=function(t,i){var n=e(t),o=n.outerWidth,r=n.outerHeight;(o||r)&&(o=this._applyGridGutter(o,this.columnWidth),r=this._applyGridGutter(r,this.rowHeight)),i.width=Math.min(o,this.packer.width),i.height=Math.min(r,this.packer.height)},h.prototype._applyGridGutter=function(t,e){if(!e)return t+this.gutter;e+=this.gutter;var i=t%e,n=i&&1>i?"round":"ceil";return t=Math[n](t/e)*e},h.prototype._getContainerSize=function(){return this.options.isHorizontal?{width:this.maxX-this.gutter}:{height:this.maxY-this.gutter}},h.prototype._manageStamp=function(t){var e,i=this.getItem(t);if(i&&i.isPlacing)e=i.placeRect;else{var o=this._getElementOffset(t);e=new n({x:this.options.isOriginLeft?o.left:o.right,y:this.options.isOriginTop?o.top:o.bottom})}this._setRectSize(t,e),this.packer.placed(e),this._setMaxXY(e)},h.prototype.sortItemsByPosition=function(){var t=this.options.isHorizontal?a:s;this.items.sort(t)},h.prototype.fit=function(t,e,i){var n=this.getItem(t);n&&(this._getMeasurements(),this.stamp(n.element),n.getSize(),n.isPlacing=!0,e=void 0===e?n.rect.x:e,i=void 0===i?n.rect.y:i,n.positionPlaceRect(e,i,!0),this._bindFitEvents(n),n.moveTo(n.placeRect.x,n.placeRect.y),this.layout(),this.unstamp(n.element),this.sortItemsByPosition(),n.isPlacing=!1,n.copyPlaceRectPosition())},h.prototype._bindFitEvents=function(t){function e(){n++,2==n&&i.dispatchEvent("fitComplete",null,[t])}var i=this,n=0;t.on("layout",function(){return e(),!0}),this.on("layoutComplete",function(){return e(),!0})},h.prototype.resize=function(){var t=e(this.element),i=this.size&&t,n=this.options.isHorizontal?"innerHeight":"innerWidth";i&&t[n]==this.size[n]||this.layout()},h.prototype.itemDragStart=function(t){this.stamp(t);var e=this.getItem(t);e&&e.dragStart()},h.prototype.itemDragMove=function(t,e,i){function n(){r.layout(),delete r.dragTimeout}var o=this.getItem(t);o&&o.dragMove(e,i);var r=this;this.clearDragTimeout(),this.dragTimeout=setTimeout(n,40)},h.prototype.clearDragTimeout=function(){this.dragTimeout&&clearTimeout(this.dragTimeout)},h.prototype.itemDragEnd=function(e){var i,n=this.getItem(e);if(n&&(i=n.didDrag,n.dragStop()),!n||!i&&!n.needsPositioning)return void this.unstamp(e);t.add(n.element,"is-positioning-post-drag");var o=this._getDragEndLayoutComplete(e,n);n.needsPositioning?(n.on("layout",o),n.moveTo(n.placeRect.x,n.placeRect.y)):n&&n.copyPlaceRectPosition(),this.clearDragTimeout(),this.on("layoutComplete",o),this.layout()},h.prototype._getDragEndLayoutComplete=function(e,i){var n=i&&i.needsPositioning,o=0,r=n?2:1,s=this;return function(){return o++,o!=r?!0:(i&&(t.remove(i.element,"is-positioning-post-drag"),i.isPlacing=!1,i.copyPlaceRectPosition()),s.unstamp(e),s.sortItemsByPosition(),n&&s.dispatchEvent("dragItemPositioned",null,[i]),!0)}},h.prototype.bindDraggabillyEvents=function(t){t.on("dragStart",this.handleDraggabilly.dragStart),t.on("dragMove",this.handleDraggabilly.dragMove),t.on("dragEnd",this.handleDraggabilly.dragEnd)},h.prototype.bindUIDraggableEvents=function(t){t.on("dragstart",this.handleUIDraggable.start).on("drag",this.handleUIDraggable.drag).on("dragstop",this.handleUIDraggable.stop)},h.Rect=n,h.Packer=o,h});
widgets/so-social-media-buttons-widget/js/social-media-buttons-admin.js CHANGED
@@ -5,7 +5,7 @@
5
  var $socialMediaForm = $(this);
6
 
7
  var setNetworkDefaults = function($selectNetworkInput) {
8
- window.sowFetchWidgetVariable('networks', 'SiteOrigin_Widget_SocialMediaButtons_Widget',
9
  function(networks) {
10
  var selectedNetwork = networks[$selectNetworkInput.find(':selected').val()];
11
  var $closestForm = $selectNetworkInput.closest('.siteorigin-widget-field-repeater-item-form');
5
  var $socialMediaForm = $(this);
6
 
7
  var setNetworkDefaults = function($selectNetworkInput) {
8
+ window.sowForms.fetchWidgetVariable('networks', 'SiteOrigin_Widget_SocialMediaButtons_Widget',
9
  function(networks) {
10
  var selectedNetwork = networks[$selectNetworkInput.find(':selected').val()];
11
  var $closestForm = $selectNetworkInput.closest('.siteorigin-widget-field-repeater-item-form');
widgets/so-social-media-buttons-widget/js/social-media-buttons-admin.min.js CHANGED
@@ -1 +1 @@
1
- !function(i){i(document).on("sowsetupform",'.siteorigin-widget-form[data-class="SiteOrigin_Widget_SocialMediaButtons_Widget"]',function(){var o=i(this),t=function(i){window.sowFetchWidgetVariable("networks","SiteOrigin_Widget_SocialMediaButtons_Widget",function(o){var t=o[i.find(":selected").val()],e=i.closest(".siteorigin-widget-field-repeater-item-form"),n=e.find('[id*="networks-url"]');n.val(t.base_url);var r=e.find('[id*="networks-icon_color"]');r.wpColorPicker("color",t.icon_color);var d=e.find('[id*="networks-button_color"]');d.wpColorPicker("color",t.button_color)})};"undefined"==typeof o.data("initialised")&&(o.on("change",'[id*="networks-name"]',function(o){t(i(o.target))}),o.data("initialised",!0))})}(jQuery);
1
+ !function(i){i(document).on("sowsetupform",'.siteorigin-widget-form[data-class="SiteOrigin_Widget_SocialMediaButtons_Widget"]',function(){var o=i(this),t=function(i){window.sowForms.fetchWidgetVariable("networks","SiteOrigin_Widget_SocialMediaButtons_Widget",function(o){var t=o[i.find(":selected").val()],e=i.closest(".siteorigin-widget-field-repeater-item-form"),n=e.find('[id*="networks-url"]');n.val(t.base_url);var r=e.find('[id*="networks-icon_color"]');r.wpColorPicker("color",t.icon_color);var d=e.find('[id*="networks-button_color"]');d.wpColorPicker("color",t.button_color)})};"undefined"==typeof o.data("initialised")&&(o.on("change",'[id*="networks-name"]',function(o){t(i(o.target))}),o.data("initialised",!0))})}(jQuery);
widgets/so-social-media-buttons-widget/tpl/social-media-buttons.php CHANGED
@@ -13,9 +13,9 @@
13
 
14
  <a <?php foreach($button_attributes as $name => $val) echo $name . '="' . $val . '" ' ?>>
15
  <span>
16
- <!-- premium-<?php echo $network['name'] ?> -->
17
  <?php echo siteorigin_widget_get_icon( $network['icon_name'] ); ?>
18
- <!-- endpremium -->
19
  </span>
20
  </a>
21
  <?php endforeach; ?>
13
 
14
  <a <?php foreach($button_attributes as $name => $val) echo $name . '="' . $val . '" ' ?>>
15
  <span>
16
+ <?php if( !empty( $network['is_custom'] ) ) echo '<!-- premium-' . $network['name'] . ' -->'; ?>
17
  <?php echo siteorigin_widget_get_icon( $network['icon_name'] ); ?>
18
+ <?php if( !empty( $network['is_custom'] ) ) echo '<!-- endpremium -->'; ?>
19
  </span>
20
  </a>
21
  <?php endforeach; ?>