SiteOrigin Widgets Bundle - Version 1.6.1

Version Description

  • 24 June 2016 =
  • Social Links: Fixed auto-filling of network colors.
  • Social Links: Added 500px network.
  • Social Links: Added title tag to link tags.
  • Maps: Prevent JS error in when maps widget script is enqueued but widget isn't displayed.
  • Maps: Made API field more prominent as it's now required by the Google Maps API.
  • Added more general error checking.
Download this release

Release Info

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

Code changes from version 1.6 to 1.6.1

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),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")});
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 c="function"==typeof require&&require;if(!i&&c)return c(o,!0);if(a)return a(o,!0);var d=new Error("Cannot find module '"+o+"'");throw d.code="MODULE_NOT_FOUND",d}var s=n[o]={exports:{}};e[o][0].call(s.exports,function(r){var n=e[o][1][r];return f(n?n:r)},s,s.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;a<n+y;a+=e.cell_size)for(var o=-w;o<t+w;o+=e.cell_size){var i=a+e.cell_size/2+r(rand(),[0,1],[-v,v]),c=o+e.cell_size/2+r(rand(),[0,1],[-v,v]);f.push([i,c].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 s(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=s(d,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 u;if(e.color_function)u=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);u=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=u(x(A.x),_(A.y)).hex();M.push([P,U])}return c(M,e)}var f=e("delaunay-fast"),a=e("seedrandom"),o=e("chroma-js"),i=e("./colorbrewer"),c=e("./pattern"),d={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=d,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,c,d,s,u,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,c,d,s,u,l,h,g,p;for(f=this,n=[],d=0,s=arguments.length;d<s;d++)r=arguments[d],null!=r&&n.push(r);if(0===n.length)u=[255,0,255,1,"rgb"],o=u[0],i=u[1],c=u[2],e=u[3],t=u[4];else if("array"===R(n[0])){if(3===n[0].length)l=n[0],o=l[0],i=l[1],c=l[2],e=1;else{if(4!==n[0].length)throw"unknown input argument";h=n[0],o=h[0],i=h[1],c=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],c=p[2],e=p[3],t="rgb"):n.length>=3&&(o=n[0],i=n[1],c=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,c,e]:"gl"===t?f._rgb=[255*o,255*i,255*c,e]:"hsl"===t?(f._rgb=w(o,i,c),f._rgb[3]=e):"hsv"===t?(f._rgb=v(o,i,c),f._rgb[3]=e):"hex"===t?f._rgb=m(o):"lab"===t?(f._rgb=_(o,i,c),f._rgb[3]=e):"lch"===t?(f._rgb=M(o,i,c),f._rgb[3]=e):"hsi"===t&&(f._rgb=y(o,i,c),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,c;return c=e.interpolate(.5,t,n),i=c.luminance(),Math.abs(r-i)<f||!a--?c:i>r?o(e,c):o(c,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,c,d,s,u,l,b,h,g,p,m;if(u=this,null==t&&(t="rgb"),"string"===R(n)&&(n=new e(n)),"hsl"===t||"hsv"===t||"lch"===t||"hsi"===t)"hsl"===t?(p=u.hsl(),m=n.hsl()):"hsv"===t?(p=u.hsv(),m=n.hsv()):"hsi"===t?(p=u.hsi(),m=n.hsi()):"lch"===t&&(p=u.lch(),m=n.lch()),"h"===t.substr(0,1)?(o=p[0],h=p[1],d=p[2],i=m[0],g=m[1],s=m[2]):(d=p[0],h=p[1],o=p[2],s=m[0],g=m[1],i=m[2]),isNaN(o)||isNaN(i)?isNaN(o)?isNaN(i)?a=Number.NaN:(a=i,1!==d&&0!==d||"hsv"===t||(b=g)):(a=o,1!==s&&0!==s||"hsv"===t||(b=h)):(f=i>o&&i-o>180?i-(o+360):i<o&&o-i>180?i+360-o:i-o,a=o+r*f),null==b&&(b=h+r*(g-h)),c=d+r*(s-d),l="h"===t.substr(0,1)?new e(a,b,c,t):new e(c,b,a,t);else if("rgb"===t)p=u._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=u.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(u.alpha()+r*(n.alpha()-u.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)r<3?(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,c;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;a<=2;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;o<=3;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;i<=2;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=c=0;c<=2;n=++c)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,c;return c=S(arguments),e=c[0],r=c[1],n=c[2],e/=360,e<1/3?(t=(1-r)/3,i=(1+r*g(o*e)/g(a-o*e))/3,f=1-(t+i)):e<2/3?(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,c,d,s,u,l,b;if(l=S(arguments),t=l[0],i=l[1],a=l[2],0===i)o=n=e=255*a;else{for(s=[0,0,0],r=[0,0,0],d=a<.5?a*(1+i):a+i-a*i,c=2*a-d,t/=360,s[0]=t+1/3,s[1]=t,s[2]=t-1/3,f=u=0;u<=2;f=++u)s[f]<0&&(s[f]+=1),s[f]>1&&(s[f]-=1),6*s[f]<1?r[f]=c+6*(d-c)*s[f]:2*s[f]<1?r[f]=d:3*s[f]<2?r[f]=c+(d-c)*(2/3-s[f])*6:r[f]=c;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,c,d,s,u,l,b,h,g,p,m;if(u=S(arguments),t=u[0],c=u[1],s=u[2],s*=255,0===c)i=n=e=s;else switch(360===t&&(t=0),t>360&&(t-=360),t<0&&(t+=360),t/=60,f=Math.floor(t),r=t-f,a=s*(1-c),o=s*(1-c*r),d=s*(1-c*(1-r)),f){case 0:l=[s,d,a],i=l[0],n=l[1],e=l[2];break;case 1:b=[o,s,a],i=b[0],n=b[1],e=b[2];break;case 2:h=[a,s,d],i=h[0],n=h[1],e=h[2];break;case 3:g=[a,o,s],i=g[0],n=g[1],e=g[2];break;case 4:p=[d,a,s],i=p[0],n=p[1],e=p[2];break;case 5:m=[s,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,c=1,d=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,s,u,l;return void 0!==e&&3===e.length&&(u=e,e=u[0],r=u[1],n=u[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,s=o-n/200,a=k(a)*i,o=k(o)*c,s=k(s)*d,f=C(3.2404542*a-1.5371385*o-.4985314*s),t=C(-.969266*a+1.8760108*o+.041556*s),n=C(.0556434*a-.2040259*o+1.0572252*s),[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*(e<=.00304?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,c,d;return c=j(e,r,n),t=c[0],f=c[1],a=c[2],d=_(t,f,a),i=d[0],o=d[1],a=d[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,e<=.03928?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,c;return c=S(arguments),o=c[0],n=c[1],r=c[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,c;return void 0!==e&&e.length>=3&&(c=e,e=c[0],r=c[1],n=c[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=f<.5?(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,t<0&&(t+=360),[t,i,f]},G=function(){var e,r,n,t,f,a,o,i,c,d;return d=S(arguments),o=d[0],n=d[1],e=d[2],a=Math.min(o,n,e),f=Math.max(o,n,e),r=f-a,c=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,t<0&&(t+=360)),[t,i,c]},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)/c),a=O((.0193339*n+.119192*r+.9503041*e)/d),[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,c,d,s,u,b,h,g,p,m,y,w,v,x,_,k;return y="rgb",w=l("#ccc"),k=0,g=!1,h=[0,1],u=[],x=!1,_=[],m=0,p=1,b=!1,v=0,s={},i=function(e,r){var n,t,f,a,i,c,d;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,c=e.length-1;0<=c?f<=c:f>=c;n=0<=c?++f:--f)t=e[n],"string"===R(t)&&(e[n]=l(t));if(null!=r)_=r;else for(_=[],n=a=0,d=e.length-1;0<=d?a<=d:a>=d;n=0<=d?++a:--a)_.push(n/(e.length-1))}return o(),u=e},c=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;r<n&&e>=h[r];)r++;return r-1}return 0},d=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,c,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=d(b)),i=Math.floor(1e4*b),s[i])t=s[i];else{if("array"===R(u))for(o=g=0,x=_.length-1;0<=x?g<=x:g>=x;o=0<=x?++g:--g){if(c=_[o],b<=c){t=u[o];break}if(b>=c&&o===_.length-1){t=u[o];break}if(b>c&&b<_[o+1]){b=(b-c)/(_[o+1]-c),t=l.interpolate(u[o],u[o+1],b,y);break}}else"function"===R(u)&&(t=u(b));s[i]=t}return t},o=function(){return s={}},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)),c(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(),d=b?function(e){var r,n,t,f,o,i,c,d,s;for(r=a(0,!0).lab()[0],n=a(1,!0).lab()[0],c=r>n,t=a(e,!0).lab()[0],o=r+(n-r)*e,f=t-o,d=0,s=1,i=20;Math.abs(f)>.01&&i-- >0;)!function(){return c&&(f*=-1),f<0?(d=e,e+=.5*(s-e)):(s=e,e+=.5*(d-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,c;if(null==r&&(r="hex"),e=[],f=[],h.length>2)for(n=a=1,c=h.length;1<=c?a<c:a>c;n=1<=c?++a:--a)f.push(.5*(h[n-1]+h[n]));else f=h;for(o=0,i=f.length;o<i;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,c,d;if(a={min:Number.MAX_VALUE,max:Number.MAX_VALUE*-1,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){if(n(e,f))return t(null!=r&&"function"===R(r)?r(e):null!=r&&"string"===R(r)||"number"===R(r)?e[r]:e)},"array"===R(e))for(c=0,d=e.length;c<d;c++)o=e[c],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,c,d,s,u,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),d=P=1,T=n-1;1<=T?P<=T:P>=T;d=1<=T?++P:--P)b.push(p+d/n*(h-p));b.push(h)}else if("l"===r.substr(0,1)){if(p<=0)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),d=z=1,$=n-1;1<=$?z<=$:z>=$;d=1<=$?++z:--z)b.push(Math.pow(10,m+d/n*(g-m)));b.push(h)}else if("q"===r.substr(0,1)){for(b.push(p),d=G=1,Z=n-1;1<=Z?G<=Z:G>=Z;d=1<=Z?++G:--G)_=A.length*d/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),d=E=1,H=n-1;1<=H?E<=H:E>=H;d=1<=H?++E:--E)a.push(p+d/n*(h-p));for(a.push(h);M;){for(s=B=0,J=n-1;0<=J?B<=J:B>=J;s=0<=J?++B:--B)i[s]=0;for(d=I=0,K=w-1;0<=K?I<=K:I>=K;d=0<=K?++I:--I){for(U=A[d],y=Number.MAX_VALUE,s=q=0,Q=n-1;0<=Q?q<=Q:q>=Q;s=0<=Q?++q:--q)c=Math.abs(a[s]-U),c<y&&(y=c,f=s);i[f]++,t[d]=f}for(x=new Array(n),s=S=0,ee=n-1;0<=ee?S<=ee:S>=ee;s=0<=ee?++S:--S)x[s]=null;for(d=O=0,re=w-1;0<=re?O<=re:O>=re;d=0<=re?++O:--O)o=t[d],null===x[o]?x[o]=A[d]:x[o]+=A[d];for(s=C=0,Y=n-1;0<=Y?C<=Y:C>=Y;s=0<=Y?++C:--C)x[s]*=1/i[s];for(M=!1,s=ne=0,L=n-1;0<=L?ne<=L:ne>=L;s=0<=L?++ne:--ne)if(x[s]!==a[d]){M=!0;break}a=x,v++,v>200&&(M=!1)}for(u={},s=te=0,F=n-1;0<=F?te<=F:te>=F;s=0<=F?++te:--te)u[s]=[];for(d=fe=0,V=w-1;0<=V?fe<=V:fe>=V;d=0<=V?++fe:--fe)o=t[d],u[o].push(A[d]);for(D=[],s=ae=0,X=n-1;0<=X?ae<=X:ae>=X;s=0<=X?++ae:--ae)D.push(u[s][0]),D.push(u[s][u[s].length-1]);for(D=D.sort(function(e,r){return e-r}),b.push(D[0]),d=oe=1,W=D.length-1;oe<=W;d=oe+=2)isNaN(D[d])||b.push(D[d])}return b},l.brewer=u={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;n<t;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),e<r&&(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,s=function(e){var r,n,t,f,a,o,i,c,d,u,b;return e=function(){var r,n,t;for(t=[],r=0,n=e.length;r<n;r++)f=e[r],t.push(l(f));return t}(),2===e.length?(d=function(){var r,n,t;for(t=[],r=0,n=e.length;r<n;r++)f=e[r],
2
+ t.push(f.lab());return t}(),a=d[0],o=d[1],r=function(e){var r,n;return n=function(){var n,t;for(t=[],r=n=0;n<=2;r=++n)t.push(a[r]+e*(o[r]-a[r]));return t}(),l.lab.apply(l,n)}):3===e.length?(u=function(){var r,n,t;for(t=[],r=0,n=e.length;r<n;r++)f=e[r],t.push(f.lab());return t}(),a=u[0],o=u[1],i=u[2],r=function(e){var r,n;return n=function(){var n,t;for(t=[],r=n=0;n<=2;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;r<n;r++)f=e[r],t.push(f.lab());return t}(),a=b[0],o=b[1],i=b[2],c=b[3],r=function(e){var r,n;return n=function(){var n,t;for(t=[],r=n=0;n<=2;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*c[r]);return t}(),l.lab.apply(l,n)}):5===e.length&&(n=s(e.slice(0,3)),t=s(e.slice(2,5)),r=function(e){return e<.5?n(2*e):t(2*(e-.5))}),r},l.interpolate.bezier=s}).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,c=Number.POSITIVE_INFINITY,d=Number.NEGATIVE_INFINITY,s=Number.NEGATIVE_INFINITY;for(r=e.length;r--;)e[r][0]<i&&(i=e[r][0]),e[r][0]>d&&(d=e[r][0]),e[r][1]<c&&(c=e[r][1]),e[r][1]>s&&(s=e[r][1]);return n=d-i,t=s-c,f=Math.max(n,t),a=i+.5*n,o=c+.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,c,d,s,u,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(x<a&&_<a)throw new Error("Eek! Coincident points!");return x<a?(c=-((w-m)/(v-y)),s=(m+w)/2,l=(y+v)/2,f=(m+g)/2,o=c*(f-s)+l):_<a?(i=-((m-g)/(y-p)),d=(g+m)/2,u=(p+y)/2,f=(w+m)/2,o=i*(f-d)+u):(i=-((m-g)/(y-p)),c=-((w-m)/(v-y)),d=(g+m)/2,s=(m+w)/2,u=(p+y)/2,l=(y+v)/2,f=(i*d-c*s+l-u)/(i-c),o=x>_?i*(f-d)+u:c*(f-s)+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,c,d,s,u,l,b,h,g,p,m,y=r.length;if(y<3)return[];if(r=r.slice(0),t)for(o=y;o--;)r[o]=r[o][t];for(c=new Array(y),o=y;o--;)c[o]=o;for(c.sort(function(e,n){return r[n][0]-r[e][0]}),d=e(r),r.push(d[0],d[1],d[2]),s=[n(r,y+0,y+1,y+2)],u=[],l=[],o=c.length;o--;l.length=0){for(m=c[o],i=s.length;i--;)b=r[m][0]-s[i].x,b>0&&b*b>s[i].r?(u.push(s[i]),s.splice(i,1)):(h=r[m][1]-s[i].y,b*b+h*h-s[i].r>a||(l.push(s[i].i,s[i].j,s[i].j,s[i].k,s[i].k,s[i].i),s.splice(i,1)));for(f(l),i=l.length;i;)p=l[--i],g=l[--i],s.push(n(r,g,p,m))}for(o=s.length;o--;)u.push(s[o]);for(s.length=0,o=u.length;o--;)u[o].i<y&&u[o].j<y&&u[o].k<y&&s.push(u[o].i,u[o].j,u[o].k);return s},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,c=(n*(r[1]-e[0][1])-f*(r[0]-e[0][0]))/o;return i<0||c<0||i+c>1?null:[i,c]}},"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"),c=e("./lib/tychei"),d=e("./seedrandom");d.alea=t,d.xor128=f,d.xorwow=a,d.xorshift7=o,d.xor4096=i,d.tychei=c,r.exports=d},{"./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=[],c=128;for(r===(0|r)?(t=r,r=null):(r+="\0",t=0,c=Math.max(c,r.length)),f=0,a=-32;a<c;++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;n<8&&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=d(c(r.entropy?[e,u(t)]:null==e?s():e,3),a),b=new o(a),p=function(){for(var e=b.g(g),r=y,n=0;e<w;)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,d(u(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++]);f<h;)o[f]=f++;for(f=0;f<h;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 c(e,r){var n,t=[],f=typeof e;if(r&&"object"==f)for(n in e)try{t.push(c(e[n],r-1))}catch(a){}return t.length?t:"string"==f?e:e+"\0"}function d(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 u(r)}function s(){try{if(l)return u(l.randomBytes(h));var e=new Uint8Array(h);return(b.crypto||b.msCrypto).getRandomValues(e),u(e)}catch(r){var n=b.navigator,f=n&&n.plugins;return[+new Date,b,f,b.screen,u(t)]}}function u(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,d(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/post-selector.php CHANGED
@@ -43,7 +43,7 @@ function siteorigin_widget_post_selector_process_query($query){
43
  if($query['post_type'] == '_all') $query['post_type'] = siteorigin_widget_post_selector_all_post_types();
44
  $query['post_type'] = strpos( $query['post_type'], ',' ) !== false ? explode( ',', $query['post_type'] ) : $query['post_type'];
45
  }
46
- if( $query['post_type'] == 'attachment' && $query['post_status'] == 'publish' ) {
47
  $query['post_status'] = 'inherit';
48
  }
49
 
43
  if($query['post_type'] == '_all') $query['post_type'] = siteorigin_widget_post_selector_all_post_types();
44
  $query['post_type'] = strpos( $query['post_type'], ',' ) !== false ? explode( ',', $query['post_type'] ) : $query['post_type'];
45
  }
46
+ if( !empty( $query['post_type'] ) && $query['post_type'] == 'attachment' && $query['post_status'] == 'publish' ) {
47
  $query['post_status'] = 'inherit';
48
  }
49
 
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,g,c={},u=window.sowForms.getRepeaterId(i);if(u!==!1){var p={};for(var w in a)p[w.replace("{$repeater}",u)]=a[w];a=p}for(var w in a)if(f=!1,r=w.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 m=0;m<g.length&&!(f=o.group===t&&g[m]===n);m++);}if(f){d=a[w],o.multi||(d=[d]);for(var m=0;m<d.length;m++)l="undefined"!=typeof d[m][1]&&Boolean(d[m][1])?i.find(d[m][1]):i,l[d[m][0]].apply(l,"undefined"!=typeof d[m][2]?d[m][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&&(a.find("span").show().attr("data-sow-icon",o.attr("data-sow-icon")).attr("class","").addClass("sow-icon-"+i),o.addClass("siteorigin-widget-active"))}r.prepend(r.find(".siteorigin-widget-active"))}},s=function(){var i=t.find("select.siteorigin-widget-icon-family").val(),n=t.find("select.siteorigin-widget-icon-family option:selected").data("icons");null!==n&&(l[i]=n),"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)})}),"undefined"!=typeof jQuery.fn.soPanelsSetupBuilderWidget&&d.filter(".siteorigin-widget-field-type-builder").each(function(){var i=e(this);i.find("> .siteorigin-page-builder-field").soPanelsSetupBuilderWidget()});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++)if(s===a.length-1)if("checkbox"===i.attr("type"))i.is(":checked")?r[a[s]]=""!==i.val()?i.val():!0:r[a[s]]=!1;else if("radio"===i.attr("type"))i.is(":checked")&&(r[a[s]]=""!==i.val()?i.val():!0);else if("TEXTAREA"===i.prop("tagName")&&i.hasClass("wp-editor-area")){var o=null;"undefined"!=typeof tinyMCE&&(o=tinyMCE.get(i.attr("id"))),null===o||"function"!=typeof o.getContent||o.isHidden()?r[a[s]]=i.val():r[a[s]]=o.getContent()}else r[a[s]]=i.val();else"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-expand").click(function(i){i.preventDefault(),n.closest(".siteorigin-widget-field-repeater").find("> .siteorigin-widget-field-repeateritems-").slideToggle("fast",function(){e(window).resize()})})})},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(window).resize(),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 w=p+"-"+d[p]++;i.attr("id",w),r.find("label[for="+s+"]").attr("for",w),r.find("[id*="+s+"]").each(function(){var i=e(this).attr("id"),t=i.replace(s,w);e(this).attr("id",t)}),"undefined"!=typeof tinymce&&tinymce.get(w)&&tinymce.get(w).remove()}var m=a.parents(".siteorigin-widget-field-repeater").length,v=e("body");(v.hasClass("wp-customizer")||v.hasClass("widgets-php"))&&0==n.closest(".panel-dialog").length&&(m+=1);var h=l.replace(new RegExp("((?:.*?\\[\\d+\\]){"+(m-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&&o.attr("name").indexOf("__i__")!==-1)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 w in a)p[w.replace("{$repeater}",u)]=a[w];a=p}for(var w in a)if(f=!1,r=w.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 m=0;m<g.length&&!(f=o.group===t&&g[m]===n);m++);}if(f){d=a[w],o.multi||(d=[d]);for(var m=0;m<d.length;m++)l="undefined"!=typeof d[m][1]&&Boolean(d[m][1])?i.find(d[m][1]):i,l[d[m][0]].apply(l,"undefined"!=typeof d[m][2]?d[m][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&&(a.find("span").show().attr("data-sow-icon",o.attr("data-sow-icon")).attr("class","").addClass("sow-icon-"+i),o.addClass("siteorigin-widget-active"))}r.prepend(r.find(".siteorigin-widget-active"))}},s=function(){var i=t.find("select.siteorigin-widget-icon-family").val(),n=t.find("select.siteorigin-widget-icon-family option:selected").data("icons");null!==n&&(l[i]=n),"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)})}),"undefined"!=typeof jQuery.fn.soPanelsSetupBuilderWidget&&d.filter(".siteorigin-widget-field-type-builder").each(function(){var i=e(this);i.find("> .siteorigin-page-builder-field").soPanelsSetupBuilderWidget()});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++)if(s===a.length-1)if("checkbox"===i.attr("type"))i.is(":checked")?r[a[s]]=""===i.val()||i.val():r[a[s]]=!1;else if("radio"===i.attr("type"))i.is(":checked")&&(r[a[s]]=""===i.val()||i.val());else if("TEXTAREA"===i.prop("tagName")&&i.hasClass("wp-editor-area")){var o=null;"undefined"!=typeof tinyMCE&&(o=tinyMCE.get(i.attr("id"))),null===o||"function"!=typeof o.getContent||o.isHidden()?r[a[s]]=i.val():r[a[s]]=o.getContent()}else r[a[s]]=i.val();else"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-expand").click(function(i){i.preventDefault(),n.closest(".siteorigin-widget-field-repeater").find("> .siteorigin-widget-field-repeateritems-").slideToggle("fast",function(){e(window).resize()})})})},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(window).resize(),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 w=p+"-"+d[p]++;i.attr("id",w),r.find("label[for="+s+"]").attr("for",w),r.find("[id*="+s+"]").each(function(){var i=e(this).attr("id"),t=i.replace(s,w);e(this).attr("id",t)}),"undefined"!=typeof tinymce&&tinymce.get(w)&&tinymce.get(w).remove()}var m=a.parents(".siteorigin-widget-field-repeater").length,v=e("body");(v.hasClass("wp-customizer")||v.hasClass("widgets-php"))&&0==n.closest(".panel-dialog").length&&(m+=1);var h=l.replace(new RegExp("((?:.*?\\[\\d+\\]){"+(m-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 t.split(",").map(function(e){return e.trim()}).indexOf(e)!==-1})}};
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")?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);
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():r[n[c]]=!1:"radio"===e.attr("type")?e.is(":checked")&&(r[n[c]]=""===e.val()||e.val()):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.js CHANGED
@@ -631,10 +631,7 @@ var soWidgetPostSelector = ( function ($, _) {
631
  query : 'post_type=_all&posts_per_page=-1&post__in=' + getPosts.join(',')
632
  },
633
  function(data){
634
-
635
- console.log(data);
636
  if(typeof data.posts !== 'undefined') {
637
-
638
  _.each(data.posts, function(post, i){
639
  v.postCache[post.id] = {
640
  id : post.id,
@@ -643,7 +640,6 @@ var soWidgetPostSelector = ( function ($, _) {
643
  editUrl: post.editUrl
644
  };
645
  });
646
-
647
  }
648
 
649
  v.refreshLoading();
631
  query : 'post_type=_all&posts_per_page=-1&post__in=' + getPosts.join(',')
632
  },
633
  function(data){
 
 
634
  if(typeof data.posts !== 'undefined') {
 
635
  _.each(data.posts, function(post, i){
636
  v.postCache[post.id] = {
637
  id : post.id,
640
  editUrl: post.editUrl
641
  };
642
  });
 
643
  }
644
 
645
  v.refreshLoading();
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,date_range: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("date_query")||t.isEmpty(this.get("date_query"))||e.push("date_query="+JSON.stringify(this.get("date_query"))),"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("date_query")&&(d.date_query=JSON.parse(n.date_query)),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;if(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('<div class="query-builder-form-field">'+sowPostsSelectorTpl.fields.date_query+"</div>"),"undefined"!=typeof this.model.get("date_query")){var s=this.model.get("date_query");s.hasOwnProperty("after")&&this.form.find('input[name="after"]').val(s.after),s.hasOwnProperty("before")&&this.form.find('input[name="before"]').val(s.before)}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(decodeURIComponent(this.model.get("additional")));var i=this.form.find('input[name="order"]'),o=i.closest(".query-builder-form-field").find(".sow-order-button"),n=function(){"DESC"===i.val()?(o.removeClass("sow-order-button-asc"),o.addClass("sow-order-button-desc")):(o.addClass("sow-order-button-asc"),o.removeClass("sow-order-button-desc"))};return n(),o.click(function(e){return e.preventDefault(),"DESC"===i.val()?i.val("ASC"):i.val("DESC"),n(),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("date_query",{after:this.$el.find('*[name="after"]').val(),before:this.$el.find('*[name="before"]').val()}),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",encodeURIComponent(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,date_range: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("date_query")||t.isEmpty(this.get("date_query"))||e.push("date_query="+JSON.stringify(this.get("date_query"))),"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("date_query")&&(d.date_query=JSON.parse(n.date_query)),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;if(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('<div class="query-builder-form-field">'+sowPostsSelectorTpl.fields.date_query+"</div>"),"undefined"!=typeof this.model.get("date_query")){var s=this.model.get("date_query");s.hasOwnProperty("after")&&this.form.find('input[name="after"]').val(s.after),s.hasOwnProperty("before")&&this.form.find('input[name="before"]').val(s.before)}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(decodeURIComponent(this.model.get("additional")));var i=this.form.find('input[name="order"]'),o=i.closest(".query-builder-form-field").find(".sow-order-button"),n=function(){"DESC"===i.val()?(o.removeClass("sow-order-button-asc"),o.addClass("sow-order-button-desc")):(o.addClass("sow-order-button-asc"),o.removeClass("sow-order-button-desc"))};return n(),o.click(function(e){return e.preventDefault(),"DESC"===i.val()?i.val("ASC"):i.val("DESC"),n(),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();if(e.length<1)return!1},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("date_query",{after:this.$el.find('*[name="after"]').val(),before:this.$el.find('*[name="before"]').val()}),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",encodeURIComponent(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){"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,_);
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),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);
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&&o<2&&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||e<0)&&(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;o<l;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)||s<0||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/jquery.touchSwipe.min.js CHANGED
@@ -1 +1 @@
1
- !function(n){"function"==typeof define&&define.amd&&define.amd.jQuery?define(["jquery.touchSwipe.js"],n):n(jQuery)}(function(n){"use strict";function e(e){return!e||void 0!==e.allowPageScroll||void 0===e.swipe&&void 0===e.swipeStatus||(e.allowPageScroll=c),void 0!==e.click&&void 0===e.tap&&(e.tap=e.click),e||(e={}),e=n.extend({},n.fn.swipe.defaults,e),this.each(function(){var r=n(this),i=r.data(P);i||(i=new t(this,e),r.data(P,i))})}function t(e,t){function D(e){if(!(sn()||n(e.target).closest(t.excludedElements,Fn).length>0)){var r,i=e.originalEvent?e.originalEvent:e,o=O?i.touches[0]:i;return Vn=S,O?zn=i.touches.length:e.preventDefault(),jn=0,Hn=null,qn=null,_n=0,Qn=0,Cn=0,Xn=1,Yn=0,Gn=gn(),Wn=Tn(),an(),!O||zn===t.fingers||t.fingers===T||q()?(hn(0,o),Zn=Pn(),2==zn&&(hn(1,i.touches[1]),Qn=Cn=En(Gn[0].start,Gn[1].start)),(t.swipeStatus||t.pinchStatus)&&(r=U(i,Vn))):r=!1,r===!1?(Vn=y,U(i,Vn),r):(t.hold&&(ee=setTimeout(n.proxy(function(){Fn.trigger("hold",[i.target]),t.hold&&(r=t.hold.call(Fn,i,i.target))},this),t.longTapThreshold)),pn(!0),null)}}function L(n){var e=n.originalEvent?n.originalEvent:n;if(Vn!==m&&Vn!==y&&!cn()){var r,i=O?e.touches[0]:e,o=fn(i);if(Bn=Pn(),O&&(zn=e.touches.length),t.hold&&clearTimeout(ee),Vn=E,2==zn&&(0==Qn?(hn(1,e.touches[1]),Qn=Cn=En(Gn[0].start,Gn[1].start)):(fn(e.touches[1]),Cn=En(Gn[0].end,Gn[1].end),qn=yn(Gn[0].end,Gn[1].end)),Xn=mn(Qn,Cn),Yn=Math.abs(Qn-Cn)),zn===t.fingers||t.fingers===T||!O||q()){if(Hn=Mn(o.start,o.end),X(n,Hn),jn=On(o.start,o.end),_n=Sn(),wn(Hn,jn),(t.swipeStatus||t.pinchStatus)&&(r=U(e,Vn)),!t.triggerOnTouchEnd||t.triggerOnTouchLeave){var u=!0;if(t.triggerOnTouchLeave){var l=Dn(this);u=Ln(o.end,l)}!t.triggerOnTouchEnd&&u?Vn=N(E):t.triggerOnTouchLeave&&!u&&(Vn=N(m)),(Vn==y||Vn==m)&&U(e,Vn)}}else Vn=y,U(e,Vn);r===!1&&(Vn=y,U(e,Vn))}}function R(n){var e=n.originalEvent;return O&&e.touches.length>0?(ln(),!0):(cn()&&(zn=Kn),Bn=Pn(),_n=Sn(),_()||!H()?(Vn=y,U(e,Vn)):t.triggerOnTouchEnd||0==t.triggerOnTouchEnd&&Vn===E?(n.preventDefault(),Vn=m,U(e,Vn)):!t.triggerOnTouchEnd&&B()?(Vn=m,j(e,Vn,f)):Vn===E&&(Vn=y,U(e,Vn)),pn(!1),null)}function k(){zn=0,Bn=0,Zn=0,Qn=0,Cn=0,Xn=1,an(),pn(!1)}function A(n){var e=n.originalEvent;t.triggerOnTouchLeave&&(Vn=N(m),U(e,Vn))}function I(){Fn.unbind(kn,D),Fn.unbind(Un,k),Fn.unbind(An,L),Fn.unbind(In,R),Nn&&Fn.unbind(Nn,A),pn(!1)}function N(n){var e=n,r=C(),i=H(),o=_();return!r||o?e=y:!i||n!=E||t.triggerOnTouchEnd&&!t.triggerOnTouchLeave?!i&&n==m&&t.triggerOnTouchLeave&&(e=y):e=m,e}function U(n,e){var t=void 0;return z()||V()||W()||q()?((z()||V())&&(t=j(n,e,p)),(W()||q())&&t!==!1&&(t=j(n,e,h))):on()&&t!==!1?t=j(n,e,d):un()&&t!==!1?t=j(n,e,g):rn()&&t!==!1&&(t=j(n,e,f)),e===y&&k(n),e===m&&(O?0==n.touches.length&&k(n):k(n)),t}function j(e,c,s){var w=void 0;if(s==p){if(Fn.trigger("swipeStatus",[c,Hn||null,jn||0,_n||0,zn,Gn]),t.swipeStatus&&(w=t.swipeStatus.call(Fn,e,c,Hn||null,jn||0,_n||0,zn,Gn),w===!1))return!1;if(c==m&&F()){if(Fn.trigger("swipe",[Hn,jn,_n,zn,Gn]),t.swipe&&(w=t.swipe.call(Fn,e,Hn,jn,_n,zn,Gn),w===!1))return!1;switch(Hn){case r:Fn.trigger("swipeLeft",[Hn,jn,_n,zn,Gn]),t.swipeLeft&&(w=t.swipeLeft.call(Fn,e,Hn,jn,_n,zn,Gn));break;case i:Fn.trigger("swipeRight",[Hn,jn,_n,zn,Gn]),t.swipeRight&&(w=t.swipeRight.call(Fn,e,Hn,jn,_n,zn,Gn));break;case o:Fn.trigger("swipeUp",[Hn,jn,_n,zn,Gn]),t.swipeUp&&(w=t.swipeUp.call(Fn,e,Hn,jn,_n,zn,Gn));break;case u:Fn.trigger("swipeDown",[Hn,jn,_n,zn,Gn]),t.swipeDown&&(w=t.swipeDown.call(Fn,e,Hn,jn,_n,zn,Gn))}}}if(s==h){if(Fn.trigger("pinchStatus",[c,qn||null,Yn||0,_n||0,zn,Xn,Gn]),t.pinchStatus&&(w=t.pinchStatus.call(Fn,e,c,qn||null,Yn||0,_n||0,zn,Xn,Gn),w===!1))return!1;if(c==m&&Y())switch(qn){case l:Fn.trigger("pinchIn",[qn||null,Yn||0,_n||0,zn,Xn,Gn]),t.pinchIn&&(w=t.pinchIn.call(Fn,e,qn||null,Yn||0,_n||0,zn,Xn,Gn));break;case a:Fn.trigger("pinchOut",[qn||null,Yn||0,_n||0,zn,Xn,Gn]),t.pinchOut&&(w=t.pinchOut.call(Fn,e,qn||null,Yn||0,_n||0,zn,Xn,Gn))}}return s==f?(c===y||c===m)&&(clearTimeout(ne),clearTimeout(ee),J()&&!nn()?($n=Pn(),ne=setTimeout(n.proxy(function(){$n=null,Fn.trigger("tap",[e.target]),t.tap&&(w=t.tap.call(Fn,e,e.target))},this),t.doubleTapThreshold)):($n=null,Fn.trigger("tap",[e.target]),t.tap&&(w=t.tap.call(Fn,e,e.target)))):s==d?(c===y||c===m)&&(clearTimeout(ne),$n=null,Fn.trigger("doubletap",[e.target]),t.doubleTap&&(w=t.doubleTap.call(Fn,e,e.target))):s==g&&(c===y||c===m)&&(clearTimeout(ne),$n=null,Fn.trigger("longtap",[e.target]),t.longTap&&(w=t.longTap.call(Fn,e,e.target))),w}function H(){var n=!0;return null!==t.threshold&&(n=jn>=t.threshold),n}function _(){var n=!1;return null!==t.cancelThreshold&&null!==Hn&&(n=vn(Hn)-jn>=t.cancelThreshold),n}function Q(){return null!==t.pinchThreshold?Yn>=t.pinchThreshold:!0}function C(){var n;return n=t.maxTimeThreshold&&_n>=t.maxTimeThreshold?!1:!0}function X(n,e){if(t.preventDefaultEvents!==!1)if(t.allowPageScroll===c)n.preventDefault();else{var l=t.allowPageScroll===s;switch(e){case r:(t.swipeLeft&&l||!l&&t.allowPageScroll!=w)&&n.preventDefault();break;case i:(t.swipeRight&&l||!l&&t.allowPageScroll!=w)&&n.preventDefault();break;case o:(t.swipeUp&&l||!l&&t.allowPageScroll!=v)&&n.preventDefault();break;case u:(t.swipeDown&&l||!l&&t.allowPageScroll!=v)&&n.preventDefault()}}}function Y(){var n=G(),e=Z(),t=Q();return n&&e&&t}function q(){return!!(t.pinchStatus||t.pinchIn||t.pinchOut)}function W(){return!(!Y()||!q())}function F(){var n=C(),e=H(),t=G(),r=Z(),i=_(),o=!i&&r&&t&&e&&n;return o}function V(){return!!(t.swipe||t.swipeStatus||t.swipeLeft||t.swipeRight||t.swipeUp||t.swipeDown)}function z(){return!(!F()||!V())}function G(){return zn===t.fingers||t.fingers===T||!O}function Z(){return 0!==Gn[0].end.x}function B(){return!!t.tap}function J(){return!!t.doubleTap}function K(){return!!t.longTap}function $(){if(null==$n)return!1;var n=Pn();return J()&&n-$n<=t.doubleTapThreshold}function nn(){return $()}function en(){return(1===zn||!O)&&(isNaN(jn)||jn<t.threshold)}function tn(){return _n>t.longTapThreshold&&b>jn}function rn(){return!(!en()||!B())}function on(){return!(!$()||!J())}function un(){return!(!tn()||!K())}function ln(){Jn=Pn(),Kn=event.touches.length+1}function an(){Jn=0,Kn=0}function cn(){var n=!1;if(Jn){var e=Pn()-Jn;e<=t.fingerReleaseThreshold&&(n=!0)}return n}function sn(){return!(Fn.data(P+"_intouch")!==!0)}function pn(n){n===!0?(Fn.bind(An,L),Fn.bind(In,R),Nn&&Fn.bind(Nn,A)):(Fn.unbind(An,L,!1),Fn.unbind(In,R,!1),Nn&&Fn.unbind(Nn,A,!1)),Fn.data(P+"_intouch",n===!0)}function hn(n,e){var t=void 0!==e.identifier?e.identifier:0;return Gn[n].identifier=t,Gn[n].start.x=Gn[n].end.x=e.pageX||e.clientX,Gn[n].start.y=Gn[n].end.y=e.pageY||e.clientY,Gn[n]}function fn(n){var e=void 0!==n.identifier?n.identifier:0,t=dn(e);return t.end.x=n.pageX||n.clientX,t.end.y=n.pageY||n.clientY,t}function dn(n){for(var e=0;e<Gn.length;e++)if(Gn[e].identifier==n)return Gn[e]}function gn(){for(var n=[],e=0;5>=e;e++)n.push({start:{x:0,y:0},end:{x:0,y:0},identifier:0});return n}function wn(n,e){e=Math.max(e,vn(n)),Wn[n].distance=e}function vn(n){return Wn[n]?Wn[n].distance:void 0}function Tn(){var n={};return n[r]=bn(r),n[i]=bn(i),n[o]=bn(o),n[u]=bn(u),n}function bn(n){return{direction:n,distance:0}}function Sn(){return Bn-Zn}function En(n,e){var t=Math.abs(n.x-e.x),r=Math.abs(n.y-e.y);return Math.round(Math.sqrt(t*t+r*r))}function mn(n,e){var t=e/n*1;return t.toFixed(2)}function yn(){return 1>Xn?a:l}function On(n,e){return Math.round(Math.sqrt(Math.pow(e.x-n.x,2)+Math.pow(e.y-n.y,2)))}function xn(n,e){var t=n.x-e.x,r=e.y-n.y,i=Math.atan2(r,t),o=Math.round(180*i/Math.PI);return 0>o&&(o=360-Math.abs(o)),o}function Mn(n,e){var t=xn(n,e);return 45>=t&&t>=0?r:360>=t&&t>=315?r:t>=135&&225>=t?i:t>45&&135>t?u:o}function Pn(){var n=new Date;return n.getTime()}function Dn(e){e=n(e);var t=e.offset(),r={left:t.left,right:t.left+e.outerWidth(),top:t.top,bottom:t.top+e.outerHeight()};return r}function Ln(n,e){return n.x>e.left&&n.x<e.right&&n.y>e.top&&n.y<e.bottom}var Rn=O||M||!t.fallbackToMouseEvents,kn=Rn?M?x?"MSPointerDown":"pointerdown":"touchstart":"mousedown",An=Rn?M?x?"MSPointerMove":"pointermove":"touchmove":"mousemove",In=Rn?M?x?"MSPointerUp":"pointerup":"touchend":"mouseup",Nn=Rn?null:"mouseleave",Un=M?x?"MSPointerCancel":"pointercancel":"touchcancel",jn=0,Hn=null,_n=0,Qn=0,Cn=0,Xn=1,Yn=0,qn=0,Wn=null,Fn=n(e),Vn="start",zn=0,Gn=null,Zn=0,Bn=0,Jn=0,Kn=0,$n=0,ne=null,ee=null;try{Fn.bind(kn,D),Fn.bind(Un,k)}catch(te){n.error("events not supported "+kn+","+Un+" on jQuery.swipe")}this.enable=function(){return Fn.bind(kn,D),Fn.bind(Un,k),Fn},this.disable=function(){return I(),Fn},this.destroy=function(){I(),Fn.data(P,null),Fn=null},this.option=function(e,r){if(void 0!==t[e]){if(void 0===r)return t[e];t[e]=r}else n.error("Option "+e+" does not exist on jQuery.swipe.options");return null}}var r="left",i="right",o="up",u="down",l="in",a="out",c="none",s="auto",p="swipe",h="pinch",f="tap",d="doubletap",g="longtap",w="horizontal",v="vertical",T="all",b=10,S="start",E="move",m="end",y="cancel",O="ontouchstart"in window,x=window.navigator.msPointerEnabled&&!window.navigator.pointerEnabled,M=window.navigator.pointerEnabled||window.navigator.msPointerEnabled,P="TouchSwipe",D={fingers:1,threshold:75,cancelThreshold:null,pinchThreshold:20,maxTimeThreshold:null,fingerReleaseThreshold:250,longTapThreshold:500,doubleTapThreshold:200,swipe:null,swipeLeft:null,swipeRight:null,swipeUp:null,swipeDown:null,swipeStatus:null,pinchIn:null,pinchOut:null,pinchStatus:null,click:null,tap:null,doubleTap:null,longTap:null,hold:null,triggerOnTouchEnd:!0,triggerOnTouchLeave:!1,allowPageScroll:"auto",fallbackToMouseEvents:!0,excludedElements:"label, button, input, select, textarea, a, .noSwipe",preventDefaultEvents:!0};n.fn.swipe=function(t){var r=n(this),i=r.data(P);if(i&&"string"==typeof t){if(i[t])return i[t].apply(this,Array.prototype.slice.call(arguments,1));n.error("Method "+t+" does not exist on jQuery.swipe")}else if(!(i||"object"!=typeof t&&t))return e.apply(this,arguments);return r},n.fn.swipe.defaults=D,n.fn.swipe.phases={PHASE_START:S,PHASE_MOVE:E,PHASE_END:m,PHASE_CANCEL:y},n.fn.swipe.directions={LEFT:r,RIGHT:i,UP:o,DOWN:u,IN:l,OUT:a},n.fn.swipe.pageScroll={NONE:c,HORIZONTAL:w,VERTICAL:v,AUTO:s},n.fn.swipe.fingers={ONE:1,TWO:2,THREE:3,ALL:T}});
1
+ !function(n){"function"==typeof define&&define.amd&&define.amd.jQuery?define(["jquery.touchSwipe.js"],n):n(jQuery)}(function(n){"use strict";function e(e){return!e||void 0!==e.allowPageScroll||void 0===e.swipe&&void 0===e.swipeStatus||(e.allowPageScroll=c),void 0!==e.click&&void 0===e.tap&&(e.tap=e.click),e||(e={}),e=n.extend({},n.fn.swipe.defaults,e),this.each(function(){var r=n(this),i=r.data(P);i||(i=new t(this,e),r.data(P,i))})}function t(e,t){function D(e){if(!(sn()||n(e.target).closest(t.excludedElements,Fn).length>0)){var r,i=e.originalEvent?e.originalEvent:e,o=O?i.touches[0]:i;return Vn=S,O?zn=i.touches.length:e.preventDefault(),jn=0,Hn=null,qn=null,_n=0,Qn=0,Cn=0,Xn=1,Yn=0,Gn=gn(),Wn=Tn(),an(),!O||zn===t.fingers||t.fingers===T||q()?(hn(0,o),Zn=Pn(),2==zn&&(hn(1,i.touches[1]),Qn=Cn=En(Gn[0].start,Gn[1].start)),(t.swipeStatus||t.pinchStatus)&&(r=U(i,Vn))):r=!1,r===!1?(Vn=y,U(i,Vn),r):(t.hold&&(ee=setTimeout(n.proxy(function(){Fn.trigger("hold",[i.target]),t.hold&&(r=t.hold.call(Fn,i,i.target))},this),t.longTapThreshold)),pn(!0),null)}}function L(n){var e=n.originalEvent?n.originalEvent:n;if(Vn!==m&&Vn!==y&&!cn()){var r,i=O?e.touches[0]:e,o=fn(i);if(Bn=Pn(),O&&(zn=e.touches.length),t.hold&&clearTimeout(ee),Vn=E,2==zn&&(0==Qn?(hn(1,e.touches[1]),Qn=Cn=En(Gn[0].start,Gn[1].start)):(fn(e.touches[1]),Cn=En(Gn[0].end,Gn[1].end),qn=yn(Gn[0].end,Gn[1].end)),Xn=mn(Qn,Cn),Yn=Math.abs(Qn-Cn)),zn===t.fingers||t.fingers===T||!O||q()){if(Hn=Mn(o.start,o.end),X(n,Hn),jn=On(o.start,o.end),_n=Sn(),wn(Hn,jn),(t.swipeStatus||t.pinchStatus)&&(r=U(e,Vn)),!t.triggerOnTouchEnd||t.triggerOnTouchLeave){var u=!0;if(t.triggerOnTouchLeave){var l=Dn(this);u=Ln(o.end,l)}!t.triggerOnTouchEnd&&u?Vn=N(E):t.triggerOnTouchLeave&&!u&&(Vn=N(m)),Vn!=y&&Vn!=m||U(e,Vn)}}else Vn=y,U(e,Vn);r===!1&&(Vn=y,U(e,Vn))}}function R(n){var e=n.originalEvent;return O&&e.touches.length>0?(ln(),!0):(cn()&&(zn=Kn),Bn=Pn(),_n=Sn(),_()||!H()?(Vn=y,U(e,Vn)):t.triggerOnTouchEnd||0==t.triggerOnTouchEnd&&Vn===E?(n.preventDefault(),Vn=m,U(e,Vn)):!t.triggerOnTouchEnd&&B()?(Vn=m,j(e,Vn,f)):Vn===E&&(Vn=y,U(e,Vn)),pn(!1),null)}function k(){zn=0,Bn=0,Zn=0,Qn=0,Cn=0,Xn=1,an(),pn(!1)}function A(n){var e=n.originalEvent;t.triggerOnTouchLeave&&(Vn=N(m),U(e,Vn))}function I(){Fn.unbind(kn,D),Fn.unbind(Un,k),Fn.unbind(An,L),Fn.unbind(In,R),Nn&&Fn.unbind(Nn,A),pn(!1)}function N(n){var e=n,r=C(),i=H(),o=_();return!r||o?e=y:!i||n!=E||t.triggerOnTouchEnd&&!t.triggerOnTouchLeave?!i&&n==m&&t.triggerOnTouchLeave&&(e=y):e=m,e}function U(n,e){var t=void 0;return z()||V()||W()||q()?((z()||V())&&(t=j(n,e,p)),(W()||q())&&t!==!1&&(t=j(n,e,h))):on()&&t!==!1?t=j(n,e,d):un()&&t!==!1?t=j(n,e,g):rn()&&t!==!1&&(t=j(n,e,f)),e===y&&k(n),e===m&&(O?0==n.touches.length&&k(n):k(n)),t}function j(e,c,s){var w=void 0;if(s==p){if(Fn.trigger("swipeStatus",[c,Hn||null,jn||0,_n||0,zn,Gn]),t.swipeStatus&&(w=t.swipeStatus.call(Fn,e,c,Hn||null,jn||0,_n||0,zn,Gn),w===!1))return!1;if(c==m&&F()){if(Fn.trigger("swipe",[Hn,jn,_n,zn,Gn]),t.swipe&&(w=t.swipe.call(Fn,e,Hn,jn,_n,zn,Gn),w===!1))return!1;switch(Hn){case r:Fn.trigger("swipeLeft",[Hn,jn,_n,zn,Gn]),t.swipeLeft&&(w=t.swipeLeft.call(Fn,e,Hn,jn,_n,zn,Gn));break;case i:Fn.trigger("swipeRight",[Hn,jn,_n,zn,Gn]),t.swipeRight&&(w=t.swipeRight.call(Fn,e,Hn,jn,_n,zn,Gn));break;case o:Fn.trigger("swipeUp",[Hn,jn,_n,zn,Gn]),t.swipeUp&&(w=t.swipeUp.call(Fn,e,Hn,jn,_n,zn,Gn));break;case u:Fn.trigger("swipeDown",[Hn,jn,_n,zn,Gn]),t.swipeDown&&(w=t.swipeDown.call(Fn,e,Hn,jn,_n,zn,Gn))}}}if(s==h){if(Fn.trigger("pinchStatus",[c,qn||null,Yn||0,_n||0,zn,Xn,Gn]),t.pinchStatus&&(w=t.pinchStatus.call(Fn,e,c,qn||null,Yn||0,_n||0,zn,Xn,Gn),w===!1))return!1;if(c==m&&Y())switch(qn){case l:Fn.trigger("pinchIn",[qn||null,Yn||0,_n||0,zn,Xn,Gn]),t.pinchIn&&(w=t.pinchIn.call(Fn,e,qn||null,Yn||0,_n||0,zn,Xn,Gn));break;case a:Fn.trigger("pinchOut",[qn||null,Yn||0,_n||0,zn,Xn,Gn]),t.pinchOut&&(w=t.pinchOut.call(Fn,e,qn||null,Yn||0,_n||0,zn,Xn,Gn))}}return s==f?c!==y&&c!==m||(clearTimeout(ne),clearTimeout(ee),J()&&!nn()?($n=Pn(),ne=setTimeout(n.proxy(function(){$n=null,Fn.trigger("tap",[e.target]),t.tap&&(w=t.tap.call(Fn,e,e.target))},this),t.doubleTapThreshold)):($n=null,Fn.trigger("tap",[e.target]),t.tap&&(w=t.tap.call(Fn,e,e.target)))):s==d?c!==y&&c!==m||(clearTimeout(ne),$n=null,Fn.trigger("doubletap",[e.target]),t.doubleTap&&(w=t.doubleTap.call(Fn,e,e.target))):s==g&&(c!==y&&c!==m||(clearTimeout(ne),$n=null,Fn.trigger("longtap",[e.target]),t.longTap&&(w=t.longTap.call(Fn,e,e.target)))),w}function H(){var n=!0;return null!==t.threshold&&(n=jn>=t.threshold),n}function _(){var n=!1;return null!==t.cancelThreshold&&null!==Hn&&(n=vn(Hn)-jn>=t.cancelThreshold),n}function Q(){return null===t.pinchThreshold||Yn>=t.pinchThreshold}function C(){var n;return n=!t.maxTimeThreshold||!(_n>=t.maxTimeThreshold)}function X(n,e){if(t.preventDefaultEvents!==!1)if(t.allowPageScroll===c)n.preventDefault();else{var l=t.allowPageScroll===s;switch(e){case r:(t.swipeLeft&&l||!l&&t.allowPageScroll!=w)&&n.preventDefault();break;case i:(t.swipeRight&&l||!l&&t.allowPageScroll!=w)&&n.preventDefault();break;case o:(t.swipeUp&&l||!l&&t.allowPageScroll!=v)&&n.preventDefault();break;case u:(t.swipeDown&&l||!l&&t.allowPageScroll!=v)&&n.preventDefault()}}}function Y(){var n=G(),e=Z(),t=Q();return n&&e&&t}function q(){return!!(t.pinchStatus||t.pinchIn||t.pinchOut)}function W(){return!(!Y()||!q())}function F(){var n=C(),e=H(),t=G(),r=Z(),i=_(),o=!i&&r&&t&&e&&n;return o}function V(){return!!(t.swipe||t.swipeStatus||t.swipeLeft||t.swipeRight||t.swipeUp||t.swipeDown)}function z(){return!(!F()||!V())}function G(){return zn===t.fingers||t.fingers===T||!O}function Z(){return 0!==Gn[0].end.x}function B(){return!!t.tap}function J(){return!!t.doubleTap}function K(){return!!t.longTap}function $(){if(null==$n)return!1;var n=Pn();return J()&&n-$n<=t.doubleTapThreshold}function nn(){return $()}function en(){return(1===zn||!O)&&(isNaN(jn)||jn<t.threshold)}function tn(){return _n>t.longTapThreshold&&jn<b}function rn(){return!(!en()||!B())}function on(){return!(!$()||!J())}function un(){return!(!tn()||!K())}function ln(){Jn=Pn(),Kn=event.touches.length+1}function an(){Jn=0,Kn=0}function cn(){var n=!1;if(Jn){var e=Pn()-Jn;e<=t.fingerReleaseThreshold&&(n=!0)}return n}function sn(){return!(Fn.data(P+"_intouch")!==!0)}function pn(n){n===!0?(Fn.bind(An,L),Fn.bind(In,R),Nn&&Fn.bind(Nn,A)):(Fn.unbind(An,L,!1),Fn.unbind(In,R,!1),Nn&&Fn.unbind(Nn,A,!1)),Fn.data(P+"_intouch",n===!0)}function hn(n,e){var t=void 0!==e.identifier?e.identifier:0;return Gn[n].identifier=t,Gn[n].start.x=Gn[n].end.x=e.pageX||e.clientX,Gn[n].start.y=Gn[n].end.y=e.pageY||e.clientY,Gn[n]}function fn(n){var e=void 0!==n.identifier?n.identifier:0,t=dn(e);return t.end.x=n.pageX||n.clientX,t.end.y=n.pageY||n.clientY,t}function dn(n){for(var e=0;e<Gn.length;e++)if(Gn[e].identifier==n)return Gn[e]}function gn(){for(var n=[],e=0;e<=5;e++)n.push({start:{x:0,y:0},end:{x:0,y:0},identifier:0});return n}function wn(n,e){e=Math.max(e,vn(n)),Wn[n].distance=e}function vn(n){if(Wn[n])return Wn[n].distance}function Tn(){var n={};return n[r]=bn(r),n[i]=bn(i),n[o]=bn(o),n[u]=bn(u),n}function bn(n){return{direction:n,distance:0}}function Sn(){return Bn-Zn}function En(n,e){var t=Math.abs(n.x-e.x),r=Math.abs(n.y-e.y);return Math.round(Math.sqrt(t*t+r*r))}function mn(n,e){var t=e/n*1;return t.toFixed(2)}function yn(){return Xn<1?a:l}function On(n,e){return Math.round(Math.sqrt(Math.pow(e.x-n.x,2)+Math.pow(e.y-n.y,2)))}function xn(n,e){var t=n.x-e.x,r=e.y-n.y,i=Math.atan2(r,t),o=Math.round(180*i/Math.PI);return o<0&&(o=360-Math.abs(o)),o}function Mn(n,e){var t=xn(n,e);return t<=45&&t>=0?r:t<=360&&t>=315?r:t>=135&&t<=225?i:t>45&&t<135?u:o}function Pn(){var n=new Date;return n.getTime()}function Dn(e){e=n(e);var t=e.offset(),r={left:t.left,right:t.left+e.outerWidth(),top:t.top,bottom:t.top+e.outerHeight()};return r}function Ln(n,e){return n.x>e.left&&n.x<e.right&&n.y>e.top&&n.y<e.bottom}var Rn=O||M||!t.fallbackToMouseEvents,kn=Rn?M?x?"MSPointerDown":"pointerdown":"touchstart":"mousedown",An=Rn?M?x?"MSPointerMove":"pointermove":"touchmove":"mousemove",In=Rn?M?x?"MSPointerUp":"pointerup":"touchend":"mouseup",Nn=Rn?null:"mouseleave",Un=M?x?"MSPointerCancel":"pointercancel":"touchcancel",jn=0,Hn=null,_n=0,Qn=0,Cn=0,Xn=1,Yn=0,qn=0,Wn=null,Fn=n(e),Vn="start",zn=0,Gn=null,Zn=0,Bn=0,Jn=0,Kn=0,$n=0,ne=null,ee=null;try{Fn.bind(kn,D),Fn.bind(Un,k)}catch(te){n.error("events not supported "+kn+","+Un+" on jQuery.swipe")}this.enable=function(){return Fn.bind(kn,D),Fn.bind(Un,k),Fn},this.disable=function(){return I(),Fn},this.destroy=function(){I(),Fn.data(P,null),Fn=null},this.option=function(e,r){if(void 0!==t[e]){if(void 0===r)return t[e];t[e]=r}else n.error("Option "+e+" does not exist on jQuery.swipe.options");return null}}var r="left",i="right",o="up",u="down",l="in",a="out",c="none",s="auto",p="swipe",h="pinch",f="tap",d="doubletap",g="longtap",w="horizontal",v="vertical",T="all",b=10,S="start",E="move",m="end",y="cancel",O="ontouchstart"in window,x=window.navigator.msPointerEnabled&&!window.navigator.pointerEnabled,M=window.navigator.pointerEnabled||window.navigator.msPointerEnabled,P="TouchSwipe",D={fingers:1,threshold:75,cancelThreshold:null,pinchThreshold:20,maxTimeThreshold:null,fingerReleaseThreshold:250,longTapThreshold:500,doubleTapThreshold:200,swipe:null,swipeLeft:null,swipeRight:null,swipeUp:null,swipeDown:null,swipeStatus:null,pinchIn:null,pinchOut:null,pinchStatus:null,click:null,tap:null,doubleTap:null,longTap:null,hold:null,triggerOnTouchEnd:!0,triggerOnTouchLeave:!1,allowPageScroll:"auto",fallbackToMouseEvents:!0,excludedElements:"label, button, input, select, textarea, a, .noSwipe",preventDefaultEvents:!0};n.fn.swipe=function(t){var r=n(this),i=r.data(P);if(i&&"string"==typeof t){if(i[t])return i[t].apply(this,Array.prototype.slice.call(arguments,1));n.error("Method "+t+" does not exist on jQuery.swipe")}else if(!(i||"object"!=typeof t&&t))return e.apply(this,arguments);return r},n.fn.swipe.defaults=D,n.fn.swipe.phases={PHASE_START:S,PHASE_MOVE:E,PHASE_END:m,PHASE_CANCEL:y},n.fn.swipe.directions={LEFT:r,RIGHT:i,UP:o,DOWN:u,IN:l,OUT:a},n.fn.swipe.pageScroll={NONE:c,HORIZONTAL:w,VERTICAL:v,AUTO:s},n.fn.swipe.fingers={ONE:1,TWO:2,THREE:3,ALL:T}});
readme.txt CHANGED
@@ -2,8 +2,8 @@
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.5.2
5
- Stable tag: 1.6
6
- Build time: 2016-06-21T15:53:26+02:00
7
  License: GPLv3 or later
8
  Contributors: gpriday, braam-genis
9
 
@@ -51,6 +51,14 @@ The SiteOrigin Widgets Bundle is the perfect platform to build widgets for your
51
 
52
  == Changelog ==
53
 
 
 
 
 
 
 
 
 
54
  = 1.6 - 21 June 2016 =
55
  * Added builder field.
56
  * Added new multi checkboxes field.
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.5.2
5
+ Stable tag: 1.6.1
6
+ Build time: 2016-06-24T11:49:37+02:00
7
  License: GPLv3 or later
8
  Contributors: gpriday, braam-genis
9
 
51
 
52
  == Changelog ==
53
 
54
+ = 1.6.1 - 24 June 2016 =
55
+ * Social Links: Fixed auto-filling of network colors.
56
+ * Social Links: Added 500px network.
57
+ * Social Links: Added title tag to link tags.
58
+ * Maps: Prevent JS error in when maps widget script is enqueued but widget isn't displayed.
59
+ * Maps: Made API field more prominent as it's now required by the Google Maps API.
60
+ * Added more general error checking.
61
+
62
  = 1.6 - 21 June 2016 =
63
  * Added builder field.
64
  * Added new multi checkboxes field.
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.6
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.6');
16
  define('SOW_BUNDLE_BASE_FILE', __FILE__);
17
 
18
  // Allow JS suffix to be pre-set
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.6.1
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.6.1');
16
  define('SOW_BUNDLE_BASE_FILE', __FILE__);
17
 
18
  // Allow JS suffix to be pre-set
widgets/google-map/google-map.php CHANGED
@@ -55,6 +55,22 @@ class SiteOrigin_Widget_GoogleMap_Widget extends SiteOrigin_Widget {
55
  'label' => __( 'Map center', 'so-widgets-bundle' ),
56
  'description' => __( 'The name of a place, town, city, or even a country. Can be an exact address too.', 'so-widgets-bundle' )
57
  ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
58
  'settings' => array(
59
  'type' => 'section',
60
  'label' => __( 'Settings', 'so-widgets-bundle' ),
@@ -373,19 +389,6 @@ class SiteOrigin_Widget_GoogleMap_Widget extends SiteOrigin_Widget {
373
  )
374
  )
375
  ),
376
- 'api_key_section' => array(
377
- 'type' => 'section',
378
- 'label' => __( 'API key', 'so-widgets-bundle' ),
379
- 'hide' => true,
380
- 'fields' => array(
381
- 'api_key' => array(
382
- 'type' => 'text',
383
- 'label' => __( 'API key', 'so-widgets-bundle' ),
384
- 'description' => __( 'Enter your API key if you have one. This enables you to monitor your Google Maps API usage in the Google APIs Console.', 'so-widgets-bundle' ),
385
- 'optional' => true
386
- )
387
- )
388
- )
389
  );
390
  }
391
 
55
  'label' => __( 'Map center', 'so-widgets-bundle' ),
56
  'description' => __( 'The name of a place, town, city, or even a country. Can be an exact address too.', 'so-widgets-bundle' )
57
  ),
58
+ 'api_key_section' => array(
59
+ 'type' => 'section',
60
+ 'label' => __( 'API key', 'so-widgets-bundle' ),
61
+ 'hide' => false,
62
+ 'fields' => array(
63
+ 'api_key' => array(
64
+ 'type' => 'text',
65
+ 'label' => __( 'API key', 'so-widgets-bundle' ),
66
+ 'description' => sprintf(
67
+ __( 'Enter your %sAPI key%s. Your map may not function correctly without one.', 'so-widgets-bundle' ),
68
+ '<a href="https://developers.google.com/maps/documentation/javascript/get-api-key" target="_blank">',
69
+ '</a>'
70
+ )
71
+ )
72
+ )
73
+ ),
74
  'settings' => array(
75
  'type' => 'section',
76
  'label' => __( 'Settings', 'so-widgets-bundle' ),
389
  )
390
  )
391
  ),
 
 
 
 
 
 
 
 
 
 
 
 
 
392
  );
393
  }
394
 
widgets/google-map/js/js-map.js CHANGED
@@ -197,12 +197,12 @@ jQuery(function ($) {
197
  if (window.google && window.google.maps) {
198
  new SiteOriginGoogleMap($).loadMaps();
199
  } else {
200
- var apiKey = $('.sow-google-map-canvas').data('options').apiKey;
201
 
202
- var apiUrl = 'https://maps.googleapis.com/maps/api/js?v=3.exp&callback=soGoogleMapInitialize';
203
- if(apiKey) {
204
- apiUrl += '&key=' + apiKey;
205
- }
206
  var script = $('<script type="text/javascript" src="' + apiUrl + '">');
207
  $('body').append(script);
208
  }
197
  if (window.google && window.google.maps) {
198
  new SiteOriginGoogleMap($).loadMaps();
199
  } else {
200
+ var mapOptions = $('.sow-google-map-canvas').data('options');
201
 
202
+ var apiUrl = 'https://maps.googleapis.com/maps/api/js?v=3.exp&callback=soGoogleMapInitialize';
203
+ if(mapOptions && mapOptions.apiKey) {
204
+ apiUrl += '&key=' + mapOptions.apiKey;
205
+ }
206
  var script = $('<script type="text/javascript" src="' + apiUrl + '">');
207
  $('body').append(script);
208
  }
widgets/google-map/js/js-map.min.js CHANGED
@@ -1 +1 @@
1
- function soGoogleMapInitialize(){new SiteOriginGoogleMap(window.jQuery).loadMaps()}var SiteOriginGoogleMap=function(e){return{showMap:function(e,o,a){var i=Number(a.zoom);i||(i=14);var n="user_map_style",t={zoom:i,scrollwheel:a.scrollZoom,draggable:a.draggable,disableDefaultUI:a.disableUi,center:o,mapTypeControlOptions:{mapTypeIds:[google.maps.MapTypeId.ROADMAP,n]}},s=new google.maps.Map(e,t),r={name:a.mapName},p=a.mapStyles;if(p){var l=new google.maps.StyledMapType(p,r);s.mapTypes.set(n,l),s.setMapTypeId(n)}if(a.markerAtCenter&&new google.maps.Marker({position:o,map:s,draggable:a.markersDraggable,icon:a.markerIcon,title:""}),a.keepCentered){var g;google.maps.event.addDomListener(s,"idle",function(){g=s.getCenter()}),google.maps.event.addDomListener(window,"resize",function(){s.setCenter(g)})}this.showMarkers(a.markerPositions,s,a),this.showDirections(a.directions,s,a)},showMarkers:function(e,o,a){if(e&&e.length){var i=new google.maps.Geocoder;e.forEach(function(e){var n=function(){i.geocode({address:e.place},function(i,t){if(t==google.maps.GeocoderStatus.OK){var s=new google.maps.Marker({position:i[0].geometry.location,map:o,draggable:a.markersDraggable,icon:a.markerIcon,title:""});if(e.hasOwnProperty("info")&&e.info){var r={content:e.info};e.hasOwnProperty("info_max_width")&&e.info_max_width&&(r.maxWidth=e.info_max_width);var p=a.markerInfoDisplay;r.disableAutoPan="always"==p;var l=new google.maps.InfoWindow(r);"always"==p?(l.open(o,s),s.addListener("click",function(){l.open(o,s)})):s.addListener(p,function(){l.open(o,s)})}}else t==google.maps.GeocoderStatus.OVER_QUERY_LIMIT&&setTimeout(n,1e3*Math.random(),e)})};setTimeout(n,1e3*Math.random(),e)})}},showDirections:function(e,o){if(e){e.waypoints&&e.waypoints.length&&e.waypoints.map(function(e){e.stopover=Boolean(e.stopover)});var a=new google.maps.DirectionsRenderer;a.setMap(o);var i=new google.maps.DirectionsService;i.route({origin:e.origin,destination:e.destination,travelMode:e.travelMode.toUpperCase(),avoidHighways:e.avoidHighways,avoidTolls:e.avoidTolls,waypoints:e.waypoints,optimizeWaypoints:e.optimizeWaypoints},function(e,o){o==google.maps.DirectionsStatus.OK&&a.setDirections(e)})}},loadMaps:function(){e(".sow-google-map-canvas").each(function(o,a){var i=e(a),n=i.data("options"),t=n.address;if(!t){var s=n.markerPositions;s&&s.length&&(t=s[0].place)}var r,p={address:t};if(t&&t.indexOf(",")>-1){var l=t.split(",");l&&2==l.length&&(r=new google.maps.LatLng(l[0],l[1]),isNaN(r.lat())||isNaN(r.lng())||(p={location:{lat:r.lat(),lng:r.lng()}}))}if(p.hasOwnProperty("location"))this.showMap(a,p.location,n);else if(p.hasOwnProperty("address")){var g=new google.maps.Geocoder;g.geocode(p,function(e,o){o==google.maps.GeocoderStatus.OK?this.showMap(a,e[0].geometry.location,n):o==google.maps.GeocoderStatus.ZERO_RESULTS&&i.append("<div><p><strong>There were no results for the place you entered. Please try another.</strong></p></div>")}.bind(this))}}.bind(this))}}};jQuery(function(e){if(window.google&&window.google.maps)new SiteOriginGoogleMap(e).loadMaps();else{var o=e(".sow-google-map-canvas").data("options").apiKey,a="https://maps.googleapis.com/maps/api/js?v=3.exp&callback=soGoogleMapInitialize";o&&(a+="&key="+o);var i=e('<script type="text/javascript" src="'+a+'">');e("body").append(i)}});
1
+ function soGoogleMapInitialize(){new SiteOriginGoogleMap(window.jQuery).loadMaps()}var SiteOriginGoogleMap=function(e){return{showMap:function(e,o,a){var i=Number(a.zoom);i||(i=14);var n="user_map_style",t={zoom:i,scrollwheel:a.scrollZoom,draggable:a.draggable,disableDefaultUI:a.disableUi,center:o,mapTypeControlOptions:{mapTypeIds:[google.maps.MapTypeId.ROADMAP,n]}},s=new google.maps.Map(e,t),r={name:a.mapName},p=a.mapStyles;if(p){var l=new google.maps.StyledMapType(p,r);s.mapTypes.set(n,l),s.setMapTypeId(n)}if(a.markerAtCenter&&new google.maps.Marker({position:o,map:s,draggable:a.markersDraggable,icon:a.markerIcon,title:""}),a.keepCentered){var g;google.maps.event.addDomListener(s,"idle",function(){g=s.getCenter()}),google.maps.event.addDomListener(window,"resize",function(){s.setCenter(g)})}this.showMarkers(a.markerPositions,s,a),this.showDirections(a.directions,s,a)},showMarkers:function(e,o,a){if(e&&e.length){var i=new google.maps.Geocoder;e.forEach(function(e){var n=function(){i.geocode({address:e.place},function(i,t){if(t==google.maps.GeocoderStatus.OK){var s=new google.maps.Marker({position:i[0].geometry.location,map:o,draggable:a.markersDraggable,icon:a.markerIcon,title:""});if(e.hasOwnProperty("info")&&e.info){var r={content:e.info};e.hasOwnProperty("info_max_width")&&e.info_max_width&&(r.maxWidth=e.info_max_width);var p=a.markerInfoDisplay;r.disableAutoPan="always"==p;var l=new google.maps.InfoWindow(r);"always"==p?(l.open(o,s),s.addListener("click",function(){l.open(o,s)})):s.addListener(p,function(){l.open(o,s)})}}else t==google.maps.GeocoderStatus.OVER_QUERY_LIMIT&&setTimeout(n,1e3*Math.random(),e)})};setTimeout(n,1e3*Math.random(),e)})}},showDirections:function(e,o){if(e){e.waypoints&&e.waypoints.length&&e.waypoints.map(function(e){e.stopover=Boolean(e.stopover)});var a=new google.maps.DirectionsRenderer;a.setMap(o);var i=new google.maps.DirectionsService;i.route({origin:e.origin,destination:e.destination,travelMode:e.travelMode.toUpperCase(),avoidHighways:e.avoidHighways,avoidTolls:e.avoidTolls,waypoints:e.waypoints,optimizeWaypoints:e.optimizeWaypoints},function(e,o){o==google.maps.DirectionsStatus.OK&&a.setDirections(e)})}},loadMaps:function(){e(".sow-google-map-canvas").each(function(o,a){var i=e(a),n=i.data("options"),t=n.address;if(!t){var s=n.markerPositions;s&&s.length&&(t=s[0].place)}var r,p={address:t};if(t&&t.indexOf(",")>-1){var l=t.split(",");l&&2==l.length&&(r=new google.maps.LatLng(l[0],l[1]),isNaN(r.lat())||isNaN(r.lng())||(p={location:{lat:r.lat(),lng:r.lng()}}))}if(p.hasOwnProperty("location"))this.showMap(a,p.location,n);else if(p.hasOwnProperty("address")){var g=new google.maps.Geocoder;g.geocode(p,function(e,o){o==google.maps.GeocoderStatus.OK?this.showMap(a,e[0].geometry.location,n):o==google.maps.GeocoderStatus.ZERO_RESULTS&&i.append("<div><p><strong>There were no results for the place you entered. Please try another.</strong></p></div>")}.bind(this))}}.bind(this))}}};jQuery(function(e){if(window.google&&window.google.maps)new SiteOriginGoogleMap(e).loadMaps();else{var o=e(".sow-google-map-canvas").data("options"),a="https://maps.googleapis.com/maps/api/js?v=3.exp&callback=soGoogleMapInitialize";o&&o.apiKey&&(a+="&key="+o.apiKey);var i=e('<script type="text/javascript" src="'+a+'">');e("body").append(i)}});
widgets/headline/headline.php CHANGED
@@ -187,7 +187,7 @@ class SiteOrigin_Widget_Headline_Widget extends SiteOrigin_Widget {
187
  }
188
  }
189
 
190
- if ( ! empty( $instance['sub_headline'] ) && ! empty ( $instance['sub_headline']['text'] ) ) {
191
  $sub_headline_styles = $instance['sub_headline'];
192
  if ( ! empty( $sub_headline_styles['align'] ) ) {
193
  $less_vars['sub_headline_align'] = $sub_headline_styles['align'];
187
  }
188
  }
189
 
190
+ if ( ! empty( $instance['sub_headline'] ) ) {
191
  $sub_headline_styles = $instance['sub_headline'];
192
  if ( ! empty( $sub_headline_styles['align'] ) ) {
193
  $less_vars['sub_headline_align'] = $sub_headline_styles['align'];
widgets/headline/styles/default.less CHANGED
@@ -5,13 +5,13 @@
5
  @headline_tag: h1;
6
  @headline_font: default;
7
  @headline_font_weight: 400;
8
- @headline_align: left;
9
  @headline_color: default;
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: default;
16
 
17
  @divider_weight: thin;
5
  @headline_tag: h1;
6
  @headline_font: default;
7
  @headline_font_weight: 400;
8
+ @headline_align: center;
9
  @headline_color: default;
10
 
11
  @sub_headline_tag: h3;
12
  @sub_headline_font: default;
13
  @sub_headline_font_weight: 400;
14
+ @sub_headline_align: center;
15
  @sub_headline_color: default;
16
 
17
  @divider_weight: thin;
widgets/post-carousel/js/carousel.min.js CHANGED
@@ -1 +1 @@
1
- jQuery(function(e){e(".sow-carousel-wrapper").each(function(){var t=e(this),a=t.closest(".sow-carousel-container"),n=t.closest(".sow-carousel-container").parent(),s=t.find(".sow-carousel-items"),o=t.find(".sow-carousel-item"),i=o.eq(0),r=0,c=1,l=!1,u=o.length,f=t.data("found-posts"),d=u==f,w=i.width()+parseInt(i.css("margin-right")),p=a.hasClass("js-rtl"),g=p?"margin-right":"margin-left",h=function(){0>r&&(r=0),r>=t.find(".sow-carousel-item").length-1&&(r=t.find(".sow-carousel-item").length-1,l||d||(l=!0,c++,s.append('<li class="sow-carousel-item sow-carousel-loading"></li>'),e.get(t.data("ajax-url"),{query:t.data("query"),action:"sow_carousel_load",paged:c},function(a,n){var o=e(a.html);o.appendTo(s).hide().fadeIn(),t.find(".sow-carousel-loading").remove(),u=t.find(".sow-carousel-item").length,d=u==f,l=!1}))),s.css("transition-duration","0.45s"),s.css(g,-(w*r)+"px")};n.on("click","a.sow-carousel-previous",function(e){e.preventDefault(),r-=p?-1:1,h()}),n.on("click","a.sow-carousel-next",function(e){e.preventDefault(),r+=p?-1:1,h()});var m,v=!1,D=0,I=0,T=0,x=0,y=p?"right":"left";"function"==typeof t.swipe&&t.swipe({excludedElements:"",triggerOnTouchEnd:!0,threshold:75,swipeStatus:function(e,t,a,n,s,o,i){if("start"==t)I=-(w*r),x=(new Date).getTime(),clearInterval(m);else if("move"==t){a==y&&(n*=-1),M(I+n);var c=(new Date).getTime(),l=(c-x)/1e3;T=(n-D)/l,x=c,D=n}else if("end"==t)if(v=!0,a==y&&(n*=-1),Math.abs(T)>400){T*=.1;var u=(new Date).getTime(),f=0;m=setInterval(function(){var e=((new Date).getTime()-u)/1e3;f+=T*e;var t=I+n+f,s=30,o=Math.abs(T)-s<0;a==y?T+=s:T-=s,(o||!M(t))&&(clearInterval(m),b())},20)}else b();else"cancel"==t&&h()}});var M=function(e){return 50>e&&e>-(w*u)?(s.css("transition-duration","0s"),s.css(g,e+"px"),!0):!1},b=function(){var e=parseInt(s.css(g));r=Math.abs(Math.round(e/w)),h()};t.on("click",".sow-carousel-item a",function(e){v&&(e.preventDefault(),v=!1)})})});
1
+ jQuery(function(e){e(".sow-carousel-wrapper").each(function(){var t=e(this),a=t.closest(".sow-carousel-container"),n=t.closest(".sow-carousel-container").parent(),s=t.find(".sow-carousel-items"),o=t.find(".sow-carousel-item"),i=o.eq(0),r=0,c=1,l=!1,u=o.length,f=t.data("found-posts"),d=u==f,w=i.width()+parseInt(i.css("margin-right")),p=a.hasClass("js-rtl"),g=p?"margin-right":"margin-left",h=function(){r<0&&(r=0),r>=t.find(".sow-carousel-item").length-1&&(r=t.find(".sow-carousel-item").length-1,l||d||(l=!0,c++,s.append('<li class="sow-carousel-item sow-carousel-loading"></li>'),e.get(t.data("ajax-url"),{query:t.data("query"),action:"sow_carousel_load",paged:c},function(a,n){var o=e(a.html);o.appendTo(s).hide().fadeIn(),t.find(".sow-carousel-loading").remove(),u=t.find(".sow-carousel-item").length,d=u==f,l=!1}))),s.css("transition-duration","0.45s"),s.css(g,-(w*r)+"px")};n.on("click","a.sow-carousel-previous",function(e){e.preventDefault(),r-=p?-1:1,h()}),n.on("click","a.sow-carousel-next",function(e){e.preventDefault(),r+=p?-1:1,h()});var m,v=!1,D=0,I=0,T=0,x=0,y=p?"right":"left";"function"==typeof t.swipe&&t.swipe({excludedElements:"",triggerOnTouchEnd:!0,threshold:75,swipeStatus:function(e,t,a,n,s,o,i){if("start"==t)I=-(w*r),x=(new Date).getTime(),clearInterval(m);else if("move"==t){a==y&&(n*=-1),M(I+n);var c=(new Date).getTime(),l=(c-x)/1e3;T=(n-D)/l,x=c,D=n}else if("end"==t)if(v=!0,a==y&&(n*=-1),Math.abs(T)>400){T*=.1;var u=(new Date).getTime(),f=0;m=setInterval(function(){var e=((new Date).getTime()-u)/1e3;f+=T*e;var t=I+n+f,s=30,o=Math.abs(T)-s<0;a==y?T+=s:T-=s,!o&&M(t)||(clearInterval(m),b())},20)}else b();else"cancel"==t&&h()}});var M=function(e){return e<50&&e>-(w*u)&&(s.css("transition-duration","0s"),s.css(g,e+"px"),!0)},b=function(){var e=parseInt(s.css(g));r=Math.abs(Math.round(e/w)),h()};t.on("click",".sow-carousel-item a",function(e){v&&(e.preventDefault(),v=!1)})})});
widgets/simple-masonry/js/imagesloaded.pkgd.min.js CHANGED
@@ -1 +1 @@
1
- (function(){"use strict";function e(){}function t(e,t){for(var n=e.length;n--;)if(e[n].listener===t)return n;return-1}function n(e){return function(){return this[e].apply(this,arguments)}}var i=e.prototype,r=this,s=r.EventEmitter;i.getListeners=function(e){var t,n,i=this._getEvents();if("object"==typeof e){t={};for(n in i)i.hasOwnProperty(n)&&e.test(n)&&(t[n]=i[n])}else t=i[e]||(i[e]=[]);return t},i.flattenListeners=function(e){var t,n=[];for(t=0;t<e.length;t+=1)n.push(e[t].listener);return n},i.getListenersAsObject=function(e){var t,n=this.getListeners(e);return n instanceof Array&&(t={},t[e]=n),t||n},i.addListener=function(e,n){var i,r=this.getListenersAsObject(e),s="object"==typeof n;for(i in r)r.hasOwnProperty(i)&&-1===t(r[i],n)&&r[i].push(s?n:{listener:n,once:!1});return this},i.on=n("addListener"),i.addOnceListener=function(e,t){return this.addListener(e,{listener:t,once:!0})},i.once=n("addOnceListener"),i.defineEvent=function(e){return this.getListeners(e),this},i.defineEvents=function(e){for(var t=0;t<e.length;t+=1)this.defineEvent(e[t]);return this},i.removeListener=function(e,n){var i,r,s=this.getListenersAsObject(e);for(r in s)s.hasOwnProperty(r)&&(i=t(s[r],n),-1!==i&&s[r].splice(i,1));return this},i.off=n("removeListener"),i.addListeners=function(e,t){return this.manipulateListeners(!1,e,t)},i.removeListeners=function(e,t){return this.manipulateListeners(!0,e,t)},i.manipulateListeners=function(e,t,n){var i,r,s=e?this.removeListener:this.addListener,o=e?this.removeListeners:this.addListeners;if("object"!=typeof t||t instanceof RegExp)for(i=n.length;i--;)s.call(this,t,n[i]);else for(i in t)t.hasOwnProperty(i)&&(r=t[i])&&("function"==typeof r?s.call(this,i,r):o.call(this,i,r));return this},i.removeEvent=function(e){var t,n=typeof e,i=this._getEvents();if("string"===n)delete i[e];else if("object"===n)for(t in i)i.hasOwnProperty(t)&&e.test(t)&&delete i[t];else delete this._events;return this},i.removeAllListeners=n("removeEvent"),i.emitEvent=function(e,t){var n,i,r,s,o=this.getListenersAsObject(e);for(r in o)if(o.hasOwnProperty(r))for(i=o[r].length;i--;)n=o[r][i],n.once===!0&&this.removeListener(e,n.listener),s=n.listener.apply(this,t||[]),s===this._getOnceReturnValue()&&this.removeListener(e,n.listener);return this},i.trigger=n("emitEvent"),i.emit=function(e){var t=Array.prototype.slice.call(arguments,1);return this.emitEvent(e,t)},i.setOnceReturnValue=function(e){return this._onceReturnValue=e,this},i._getOnceReturnValue=function(){return this.hasOwnProperty("_onceReturnValue")?this._onceReturnValue:!0},i._getEvents=function(){return this._events||(this._events={})},e.noConflict=function(){return r.EventEmitter=s,e},"function"==typeof define&&define.amd?define("eventEmitter/EventEmitter",[],function(){return e}):"object"==typeof module&&module.exports?module.exports=e:this.EventEmitter=e}).call(this),function(e){function t(t){var n=e.event;return n.target=n.target||n.srcElement||t,n}var n=document.documentElement,i=function(){};n.addEventListener?i=function(e,t,n){e.addEventListener(t,n,!1)}:n.attachEvent&&(i=function(e,n,i){e[n+i]=i.handleEvent?function(){var n=t(e);i.handleEvent.call(i,n)}:function(){var n=t(e);i.call(e,n)},e.attachEvent("on"+n,e[n+i])});var r=function(){};n.removeEventListener?r=function(e,t,n){e.removeEventListener(t,n,!1)}:n.detachEvent&&(r=function(e,t,n){e.detachEvent("on"+t,e[t+n]);try{delete e[t+n]}catch(i){e[t+n]=void 0}});var s={bind:i,unbind:r};"function"==typeof define&&define.amd?define("eventie/eventie",s):e.eventie=s}(this),function(e,t){"use strict";"function"==typeof define&&define.amd?define(["eventEmitter/EventEmitter","eventie/eventie"],function(n,i){return t(e,n,i)}):"object"==typeof module&&module.exports?module.exports=t(e,require("wolfy87-eventemitter"),require("eventie")):e.imagesLoaded=t(e,e.EventEmitter,e.eventie)}(window,function(e,t,n){function i(e,t){for(var n in t)e[n]=t[n];return e}function r(e){return"[object Array]"==f.call(e)}function s(e){var t=[];if(r(e))t=e;else if("number"==typeof e.length)for(var n=0;n<e.length;n++)t.push(e[n]);else t.push(e);return t}function o(e,t,n){if(!(this instanceof o))return new o(e,t,n);"string"==typeof e&&(e=document.querySelectorAll(e)),this.elements=s(e),this.options=i({},this.options),"function"==typeof t?n=t:i(this.options,t),n&&this.on("always",n),this.getImages(),u&&(this.jqDeferred=new u.Deferred);var r=this;setTimeout(function(){r.check()})}function h(e){this.img=e}function a(e,t){this.url=e,this.element=t,this.img=new Image}var u=e.jQuery,c=e.console,f=Object.prototype.toString;o.prototype=new t,o.prototype.options={},o.prototype.getImages=function(){this.images=[];for(var e=0;e<this.elements.length;e++){var t=this.elements[e];this.addElementImages(t)}},o.prototype.addElementImages=function(e){"IMG"==e.nodeName&&this.addImage(e),this.options.background===!0&&this.addElementBackgroundImages(e);var t=e.nodeType;if(t&&d[t]){for(var n=e.querySelectorAll("img"),i=0;i<n.length;i++){var r=n[i];this.addImage(r)}if("string"==typeof this.options.background){var s=e.querySelectorAll(this.options.background);for(i=0;i<s.length;i++){var o=s[i];this.addElementBackgroundImages(o)}}}};var d={1:!0,9:!0,11:!0};o.prototype.addElementBackgroundImages=function(e){for(var t=m(e),n=/url\(['"]*([^'"\)]+)['"]*\)/gi,i=n.exec(t.backgroundImage);null!==i;){var r=i&&i[1];r&&this.addBackground(r,e),i=n.exec(t.backgroundImage)}};var m=e.getComputedStyle||function(e){return e.currentStyle};return o.prototype.addImage=function(e){var t=new h(e);this.images.push(t)},o.prototype.addBackground=function(e,t){var n=new a(e,t);this.images.push(n)},o.prototype.check=function(){function e(e,n,i){setTimeout(function(){t.progress(e,n,i)})}var t=this;if(this.progressedCount=0,this.hasAnyBroken=!1,!this.images.length)return void this.complete();for(var n=0;n<this.images.length;n++){var i=this.images[n];i.once("progress",e),i.check()}},o.prototype.progress=function(e,t,n){this.progressedCount++,this.hasAnyBroken=this.hasAnyBroken||!e.isLoaded,this.emit("progress",this,e,t),this.jqDeferred&&this.jqDeferred.notify&&this.jqDeferred.notify(this,e),this.progressedCount==this.images.length&&this.complete(),this.options.debug&&c&&c.log("progress: "+n,e,t)},o.prototype.complete=function(){var e=this.hasAnyBroken?"fail":"done";if(this.isComplete=!0,this.emit(e,this),this.emit("always",this),this.jqDeferred){var t=this.hasAnyBroken?"reject":"resolve";this.jqDeferred[t](this)}},h.prototype=new t,h.prototype.check=function(){var e=this.getIsImageComplete();return e?void this.confirm(0!==this.img.naturalWidth,"naturalWidth"):(this.proxyImage=new Image,n.bind(this.proxyImage,"load",this),n.bind(this.proxyImage,"error",this),n.bind(this.img,"load",this),n.bind(this.img,"error",this),void(this.proxyImage.src=this.img.src))},h.prototype.getIsImageComplete=function(){return this.img.complete&&void 0!==this.img.naturalWidth},h.prototype.confirm=function(e,t){this.isLoaded=e,this.emit("progress",this,this.img,t)},h.prototype.handleEvent=function(e){var t="on"+e.type;this[t]&&this[t](e)},h.prototype.onload=function(){this.confirm(!0,"onload"),this.unbindEvents()},h.prototype.onerror=function(){this.confirm(!1,"onerror"),this.unbindEvents()},h.prototype.unbindEvents=function(){n.unbind(this.proxyImage,"load",this),n.unbind(this.proxyImage,"error",this),n.unbind(this.img,"load",this),n.unbind(this.img,"error",this)},a.prototype=new h,a.prototype.check=function(){n.bind(this.img,"load",this),n.bind(this.img,"error",this),this.img.src=this.url;var e=this.getIsImageComplete();e&&(this.confirm(0!==this.img.naturalWidth,"naturalWidth"),this.unbindEvents())},a.prototype.unbindEvents=function(){n.unbind(this.img,"load",this),n.unbind(this.img,"error",this)},a.prototype.confirm=function(e,t){this.isLoaded=e,this.emit("progress",this,this.element,t)},o.makeJQueryPlugin=function(t){t=t||e.jQuery,t&&(u=t,u.fn.imagesLoaded=function(e,t){var n=new o(this,e,t);return n.jqDeferred.promise(u(this))})},o.makeJQueryPlugin(),o});
1
+ (function(){"use strict";function e(){}function t(e,t){for(var n=e.length;n--;)if(e[n].listener===t)return n;return-1}function n(e){return function(){return this[e].apply(this,arguments)}}var i=e.prototype,r=this,s=r.EventEmitter;i.getListeners=function(e){var t,n,i=this._getEvents();if("object"==typeof e){t={};for(n in i)i.hasOwnProperty(n)&&e.test(n)&&(t[n]=i[n])}else t=i[e]||(i[e]=[]);return t},i.flattenListeners=function(e){var t,n=[];for(t=0;t<e.length;t+=1)n.push(e[t].listener);return n},i.getListenersAsObject=function(e){var t,n=this.getListeners(e);return n instanceof Array&&(t={},t[e]=n),t||n},i.addListener=function(e,n){var i,r=this.getListenersAsObject(e),s="object"==typeof n;for(i in r)r.hasOwnProperty(i)&&t(r[i],n)===-1&&r[i].push(s?n:{listener:n,once:!1});return this},i.on=n("addListener"),i.addOnceListener=function(e,t){return this.addListener(e,{listener:t,once:!0})},i.once=n("addOnceListener"),i.defineEvent=function(e){return this.getListeners(e),this},i.defineEvents=function(e){for(var t=0;t<e.length;t+=1)this.defineEvent(e[t]);return this},i.removeListener=function(e,n){var i,r,s=this.getListenersAsObject(e);for(r in s)s.hasOwnProperty(r)&&(i=t(s[r],n),i!==-1&&s[r].splice(i,1));return this},i.off=n("removeListener"),i.addListeners=function(e,t){return this.manipulateListeners(!1,e,t)},i.removeListeners=function(e,t){return this.manipulateListeners(!0,e,t)},i.manipulateListeners=function(e,t,n){var i,r,s=e?this.removeListener:this.addListener,o=e?this.removeListeners:this.addListeners;if("object"!=typeof t||t instanceof RegExp)for(i=n.length;i--;)s.call(this,t,n[i]);else for(i in t)t.hasOwnProperty(i)&&(r=t[i])&&("function"==typeof r?s.call(this,i,r):o.call(this,i,r));return this},i.removeEvent=function(e){var t,n=typeof e,i=this._getEvents();if("string"===n)delete i[e];else if("object"===n)for(t in i)i.hasOwnProperty(t)&&e.test(t)&&delete i[t];else delete this._events;return this},i.removeAllListeners=n("removeEvent"),i.emitEvent=function(e,t){var n,i,r,s,o=this.getListenersAsObject(e);for(r in o)if(o.hasOwnProperty(r))for(i=o[r].length;i--;)n=o[r][i],n.once===!0&&this.removeListener(e,n.listener),s=n.listener.apply(this,t||[]),s===this._getOnceReturnValue()&&this.removeListener(e,n.listener);return this},i.trigger=n("emitEvent"),i.emit=function(e){var t=Array.prototype.slice.call(arguments,1);return this.emitEvent(e,t)},i.setOnceReturnValue=function(e){return this._onceReturnValue=e,this},i._getOnceReturnValue=function(){return!this.hasOwnProperty("_onceReturnValue")||this._onceReturnValue},i._getEvents=function(){return this._events||(this._events={})},e.noConflict=function(){return r.EventEmitter=s,e},"function"==typeof define&&define.amd?define("eventEmitter/EventEmitter",[],function(){return e}):"object"==typeof module&&module.exports?module.exports=e:this.EventEmitter=e}).call(this),function(e){function t(t){var n=e.event;return n.target=n.target||n.srcElement||t,n}var n=document.documentElement,i=function(){};n.addEventListener?i=function(e,t,n){e.addEventListener(t,n,!1)}:n.attachEvent&&(i=function(e,n,i){e[n+i]=i.handleEvent?function(){var n=t(e);i.handleEvent.call(i,n)}:function(){var n=t(e);i.call(e,n)},e.attachEvent("on"+n,e[n+i])});var r=function(){};n.removeEventListener?r=function(e,t,n){e.removeEventListener(t,n,!1)}:n.detachEvent&&(r=function(e,t,n){e.detachEvent("on"+t,e[t+n]);try{delete e[t+n]}catch(i){e[t+n]=void 0}});var s={bind:i,unbind:r};"function"==typeof define&&define.amd?define("eventie/eventie",s):e.eventie=s}(this),function(e,t){"use strict";"function"==typeof define&&define.amd?define(["eventEmitter/EventEmitter","eventie/eventie"],function(n,i){return t(e,n,i)}):"object"==typeof module&&module.exports?module.exports=t(e,require("wolfy87-eventemitter"),require("eventie")):e.imagesLoaded=t(e,e.EventEmitter,e.eventie)}(window,function(e,t,n){function i(e,t){for(var n in t)e[n]=t[n];return e}function r(e){return"[object Array]"==f.call(e)}function s(e){var t=[];if(r(e))t=e;else if("number"==typeof e.length)for(var n=0;n<e.length;n++)t.push(e[n]);else t.push(e);return t}function o(e,t,n){if(!(this instanceof o))return new o(e,t,n);"string"==typeof e&&(e=document.querySelectorAll(e)),this.elements=s(e),this.options=i({},this.options),"function"==typeof t?n=t:i(this.options,t),n&&this.on("always",n),this.getImages(),u&&(this.jqDeferred=new u.Deferred);var r=this;setTimeout(function(){r.check()})}function h(e){this.img=e}function a(e,t){this.url=e,this.element=t,this.img=new Image}var u=e.jQuery,c=e.console,f=Object.prototype.toString;o.prototype=new t,o.prototype.options={},o.prototype.getImages=function(){this.images=[];for(var e=0;e<this.elements.length;e++){var t=this.elements[e];this.addElementImages(t)}},o.prototype.addElementImages=function(e){"IMG"==e.nodeName&&this.addImage(e),this.options.background===!0&&this.addElementBackgroundImages(e);var t=e.nodeType;if(t&&d[t]){for(var n=e.querySelectorAll("img"),i=0;i<n.length;i++){var r=n[i];this.addImage(r)}if("string"==typeof this.options.background){var s=e.querySelectorAll(this.options.background);for(i=0;i<s.length;i++){var o=s[i];this.addElementBackgroundImages(o)}}}};var d={1:!0,9:!0,11:!0};o.prototype.addElementBackgroundImages=function(e){for(var t=l(e),n=/url\(['"]*([^'"\)]+)['"]*\)/gi,i=n.exec(t.backgroundImage);null!==i;){var r=i&&i[1];r&&this.addBackground(r,e),i=n.exec(t.backgroundImage)}};var l=e.getComputedStyle||function(e){return e.currentStyle};return o.prototype.addImage=function(e){var t=new h(e);this.images.push(t)},o.prototype.addBackground=function(e,t){var n=new a(e,t);this.images.push(n)},o.prototype.check=function(){function e(e,n,i){setTimeout(function(){t.progress(e,n,i)})}var t=this;if(this.progressedCount=0,this.hasAnyBroken=!1,!this.images.length)return void this.complete();for(var n=0;n<this.images.length;n++){var i=this.images[n];i.once("progress",e),i.check()}},o.prototype.progress=function(e,t,n){this.progressedCount++,this.hasAnyBroken=this.hasAnyBroken||!e.isLoaded,this.emit("progress",this,e,t),this.jqDeferred&&this.jqDeferred.notify&&this.jqDeferred.notify(this,e),this.progressedCount==this.images.length&&this.complete(),this.options.debug&&c&&c.log("progress: "+n,e,t)},o.prototype.complete=function(){var e=this.hasAnyBroken?"fail":"done";if(this.isComplete=!0,this.emit(e,this),this.emit("always",this),this.jqDeferred){var t=this.hasAnyBroken?"reject":"resolve";this.jqDeferred[t](this)}},h.prototype=new t,h.prototype.check=function(){var e=this.getIsImageComplete();return e?void this.confirm(0!==this.img.naturalWidth,"naturalWidth"):(this.proxyImage=new Image,n.bind(this.proxyImage,"load",this),n.bind(this.proxyImage,"error",this),n.bind(this.img,"load",this),n.bind(this.img,"error",this),void(this.proxyImage.src=this.img.src))},h.prototype.getIsImageComplete=function(){return this.img.complete&&void 0!==this.img.naturalWidth},h.prototype.confirm=function(e,t){this.isLoaded=e,this.emit("progress",this,this.img,t)},h.prototype.handleEvent=function(e){var t="on"+e.type;this[t]&&this[t](e)},h.prototype.onload=function(){this.confirm(!0,"onload"),this.unbindEvents()},h.prototype.onerror=function(){this.confirm(!1,"onerror"),this.unbindEvents()},h.prototype.unbindEvents=function(){n.unbind(this.proxyImage,"load",this),n.unbind(this.proxyImage,"error",this),n.unbind(this.img,"load",this),n.unbind(this.img,"error",this)},a.prototype=new h,a.prototype.check=function(){n.bind(this.img,"load",this),n.bind(this.img,"error",this),this.img.src=this.url;var e=this.getIsImageComplete();e&&(this.confirm(0!==this.img.naturalWidth,"naturalWidth"),this.unbindEvents())},a.prototype.unbindEvents=function(){n.unbind(this.img,"load",this),n.unbind(this.img,"error",this)},a.prototype.confirm=function(e,t){this.isLoaded=e,this.emit("progress",this,this.element,t)},o.makeJQueryPlugin=function(t){t=t||e.jQuery,t&&(u=t,u.fn.imagesLoaded=function(e,t){var n=new o(this,e,t);return n.jqDeferred.promise(u(this))})},o.makeJQueryPlugin(),o});
widgets/simple-masonry/js/packery.pkgd.min.js CHANGED
@@ -1,2 +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
- }(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;a<h;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;o<r;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=t.indexOf("%")===-1&&!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;e<i;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;d<l;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||i.indexOf("%")===-1)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)&&e(o[n],i)===-1&&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),n!==-1&&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},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;t<i;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;o<r;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;i<n;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;i<o;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;i<n;i++)if(t[i]===e)return i;return-1},n.removeFrom=function(t,e){var i=n.indexOf(t,e);i!=-1&&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;r<s;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;p<u;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;h<p;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;e<i;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=o.indexOf("%")!=-1?parseFloat(o)/100*s.width:parseInt(o,10),h=r.indexOf("%")!=-1?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;o<r;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;e<i;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;i<n;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;n<o;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;e<i;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;a<h;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;e<i;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;e<i;e++){var n=t[e];o.removeFrom(this.stamps,n),this.unignore(n)}},s.prototype._find=function(t){if(t)return"string"==typeof t&&(t=this.element.querySelectorAll(t)),t=o.makeArray(t)},s.prototype._manageStamps=function(){if(this.stamps&&this.stamps.length){this._getBoundingRect();for(var t=0,e=this.stamps.length;t<e;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&&i<e;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&&i<e;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;e<i;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;i<n;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;i<n;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;e<i;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;e<i;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;i<n;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;e<i;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;s<a;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&&i<1?"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||(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/social-media-buttons/data/networks.php CHANGED
@@ -73,6 +73,15 @@ return array(
73
  'icon_color' => '#FFFFFF',
74
  'button_color' => '#17B48A'
75
  ),
 
 
 
 
 
 
 
 
 
76
  'behance' => array(
77
  'label' => __( 'Behance', 'so-widgets-bundle' ),
78
  'base_url' => 'https://www.behance.net/',
73
  'icon_color' => '#FFFFFF',
74
  'button_color' => '#17B48A'
75
  ),
76
+
77
+ // The rest of the networks, alphabetically
78
+
79
+ '500px' => array(
80
+ 'label' => __( '500px', 'so-widgets-bundle' ),
81
+ 'base_url' => 'https://500px.com/',
82
+ 'icon_color' => '#FFFFFF',
83
+ 'button_color' => '#292929'
84
+ ),
85
  'behance' => array(
86
  'label' => __( 'Behance', 'so-widgets-bundle' ),
87
  'base_url' => 'https://www.behance.net/',
widgets/social-media-buttons/social-media-buttons.php CHANGED
@@ -27,7 +27,9 @@ class SiteOrigin_Widget_SocialMediaButtons_Widget extends SiteOrigin_Widget {
27
 
28
  function initialize_form(){
29
 
30
- $this->networks = include plugin_dir_path( __FILE__ ) . 'data/networks.php';
 
 
31
 
32
  $network_names = array();
33
  foreach ( $this->networks as $key => $value ) {
@@ -163,6 +165,10 @@ class SiteOrigin_Widget_SocialMediaButtons_Widget extends SiteOrigin_Widget {
163
  }
164
 
165
  function get_javascript_variables() {
 
 
 
 
166
  return array( 'networks' => $this->networks );
167
  }
168
 
27
 
28
  function initialize_form(){
29
 
30
+ if( empty( $this->networks ) ) {
31
+ $this->networks = include plugin_dir_path( __FILE__ ) . 'data/networks.php';
32
+ }
33
 
34
  $network_names = array();
35
  foreach ( $this->networks as $key => $value ) {
165
  }
166
 
167
  function get_javascript_variables() {
168
+ if( empty( $this->networks ) ) {
169
+ $this->networks = include plugin_dir_path( __FILE__ ) . 'data/networks.php';
170
+ }
171
+
172
  return array( 'networks' => $this->networks );
173
  }
174
 
widgets/social-media-buttons/tpl/default.php CHANGED
@@ -5,13 +5,14 @@
5
  $classes[] = "sow-social-media-button-" . sanitize_html_class( $network['name'] );
6
  $classes[] = "sow-social-media-button";
7
  $button_attributes = array(
8
- 'class' => esc_attr(implode(' ', $classes))
 
9
  );
10
  if(!empty($instance['design']['new_window'])) $button_attributes['target'] = '_blank';
11
  if ( ! empty( $network['url'] ) ) $button_attributes['href'] = sow_esc_url( $network['url'] );
12
  ?>
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'] ); ?>
5
  $classes[] = "sow-social-media-button-" . sanitize_html_class( $network['name'] );
6
  $classes[] = "sow-social-media-button";
7
  $button_attributes = array(
8
+ 'class' => esc_attr( implode(' ', $classes) ),
9
+ 'title' => sprintf( __( '%s on %s', 'so-widgets-bundle' ), get_bloginfo( 'name' ), ucwords( str_replace( '-', ' ', $network['name'] ) ) ),
10
  );
11
  if(!empty($instance['design']['new_window'])) $button_attributes['target'] = '_blank';
12
  if ( ! empty( $network['url'] ) ) $button_attributes['href'] = sow_esc_url( $network['url'] );
13
  ?>
14
 
15
+ <a <?php foreach($button_attributes as $name => $val) echo $name . '="' . esc_attr( $val ) . '" ' ?>>
16
  <span>
17
  <?php if( !empty( $network['is_custom'] ) ) echo '<!-- premium-' . $network['name'] . ' -->'; ?>
18
  <?php echo siteorigin_widget_get_icon( $network['icon_name'] ); ?>