//
// jscookie
//
!function(e){var n=!1;if("function"==typeof define&&define.amd&&(define(e),n=!0),"object"==typeof exports&&(module.exports=e(),n=!0),!n){var o=window.Cookies,t=window.Cookies=e();t.noConflict=function(){return window.Cookies=o,t}}}(function(){function e(){for(var e=0,n={};e1){if("number"==typeof(i=e({path:"/"},t.defaults,i)).expires){var a=new Date;a.setMilliseconds(a.getMilliseconds()+864e5*i.expires),i.expires=a}i.expires=i.expires?i.expires.toUTCString():"";try{c=JSON.stringify(r),/^[\{\[]/.test(c)&&(r=c)}catch(e){}r=o.write?o.write(r,n):encodeURIComponent(String(r)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),n=(n=(n=encodeURIComponent(String(n))).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent)).replace(/[\(\)]/g,escape);var s="";for(var f in i)i[f]&&(s+="; "+f,!0!==i[f]&&(s+="="+i[f]));return document.cookie=n+"="+r+s}n||(c={});for(var p=document.cookie?document.cookie.split("; "):[],d=/(%[0-9A-Z]{2})+/g,u=0;u*",ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,setData:function(a,b){a.setData("Text",b.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0}};for(var d in c)!(d in b)&&(b[d]=c[d]);ga(b);for(var e in this)"_"===e.charAt(0)&&"function"==typeof this[e]&&(this[e]=this[e].bind(this));this.nativeDraggable=!b.forceFallback&&$,f(a,"mousedown",this._onTapStart),f(a,"touchstart",this._onTapStart),f(a,"pointerdown",this._onTapStart),this.nativeDraggable&&(f(a,"dragover",this),f(a,"dragenter",this)),ea.push(this._onDragOver),b.store&&this.sort(b.store.get(this))}function b(a,b){"clone"!==a.lastPullMode&&(b=!0),z&&z.state!==b&&(i(z,"display",b?"none":""),b||z.state&&(a.options.group.revertClone?(A.insertBefore(z,B),a._animate(w,z)):A.insertBefore(z,w)),z.state=b)}function c(a,b,c){if(a){c=c||V;do if(">*"===b&&a.parentNode===c||r(a,b))return a;while(a=d(a))}return null}function d(a){var b=a.host;return b&&b.nodeType?b:a.parentNode}function e(a){a.dataTransfer&&(a.dataTransfer.dropEffect="move"),a.preventDefault()}function f(a,b,c){a.addEventListener(b,c,Z)}function g(a,b,c){a.removeEventListener(b,c,Z)}function h(a,b,c){if(a)if(a.classList)a.classList[c?"add":"remove"](b);else{var d=(" "+a.className+" ").replace(R," ").replace(" "+b+" "," ");a.className=(d+(c?" "+b:"")).replace(R," ")}}function i(a,b,c){var d=a&&a.style;if(d){if(void 0===c)return V.defaultView&&V.defaultView.getComputedStyle?c=V.defaultView.getComputedStyle(a,""):a.currentStyle&&(c=a.currentStyle),void 0===b?c:c[b];b in d||(b="-webkit-"+b),d[b]=c+("string"==typeof c?"":"px")}}function j(a,b,c){if(a){var d=a.getElementsByTagName(b),e=0,f=d.length;if(c)for(;e5||b.clientX-(d.left+d.width)>5}function p(a){for(var b=a.tagName+a.className+a.src+a.href+a.textContent,c=b.length,d=0;c--;)d+=b.charCodeAt(c);return d.toString(36)}function q(a,b){var c=0;if(!a||!a.parentNode)return-1;for(;a&&(a=a.previousElementSibling);)"TEMPLATE"===a.nodeName.toUpperCase()||">*"!==b&&!r(a,b)||c++;return c}function r(a,b){if(a){b=b.split(".");var c=b.shift().toUpperCase(),d=new RegExp("\\s("+b.join("|")+")(?=\\s)","g");return!(""!==c&&a.nodeName.toUpperCase()!=c||b.length&&((" "+a.className+" ").match(d)||[]).length!=b.length)}return!1}function s(a,b){var c,d;return function(){void 0===c&&(c=arguments,d=this,setTimeout(function(){1===c.length?a.call(d,c[0]):a.apply(d,c),c=void 0},b))}}function t(a,b){if(a&&b)for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c]);return a}function u(a){return X?X(a).clone(!0)[0]:Y&&Y.dom?Y.dom(a).cloneNode(!0):a.cloneNode(!0)}function v(a){for(var b=a.getElementsByTagName("input"),c=b.length;c--;){var d=b[c];d.checked&&da.push(d)}}if("undefined"==typeof window||!window.document)return function(){throw new Error("Sortable.js requires a window with a document")};var w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q={},R=/\s+/g,S=/left|right|inline/,T="Sortable"+(new Date).getTime(),U=window,V=U.document,W=U.parseInt,X=U.jQuery||U.Zepto,Y=U.Polymer,Z=!1,$=!!("draggable"in V.createElement("div")),_=function(a){return!navigator.userAgent.match(/Trident.*rv[ :]?11\./)&&(a=V.createElement("x"),a.style.cssText="pointer-events:auto","auto"===a.style.pointerEvents)}(),aa=!1,ba=Math.abs,ca=Math.min,da=[],ea=[],fa=s(function(a,b,c){if(c&&b.scroll){var d,e,f,g,h,i,j=c[T],k=b.scrollSensitivity,l=b.scrollSpeed,m=a.clientX,n=a.clientY,o=window.innerWidth,p=window.innerHeight;if(E!==c&&(D=b.scroll,E=c,F=b.scrollFn,D===!0)){D=c;do if(D.offsetWidth-1:e==a)}}var c={},d=a.group;d&&"object"==typeof d||(d={name:d}),c.name=d.name,c.checkPull=b(d.pull,!0),c.checkPut=b(d.put),c.revertClone=d.revertClone,a.group=c};a.prototype={constructor:a,_onTapStart:function(a){var b,d=this,e=this.el,f=this.options,g=f.preventOnFilter,h=a.type,i=a.touches&&a.touches[0],j=(i||a).target,l=a.target.shadowRoot&&a.path[0]||j,m=f.filter;if(v(e),!w&&!("mousedown"===h&&0!==a.button||f.disabled)&&(j=c(j,f.draggable,e),j&&C!==j)){if(b=q(j,f.draggable),"function"==typeof m){if(m.call(this,a,j,this))return k(d,l,"filter",j,e,b),void(g&&a.preventDefault())}else if(m&&(m=m.split(",").some(function(a){if(a=c(l,a.trim(),e))return k(d,a,"filter",j,e,b),!0})))return void(g&&a.preventDefault());f.handle&&!c(l,f.handle,e)||this._prepareDragStart(a,i,j,b)}},_prepareDragStart:function(a,b,c,d){var e,g=this,i=g.el,l=g.options,n=i.ownerDocument;c&&!w&&c.parentNode===i&&(N=a,A=i,w=c,x=w.parentNode,B=w.nextSibling,C=c,L=l.group,J=d,this._lastX=(b||a).clientX,this._lastY=(b||a).clientY,w.style["will-change"]="transform",e=function(){g._disableDelayedDrag(),w.draggable=g.nativeDraggable,h(w,l.chosenClass,!0),g._triggerDragStart(a,b),k(g,A,"choose",w,A,J)},l.ignore.split(",").forEach(function(a){j(w,a.trim(),m)}),f(n,"mouseup",g._onDrop),f(n,"touchend",g._onDrop),f(n,"touchcancel",g._onDrop),f(n,"pointercancel",g._onDrop),f(n,"selectstart",g),l.delay?(f(n,"mouseup",g._disableDelayedDrag),f(n,"touchend",g._disableDelayedDrag),f(n,"touchcancel",g._disableDelayedDrag),f(n,"mousemove",g._disableDelayedDrag),f(n,"touchmove",g._disableDelayedDrag),f(n,"pointermove",g._disableDelayedDrag),g._dragStartTimer=setTimeout(e,l.delay)):e())},_disableDelayedDrag:function(){var a=this.el.ownerDocument;clearTimeout(this._dragStartTimer),g(a,"mouseup",this._disableDelayedDrag),g(a,"touchend",this._disableDelayedDrag),g(a,"touchcancel",this._disableDelayedDrag),g(a,"mousemove",this._disableDelayedDrag),g(a,"touchmove",this._disableDelayedDrag),g(a,"pointermove",this._disableDelayedDrag)},_triggerDragStart:function(a,b){b=b||("touch"==a.pointerType?a:null),b?(N={target:w,clientX:b.clientX,clientY:b.clientY},this._onDragStart(N,"touch")):this.nativeDraggable?(f(w,"dragend",this),f(A,"dragstart",this._onDragStart)):this._onDragStart(N,!0);try{V.selection?setTimeout(function(){V.selection.empty()}):window.getSelection().removeAllRanges()}catch(a){}},_dragStarted:function(){if(A&&w){var b=this.options;h(w,b.ghostClass,!0),h(w,b.dragClass,!1),a.active=this,k(this,A,"start",w,A,J)}else this._nulling()},_emulateDragOver:function(){if(O){if(this._lastX===O.clientX&&this._lastY===O.clientY)return;this._lastX=O.clientX,this._lastY=O.clientY,_||i(y,"display","none");var a=V.elementFromPoint(O.clientX,O.clientY),b=a,c=ea.length;if(b)do{if(b[T]){for(;c--;)ea[c]({clientX:O.clientX,clientY:O.clientY,target:a,rootEl:b});break}a=b}while(b=b.parentNode);_||i(y,"display","")}},_onTouchMove:function(b){if(N){var c=this.options,d=c.fallbackTolerance,e=c.fallbackOffset,f=b.touches?b.touches[0]:b,g=f.clientX-N.clientX+e.x,h=f.clientY-N.clientY+e.y,j=b.touches?"translate3d("+g+"px,"+h+"px,0)":"translate("+g+"px,"+h+"px)";if(!a.active){if(d&&ca(ba(f.clientX-this._lastX),ba(f.clientY-this._lastY))w.offsetWidth,D=e.offsetHeight>w.offsetHeight,E=(v?(d.clientX-g.left)/t:(d.clientY-g.top)/u)>.5,F=e.nextElementSibling,J=!1;if(v){var K=w.offsetTop,N=e.offsetTop;J=K===N?e.previousElementSibling===w&&!C||E&&C:e.previousElementSibling===w||w.previousElementSibling===e?(d.clientY-g.top)/u>.5:N>K}else r||(J=F!==w&&!D||E&&D);var O=l(A,j,w,f,e,g,d,J);O!==!1&&(1!==O&&O!==-1||(J=1===O),aa=!0,setTimeout(n,30),b(p,q),w.contains(j)||(J&&!F?j.appendChild(w):e.parentNode.insertBefore(w,J?F:e)),x=w.parentNode,this._animate(f,w),this._animate(g,e))}}},_animate:function(a,b){var c=this.options.animation;if(c){var d=b.getBoundingClientRect();1===a.nodeType&&(a=a.getBoundingClientRect()),i(b,"transition","none"),i(b,"transform","translate3d("+(a.left-d.left)+"px,"+(a.top-d.top)+"px,0)"),b.offsetWidth,i(b,"transition","all "+c+"ms"),i(b,"transform","translate3d(0,0,0)"),clearTimeout(b.animated),b.animated=setTimeout(function(){i(b,"transition",""),i(b,"transform",""),b.animated=!1},c)}},_offUpEvents:function(){var a=this.el.ownerDocument;g(V,"touchmove",this._onTouchMove),g(V,"pointermove",this._onTouchMove),g(a,"mouseup",this._onDrop),g(a,"touchend",this._onDrop),g(a,"pointerup",this._onDrop),g(a,"touchcancel",this._onDrop),g(a,"pointercancel",this._onDrop),g(a,"selectstart",this)},_onDrop:function(b){var c=this.el,d=this.options;clearInterval(this._loopId),clearInterval(Q.pid),clearTimeout(this._dragStartTimer),g(V,"mousemove",this._onTouchMove),this.nativeDraggable&&(g(V,"drop",this),g(c,"dragstart",this._onDragStart)),this._offUpEvents(),b&&(P&&(b.preventDefault(),!d.dropBubble&&b.stopPropagation()),y&&y.parentNode&&y.parentNode.removeChild(y),A!==x&&"clone"===a.active.lastPullMode||z&&z.parentNode&&z.parentNode.removeChild(z),w&&(this.nativeDraggable&&g(w,"dragend",this),m(w),w.style["will-change"]="",h(w,this.options.ghostClass,!1),h(w,this.options.chosenClass,!1),k(this,A,"unchoose",w,A,J),A!==x?(K=q(w,d.draggable),K>=0&&(k(null,x,"add",w,A,J,K),k(this,A,"remove",w,A,J,K),k(null,x,"sort",w,A,J,K),k(this,A,"sort",w,A,J,K))):w.nextSibling!==B&&(K=q(w,d.draggable),K>=0&&(k(this,A,"update",w,A,J,K),k(this,A,"sort",w,A,J,K))),a.active&&(null!=K&&K!==-1||(K=J),k(this,A,"end",w,A,J,K),this.save()))),this._nulling()},_nulling:function(){A=w=x=y=B=z=C=D=E=N=O=P=K=G=H=M=L=a.active=null,da.forEach(function(a){a.checked=!0}),da.length=0},handleEvent:function(a){switch(a.type){case"drop":case"dragend":this._onDrop(a);break;case"dragover":case"dragenter":w&&(this._onDragOver(a),e(a));break;case"selectstart":a.preventDefault()}},toArray:function(){for(var a,b=[],d=this.el.children,e=0,f=d.length,g=this.options;e=0;i--){var currentTextArea=textAreaList[i];var wideAreaWrapper=document.createElement('div'),wideAreaIcons=document.createElement('div'),fullscreenIcon=document.createElement('a');wideAreaWrapper.className='widearea-wrapper';wideAreaIcons.className='widearea-icons';fullscreenIcon.className='widearea-icon fullscreen';fullscreenIcon.title=this._options.fullScreenIconLabel;fullscreenIcon.href='javascript:void(0);';fullscreenIcon.draggable=false;fullscreenIcon.onclick=fullscreenIconClickHandler;currentTextArea.className=(currentTextArea.className+" widearea").replace(/^\s+|\s+$/g,"");currentTextArea.setAttribute("data-widearea-id",this._wideAreaId);wideAreaIcons.setAttribute("id","widearea-"+this._wideAreaId);if(_getFromStorage.call(this,this._wideAreaId)){currentTextArea.value=_getFromStorage.call(this,this._wideAreaId);}
var onTextChanged=function(){_saveToStorage.call(self,this.getAttribute('data-widearea-id'),this.value);};if(currentTextArea.addEventListener){currentTextArea.addEventListener('input',onTextChanged,false);}else if(currentTextArea.attachEvent){currentTextArea.attachEvent('onpropertychange',onTextChanged);}
++this._wideAreaId;currentTextArea.parentNode.insertBefore(wideAreaWrapper,currentTextArea);wideAreaWrapper.appendChild(currentTextArea);wideAreaIcons.appendChild(fullscreenIcon);wideAreaWrapper.appendChild(wideAreaIcons);this._textareas.push(currentTextArea);}}
function _enableFullScreen(link){var self=this;var wideAreaId=parseInt(link.parentNode.id.replace(/widearea\-/,""));var targetTextarea=document.querySelector("textarea[data-widearea-id='"+wideAreaId+"']");var currentTextArea=targetTextarea.cloneNode();currentTextArea.className=('widearea-fullscreen '+targetTextarea.className).replace(/^\s+|\s+$/g,"");targetTextarea.className=('widearea-fullscreened '+targetTextarea.className).replace(/^\s+|\s+$/g,"");var controlPanel=document.createElement('div');controlPanel.className='widearea-controlPanel';var closeIcon=document.createElement('a');closeIcon.href='javascript:void(0);';closeIcon.className='widearea-icon close';closeIcon.title=this._options.closeIconLabel;closeIcon.onclick=function(){_disableFullScreen.call(self);};closeIcon.draggable=false;var changeThemeIcon=document.createElement('a');changeThemeIcon.href='javascript:void(0);';changeThemeIcon.className='widearea-icon changeTheme';changeThemeIcon.title=this._options.changeThemeIconLabel;changeThemeIcon.onclick=function(){_toggleColorScheme.call(self);};changeThemeIcon.draggable=false;controlPanel.appendChild(closeIcon);controlPanel.appendChild(changeThemeIcon);var overlayLayer=document.createElement('div');overlayLayer.className='widearea-overlayLayer '+this._options.defaultColorScheme;var markdown=document.createElement('div');markdown.className='markdown';overlayLayer.appendChild(currentTextArea);overlayLayer.appendChild(controlPanel);overlayLayer.appendChild(markdown);jQuery(currentTextArea).afterselect(function(){var totaltip=jQuery('.totaltip').hide();totaltip.first().css({top:stacks.totalMousePos.y+15,left:stacks.totalMousePos.x-15}).fadeIn('fast');jQuery("textarea,input").one("mousedown keydown scroll",function(){totaltip.removeAttr('style');});jQuery(document).one("scroll",function(event){totaltip.removeAttr('style');});});document.body.appendChild(overlayLayer);currentTextArea.focus();currentTextArea.value=targetTextarea.value;jQuery(currentTextArea).markdown({target_form:".markdown"});jQuery("body>.totalbar").hide().addClass("fullscreen").fadeIn();var onTextChanged=function(){_saveToStorage.call(self,this.getAttribute('data-widearea-id'),this.value);$(currentTextArea).markdown({target_form:".markdown"});};if(currentTextArea.addEventListener){currentTextArea.addEventListener('input',onTextChanged,false);}else if(currentTextArea.attachEvent){currentTextArea.attachEvent('onpropertychange',onTextChanged);}
jQuery('.totalbar .button,#totaltip').click(function(){$(currentTextArea).delay(200).markdown({target_form:".markdown"});});this._onKeyDown=function(e){if(e.keyCode===27&&self._options.exitOnEsc){_disableFullScreen.call(self);}
if(e.keyCode==9){e.preventDefault();var selectionStart=currentTextArea.selectionStart;currentTextArea.value=currentTextArea.value.substring(0,selectionStart)+"\t"+currentTextArea.value.substring(currentTextArea.selectionEnd);currentTextArea.selectionEnd=selectionStart+1;}};if(window.addEventListener){window.addEventListener('keydown',self._onKeyDown,true);}else if(document.attachEvent){document.attachEvent('onkeydown',self._onKeyDown);}}
function _toggleColorScheme(){var overlayLayer=document.querySelector(".widearea-overlayLayer");if(/dark/gi.test(overlayLayer.className)){overlayLayer.className=overlayLayer.className.replace('dark','light');}else{overlayLayer.className=overlayLayer.className.replace('light','dark');}
jQuery("body>.totalbar.fullscreen").toggleClass("dark");}
function _disableFullScreen(){var smallTextArea=document.querySelector("textarea.widearea-fullscreened");var overlayLayer=document.querySelector(".widearea-overlayLayer");var fullscreenTextArea=overlayLayer.querySelector("textarea");jQuery("body>.totalbar").removeClass("fullscreen").hide();smallTextArea.focus();smallTextArea.value=fullscreenTextArea.value;smallTextArea.className=smallTextArea.className.replace(/widearea-fullscreened/gi,"").replace(/^\s+|\s+$/g,"");overlayLayer.parentNode.removeChild(overlayLayer);if(window.removeEventListener){window.removeEventListener('keydown',this._onKeyDown,true);}else if(document.detachEvent){document.detachEvent('onkeydown',this._onKeyDown);}}
function _mergeOptions(obj1,obj2){var obj3={},attrname;for(attrname in obj1){obj3[attrname]=obj1[attrname];}
for(attrname in obj2){obj3[attrname]=obj2[attrname];}
return obj3;}
var wideArea=function(selector){if(typeof(selector)==='string'){var targetElement=document.querySelector(selector);if(targetElement){return new WideArea(targetElement);}else{throw new Error('There is no element with given selector.');}}else{return new WideArea(document.body);}};wideArea.version=VERSION;wideArea.fn=WideArea.prototype={clone:function(){return new WideArea(this);},setOption:function(option,value){this._options[option]=value;return this;},setOptions:function(options){this._options=_mergeOptions(this._options,options);return this;},clearData:function(value){_clearStorage.call(this,value);return this;}};exports.wideArea=wideArea;return wideArea;}));
//
// dropzone
//
"use strict";function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&_setPrototypeOf(e,t)}function _setPrototypeOf(e,t){return(_setPrototypeOf=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function _createSuper(i){var r=_isNativeReflectConstruct();return function(){var e,t=_getPrototypeOf(i);if(r){var n=_getPrototypeOf(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return _possibleConstructorReturn(this,e)}}function _possibleConstructorReturn(e,t){return!t||"object"!==_typeof(t)&&"function"!=typeof t?_assertThisInitialized(e):t}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(e){return!1}}function _getPrototypeOf(e){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function _createForOfIteratorHelper(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=_unsupportedIterableToArray(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,r=function(){};return{s:r,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,l=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){l=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw o}}}}function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n '),this.element.appendChild(e));var r=e.getElementsByTagName("span")[0];return r&&(null!=r.textContent?r.textContent=this.options.dictFallbackMessage:null!=r.innerText&&(r.innerText=this.options.dictFallbackMessage)),this.element.appendChild(this.getFallbackForm())},resize:function(e,t,n,i){var r={srcX:0,srcY:0,srcWidth:e.width,srcHeight:e.height},o=e.width/e.height;null==t&&null==n?(t=r.srcWidth,n=r.srcHeight):null==t?t=n*o:null==n&&(n=t/o);var a=(t=Math.min(t,r.srcWidth))/(n=Math.min(n,r.srcHeight));if(r.srcWidth>t||r.srcHeight>n)if("crop"===i)a\n \n \n
\n
\n \n
\n Check \n \n \n \n \n
\n \n
\n Error \n \n \n \n \n \n \n
\n',drop:function(){return this.element.classList.remove("dz-drag-hover")},dragstart:function(){},dragend:function(){return this.element.classList.remove("dz-drag-hover")},dragenter:function(){return this.element.classList.add("dz-drag-hover")},dragover:function(){return this.element.classList.add("dz-drag-hover")},dragleave:function(){return this.element.classList.remove("dz-drag-hover")},paste:function(){},reset:function(){return this.element.classList.remove("dz-started")},addedfile:function(t){var n=this;if(this.element===this.previewsContainer&&this.element.classList.add("dz-started"),this.previewsContainer){t.previewElement=b.createElement(this.options.previewTemplate.trim()),t.previewTemplate=t.previewElement,this.previewsContainer.appendChild(t.previewElement);var e,i=_createForOfIteratorHelper(t.previewElement.querySelectorAll("[data-dz-name]"));try{for(i.s();!(e=i.n()).done;){var r=e.value;r.textContent=t.name}}catch(e){i.e(e)}finally{i.f()}var o,a=_createForOfIteratorHelper(t.previewElement.querySelectorAll("[data-dz-size]"));try{for(a.s();!(o=a.n()).done;)(r=o.value).innerHTML=this.filesize(t.size)}catch(e){a.e(e)}finally{a.f()}this.options.addRemoveLinks&&(t._removeLink=b.createElement(''.concat(this.options.dictRemoveFile," ")),t.previewElement.appendChild(t._removeLink));var l,s=function(e){return e.preventDefault(),e.stopPropagation(),t.status===b.UPLOADING?b.confirm(n.options.dictCancelUploadConfirmation,function(){return n.removeFile(t)}):n.options.dictRemoveFileConfirmation?b.confirm(n.options.dictRemoveFileConfirmation,function(){return n.removeFile(t)}):n.removeFile(t)},u=_createForOfIteratorHelper(t.previewElement.querySelectorAll("[data-dz-remove]"));try{for(u.s();!(l=u.n()).done;){l.value.addEventListener("click",s)}}catch(e){u.e(e)}finally{u.f()}}},removedfile:function(e){return null!=e.previewElement&&null!=e.previewElement.parentNode&&e.previewElement.parentNode.removeChild(e.previewElement),this._updateMaxFilesReachedClass()},thumbnail:function(e,t){if(e.previewElement){e.previewElement.classList.remove("dz-file-preview");var n,i=_createForOfIteratorHelper(e.previewElement.querySelectorAll("[data-dz-thumbnail]"));try{for(i.s();!(n=i.n()).done;){var r=n.value;r.alt=e.name,r.src=t}}catch(e){i.e(e)}finally{i.f()}return setTimeout(function(){return e.previewElement.classList.add("dz-image-preview")},1)}},error:function(e,t){if(e.previewElement){e.previewElement.classList.add("dz-error"),"string"!=typeof t&&t.error&&(t=t.error);var n,i=_createForOfIteratorHelper(e.previewElement.querySelectorAll("[data-dz-errormessage]"));try{for(i.s();!(n=i.n()).done;){n.value.textContent=t}}catch(e){i.e(e)}finally{i.f()}}},errormultiple:function(){},processing:function(e){if(e.previewElement&&(e.previewElement.classList.add("dz-processing"),e._removeLink))return e._removeLink.innerHTML=this.options.dictCancelUpload},processingmultiple:function(){},uploadprogress:function(e,t){if(e.previewElement){var n,i=_createForOfIteratorHelper(e.previewElement.querySelectorAll("[data-dz-uploadprogress]"));try{for(i.s();!(n=i.n()).done;){var r=n.value;"PROGRESS"===r.nodeName?r.value=t:r.style.width="".concat(t,"%")}}catch(e){i.e(e)}finally{i.f()}}},totaluploadprogress:function(){},sending:function(){},sendingmultiple:function(){},success:function(e){if(e.previewElement)return e.previewElement.classList.add("dz-success")},successmultiple:function(){},canceled:function(e){return this.emit("error",e,this.options.dictUploadCanceled)},canceledmultiple:function(){},complete:function(e){if(e._removeLink&&(e._removeLink.innerHTML=this.options.dictRemoveFile),e.previewElement)return e.previewElement.classList.add("dz-complete")},completemultiple:function(){},maxfilesexceeded:function(){},maxfilesreached:function(){},queuecomplete:function(){},addedfiles:function(){}},this.prototype._thumbnailQueue=[],this.prototype._processingThumbnail=!1}},{key:"extend",value:function(e){for(var t=arguments.length,n=new Array(1'.concat(this.options.dictDefaultMessage," "))),this.clickableElements.length){!function r(){return o.hiddenFileInput&&o.hiddenFileInput.parentNode.removeChild(o.hiddenFileInput),o.hiddenFileInput=document.createElement("input"),o.hiddenFileInput.setAttribute("type","file"),(null===o.options.maxFiles||1".concat(this.options.dictFallbackText,"
")),n+=' ');var i=b.createElement(n);return"FORM"!==this.element.tagName?(t=b.createElement(''))).appendChild(i):(this.element.setAttribute("enctype","multipart/form-data"),this.element.setAttribute("method",this.options.method)),null!=t?t:i}},{key:"getExistingFallback",value:function(){for(var e=function(e){var t,n=_createForOfIteratorHelper(e);try{for(n.s();!(t=n.n()).done;){var i=t.value;if(/(^| )fallback($| )/.test(i.className))return i}}catch(e){n.e(e)}finally{n.f()}},t=0,n=["div","form"];t".concat(t," ").concat(this.options.dictFileSizeUnits[n])}},{key:"_updateMaxFilesReachedClass",value:function(){return null!=this.options.maxFiles&&this.getAcceptedFiles().length>=this.options.maxFiles?(this.getAcceptedFiles().length===this.options.maxFiles&&this.emit("maxfilesreached",this.files),this.element.classList.add("dz-max-files-reached")):this.element.classList.remove("dz-max-files-reached")}},{key:"drop",value:function(e){if(e.dataTransfer){this.emit("drop",e);for(var t=[],n=0;n1024*this.options.maxFilesize*1024?t(this.options.dictFileTooBig.replace("{{filesize}}",Math.round(e.size/1024/10.24)/100).replace("{{maxFilesize}}",this.options.maxFilesize)):b.isValidFile(e,this.options.acceptedFiles)?null!=this.options.maxFiles&&this.getAcceptedFiles().length>=this.options.maxFiles?(t(this.options.dictMaxFilesExceeded.replace("{{maxFiles}}",this.options.maxFiles)),this.emit("maxfilesexceeded",e)):this.options.accept.call(this,e,t):t(this.options.dictInvalidFileType)}},{key:"addFile",value:function(t){var n=this;t.upload={uuid:b.uuidv4(),progress:0,total:t.size,bytesSent:0,filename:this._renameFile(t)},this.files.push(t),t.status=b.ADDED,this.emit("addedfile",t),this._enqueueThumbnail(t),this.accept(t,function(e){e?(t.accepted=!1,n._errorProcessing([t],e)):(t.accepted=!0,n.options.autoQueue&&n.enqueueFile(t)),n._updateMaxFilesReachedClass()})}},{key:"enqueueFiles",value:function(e){var t,n=_createForOfIteratorHelper(e);try{for(n.s();!(t=n.n()).done;){var i=t.value;this.enqueueFile(i)}}catch(e){n.e(e)}finally{n.f()}return null}},{key:"enqueueFile",value:function(e){var t=this;if(e.status!==b.ADDED||!0!==e.accepted)throw new Error("This file can't be queued because it has already been processed or was rejected.");if(e.status=b.QUEUED,this.options.autoProcessQueue)return setTimeout(function(){return t.processQueue()},0)}},{key:"_enqueueThumbnail",value:function(e){var t=this;if(this.options.createImageThumbnails&&e.type.match(/image.*/)&&e.size<=1024*this.options.maxThumbnailFilesize*1024)return this._thumbnailQueue.push(e),setTimeout(function(){return t._processThumbnailQueue()},0)}},{key:"_processThumbnailQueue",value:function(){var t=this;if(!this._processingThumbnail&&0!==this._thumbnailQueue.length){this._processingThumbnail=!0;var n=this._thumbnailQueue.shift();return this.createThumbnail(n,this.options.thumbnailWidth,this.options.thumbnailHeight,this.options.thumbnailMethod,!0,function(e){return t.emit("thumbnail",n,e),t._processingThumbnail=!1,t._processThumbnailQueue()})}}},{key:"removeFile",value:function(e){if(e.status===b.UPLOADING&&this.cancelUpload(e),this.files=without(this.files,e),this.emit("removedfile",e),0===this.files.length)return this.emit("reset")}},{key:"removeAllFiles",value:function(e){null==e&&(e=!1);var t,n=_createForOfIteratorHelper(this.files.slice());try{for(n.s();!(t=n.n()).done;){var i=t.value;i.status===b.UPLOADING&&!e||this.removeFile(i)}}catch(e){n.e(e)}finally{n.f()}return null}},{key:"resizeImage",value:function(r,e,t,n,o){var a=this;return this.createThumbnail(r,e,t,n,!0,function(e,t){if(null==t)return o(r);var n=a.options.resizeMimeType;null==n&&(n=r.type);var i=t.toDataURL(n,a.options.resizeQuality);return"image/jpeg"!==n&&"image/jpg"!==n||(i=ExifRestore.restore(r.dataURL,i)),o(b.dataURItoBlob(i))})}},{key:"createThumbnail",value:function(e,t,n,i,r,o){var a=this,l=new FileReader;l.onload=function(){e.dataURL=l.result,"image/svg+xml"!==e.type?a.createThumbnailFromUrl(e,t,n,i,r,o):null!=o&&o(l.result)},l.readAsDataURL(e)}},{key:"displayExistingFile",value:function(t,e,n,i,r){var o=this,a=!(4u.options.chunkSize),s[0].upload.totalChunkCount=Math.ceil(t.size/u.options.chunkSize)}if(s[0].upload.chunked){var r=s[0],o=e[0];r.upload.chunks=[];var i=function(){for(var e=0;void 0!==r.upload.chunks[e];)e++;if(!(e>=r.upload.totalChunkCount)){0;var t=e*u.options.chunkSize,n=Math.min(t+u.options.chunkSize,o.size),i={name:u._getParamName(0),data:o.webkitSlice?o.webkitSlice(t,n):o.slice(t,n),filename:r.upload.filename,chunkIndex:e};r.upload.chunks[e]={file:r,index:e,dataBlock:i,status:b.UPLOADING,progress:0,retries:0},u._uploadData(s,[i])}};if(r.upload.finishedChunkUpload=function(e){var t=!0;e.status=b.SUCCESS,e.dataBlock=null,e.xhr=null;for(var n=0;n>1}var s=l/t;return 0==s?1:s},drawImageIOSFix=function(e,t,n,i,r,o,a,l,s,u){var c=detectVerticalSquash(t);return e.drawImage(t,n,i,r,o,a,l,s,u/c)},ExifRestore=function(){function e(){_classCallCheck(this,e)}return _createClass(e,null,[{key:"initClass",value:function(){this.KEY_STR="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}},{key:"encode64",value:function(e){for(var t="",n=void 0,i=void 0,r="",o=void 0,a=void 0,l=void 0,s="",u=0;o=(n=e[u++])>>2,a=(3&n)<<4|(i=e[u++])>>4,l=(15&i)<<2|(r=e[u++])>>6,s=63&r,isNaN(i)?l=s=64:isNaN(r)&&(s=64),t=t+this.KEY_STR.charAt(o)+this.KEY_STR.charAt(a)+this.KEY_STR.charAt(l)+this.KEY_STR.charAt(s),n=i=r="",o=a=l=s="",ue.length)break}return n}},{key:"decode64",value:function(e){var t=void 0,n=void 0,i="",r=void 0,o=void 0,a="",l=0,s=[];for(/[^A-Za-z0-9\+\/\=]/g.exec(e)&&console.warn("There were invalid base64 characters in the input text.\nValid base64 characters are A-Z, a-z, 0-9, '+', '/',and '='\nExpect errors in decoding."),e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");t=this.KEY_STR.indexOf(e.charAt(l++))<<2|(r=this.KEY_STR.indexOf(e.charAt(l++)))>>4,n=(15&r)<<4|(o=this.KEY_STR.indexOf(e.charAt(l++)))>>2,i=(3&o)<<6|(a=this.KEY_STR.indexOf(e.charAt(l++))),s.push(t),64!==o&&s.push(n),64!==a&&s.push(i),t=n=i="",r=o=a="",l=u;){var C=a>>(i-=u);d+=t.charAt(C),a^=C<0&&(d+=t.charAt(a<>6,128|63&e)}).replace(/[\u0800-\uffff]/g,function(r){var e=r.charCodeAt(0);return String.fromCharCode(224|e>>12,128|e>>6&63,128|63&e)})},decode:function(r){return r.replace(/[\u00e0-\u00ef][\u0080-\u00bf][\u0080-\u00bf]/g,function(r){var e=(15&r.charCodeAt(0))<<12|(63&r.charCodeAt(1))<<6|63&r.charCodeAt(2);return String.fromCharCode(e)}).replace(/[\u00c0-\u00df][\u0080-\u00bf]/g,function(r){var e=(31&r.charCodeAt(0))<<6|63&r.charCodeAt(1);return String.fromCharCode(e)})}};a<256;){var f=String.fromCharCode(a);t+=f,u[a]=a,o[a]=n.indexOf(f),++a}var d=r.base64=function(r,e,n){return e?d[r](e,n):r?null:this};d.btoa=d.encode=function(r,t){return r=!1===d.raw||d.utf8encode||t?c.encode(r):r,(r=e(r,!1,u,n,8,6))+"====".slice(r.length%4||4)},d.atob=d.decode=function(r,n){var u=(r=String(r).split("=")).length;do{r[--u]=e(r[u],!0,o,t,6,8)}while(u>0);return r=r.join(""),!1===d.raw||d.utf8decode||n?c.decode(r):r}}(jQuery);
//
// moment-with-locales
//
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.moment=t()}(this,function(){"use strict";var e,t;function n(){return e.apply(null,arguments)}function s(e){return e instanceof Array||"[object Array]"===Object.prototype.toString.call(e)}function i(e){return null!=e&&"[object Object]"===Object.prototype.toString.call(e)}function r(e){return void 0===e}function a(e){return"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e)}function o(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)}function u(e,t){var n,s=[];for(n=0;n>>0,s=0;s0)for(n=0;n<_.length;n++)r(i=t[s=_[n]])||(e[s]=i);return e}var g=!1;function M(e){y(this,e),this._d=new Date(null!=e._d?e._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),!1===g&&(g=!0,n.updateOffset(this),g=!1)}function p(e){return e instanceof M||null!=e&&null!=e._isAMomentObject}function v(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function w(e){var t=+e,n=0;return 0!==t&&isFinite(t)&&(n=v(t)),n}function Y(e,t,n){var s,i=Math.min(e.length,t.length),r=Math.abs(e.length-t.length),a=0;for(s=0;s=0?n?"+":"":"-")+Math.pow(10,Math.max(0,i)).toString().substr(1)+s}var U=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,N=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,E={},G={};function V(e,t,n,s){var i=s;"string"==typeof s&&(i=function(){return this[s]()}),e&&(G[e]=i),t&&(G[t[0]]=function(){return F(i.apply(this,arguments),t[1],t[2])}),n&&(G[n]=function(){return this.localeData().ordinal(i.apply(this,arguments),e)})}function A(e,t){return e.isValid()?(t=I(t,e.localeData()),E[t]=E[t]||function(e){var t,n,s,i=e.match(U);for(t=0,n=i.length;t=0&&N.test(e);)e=e.replace(N,s),N.lastIndex=0,n-=1;return e}var z=/\d/,Z=/\d\d/,q=/\d{3}/,J=/\d{4}/,$=/[+-]?\d{6}/,Q=/\d\d?/,B=/\d\d\d\d?/,X=/\d\d\d\d\d\d?/,K=/\d{1,3}/,ee=/\d{1,4}/,te=/[+-]?\d{1,6}/,ne=/\d+/,se=/[+-]?\d+/,ie=/Z|[+-]\d\d:?\d\d/gi,re=/Z|[+-]\d\d(?::?\d\d)?/gi,ae=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,oe={};function ue(e,t,n){oe[e]=L(t)?t:function(e,s){return e&&n?n:t}}function de(e,t){return d(oe,e)?oe[e](t._strict,t._locale):new RegExp(le(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(e,t,n,s,i){return t||n||s||i})))}function le(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}var he={};function ce(e,t){var n,s=t;for("string"==typeof e&&(e=[e]),a(t)&&(s=function(e,n){n[t]=w(e)}),n=0;n68?1900:2e3)};var be,Te=Le("FullYear",!0);function Le(e,t){return function(s){return null!=s?(xe(this,e,s),n.updateOffset(this,t),this):Oe(this,e)}}function Oe(e,t){return e.isValid()?e._d["get"+(e._isUTC?"UTC":"")+t]():NaN}function xe(e,t,n){e.isValid()&&!isNaN(n)&&("FullYear"===t&&Se(e.year())&&1===e.month()&&29===e.date()?e._d["set"+(e._isUTC?"UTC":"")+t](n,e.month(),He(n,e.month())):e._d["set"+(e._isUTC?"UTC":"")+t](n))}function He(e,t){if(isNaN(e)||isNaN(t))return NaN;var n,s=(t%(n=12)+n)%n;return e+=(t-s)/12,1===s?Se(e)?29:28:31-s%7%2}be=Array.prototype.indexOf?Array.prototype.indexOf:function(e){var t;for(t=0;t=0){var n=Array.prototype.slice.call(arguments);n[0]=e+400,t=new Date(Date.UTC.apply(null,n)),isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e)}else t=new Date(Date.UTC.apply(null,arguments));return t}function Ge(e,t,n){var s=7+t-n;return-((7+Ee(e,0,s).getUTCDay()-t)%7)+s-1}function Ve(e,t,n,s,i){var r,a,o=1+7*(t-1)+(7+n-s)%7+Ge(e,s,i);return o<=0?a=De(r=e-1)+o:o>De(e)?(r=e+1,a=o-De(e)):(r=e,a=o),{year:r,dayOfYear:a}}function Ae(e,t,n){var s,i,r=Ge(e.year(),t,n),a=Math.floor((e.dayOfYear()-r-1)/7)+1;return a<1?s=a+Ie(i=e.year()-1,t,n):a>Ie(e.year(),t,n)?(s=a-Ie(e.year(),t,n),i=e.year()+1):(i=e.year(),s=a),{week:s,year:i}}function Ie(e,t,n){var s=Ge(e,t,n),i=Ge(e+1,t,n);return(De(e)-s+i)/7}V("w",["ww",2],"wo","week"),V("W",["WW",2],"Wo","isoWeek"),P("week","w"),P("isoWeek","W"),C("week",5),C("isoWeek",5),ue("w",Q),ue("ww",Q,Z),ue("W",Q),ue("WW",Q,Z),fe(["w","ww","W","WW"],function(e,t,n,s){t[s.substr(0,1)]=w(e)});function ze(e,t){return e.slice(t,7).concat(e.slice(0,t))}V("d",0,"do","day"),V("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)}),V("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)}),V("dddd",0,0,function(e){return this.localeData().weekdays(this,e)}),V("e",0,0,"weekday"),V("E",0,0,"isoWeekday"),P("day","d"),P("weekday","e"),P("isoWeekday","E"),C("day",11),C("weekday",11),C("isoWeekday",11),ue("d",Q),ue("e",Q),ue("E",Q),ue("dd",function(e,t){return t.weekdaysMinRegex(e)}),ue("ddd",function(e,t){return t.weekdaysShortRegex(e)}),ue("dddd",function(e,t){return t.weekdaysRegex(e)}),fe(["dd","ddd","dddd"],function(e,t,n,s){var i=n._locale.weekdaysParse(e,s,n._strict);null!=i?t.d=i:c(n).invalidWeekday=e}),fe(["d","e","E"],function(e,t,n,s){t[s]=w(e)});var Ze="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_");var qe="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_");var Je="Su_Mo_Tu_We_Th_Fr_Sa".split("_");var $e=ae;var Qe=ae;var Be=ae;function Xe(){function e(e,t){return t.length-e.length}var t,n,s,i,r,a=[],o=[],u=[],d=[];for(t=0;t<7;t++)n=h([2e3,1]).day(t),s=this.weekdaysMin(n,""),i=this.weekdaysShort(n,""),r=this.weekdays(n,""),a.push(s),o.push(i),u.push(r),d.push(s),d.push(i),d.push(r);for(a.sort(e),o.sort(e),u.sort(e),d.sort(e),t=0;t<7;t++)o[t]=le(o[t]),u[t]=le(u[t]),d[t]=le(d[t]);this._weekdaysRegex=new RegExp("^("+d.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+u.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+o.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+a.join("|")+")","i")}function Ke(){return this.hours()%12||12}function et(e,t){V(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}function tt(e,t){return t._meridiemParse}V("H",["HH",2],0,"hour"),V("h",["hh",2],0,Ke),V("k",["kk",2],0,function(){return this.hours()||24}),V("hmm",0,0,function(){return""+Ke.apply(this)+F(this.minutes(),2)}),V("hmmss",0,0,function(){return""+Ke.apply(this)+F(this.minutes(),2)+F(this.seconds(),2)}),V("Hmm",0,0,function(){return""+this.hours()+F(this.minutes(),2)}),V("Hmmss",0,0,function(){return""+this.hours()+F(this.minutes(),2)+F(this.seconds(),2)}),et("a",!0),et("A",!1),P("hour","h"),C("hour",13),ue("a",tt),ue("A",tt),ue("H",Q),ue("h",Q),ue("k",Q),ue("HH",Q,Z),ue("hh",Q,Z),ue("kk",Q,Z),ue("hmm",B),ue("hmmss",X),ue("Hmm",B),ue("Hmmss",X),ce(["H","HH"],Me),ce(["k","kk"],function(e,t,n){var s=w(e);t[Me]=24===s?0:s}),ce(["a","A"],function(e,t,n){n._isPm=n._locale.isPM(e),n._meridiem=e}),ce(["h","hh"],function(e,t,n){t[Me]=w(e),c(n).bigHour=!0}),ce("hmm",function(e,t,n){var s=e.length-2;t[Me]=w(e.substr(0,s)),t[pe]=w(e.substr(s)),c(n).bigHour=!0}),ce("hmmss",function(e,t,n){var s=e.length-4,i=e.length-2;t[Me]=w(e.substr(0,s)),t[pe]=w(e.substr(s,2)),t[ve]=w(e.substr(i)),c(n).bigHour=!0}),ce("Hmm",function(e,t,n){var s=e.length-2;t[Me]=w(e.substr(0,s)),t[pe]=w(e.substr(s))}),ce("Hmmss",function(e,t,n){var s=e.length-4,i=e.length-2;t[Me]=w(e.substr(0,s)),t[pe]=w(e.substr(s,2)),t[ve]=w(e.substr(i))});var nt,st=Le("Hours",!0),it={calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},longDateFormat:{LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},invalidDate:"Invalid date",ordinal:"%d",dayOfMonthOrdinalParse:/\d{1,2}/,relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},months:je,monthsShort:We,week:{dow:0,doy:6},weekdays:Ze,weekdaysMin:Je,weekdaysShort:qe,meridiemParse:/[ap]\.?m?\.?/i},rt={},at={};function ot(e){return e?e.toLowerCase().replace("_","-"):e}function ut(e){var t=null;if(!rt[e]&&"undefined"!=typeof module&&module&&module.exports)try{t=nt._abbr,require("./locale/"+e),dt(t)}catch(e){}return rt[e]}function dt(e,t){var n;return e&&((n=r(t)?ht(e):lt(e,t))?nt=n:"undefined"!=typeof console&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),nt._abbr}function lt(e,t){if(null!==t){var n,s=it;if(t.abbr=e,null!=rt[e])T("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),s=rt[e]._config;else if(null!=t.parentLocale)if(null!=rt[t.parentLocale])s=rt[t.parentLocale]._config;else{if(null==(n=ut(t.parentLocale)))return at[t.parentLocale]||(at[t.parentLocale]=[]),at[t.parentLocale].push({name:e,config:t}),null;s=n._config}return rt[e]=new x(O(s,t)),at[e]&&at[e].forEach(function(e){lt(e.name,e.config)}),dt(e),rt[e]}return delete rt[e],null}function ht(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return nt;if(!s(e)){if(t=ut(e))return t;e=[e]}return function(e){for(var t,n,s,i,r=0;r0;){if(s=ut(i.slice(0,t).join("-")))return s;if(n&&n.length>=t&&Y(i,n,!0)>=t-1)break;t--}r++}return nt}(e)}function ct(e){var t,n=e._a;return n&&-2===c(e).overflow&&(t=n[ye]<0||n[ye]>11?ye:n[ge]<1||n[ge]>He(n[_e],n[ye])?ge:n[Me]<0||n[Me]>24||24===n[Me]&&(0!==n[pe]||0!==n[ve]||0!==n[we])?Me:n[pe]<0||n[pe]>59?pe:n[ve]<0||n[ve]>59?ve:n[we]<0||n[we]>999?we:-1,c(e)._overflowDayOfYear&&(t<_e||t>ge)&&(t=ge),c(e)._overflowWeeks&&-1===t&&(t=Ye),c(e)._overflowWeekday&&-1===t&&(t=ke),c(e).overflow=t),e}function ft(e,t,n){return null!=e?e:null!=t?t:n}function mt(e){var t,s,i,r,a,o=[];if(!e._d){for(i=function(e){var t=new Date(n.now());return e._useUTC?[t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()]:[t.getFullYear(),t.getMonth(),t.getDate()]}(e),e._w&&null==e._a[ge]&&null==e._a[ye]&&function(e){var t,n,s,i,r,a,o,u;if(null!=(t=e._w).GG||null!=t.W||null!=t.E)r=1,a=4,n=ft(t.GG,e._a[_e],Ae(Ot(),1,4).year),s=ft(t.W,1),((i=ft(t.E,1))<1||i>7)&&(u=!0);else{r=e._locale._week.dow,a=e._locale._week.doy;var d=Ae(Ot(),r,a);n=ft(t.gg,e._a[_e],d.year),s=ft(t.w,d.week),null!=t.d?((i=t.d)<0||i>6)&&(u=!0):null!=t.e?(i=t.e+r,(t.e<0||t.e>6)&&(u=!0)):i=r}s<1||s>Ie(n,r,a)?c(e)._overflowWeeks=!0:null!=u?c(e)._overflowWeekday=!0:(o=Ve(n,s,i,r,a),e._a[_e]=o.year,e._dayOfYear=o.dayOfYear)}(e),null!=e._dayOfYear&&(a=ft(e._a[_e],i[_e]),(e._dayOfYear>De(a)||0===e._dayOfYear)&&(c(e)._overflowDayOfYear=!0),s=Ee(a,0,e._dayOfYear),e._a[ye]=s.getUTCMonth(),e._a[ge]=s.getUTCDate()),t=0;t<3&&null==e._a[t];++t)e._a[t]=o[t]=i[t];for(;t<7;t++)e._a[t]=o[t]=null==e._a[t]?2===t?1:0:e._a[t];24===e._a[Me]&&0===e._a[pe]&&0===e._a[ve]&&0===e._a[we]&&(e._nextDay=!0,e._a[Me]=0),e._d=(e._useUTC?Ee:function(e,t,n,s,i,r,a){var o;return e<100&&e>=0?(o=new Date(e+400,t,n,s,i,r,a),isFinite(o.getFullYear())&&o.setFullYear(e)):o=new Date(e,t,n,s,i,r,a),o}).apply(null,o),r=e._useUTC?e._d.getUTCDay():e._d.getDay(),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[Me]=24),e._w&&void 0!==e._w.d&&e._w.d!==r&&(c(e).weekdayMismatch=!0)}}var _t=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,yt=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,gt=/Z|[+-]\d\d(?::?\d\d)?/,Mt=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/]],pt=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],vt=/^\/?Date\((\-?\d+)/i;function wt(e){var t,n,s,i,r,a,o=e._i,u=_t.exec(o)||yt.exec(o);if(u){for(c(e).iso=!0,t=0,n=Mt.length;t0&&c(e).unusedInput.push(a),o=o.slice(o.indexOf(s)+s.length),d+=s.length),G[r]?(s?c(e).empty=!1:c(e).unusedTokens.push(r),me(r,s,e)):e._strict&&!s&&c(e).unusedTokens.push(r);c(e).charsLeftOver=u-d,o.length>0&&c(e).unusedInput.push(o),e._a[Me]<=12&&!0===c(e).bigHour&&e._a[Me]>0&&(c(e).bigHour=void 0),c(e).parsedDateParts=e._a.slice(0),c(e).meridiem=e._meridiem,e._a[Me]=function(e,t,n){var s;if(null==n)return t;return null!=e.meridiemHour?e.meridiemHour(t,n):null!=e.isPM?((s=e.isPM(n))&&t<12&&(t+=12),s||12!==t||(t=0),t):t}(e._locale,e._a[Me],e._meridiem),mt(e),ct(e)}else St(e);else wt(e)}function Tt(e){var t=e._i,d=e._f;return e._locale=e._locale||ht(e._l),null===t||void 0===d&&""===t?m({nullInput:!0}):("string"==typeof t&&(e._i=t=e._locale.preparse(t)),p(t)?new M(ct(t)):(o(t)?e._d=t:s(d)?function(e){var t,n,s,i,r;if(0===e._f.length)return c(e).invalidFormat=!0,void(e._d=new Date(NaN));for(i=0;ithis?this:e:m()});function Pt(e,t){var n,i;if(1===t.length&&s(t[0])&&(t=t[0]),!t.length)return Ot();for(n=t[0],i=1;i=0?new Date(e+400,t,n)-an:new Date(e,t,n).valueOf()}function dn(e,t,n){return e<100&&e>=0?Date.UTC(e+400,t,n)-an:Date.UTC(e,t,n)}function ln(e,t){V(0,[e,e.length],0,t)}function hn(e,t,n,s,i){var r;return null==e?Ae(this,s,i).year:(t>(r=Ie(e,s,i))&&(t=r),function(e,t,n,s,i){var r=Ve(e,t,n,s,i),a=Ee(r.year,0,r.dayOfYear);return this.year(a.getUTCFullYear()),this.month(a.getUTCMonth()),this.date(a.getUTCDate()),this}.call(this,e,t,n,s,i))}V(0,["gg",2],0,function(){return this.weekYear()%100}),V(0,["GG",2],0,function(){return this.isoWeekYear()%100}),ln("gggg","weekYear"),ln("ggggg","weekYear"),ln("GGGG","isoWeekYear"),ln("GGGGG","isoWeekYear"),P("weekYear","gg"),P("isoWeekYear","GG"),C("weekYear",1),C("isoWeekYear",1),ue("G",se),ue("g",se),ue("GG",Q,Z),ue("gg",Q,Z),ue("GGGG",ee,J),ue("gggg",ee,J),ue("GGGGG",te,$),ue("ggggg",te,$),fe(["gggg","ggggg","GGGG","GGGGG"],function(e,t,n,s){t[s.substr(0,2)]=w(e)}),fe(["gg","GG"],function(e,t,s,i){t[i]=n.parseTwoDigitYear(e)}),V("Q",0,"Qo","quarter"),P("quarter","Q"),C("quarter",7),ue("Q",z),ce("Q",function(e,t){t[ye]=3*(w(e)-1)}),V("D",["DD",2],"Do","date"),P("date","D"),C("date",9),ue("D",Q),ue("DD",Q,Z),ue("Do",function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient}),ce(["D","DD"],ge),ce("Do",function(e,t){t[ge]=w(e.match(Q)[0])});var cn=Le("Date",!0);V("DDD",["DDDD",3],"DDDo","dayOfYear"),P("dayOfYear","DDD"),C("dayOfYear",4),ue("DDD",K),ue("DDDD",q),ce(["DDD","DDDD"],function(e,t,n){n._dayOfYear=w(e)}),V("m",["mm",2],0,"minute"),P("minute","m"),C("minute",14),ue("m",Q),ue("mm",Q,Z),ce(["m","mm"],pe);var fn=Le("Minutes",!1);V("s",["ss",2],0,"second"),P("second","s"),C("second",15),ue("s",Q),ue("ss",Q,Z),ce(["s","ss"],ve);var mn,_n=Le("Seconds",!1);for(V("S",0,0,function(){return~~(this.millisecond()/100)}),V(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),V(0,["SSS",3],0,"millisecond"),V(0,["SSSS",4],0,function(){return 10*this.millisecond()}),V(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),V(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),V(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),V(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),V(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),P("millisecond","ms"),C("millisecond",16),ue("S",K,z),ue("SS",K,Z),ue("SSS",K,q),mn="SSSS";mn.length<=9;mn+="S")ue(mn,ne);function yn(e,t){t[we]=w(1e3*("0."+e))}for(mn="S";mn.length<=9;mn+="S")ce(mn,yn);var gn=Le("Milliseconds",!1);V("z",0,0,"zoneAbbr"),V("zz",0,0,"zoneName");var Mn=M.prototype;function pn(e){return e}Mn.add=Qt,Mn.calendar=function(e,t){var s=e||Ot(),i=Et(s,this).startOf("day"),r=n.calendarFormat(this,i)||"sameElse",a=t&&(L(t[r])?t[r].call(this,s):t[r]);return this.format(a||this.localeData().calendar(r,this,Ot(s)))},Mn.clone=function(){return new M(this)},Mn.diff=function(e,t,n){var s,i,r;if(!this.isValid())return NaN;if(!(s=Et(e,this)).isValid())return NaN;switch(i=6e4*(s.utcOffset()-this.utcOffset()),t=j(t)){case"year":r=Xt(this,s)/12;break;case"month":r=Xt(this,s);break;case"quarter":r=Xt(this,s)/3;break;case"second":r=(this-s)/1e3;break;case"minute":r=(this-s)/6e4;break;case"hour":r=(this-s)/36e5;break;case"day":r=(this-s-i)/864e5;break;case"week":r=(this-s-i)/6048e5;break;default:r=this-s}return n?r:v(r)},Mn.endOf=function(e){var t;if(void 0===(e=j(e))||"millisecond"===e||!this.isValid())return this;var s=this._isUTC?dn:un;switch(e){case"year":t=s(this.year()+1,0,1)-1;break;case"quarter":t=s(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":t=s(this.year(),this.month()+1,1)-1;break;case"week":t=s(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":t=s(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":t=s(this.year(),this.month(),this.date()+1)-1;break;case"hour":t=this._d.valueOf(),t+=rn-on(t+(this._isUTC?0:this.utcOffset()*sn),rn)-1;break;case"minute":t=this._d.valueOf(),t+=sn-on(t,sn)-1;break;case"second":t=this._d.valueOf(),t+=nn-on(t,nn)-1}return this._d.setTime(t),n.updateOffset(this,!0),this},Mn.format=function(e){e||(e=this.isUtc()?n.defaultFormatUtc:n.defaultFormat);var t=A(this,e);return this.localeData().postformat(t)},Mn.from=function(e,t){return this.isValid()&&(p(e)&&e.isValid()||Ot(e).isValid())?zt({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},Mn.fromNow=function(e){return this.from(Ot(),e)},Mn.to=function(e,t){return this.isValid()&&(p(e)&&e.isValid()||Ot(e).isValid())?zt({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},Mn.toNow=function(e){return this.to(Ot(),e)},Mn.get=function(e){return L(this[e=j(e)])?this[e]():this},Mn.invalidAt=function(){return c(this).overflow},Mn.isAfter=function(e,t){var n=p(e)?e:Ot(e);return!(!this.isValid()||!n.isValid())&&("millisecond"===(t=j(t)||"millisecond")?this.valueOf()>n.valueOf():n.valueOf()9999?A(n,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):L(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this.valueOf()+60*this.utcOffset()*1e3).toISOString().replace("Z",A(n,"Z")):A(n,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")},Mn.inspect=function(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e="moment",t="";this.isLocal()||(e=0===this.utcOffset()?"moment.utc":"moment.parseZone",t="Z");var n="["+e+'("]',s=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",i=t+'[")]';return this.format(n+s+"-MM-DD[T]HH:mm:ss.SSS"+i)},Mn.toJSON=function(){return this.isValid()?this.toISOString():null},Mn.toString=function(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},Mn.unix=function(){return Math.floor(this.valueOf()/1e3)},Mn.valueOf=function(){return this._d.valueOf()-6e4*(this._offset||0)},Mn.creationData=function(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}},Mn.year=Te,Mn.isLeapYear=function(){return Se(this.year())},Mn.weekYear=function(e){return hn.call(this,e,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)},Mn.isoWeekYear=function(e){return hn.call(this,e,this.isoWeek(),this.isoWeekday(),1,4)},Mn.quarter=Mn.quarters=function(e){return null==e?Math.ceil((this.month()+1)/3):this.month(3*(e-1)+this.month()%3)},Mn.month=Ce,Mn.daysInMonth=function(){return He(this.year(),this.month())},Mn.week=Mn.weeks=function(e){var t=this.localeData().week(this);return null==e?t:this.add(7*(e-t),"d")},Mn.isoWeek=Mn.isoWeeks=function(e){var t=Ae(this,1,4).week;return null==e?t:this.add(7*(e-t),"d")},Mn.weeksInYear=function(){var e=this.localeData()._week;return Ie(this.year(),e.dow,e.doy)},Mn.isoWeeksInYear=function(){return Ie(this.year(),1,4)},Mn.date=cn,Mn.day=Mn.days=function(e){if(!this.isValid())return null!=e?this:NaN;var t=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=e?(e=function(e,t){return"string"!=typeof e?e:isNaN(e)?"number"==typeof(e=t.weekdaysParse(e))?e:null:parseInt(e,10)}(e,this.localeData()),this.add(e-t,"d")):t},Mn.weekday=function(e){if(!this.isValid())return null!=e?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return null==e?t:this.add(e-t,"d")},Mn.isoWeekday=function(e){if(!this.isValid())return null!=e?this:NaN;if(null!=e){var t=function(e,t){return"string"==typeof e?t.weekdaysParse(e)%7||7:isNaN(e)?null:e}(e,this.localeData());return this.day(this.day()%7?t:t-7)}return this.day()||7},Mn.dayOfYear=function(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==e?t:this.add(e-t,"d")},Mn.hour=Mn.hours=st,Mn.minute=Mn.minutes=fn,Mn.second=Mn.seconds=_n,Mn.millisecond=Mn.milliseconds=gn,Mn.utcOffset=function(e,t,s){var i,r=this._offset||0;if(!this.isValid())return null!=e?this:NaN;if(null!=e){if("string"==typeof e){if(null===(e=Nt(re,e)))return this}else Math.abs(e)<16&&!s&&(e*=60);return!this._isUTC&&t&&(i=Gt(this)),this._offset=e,this._isUTC=!0,null!=i&&this.add(i,"m"),r!==e&&(!t||this._changeInProgress?$t(this,zt(e-r,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,n.updateOffset(this,!0),this._changeInProgress=null)),this}return this._isUTC?r:Gt(this)},Mn.utc=function(e){return this.utcOffset(0,e)},Mn.local=function(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(Gt(this),"m")),this},Mn.parseZone=function(){if(null!=this._tzm)this.utcOffset(this._tzm,!1,!0);else if("string"==typeof this._i){var e=Nt(ie,this._i);null!=e?this.utcOffset(e):this.utcOffset(0,!0)}return this},Mn.hasAlignedHourOffset=function(e){return!!this.isValid()&&(e=e?Ot(e).utcOffset():0,(this.utcOffset()-e)%60==0)},Mn.isDST=function(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()},Mn.isLocal=function(){return!!this.isValid()&&!this._isUTC},Mn.isUtcOffset=function(){return!!this.isValid()&&this._isUTC},Mn.isUtc=Vt,Mn.isUTC=Vt,Mn.zoneAbbr=function(){return this._isUTC?"UTC":""},Mn.zoneName=function(){return this._isUTC?"Coordinated Universal Time":""},Mn.dates=D("dates accessor is deprecated. Use date instead.",cn),Mn.months=D("months accessor is deprecated. Use month instead",Ce),Mn.years=D("years accessor is deprecated. Use year instead",Te),Mn.zone=D("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",function(e,t){return null!=e?("string"!=typeof e&&(e=-e),this.utcOffset(e,t),this):-this.utcOffset()}),Mn.isDSTShifted=D("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",function(){if(!r(this._isDSTShifted))return this._isDSTShifted;var e={};if(y(e,this),(e=Tt(e))._a){var t=e._isUTC?h(e._a):Ot(e._a);this._isDSTShifted=this.isValid()&&Y(e._a,t.toArray())>0}else this._isDSTShifted=!1;return this._isDSTShifted});var vn=x.prototype;function wn(e,t,n,s){var i=ht(),r=h().set(s,t);return i[n](r,e)}function Yn(e,t,n){if(a(e)&&(t=e,e=void 0),e=e||"",null!=t)return wn(e,t,n,"month");var s,i=[];for(s=0;s<12;s++)i[s]=wn(e,s,n,"month");return i}function kn(e,t,n,s){"boolean"==typeof e?(a(t)&&(n=t,t=void 0),t=t||""):(n=t=e,e=!1,a(t)&&(n=t,t=void 0),t=t||"");var i,r=ht(),o=e?r._week.dow:0;if(null!=n)return wn(t,(n+o)%7,s,"day");var u=[];for(i=0;i<7;i++)u[i]=wn(t,(i+o)%7,s,"day");return u}vn.calendar=function(e,t,n){var s=this._calendar[e]||this._calendar.sameElse;return L(s)?s.call(t,n):s},vn.longDateFormat=function(e){var t=this._longDateFormat[e],n=this._longDateFormat[e.toUpperCase()];return t||!n?t:(this._longDateFormat[e]=n.replace(/MMMM|MM|DD|dddd/g,function(e){return e.slice(1)}),this._longDateFormat[e])},vn.invalidDate=function(){return this._invalidDate},vn.ordinal=function(e){return this._ordinal.replace("%d",e)},vn.preparse=pn,vn.postformat=pn,vn.relativeTime=function(e,t,n,s){var i=this._relativeTime[n];return L(i)?i(e,t,n,s):i.replace(/%d/i,e)},vn.pastFuture=function(e,t){var n=this._relativeTime[e>0?"future":"past"];return L(n)?n(t):n.replace(/%s/i,t)},vn.set=function(e){var t,n;for(n in e)L(t=e[n])?this[n]=t:this["_"+n]=t;this._config=e,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)},vn.months=function(e,t){return e?s(this._months)?this._months[e.month()]:this._months[(this._months.isFormat||Pe).test(t)?"format":"standalone"][e.month()]:s(this._months)?this._months:this._months.standalone},vn.monthsShort=function(e,t){return e?s(this._monthsShort)?this._monthsShort[e.month()]:this._monthsShort[Pe.test(t)?"format":"standalone"][e.month()]:s(this._monthsShort)?this._monthsShort:this._monthsShort.standalone},vn.monthsParse=function(e,t,n){var s,i,r;if(this._monthsParseExact)return function(e,t,n){var s,i,r,a=e.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],s=0;s<12;++s)r=h([2e3,s]),this._shortMonthsParse[s]=this.monthsShort(r,"").toLocaleLowerCase(),this._longMonthsParse[s]=this.months(r,"").toLocaleLowerCase();return n?"MMM"===t?-1!==(i=be.call(this._shortMonthsParse,a))?i:null:-1!==(i=be.call(this._longMonthsParse,a))?i:null:"MMM"===t?-1!==(i=be.call(this._shortMonthsParse,a))?i:-1!==(i=be.call(this._longMonthsParse,a))?i:null:-1!==(i=be.call(this._longMonthsParse,a))?i:-1!==(i=be.call(this._shortMonthsParse,a))?i:null}.call(this,e,t,n);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),s=0;s<12;s++){if(i=h([2e3,s]),n&&!this._longMonthsParse[s]&&(this._longMonthsParse[s]=new RegExp("^"+this.months(i,"").replace(".","")+"$","i"),this._shortMonthsParse[s]=new RegExp("^"+this.monthsShort(i,"").replace(".","")+"$","i")),n||this._monthsParse[s]||(r="^"+this.months(i,"")+"|^"+this.monthsShort(i,""),this._monthsParse[s]=new RegExp(r.replace(".",""),"i")),n&&"MMMM"===t&&this._longMonthsParse[s].test(e))return s;if(n&&"MMM"===t&&this._shortMonthsParse[s].test(e))return s;if(!n&&this._monthsParse[s].test(e))return s}},vn.monthsRegex=function(e){return this._monthsParseExact?(d(this,"_monthsRegex")||Ne.call(this),e?this._monthsStrictRegex:this._monthsRegex):(d(this,"_monthsRegex")||(this._monthsRegex=Ue),this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex)},vn.monthsShortRegex=function(e){return this._monthsParseExact?(d(this,"_monthsRegex")||Ne.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):(d(this,"_monthsShortRegex")||(this._monthsShortRegex=Fe),this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex)},vn.week=function(e){return Ae(e,this._week.dow,this._week.doy).week},vn.firstDayOfYear=function(){return this._week.doy},vn.firstDayOfWeek=function(){return this._week.dow},vn.weekdays=function(e,t){var n=s(this._weekdays)?this._weekdays:this._weekdays[e&&!0!==e&&this._weekdays.isFormat.test(t)?"format":"standalone"];return!0===e?ze(n,this._week.dow):e?n[e.day()]:n},vn.weekdaysMin=function(e){return!0===e?ze(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin},vn.weekdaysShort=function(e){return!0===e?ze(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort},vn.weekdaysParse=function(e,t,n){var s,i,r;if(this._weekdaysParseExact)return function(e,t,n){var s,i,r,a=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],s=0;s<7;++s)r=h([2e3,1]).day(s),this._minWeekdaysParse[s]=this.weekdaysMin(r,"").toLocaleLowerCase(),this._shortWeekdaysParse[s]=this.weekdaysShort(r,"").toLocaleLowerCase(),this._weekdaysParse[s]=this.weekdays(r,"").toLocaleLowerCase();return n?"dddd"===t?-1!==(i=be.call(this._weekdaysParse,a))?i:null:"ddd"===t?-1!==(i=be.call(this._shortWeekdaysParse,a))?i:null:-1!==(i=be.call(this._minWeekdaysParse,a))?i:null:"dddd"===t?-1!==(i=be.call(this._weekdaysParse,a))?i:-1!==(i=be.call(this._shortWeekdaysParse,a))?i:-1!==(i=be.call(this._minWeekdaysParse,a))?i:null:"ddd"===t?-1!==(i=be.call(this._shortWeekdaysParse,a))?i:-1!==(i=be.call(this._weekdaysParse,a))?i:-1!==(i=be.call(this._minWeekdaysParse,a))?i:null:-1!==(i=be.call(this._minWeekdaysParse,a))?i:-1!==(i=be.call(this._weekdaysParse,a))?i:-1!==(i=be.call(this._shortWeekdaysParse,a))?i:null}.call(this,e,t,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),s=0;s<7;s++){if(i=h([2e3,1]).day(s),n&&!this._fullWeekdaysParse[s]&&(this._fullWeekdaysParse[s]=new RegExp("^"+this.weekdays(i,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[s]=new RegExp("^"+this.weekdaysShort(i,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[s]=new RegExp("^"+this.weekdaysMin(i,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[s]||(r="^"+this.weekdays(i,"")+"|^"+this.weekdaysShort(i,"")+"|^"+this.weekdaysMin(i,""),this._weekdaysParse[s]=new RegExp(r.replace(".",""),"i")),n&&"dddd"===t&&this._fullWeekdaysParse[s].test(e))return s;if(n&&"ddd"===t&&this._shortWeekdaysParse[s].test(e))return s;if(n&&"dd"===t&&this._minWeekdaysParse[s].test(e))return s;if(!n&&this._weekdaysParse[s].test(e))return s}},vn.weekdaysRegex=function(e){return this._weekdaysParseExact?(d(this,"_weekdaysRegex")||Xe.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(d(this,"_weekdaysRegex")||(this._weekdaysRegex=$e),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)},vn.weekdaysShortRegex=function(e){return this._weekdaysParseExact?(d(this,"_weekdaysRegex")||Xe.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(d(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=Qe),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)},vn.weekdaysMinRegex=function(e){return this._weekdaysParseExact?(d(this,"_weekdaysRegex")||Xe.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(d(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=Be),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)},vn.isPM=function(e){return"p"===(e+"").toLowerCase().charAt(0)},vn.meridiem=function(e,t,n){return e>11?n?"pm":"PM":n?"am":"AM"},dt("en",{dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10;return e+(1===w(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")}}),n.lang=D("moment.lang is deprecated. Use moment.locale instead.",dt),n.langData=D("moment.langData is deprecated. Use moment.localeData instead.",ht);var Dn=Math.abs;function Sn(e,t,n,s){var i=zt(t,n);return e._milliseconds+=s*i._milliseconds,e._days+=s*i._days,e._months+=s*i._months,e._bubble()}function bn(e){return e<0?Math.floor(e):Math.ceil(e)}function Tn(e){return 4800*e/146097}function Ln(e){return 146097*e/4800}function On(e){return function(){return this.as(e)}}var xn=On("ms"),Hn=On("s"),Pn=On("m"),jn=On("h"),Wn=On("d"),Rn=On("w"),Cn=On("M"),Fn=On("Q"),Un=On("y");function Nn(e){return function(){return this.isValid()?this._data[e]:NaN}}var En=Nn("milliseconds"),Gn=Nn("seconds"),Vn=Nn("minutes"),An=Nn("hours"),In=Nn("days"),zn=Nn("months"),Zn=Nn("years");var qn=Math.round,Jn={ss:44,s:45,m:45,h:22,d:26,M:11};var $n=Math.abs;function Qn(e){return(e>0)-(e<0)||+e}function Bn(){if(!this.isValid())return this.localeData().invalidDate();var e,t,n=$n(this._milliseconds)/1e3,s=$n(this._days),i=$n(this._months);t=v((e=v(n/60))/60),n%=60,e%=60;var r=v(i/12),a=i%=12,o=s,u=t,d=e,l=n?n.toFixed(3).replace(/\.?0+$/,""):"",h=this.asSeconds();if(!h)return"P0D";var c=h<0?"-":"",f=Qn(this._months)!==Qn(h)?"-":"",m=Qn(this._days)!==Qn(h)?"-":"",_=Qn(this._milliseconds)!==Qn(h)?"-":"";return c+"P"+(r?f+r+"Y":"")+(a?f+a+"M":"")+(o?m+o+"D":"")+(u||d||l?"T":"")+(u?_+u+"H":"")+(d?_+d+"M":"")+(l?_+l+"S":"")}var Xn=Wt.prototype;return Xn.isValid=function(){return this._isValid},Xn.abs=function(){var e=this._data;return this._milliseconds=Dn(this._milliseconds),this._days=Dn(this._days),this._months=Dn(this._months),e.milliseconds=Dn(e.milliseconds),e.seconds=Dn(e.seconds),e.minutes=Dn(e.minutes),e.hours=Dn(e.hours),e.months=Dn(e.months),e.years=Dn(e.years),this},Xn.add=function(e,t){return Sn(this,e,t,1)},Xn.subtract=function(e,t){return Sn(this,e,t,-1)},Xn.as=function(e){if(!this.isValid())return NaN;var t,n,s=this._milliseconds;if("month"===(e=j(e))||"quarter"===e||"year"===e)switch(t=this._days+s/864e5,n=this._months+Tn(t),e){case"month":return n;case"quarter":return n/3;case"year":return n/12}else switch(t=this._days+Math.round(Ln(this._months)),e){case"week":return t/7+s/6048e5;case"day":return t+s/864e5;case"hour":return 24*t+s/36e5;case"minute":return 1440*t+s/6e4;case"second":return 86400*t+s/1e3;case"millisecond":return Math.floor(864e5*t)+s;default:throw new Error("Unknown unit "+e)}},Xn.asMilliseconds=xn,Xn.asSeconds=Hn,Xn.asMinutes=Pn,Xn.asHours=jn,Xn.asDays=Wn,Xn.asWeeks=Rn,Xn.asMonths=Cn,Xn.asQuarters=Fn,Xn.asYears=Un,Xn.valueOf=function(){return this.isValid()?this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*w(this._months/12):NaN},Xn._bubble=function(){var e,t,n,s,i,r=this._milliseconds,a=this._days,o=this._months,u=this._data;return r>=0&&a>=0&&o>=0||r<=0&&a<=0&&o<=0||(r+=864e5*bn(Ln(o)+a),a=0,o=0),u.milliseconds=r%1e3,e=v(r/1e3),u.seconds=e%60,t=v(e/60),u.minutes=t%60,n=v(t/60),u.hours=n%24,o+=i=v(Tn(a+=v(n/24))),a-=bn(Ln(i)),s=v(o/12),o%=12,u.days=a,u.months=o,u.years=s,this},Xn.clone=function(){return zt(this)},Xn.get=function(e){return e=j(e),this.isValid()?this[e+"s"]():NaN},Xn.milliseconds=En,Xn.seconds=Gn,Xn.minutes=Vn,Xn.hours=An,Xn.days=In,Xn.weeks=function(){return v(this.days()/7)},Xn.months=zn,Xn.years=Zn,Xn.humanize=function(e){if(!this.isValid())return this.localeData().invalidDate();var t=this.localeData(),n=function(e,t,n){var s=zt(e).abs(),i=qn(s.as("s")),r=qn(s.as("m")),a=qn(s.as("h")),o=qn(s.as("d")),u=qn(s.as("M")),d=qn(s.as("y")),l=i<=Jn.ss&&["s",i]||i0,l[4]=n,function(e,t,n,s,i){return i.relativeTime(t||1,!!n,e,s)}.apply(null,l)}(this,!e,t);return e&&(n=t.pastFuture(+this,n)),t.postformat(n)},Xn.toISOString=Bn,Xn.toString=Bn,Xn.toJSON=Bn,Xn.locale=Kt,Xn.localeData=tn,Xn.toIsoString=D("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Bn),Xn.lang=en,V("X",0,0,"unix"),V("x",0,0,"valueOf"),ue("x",se),ue("X",/[+-]?\d+(\.\d{1,3})?/),ce("X",function(e,t,n){n._d=new Date(1e3*parseFloat(e,10))}),ce("x",function(e,t,n){n._d=new Date(w(e))}),n.version="2.24.0",e=Ot,n.fn=Mn,n.min=function(){return Pt("isBefore",[].slice.call(arguments,0))},n.max=function(){return Pt("isAfter",[].slice.call(arguments,0))},n.now=function(){return Date.now?Date.now():+new Date},n.utc=h,n.unix=function(e){return Ot(1e3*e)},n.months=function(e,t){return Yn(e,t,"months")},n.isDate=o,n.locale=dt,n.invalid=m,n.duration=zt,n.isMoment=p,n.weekdays=function(e,t,n){return kn(e,t,n,"weekdays")},n.parseZone=function(){return Ot.apply(null,arguments).parseZone()},n.localeData=ht,n.isDuration=Rt,n.monthsShort=function(e,t){return Yn(e,t,"monthsShort")},n.weekdaysMin=function(e,t,n){return kn(e,t,n,"weekdaysMin")},n.defineLocale=lt,n.updateLocale=function(e,t){if(null!=t){var n,s,i=it;null!=(s=ut(e))&&(i=s._config),(n=new x(t=O(i,t))).parentLocale=rt[e],rt[e]=n,dt(e)}else null!=rt[e]&&(null!=rt[e].parentLocale?rt[e]=rt[e].parentLocale:null!=rt[e]&&delete rt[e]);return rt[e]},n.locales=function(){return S(rt)},n.weekdaysShort=function(e,t,n){return kn(e,t,n,"weekdaysShort")},n.normalizeUnits=j,n.relativeTimeRounding=function(e){return void 0===e?qn:"function"==typeof e&&(qn=e,!0)},n.relativeTimeThreshold=function(e,t){return void 0!==Jn[e]&&(void 0===t?Jn[e]:(Jn[e]=t,"s"===e&&(Jn.ss=t-1),!0))},n.calendarFormat=function(e,t){var n=e.diff(t,"days",!0);return n<-6?"sameElse":n<-1?"lastWeek":n<0?"lastDay":n<1?"sameDay":n<2?"nextDay":n<7?"nextWeek":"sameElse"},n.prototype=Mn,n.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},n}),function(e,t){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?t(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],t):t(e.moment)}(this,function(e){"use strict";return e.defineLocale("da",{months:"januar_februar_marts_april_maj_juni_juli_august_september_oktober_november_december".split("_"),monthsShort:"jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec".split("_"),weekdays:"søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag".split("_"),weekdaysShort:"søn_man_tir_ons_tor_fre_lør".split("_"),weekdaysMin:"sø_ma_ti_on_to_fr_lø".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd [d.] D. MMMM YYYY [kl.] HH:mm"},calendar:{sameDay:"[i dag kl.] LT",nextDay:"[i morgen kl.] LT",nextWeek:"pÃ¥ dddd [kl.] LT",lastDay:"[i gÃ¥r kl.] LT",lastWeek:"[i] dddd[s kl.] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"%s siden",s:"fÃ¥ sekunder",ss:"%d sekunder",m:"et minut",mm:"%d minutter",h:"en time",hh:"%d timer",d:"en dag",dd:"%d dage",M:"en mÃ¥ned",MM:"%d mÃ¥neder",y:"et Ã¥r",yy:"%d Ã¥r"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}),function(e,t){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?t(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],t):t(e.moment)}(this,function(e){"use strict";function t(e,t,n,s){var i={m:["eine Minute","einer Minute"],h:["eine Stunde","einer Stunde"],d:["ein Tag","einem Tag"],dd:[e+" Tage",e+" Tagen"],M:["ein Monat","einem Monat"],MM:[e+" Monate",e+" Monaten"],y:["ein Jahr","einem Jahr"],yy:[e+" Jahre",e+" Jahren"]};return t?i[n][0]:i[n][1]}return e.defineLocale("de",{months:"Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So._Mo._Di._Mi._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},calendar:{sameDay:"[heute um] LT [Uhr]",sameElse:"L",nextDay:"[morgen um] LT [Uhr]",nextWeek:"dddd [um] LT [Uhr]",lastDay:"[gestern um] LT [Uhr]",lastWeek:"[letzten] dddd [um] LT [Uhr]"},relativeTime:{future:"in %s",past:"vor %s",s:"ein paar Sekunden",ss:"%d Sekunden",m:t,mm:"%d Minuten",h:t,hh:"%d Stunden",d:t,dd:t,M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}),function(e,t){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?t(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],t):t(e.moment)}(this,function(e){"use strict";return e.defineLocale("fr",{months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),monthsParseExact:!0,weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"di_lu_ma_me_je_ve_sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Aujourd’hui à ] LT",nextDay:"[Demain à ] LT",nextWeek:"dddd [à ] LT",lastDay:"[Hier à ] LT",lastWeek:"dddd [dernier à ] LT",sameElse:"L"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",ss:"%d secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},dayOfMonthOrdinalParse:/\d{1,2}(er|)/,ordinal:function(e,t){switch(t){case"D":return e+(1===e?"er":"");default:case"M":case"Q":case"DDD":case"d":return e+(1===e?"er":"e");case"w":case"W":return e+(1===e?"re":"e")}},week:{dow:1,doy:4}})}),function(e,t){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?t(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],t):t(e.moment)}(this,function(e){"use strict";return e.defineLocale("it",{months:"gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre".split("_"),monthsShort:"gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic".split("_"),weekdays:"domenica_lunedì_martedì_mercoledì_giovedì_venerdì_sabato".split("_"),weekdaysShort:"dom_lun_mar_mer_gio_ven_sab".split("_"),weekdaysMin:"do_lu_ma_me_gi_ve_sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Oggi alle] LT",nextDay:"[Domani alle] LT",nextWeek:"dddd [alle] LT",lastDay:"[Ieri alle] LT",lastWeek:function(){switch(this.day()){case 0:return"[la scorsa] dddd [alle] LT";default:return"[lo scorso] dddd [alle] LT"}},sameElse:"L"},relativeTime:{future:function(e){return(/^[0-9].+$/.test(e)?"tra":"in")+" "+e},past:"%s fa",s:"alcuni secondi",ss:"%d secondi",m:"un minuto",mm:"%d minuti",h:"un'ora",hh:"%d ore",d:"un giorno",dd:"%d giorni",M:"un mese",MM:"%d mesi",y:"un anno",yy:"%d anni"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})}),function(e,t){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?t(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],t):t(e.moment)}(this,function(e){"use strict";var t="jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.".split("_"),n="jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec".split("_"),s=[/^jan/i,/^feb/i,/^maart|mrt.?$/i,/^apr/i,/^mei$/i,/^jun[i.]?$/i,/^jul[i.]?$/i,/^aug/i,/^sep/i,/^okt/i,/^nov/i,/^dec/i],i=/^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december|jan\.?|feb\.?|mrt\.?|apr\.?|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i;return e.defineLocale("nl",{months:"januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december".split("_"),monthsShort:function(e,s){return e?/-MMM-/.test(s)?n[e.month()]:t[e.month()]:t},monthsRegex:i,monthsShortRegex:i,monthsStrictRegex:/^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december)/i,monthsShortStrictRegex:/^(jan\.?|feb\.?|mrt\.?|apr\.?|mei|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i,monthsParse:s,longMonthsParse:s,shortMonthsParse:s,weekdays:"zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag".split("_"),weekdaysShort:"zo._ma._di._wo._do._vr._za.".split("_"),weekdaysMin:"zo_ma_di_wo_do_vr_za".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[vandaag om] LT",nextDay:"[morgen om] LT",nextWeek:"dddd [om] LT",lastDay:"[gisteren om] LT",lastWeek:"[afgelopen] dddd [om] LT",sameElse:"L"},relativeTime:{future:"over %s",past:"%s geleden",s:"een paar seconden",ss:"%d seconden",m:"één minuut",mm:"%d minuten",h:"één uur",hh:"%d uur",d:"één dag",dd:"%d dagen",M:"één maand",MM:"%d maanden",y:"één jaar",yy:"%d jaar"},dayOfMonthOrdinalParse:/\d{1,2}(ste|de)/,ordinal:function(e){return e+(1===e||8===e||e>=20?"ste":"de")},week:{dow:1,doy:4}})}),function(e,t){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?t(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],t):t(e.moment)}(this,function(e){"use strict";var t="ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.".split("_"),n="ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),s=[/^ene/i,/^feb/i,/^mar/i,/^abr/i,/^may/i,/^jun/i,/^jul/i,/^ago/i,/^sep/i,/^oct/i,/^nov/i,/^dic/i],i=/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i;return e.defineLocale("es",{months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:function(e,s){return e?/-MMM-/.test(s)?n[e.month()]:t[e.month()]:t},monthsRegex:i,monthsShortRegex:i,monthsStrictRegex:/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,monthsShortStrictRegex:/^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,monthsParse:s,longMonthsParse:s,shortMonthsParse:s,weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY H:mm",LLLL:"dddd, D [de] MMMM [de] YYYY H:mm"},calendar:{sameDay:function(){return"[hoy a la"+(1!==this.hours()?"s":"")+"] LT"},nextDay:function(){return"[mañana a la"+(1!==this.hours()?"s":"")+"] LT"},nextWeek:function(){return"dddd [a la"+(1!==this.hours()?"s":"")+"] LT"},lastDay:function(){return"[ayer a la"+(1!==this.hours()?"s":"")+"] LT"},lastWeek:function(){return"[el] dddd [pasado a la"+(1!==this.hours()?"s":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",ss:"%d segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un dÃa",dd:"%d dÃas",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})});
//
// markdown
//
(function($){$.fn.extend({markdown:function(options){var defaults={target_form:$(this).selector};options=$.extend(defaults,options);function markdownConvert(art_body){var md={options:{empty_mark:"\n"},vs:{},variable:{editbody:null,stack:{tag:[],text:[]},text:"",html:""},convert:{tags:{hr:{default_:function(){return" ";}},a:{default_:function(href,v){return''+v+' ';},title:function(href,v,title){return''+v+' ';},target_blank:function(href,v){return''+v+' ';}},img:{default_:function(src,alt){return' ';},title:function(src,alt,title){return' ';}},pre:{default_:function(lang,v){return''+v+' ';}},empty:{default_:function(){return md.options.empty_mark;}},th:{default_:function(v){return''+v+' ';},center:function(v){return''+v+' ';},left:function(v){return''+v+' ';},right:function(v){return''+v+' ';}},td:{default_:function(v){return''+v+' ';},center:function(v){return''+v+' ';},left:function(v){return''+v+' ';},right:function(v){return''+v+' ';}},notag:{default_:function(tag,v){return'<'+tag+'>'+v+''+tag+'>';}}},replacer:{strong:["__([^_]+)__","\\\*\\\*([^*]+)\\\*\\\*"],em:["_([^_]+)_","\\\*([^*]+)\\\*"],del:["~~([^~]+)~~"],code:["`([^`]+)`"]},push:function(tag,text){if(!md.convert.inStack(tag)){md.variable.stack.tag.push(tag);}
if(!md.variable.stack.text[tag]){md.variable.stack.text[tag]=[];}
if(typeof text!=='undefined'){md.variable.stack.text[tag].push(text);}
return this;},pushest:function(text){if(md.convert.inStack()){var maxi=md.variable.stack.tag.length-1;var tag=md.variable.stack.tag[maxi];return md.convert.push(tag,text);}
return this;},pop:function(called,arguments_){if(md.convert.inStack()){var tag=md.variable.stack.tag.pop(),text="",innerHtml="",args=(arguments_||[]);while(typeof(text=md.variable.stack.text[tag].shift())!=='undefined'){if(tag==="pre"&&args.length===0){args.push(text);continue;}
md.convert.text(md.convert.text()+text);if(tag==="pre"||tag==="blockquote"){md.convert.text(md.convert.text()+md.options.empty_mark);}}
if(tag==="blockquote"){md.convert.text(markdownConvert(md.convert.text()));}
if(typeof called==='undefined'){called='default_';}
if(args.length===0&&!md.convert.tags[tag]){args.push(tag);tag="notag";}
args.push(md.convert.text());innerHtml=md.convert.tags[tag][called].apply(this,args);$.each(md.convert.replacer,function(rep,regs){$(regs).each(function(i,exp){var regexp=new RegExp(exp,"g");innerHtml=innerHtml.replace(regexp,'<'+rep+'>$1'+rep+'>');});});if(!md.convert.inStack()){md.convert.html(innerHtml);}
md.convert.text("");return innerHtml;}
return this;},_string:function(variable,string){if(typeof string==='undefined'){return md.variable[variable];}else{md.variable[variable]=string;return this;}},text:function(text){return md.convert._string("text",text);},html:function(html){return md.convert._string("html",html);},inStack:function(tag){if(typeof tag==='undefined'){return(md.variable.stack.tag.length!==0)?true:false;}
if(tag==="h"&&md.convert.inStack()){var maxi=md.variable.stack.tag.length-1;if(md.variable.stack.tag[maxi].match(/^h[1-6]/)){return true;}}
return($.inArray(tag,md.variable.stack.tag)!==-1)?true:false;}},check:{init:function(){md.vs={};},valid:function(callmethod){if(''!==md.convert.html()){return false;}
if(md.convert.inStack()&&!md.convert.inStack(callmethod)){return false;}
return true;},_pre:function(i,v){return{"nowv":v,"prev":md.variable.editbody[i-1],"nexv":md.variable.editbody[i+1],"tag":"","args":false};},isset:function(v){return(md.options.empty_mark!==v&&""!==v)?true:false;},wrapper:function(callmethod,args){md.check.init();if(md.check.valid(callmethod)){md.vs=md.check._pre.apply(this,args);}else{return false;}
md.check.tags[callmethod].apply(this);if(typeof md.vs.nexv==='undefined'){while(md.convert.inStack()){md.convert.pushest(md.convert.pop());}}},tags:{h:function(args){if(null!==md.vs.nowv.match(/^#{1,6}\s*/)){var tag="h"+md.vs.nowv.match(/^#{1,6}/)[0].length;var text=md.vs.nowv.replace(/^#{1,6}\s*/,"");md.convert.push(tag,text).pop();}else if(md.check.isset(md.vs.nowv)&&md.vs.nexv){if(md.convert.inStack("h")){md.convert.pop();}
if(md.vs.nexv.match(/^=+$/)){md.convert.push("h1",md.vs.nowv);}
if(md.vs.nexv.match(/^\-+$/)){md.convert.push("h2",md.vs.nowv);}}else if(md.convert.inStack("h")){md.convert.pop();}},hr:function(){var checker=function(mark){if(md.vs.nowv.indexOf(mark)===0){var regexp=new RegExp(((mark==="*")?"\\"+mark:mark),"g");if(""===md.vs.nowv.replace(regexp,"")){md.convert.push("hr").pop();}}};checker("-");checker("*");checker("_");},empty:function(){if(""===md.vs.nowv||md.vs.nowv.match(/^!?\[.*\]:.*/)){md.convert.push("empty").pop();}},pre:function(){if(md.vs.nowv.indexOf("```")!==-1){if(!md.convert.inStack("pre")){md.convert.push("pre",md.vs.nowv.replace(/`/g,""));}
else{md.convert.pop();}}else if(md.convert.inStack("pre")){md.convert.pushest(md.vs.nowv);}},blockquote:function(args){var regexp=/^\s*(>|>)\s?/;if(md.vs.nowv.match(regexp)){md.vs.nowv=md.vs.nowv.replace(regexp,"");md.convert.push("blockquote",md.vs.nowv);}else if(!md.check.isset(md.vs.nowv)){if(typeof md.vs.nexv!=='undefined'&&md.check.isset(md.vs.nexv)){if(!md.vs.nexv.match(regexp)){md.convert.pop();}}}else if(md.convert.inStack("blockquote")){md.convert.pushest(md.vs.nowv);}},ol:function(){var nv=md.vs.nowv;var nn=md.vs.nexv;if(nv.match(/^(\s{0,7})?[0-9]+[.]\s/)){if(!md.convert.inStack("ol")){md.convert.push("ol");nv=nv.replace(/^\s+/g,"");}}
if(md.convert.inStack("ol")){if(nv.match(/^[0-9]+[.]\s/)||nv.match(/^[\*\+\-]\s/)){lipop();md.convert.push("li",nv.replace(/^\s{0,7}?[0-9]+[.]\s(.*)/,"$1").replace(/^[\*\+\-]\s(.*)/,"$1"));}else if(nv.match(/^\s+/)){nv=nv.replace(/^\s+/g,"");if(nv.match(/^[\*\+\-]\s/)){md.convert.pushest(nv);if(nn.match(/^[0-9]+[.]\s/)){lipop();}}else if(nv.match(/^.*/)){md.convert.pushest(nv);}else if(!md.check.isset(nv)){md.convert.pushest(nv);}}else if(!md.check.isset(nv)){if(!md.check.isset(nn)){md.convert.pushest(nv);return true;}
if(nn&&nn.match(/^\s+/)){if(!nn.match(/^\s{1,7}?[\*\+\-]\s/)){md.convert.pushest(nv);return true;}}else if(nn){if(nn.match(/^[0-9]+[.]\s/)){md.convert.pushest(nv);return true;}}
lipop();md.convert.pop();md.addP=false;}else{md.convert.pushest(nv);}}},ul:function(){var nv=md.vs.nowv;var nn=md.vs.nexv;if(nv.match(/^(\s{0,7})?[\*\+\-]\s/)){if(!md.convert.inStack("ul")){md.convert.push("ul");nv=nv.replace(/^\s+/g,"");}}
if(md.convert.inStack("ul")){if(nv.match(/^[0-9]+[.]\s/)||nv.match(/^[\*\+\-]\s/)){lipop();md.convert.push("li",nv.replace(/^\s{0,7}?[0-9]+[.]\s(.*)/,"$1").replace(/^[\*\+\-]\s(.*)/,"$1"));}else if(nv.match(/^\s+/)){nv=nv.replace(/^\s+/g,"");if(nv.match(/^[0-9]+[.]\s/)){md.convert.pushest(nv);if(nn.match(/^[\*\+\-]\s/)){lipop();}}else if(nv.match(/^.*/)){md.convert.pushest(nv);}else if(!md.check.isset(nv)){md.convert.pushest(nv);}}else if(!md.check.isset(nv)){if(!md.check.isset(nn)){md.convert.pushest(nv);return true;}
if(nn&&nn.match(/^\s+/)){if(!nn.match(/^\s{1,7}?[0-9]+[.]\s/)){md.convert.pushest(nv);return true;}}else if(nn){if(nn.match(/^[\*\+\-]\s/)){md.convert.pushest(nv);return true;}}
lipop();md.convert.pop();md.addP=false;}else{md.convert.pushest(nv);}}},table:function(){var nv=md.vs.nowv;var nn=md.vs.nexv;if(nn&&nv.match(/\|/)&&nn.match(/:?-+:?[\s+]?\|/)){if(!md.convert.inStack("table")){md.convert.push("table").push("thead").push("tr");var trs=nn.replace(/^\|(.*)\|$/,"$1").split("|");md.aligns=[];$(trs).each(function(i,v){var repv=v.replace(/^\s+|\s+$/g,"");if(repv.match(/^:.*:$/)){md.aligns[i]="center";}else if(repv.match(/^:/)){md.aligns[i]="left";}else if(repv.match(/:$/)){md.aligns[i]="right";}else{md.aligns[i]="default_";}});var ths=nv.replace(/^\|(.*)\|$/,"$1").split("|");$(ths).each(function(i,v){md.convert.pushest(md.convert.push("th",v.replace(/^\s+|\s+$/g,"")).pop(md.aligns[i]));});md.convert.pushest((md.convert.pop()));md.convert.pushest((md.convert.pop()));}}else if(nn&&nv.match(/\|/)){if(!md.convert.inStack("tbody")){md.convert.push("tbody");}else{md.convert.push("tr");var tds=nv.replace(/^\|(.*)\|$/,"$1").split("|");$(tds).each(function(i,v){md.convert.pushest(md.convert.push("td",v.replace(/^\s+|\s+$/g,"")).pop(md.aligns[i]));});md.convert.pushest((md.convert.pop()));}}else if(md.convert.inStack("table")){md.convert.pushest((md.convert.pop()));md.convert.pop();}},p:function(){if((!md.vs.nowv.match(/^\s*?)&&md.vs.nowv!=="\n")){if(!md.vs.nowv.match(/^\s*?)){if(!md.convert.inStack("p")){md.convert.push("p");}
var getTitle=function(src){var title=null;src=src.replace(/\\/g,"\\\\").replace(/\*/g,"\\*").replace(/\(/g,"\\(").replace(/\)/g,"\\)").replace(/\[/g,"\\[").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/\$/g,"\\$").replace(/\-/g,"\\-").replace(/\|/g,"\\|").replace(/\//g,"\\/");var matches=new RegExp("\\["+src+"\\]:","i");$.each(md.variable.editbody,function(i,v){if(v.match(matches)){if((uri=v.match(/\[.*\]:(.*)/))){uri=uri[1].replace(/^\s+/,"");src=uri.split(" ")[0];title=uri.match(/.*"(.*)"/);title=(title)?title[1]:null;}}});return[src,title];};var createtags=function(src,alt,title){if(null!==md.vs.nowv.match(/!/)){return md.convert.push("img").pop((title?"title":"default_"),[src,alt,title]);}
else{return md.convert.push("a").pop((title?"title":"default_"),[src,alt,title]);}};var alt,src,title_matches,title,a;while(null!==md.vs.nowv.match(/!?\[.*?\]\(.*?\)/)){var a_match=md.vs.nowv.match(/\[(.*?)\]\((.*?)\)/);var src_title=a_match[2].split(" ");title=src_title[1]&&src_title[1].replace(/"/g,"");a=createtags(src_title[0],a_match[1],title);md.vs.nowv=md.vs.nowv.replace(a_match[0],a);}
if(null!==md.vs.nowv.match(/!?\[.*?\]\[.*?\]/)){alt=md.vs.nowv.replace(/^.*?!?\[(.*?)\]\[.*?\].*/,"$1");src=md.vs.nowv.replace(/^.*?!?\[.*?\]\[(.*?)\].*/,"$1");title_matches=getTitle(src);src=title_matches[0];title=title_matches[1];a=createtags(src,alt,title);md.vs.nowv=md.vs.nowv.replace(/^(.*)?(!?\[.*?\]\[.*?\])(.*)?/,"$1"+a+"$3");}
if(null!==md.vs.nowv.match(/!?\[.*?\]/)){alt=md.vs.nowv.replace(/^.*?!?\[(.*?)\].*?/,"$1");src=alt;title_matches=getTitle(src);src=title_matches[0];title=title_matches[1];a=createtags(src,alt,title);md.vs.nowv=md.vs.nowv.replace(/^(.*)?!?\[(.*?)\](.*)?/,"$1"+a+"$3");}
md.vs.nowv=md.vs.nowv.replace(/(.*)!("!==convertedtext.substr(0,3)){md.convert.pushest(md.vs.nowv).pop();}}
if(typeof md.vs.nexv==='undefined'){md.convert.pushest(md.vs.nowv).pop();}else{md.convert.pushest(md.vs.nowv+' ');}}}},etc:function(){var innerHtml=md.vs.nowv;md.convert.html(innerHtml);}}}};var lipop=function(){var tag="li";if(md.convert.inStack(tag)){var textlength=getTextLength();var textlengthAddSpace=getTextLength(true);var converttext=getConvertText();if(textlength!==1&&textlength!==textlengthAddSpace){md.addP=true;}
md.convert.pop();var poped=markdownConvert(converttext);if(!md.addP){poped=poped.replace("","").replace("
","");}
md.convert.push(tag,poped);md.convert.pushest(md.convert.pop());}};var getConvertText=function(mode_length){var tag="li";var textlength=0;var converttext="";$(md.variable.stack.text[tag]).each(function(i,v){if(""!==v){textlength++;}
converttext+=v+md.options.empty_mark;});return((mode_length)?textlength:converttext);};var getTextLength=function(isset_){tag="li";return((isset_)?getConvertText(true):md.variable.stack.text[tag].length);};md.variable.editbody=art_body.split(/\n/);var md_format="";$.each(md.variable.editbody,function(){var args=arguments;$.each(md.check.tags,function(tagname){md.check.wrapper(tagname,args);});md_format+=md.convert.html();md.convert.html("");});return md_format;}
return this.each(function(i,textarea){var contents=($(textarea).val()||$(textarea).html()),markdown=markdownConvert.apply(this,[contents]);$(options.target_form).html(markdown);});}});})(jQuery);
//
// textrange
//
!function(t){"function"==typeof define&&define.amd?define(["jquery"],t):"object"==typeof exports?t(require("jquery")):t(jQuery)}(function(t){var e,n={get:function(t){return i[e].get.apply(this,[t])},set:function(t,n){var s,r=parseInt(t),o=parseInt(n);return void 0===t?r=0:t<0&&(r=this[0].value.length+r),void 0!==n&&(s=n>=0?r+o:this[0].value.length+o),i[e].set.apply(this,[r,s]),this},setcursor:function(t){return this.textrange("set",t,0)},replace:function(t){return i[e].replace.apply(this,[String(t)]),this},insert:function(t){return this.textrange("replace",t)}},i={xul:{get:function(t){var e={position:this[0].selectionStart,start:this[0].selectionStart,end:this[0].selectionEnd,length:this[0].selectionEnd-this[0].selectionStart,text:this.val().substring(this[0].selectionStart,this[0].selectionEnd)};return void 0===t?e:e[t]},set:function(t,e){void 0===e&&(e=this[0].value.length),this[0].selectionStart=t,this[0].selectionEnd=e},replace:function(t){var e=this[0].selectionStart,n=this[0].selectionEnd,i=this.val();this.val(i.substring(0,e)+t+i.substring(n,i.length)),this[0].selectionStart=e,this[0].selectionEnd=e+t.length}},msie:{get:function(t){var e=document.selection.createRange();if(void 0===e){var n={position:0,start:0,end:this.val().length,length:this.val().length,text:this.val()};return void 0===t?n:n[t]}var i=0,s=0,r=this[0].value.length,o=this[0].value.replace(/\r\n/g,"\n"),a=this[0].createTextRange(),l=this[0].createTextRange();a.moveToBookmark(e.getBookmark()),l.collapse(!1),-1===a.compareEndPoints("StartToEnd",l)?(i=-a.moveStart("character",-r),i+=o.slice(0,i).split("\n").length-1,-1===a.compareEndPoints("EndToEnd",l)?(s=-a.moveEnd("character",-r),s+=o.slice(0,s).split("\n").length-1):s=r):(i=r,s=r);n={position:i,start:i,end:s,length:r,text:e.text};return void 0===t?n:n[t]},set:function(t,e){var n=this[0].createTextRange();if(void 0!==n){void 0===e&&(e=this[0].value.length);var i=t-(this[0].value.slice(0,t).split("\r\n").length-1),s=e-(this[0].value.slice(0,e).split("\r\n").length-1);n.collapse(!0),n.moveEnd("character",s),n.moveStart("character",i),n.select()}},replace:function(t){document.selection.createRange().text=t}}};t.fn.extend({textrange:function(i){var s="get",r={};return void 0===this[0]?this:("string"==typeof i?s=i:"object"==typeof i&&(s=i.method||s,r=i),void 0===e&&(e="selectionStart"in this[0]?"xul":document.selection?"msie":"unknown"),"unknown"===e?this:(r.nofocus||document.activeElement===this[0]||this[0].focus(),"function"==typeof n[s]?n[s].apply(this,Array.prototype.slice.call(arguments,1)):void t.error("Method "+s+" does not exist in jQuery.textrange")))}})});
//
// jwlib-rwflexnav
//
;(function($){"use strict";var version='20140730.1100',debug=function(msg,obj){if(window.debug===true&&window.console&&console.log){console.log('[rwflexnav] '+msg);if(obj)console.log(obj);}};$.fn.divideNav=function(options){var opts=$.extend(true,{},$.fn.rwflexnav.defaults,options||{});var container=$(this);$('> li.'+opts.className.divider,container).remove();var items=$('> li',container);$('').addClass(opts.className.divider).insertBefore(items);$(' ').addClass(opts.className.divider).insertAfter(items.last());return $(container);};$.fn.hackRWFlexNav=function(options){var opts=$.extend(true,{},$.fn.rwflexnav.defaults,options||{});var container=$(this);$('> ul.'+opts.className.menu,container).first().removeClass(opts.className.dropdown).find('ul').removeClass(opts.className.menu);$('> ul.'+opts.className.menu,container).find('li').each(function(){if($(this).find('ul').length===0)$(this).removeClass(opts.className.hasDropdown);});return $(container);};$.fn.processRWFlexNav=function(options){var opts=$.extend(true,{},$.fn.rwflexnav.defaults,options||{});var container=$(this);$('li a header',container).parent().attr('href','javascript:void(0)').parent().addClass(opts.className.heading);$('li a label',container).unwrap();$('li a button',container).each(function(){var classes=$(this).attr('class');var text=$(this).text();$(this).parent().addClass(opts.className.button).addClass(classes).html(text).parent().addClass(opts.className.hasButton);});$('li a hr',container).unwrap().parent().addClass(opts.className.divider).html('');return $(container);};$.fn.rwflexnav=function(options){var opts=$.extend(true,{},$.fn.rwflexnav.defaults,options||{});return this.each(function(){if($('> ul.'+opts.className.menu,this).length===0){console.error('RWFlexNav Aborting! Unable to locate menu with class "'+opts.className.menu+'"');return false;}
var method=$.fn.rwflexnav[opts.scope],container=typeof method==='function'?method(opts,this):false;if(opts.hackNav)container.hackRWFlexNav(opts);container.processRWFlexNav(opts);if(opts.divide)$('> ul.'+opts.className.menu,container).divideNav(opts);debug('Processing Complete',container);return $(container);});};$.fn.rwflexnav.all=function(opts,container){return $(container);};$.fn.rwflexnav.top=function(opts,container){$('> ul.'+opts.className.menu,container).find('ul').remove();return $(container);};$.fn.rwflexnav.subnav=function(opts,container){var menu=$('> ul.'+opts.className.menu,container).first(),submenu=$('> ul.'+opts.className.menu+'> li:nth-child('+opts.subNavIndex+') > ul',container),classes=menu.attr('class');debug('Scope SubNav',submenu);if(submenu.length===0){console.error('RWFlexNav Error! No subnav found at index '+opts.subNavIndex);}
else{submenu.addClass(opts.className.menu).addClass(classes).insertAfter(menu);submenu.find('>li.js-generated').remove();menu.remove();}
return $(container);};$.fn.rwflexnav.active=function(opts,container){var menu=$('> ul.'+opts.className.menu,container).first(),submenu=$('> ul.'+opts.className.menu+' > li.'+opts.className.active+' > ul',container),classes=menu.attr('class');debug('Scope Active',submenu);if(submenu.length===0){console.error('RWFlexNav Error! No active subnav found with class "'+opts.className.active+'"');}
else{submenu.addClass(opts.className.menu).addClass(classes).insertAfter(menu);submenu.find('>li.js-generated').remove();menu.remove();}
return $(container);};$.fn.rwflexnav.defaults={scope:'all',hackNav:true,divide:false,subNavIndex:0,className:{menu:'menu',heading:'heading',divider:'divider',active:'active',dropdown:'dropdown',button:'button',hasButton:'has-form',hasDropdown:'has-dropdown'}};})(jQuery);
//
// vein
//
!function(e,t){"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define("vein",t):this.vein=t()}(0,function(){var e=function(){},t=function(e,t,n){var s,r,l=[],i=[],u=t[document.all?"rules":"cssRules"],o=e.replace(/\s/g,"");for(s=0,r=u.length;s ',this.rightArrow=i.rightArrow||' ',this.closeIcon=i.closeIcon||' ',this.minView=0,"minView"in i?this.minView=i.minView:"minView"in this.element.data()&&(this.minView=this.element.data("min-view")),this.minView=s.convertViewMode(this.minView),this.maxView=s.modes.length-1,"maxView"in i?this.maxView=i.maxView:"maxView"in this.element.data()&&(this.maxView=this.element.data("max-view")),this.maxView=s.convertViewMode(this.maxView),this.nonMilitaryTime=!1,"nonMilitaryTime"in i&&(this.nonMilitaryTime=i.nonMilitaryTime),this.startViewMode="month","startView"in i?this.startViewMode=i.startView:"startView"in this.element.data()&&(this.startViewMode=this.element.data("start-view")),this.startViewMode=s.convertViewMode(this.startViewMode),this.viewMode=this.startViewMode,"minView"in i||"maxView"in i||this.element.data("min-view")||this.element.data("max-view")||(this.pickTime=!1,"pickTime"in i&&(this.pickTime=i.pickTime),1==this.pickTime?(this.minView=0,this.maxView=4):(this.minView=2,this.maxView=4)),this.forceParse=!0,"forceParse"in i?this.forceParse=i.forceParse:"dateForceParse"in this.element.data()&&(this.forceParse=this.element.data("date-force-parse")),this.picker=t(s.template(this.leftArrow,this.rightArrow,this.closeIcon)).appendTo(this.isInline?this.element:this.appendTo).on({click:t.proxy(this.click,this),mousedown:t.proxy(this.mousedown,this)}),this.closeButton?this.picker.find("a.datepicker-close").show():this.picker.find("a.datepicker-close").hide(),this.isInline?this.picker.addClass("datepicker-inline"):this.picker.addClass("datepicker-dropdown dropdown-menu"),this.isRTL&&(this.picker.addClass("datepicker-rtl"),this.picker.find(".date-switch").each(function(){t(this).parent().prepend(t(this).siblings(".next")),t(this).parent().append(t(this).siblings(".prev"))}),this.picker.find(".prev, .next").toggleClass("prev next")),t(document).on("mousedown",function(e){n.isInput&&e.target===n.element[0]||0===t(e.target).closest(".datepicker.datepicker-inline, .datepicker.datepicker-dropdown").length&&n.hide()}),this.autoclose=!0,"autoclose"in i?this.autoclose=i.autoclose:"dateAutoclose"in this.element.data()&&(this.autoclose=this.element.data("date-autoclose")),this.keyboardNavigation=!0,"keyboardNavigation"in i?this.keyboardNavigation=i.keyboardNavigation:"dateKeyboardNavigation"in this.element.data()&&(this.keyboardNavigation=this.element.data("date-keyboard-navigation")),this.todayBtn=i.todayBtn||this.element.data("date-today-btn")||!1,this.todayHighlight=i.todayHighlight||this.element.data("date-today-highlight")||!1,this.calendarWeeks=!1,"calendarWeeks"in i?this.calendarWeeks=i.calendarWeeks:"dateCalendarWeeks"in this.element.data()&&(this.calendarWeeks=this.element.data("date-calendar-weeks")),this.calendarWeeks&&this.picker.find("tfoot th.today").attr("colspan",function(t,e){return parseInt(e)+1}),this.weekStart=(i.weekStart||this.element.data("date-weekstart")||a[this.language].weekStart||0)%7,this.weekEnd=(this.weekStart+6)%7,this.startDate=-1/0,this.endDate=1/0,this.daysOfWeekDisabled=[],this.datesDisabled=[],this.setStartDate(i.startDate||this.element.data("date-startdate")),this.setEndDate(i.endDate||this.element.data("date-enddate")),this.setDaysOfWeekDisabled(i.daysOfWeekDisabled||this.element.data("date-days-of-week-disabled")),this.setDatesDisabled(i.datesDisabled||this.element.data("dates-disabled")),null!=this.initialDate&&(this.date=this.viewDate=s.parseDate(this.initialDate,this.format,this.language),this.setValue()),this.fillDow(),this.fillMonths(),this.update(),this.showMode(),this.isInline&&this.show(),this._attachEvents()};i.prototype={constructor:i,_events:[],_attachEvents:function(){this._detachEvents(),this.isInput?this.keyboardNavigation?this._events=[[this.element,{focus:this.autoShow?t.proxy(this.show,this):function(){},keyup:t.proxy(this.update,this),keydown:t.proxy(this.keydown,this),click:this.element.attr("readonly")?t.proxy(this.show,this):function(){}}]]:this._events=[[this.element,{focus:this.autoShow?t.proxy(this.show,this):function(){}}]]:this.component&&this.hasInput?this._events=[[this.element.find("input"),{focus:this.autoShow?t.proxy(this.show,this):function(){},keyup:t.proxy(this.update,this),keydown:t.proxy(this.keydown,this)}],[this.component,{click:t.proxy(this.show,this)}]]:this.element.is("div")?this.isInline=!0:this._events=[[this.element,{click:t.proxy(this.show,this)}]],this.disableDblClickSelection&&(this._events[this._events.length]=[this.element,{dblclick:function(e){e.preventDefault(),e.stopPropagation(),t(this).blur()}}]);for(var e,i,a=0;a=t(window).width()&&(o=s.left+h-this.picker.width()),this.picker.css({top:r,left:o,zIndex:i})}},update:function(){var t,e=!1,i=this.isInput?this.element.val():this.element.data("date")||this.element.find("input").val();arguments&&arguments.length&&("string"==typeof arguments[0]||arguments[0]instanceof Date)?(t=arguments[0],e=!0):t=this.isInput?this.element.val():this.element.data("date")||this.element.find("input").val(),this.date=s.parseDate(t,this.format,this.language),e?this.setValue():""==i&&this.element.trigger({type:"changeDate",date:null}),this.datethis.endDate?this.viewDate=new Date(this.endDate.valueOf()):this.viewDate=new Date(this.date.valueOf()),this.fill()},fillDow:function(){var t=this.weekStart,e="";if(this.calendarWeeks){var i=' ';e+=i,this.picker.find(".datepicker-days thead tr:first-child").prepend(i)}for(;t'+a[this.language].daysMin[t++%7]+"";e+=" ",this.picker.find(".datepicker-days thead").append(e)},fillMonths:function(){for(var t="",e=0;e<12;)t+=''+a[this.language].monthsShort[e++]+" ";this.picker.find(".datepicker-months td").html(t)},fill:function(){if(null!=this.date&&null!=this.viewDate){var i=new Date(this.viewDate.valueOf()),n=i.getUTCFullYear(),h=i.getUTCMonth(),r=i.getUTCDate(),o=i.getUTCHours(),d=i.getUTCMinutes(),l=this.startDate!==-1/0?this.startDate.getUTCFullYear():-1/0,c=this.startDate!==-1/0?this.startDate.getUTCMonth():-1/0,u=this.endDate!==1/0?this.endDate.getUTCFullYear():1/0,p=this.endDate!==1/0?this.endDate.getUTCMonth():1/0,m=this.date&&e(this.date.getUTCFullYear(),this.date.getUTCMonth(),this.date.getUTCDate()).valueOf(),f=new Date;a[this.language].titleFormat||a.en.titleFormat;this.picker.find(".datepicker-days thead th:eq(1)").text(a[this.language].months[h]+" "+n),this.picker.find(".datepicker-hours thead th:eq(1)").text(r+" "+a[this.language].months[h]+" "+n),this.picker.find(".datepicker-minutes thead th:eq(1)").text(r+" "+a[this.language].months[h]+" "+n),this.picker.find("tfoot th.today").text(a[this.language].today).toggle(!1!==this.todayBtn),this.updateNavArrows(),this.fillMonths();var g=e(n,h-1,28,0,0,0,0),v=s.getDaysInMonth(g.getUTCFullYear(),g.getUTCMonth());g.setUTCDate(v),g.setUTCDate(v-(g.getUTCDay()-this.weekStart+7)%7);var D=new Date(g.valueOf());D.setUTCDate(D.getUTCDate()+42),D=D.valueOf();for(var y,w=[];g.valueOf()"),this.calendarWeeks)){var k=new Date(g.getUTCFullYear(),g.getUTCMonth(),g.getUTCDate()-g.getDay()+10-(this.weekStart&&this.weekStart%7<5&&7)),T=~~((k-new Date(k.getFullYear(),0,4))/864e5/7+1.5);w.push(''+T+" ")}y=" "+this.onRender(g)+" ",g.getUTCFullYear()n||g.getUTCFullYear()==n&&g.getUTCMonth()>h)&&(y+=" new"),this.todayHighlight&&g.getUTCFullYear()==f.getFullYear()&&g.getUTCMonth()==f.getMonth()&&g.getUTCDate()==f.getDate()&&(y+=" today"),m&&g.valueOf()==m&&(y+=" active"),(g.valueOf()this.endDate||-1!==t.inArray(g.getUTCDay(),this.daysOfWeekDisabled)||-1!==t.inArray(g.valueOf(),this.datesDisabled))&&(y+=" disabled"),w.push(''+g.getUTCDate()+" "),g.getUTCDay()==this.weekEnd&&w.push(""),g.setUTCDate(g.getUTCDate()+1)}this.picker.find(".datepicker-days tbody").empty().append(w.join("")),w=[];for(var M=0;M<24;M++){if(y="",(C=e(n,h,r,M)).valueOf()+36e5this.endDate?y+=" disabled":o==M&&(y+=" active"),this.nonMilitaryTime){U=0==(U=M%12)?12:U;var b="AM";M>=12&&M<=23&&(b="PM"),w.push(''+U+":00 "+b+" ")}else w.push(''+M+":00 ")}this.picker.find(".datepicker-hours td").html(w.join("")),w=[];for(M=0;M<60;M+=this.minuteStep){var C;if(y="",(C=e(n,h,r,o,M)).valueOf()this.endDate?y+=" disabled":Math.floor(d/this.minuteStep)==Math.floor(M/this.minuteStep)&&(y+=" active"),this.nonMilitaryTime){var U;U=0==(U=o%12)?12:U;b="AM";o>=12&&o<=23&&(b="PM"),w.push(''+U+":"+(M<10?"0"+M:M)+" "+b+" ")}else w.push(''+o+":"+(M<10?"0"+M:M)+" ")}this.picker.find(".datepicker-minutes td").html(w.join(""));var S=this.date&&this.date.getUTCFullYear(),x=this.picker.find(".datepicker-months").find("th:eq(1)").text(n).end().find("span").removeClass("active");S&&S==n&&x.eq(this.date.getUTCMonth()).addClass("active"),(nu)&&x.addClass("disabled"),n==l&&x.slice(0,c).addClass("disabled"),n==u&&x.slice(p+1).addClass("disabled"),w="",n=10*parseInt(n/10,10);var F=this.picker.find(".datepicker-years").find("th:eq(1)").text(n+"-"+(n+9)).end().find("td");n-=1;for(M=-1;M<11;M++)w+='u?" disabled":"")+'">'+n+" ",n+=1;F.html(w)}},updateNavArrows:function(){var t=new Date(this.viewDate),e=t.getUTCFullYear(),i=t.getUTCMonth(),a=t.getUTCDate(),s=t.getUTCHours();switch(this.viewMode){case 0:this.startDate!==-1/0&&e<=this.startDate.getUTCFullYear()&&i<=this.startDate.getUTCMonth()&&a<=this.startDate.getUTCDate()&&s<=this.startDate.getUTCHours()?this.picker.find(".prev").css({visibility:"hidden"}):this.picker.find(".prev").css({visibility:"visible"}),this.endDate!==1/0&&e>=this.endDate.getUTCFullYear()&&i>=this.endDate.getUTCMonth()&&a>=this.endDate.getUTCDate()&&s>=this.endDate.getUTCHours()?this.picker.find(".next").css({visibility:"hidden"}):this.picker.find(".next").css({visibility:"visible"});break;case 1:this.startDate!==-1/0&&e<=this.startDate.getUTCFullYear()&&i<=this.startDate.getUTCMonth()&&a<=this.startDate.getUTCDate()?this.picker.find(".prev").css({visibility:"hidden"}):this.picker.find(".prev").css({visibility:"visible"}),this.endDate!==1/0&&e>=this.endDate.getUTCFullYear()&&i>=this.endDate.getUTCMonth()&&a>=this.endDate.getUTCDate()?this.picker.find(".next").css({visibility:"hidden"}):this.picker.find(".next").css({visibility:"visible"});break;case 2:this.startDate!==-1/0&&e<=this.startDate.getUTCFullYear()&&i<=this.startDate.getUTCMonth()?this.picker.find(".prev").css({visibility:"hidden"}):this.picker.find(".prev").css({visibility:"visible"}),this.endDate!==1/0&&e>=this.endDate.getUTCFullYear()&&i>=this.endDate.getUTCMonth()?this.picker.find(".next").css({visibility:"hidden"}):this.picker.find(".next").css({visibility:"visible"});break;case 3:case 4:this.startDate!==-1/0&&e<=this.startDate.getUTCFullYear()?this.picker.find(".prev").css({visibility:"hidden"}):this.picker.find(".prev").css({visibility:"visible"}),this.endDate!==1/0&&e>=this.endDate.getUTCFullYear()?this.picker.find(".next").css({visibility:"hidden"}):this.picker.find(".next").css({visibility:"visible"})}},click:function(i){i.stopPropagation(),i.preventDefault(),(t(i.target).hasClass("datepicker-close")||t(i.target).parent().hasClass("datepicker-close"))&&this.hide();var a=t(i.target).closest("span, td, th");if(1==a.length){if(a.is(".disabled"))return void this.element.trigger({type:"outOfRange",date:this.viewDate,startDate:this.startDate,endDate:this.endDate});switch(a[0].nodeName.toLowerCase()){case"th":switch(a[0].className){case"date-switch":this.showMode(1);break;case"prev":case"next":var n=s.modes[this.viewMode].navStep*("prev"==a[0].className?-1:1);switch(this.viewMode){case 0:this.viewDate=this.moveHour(this.viewDate,n);break;case 1:this.viewDate=this.moveDate(this.viewDate,n);break;case 2:this.viewDate=this.moveMonth(this.viewDate,n);break;case 3:case 4:this.viewDate=this.moveYear(this.viewDate,n)}this.fill();break;case"today":var h=new Date;h=e(h.getFullYear(),h.getMonth(),h.getDate(),h.getHours(),h.getMinutes(),h.getSeconds()),this.viewMode=this.startViewMode,this.showMode(0),this._setDate(h)}break;case"span":if(!a.is(".disabled")){if(a.is(".month"))if(3===this.minView){var r=a.parent().find("span").index(a)||0,o=this.viewDate.getUTCFullYear(),d=1,l=this.viewDate.getUTCHours(),c=this.viewDate.getUTCMinutes(),u=this.viewDate.getUTCSeconds();this._setDate(e(o,r,d,l,c,u,0))}else{this.viewDate.setUTCDate(1);r=a.parent().find("span").index(a);this.viewDate.setUTCMonth(r),this.element.trigger({type:"changeMonth",date:this.viewDate})}else if(a.is(".year"))if(4===this.minView){o=parseInt(a.text(),10)||0,r=0,d=1,l=this.viewDate.getUTCHours(),c=this.viewDate.getUTCMinutes(),u=this.viewDate.getUTCSeconds();this._setDate(e(o,r,d,l,c,u,0))}else{this.viewDate.setUTCDate(1);o=parseInt(a.text(),10)||0;this.viewDate.setUTCFullYear(o),this.element.trigger({type:"changeYear",date:this.viewDate})}else if(a.is(".hour")){l=this.nonMilitaryTime?a.text().indexOf("AM")>=0?parseInt(a.text(),10)||0:parseInt(a.text(),10)+12||0:parseInt(a.text(),10)||0;o=this.viewDate.getUTCFullYear(),r=this.viewDate.getUTCMonth(),d=this.viewDate.getUTCDate(),c=this.viewDate.getUTCMinutes(),u=this.viewDate.getUTCSeconds();this._setDate(e(o,r,d,l,c,u,0))}else if(a.is(".minute")){c=parseInt(a.text().substr(a.text().indexOf(":")+1),10)||0,o=this.viewDate.getUTCFullYear(),r=this.viewDate.getUTCMonth(),d=this.viewDate.getUTCDate(),l=this.viewDate.getUTCHours(),u=this.viewDate.getUTCSeconds();this._setDate(e(o,r,d,l,c,u,0))}if(0!=this.viewMode){var p=this.viewMode;this.showMode(-1),this.fill(),p==this.viewMode&&this.autoclose&&this.hide()}else this.fill(),this.autoclose&&this.hide()}break;case"td":if(a.is(".day")&&!a.is(".disabled")){d=parseInt(a.text(),10)||1,o=this.viewDate.getUTCFullYear(),r=this.viewDate.getUTCMonth(),l=this.viewDate.getUTCHours(),c=this.viewDate.getUTCMinutes(),u=this.viewDate.getUTCSeconds();a.is(".old")?0===r?(r=11,o-=1):r-=1:a.is(".new")&&(11==r?(r=0,o+=1):r+=1),this._setDate(e(o,r,d,l,c,u,0))}p=this.viewMode;this.showMode(-1),this.fill(),p==this.viewMode&&this.autoclose&&this.hide()}}},_setDate:function(t,e){var i;e&&"date"!=e||(this.date=t),e&&"view"!=e||(this.viewDate=t),this.fill(),this.setValue(),this.element.trigger({type:"changeDate",date:this.date}),this.isInput?i=this.element:this.component&&(i=this.element.find("input")),i&&(i.change(),this.autoclose)},moveHour:function(t,e){if(!e)return t;var i=new Date(t.valueOf());return e=e>0?1:-1,i.setUTCHours(i.getUTCHours()+e),i},moveDate:function(t,e){if(!e)return t;var i=new Date(t.valueOf());return e=e>0?1:-1,i.setUTCDate(i.getUTCDate()+e),i},moveMonth:function(t,e){if(!e)return t;var i,a,s=new Date(t.valueOf()),n=s.getUTCDate(),h=s.getUTCMonth(),r=Math.abs(e);if(e=e>0?1:-1,1==r)a=-1==e?function(){return s.getUTCMonth()==h}:function(){return s.getUTCMonth()!=i},i=h+e,s.setUTCMonth(i),(i<0||i>11)&&(i=(i+12)%12);else{for(var o=0;o=this.startDate&&t<=this.endDate},keydown:function(t){if(!this.keyboardNavigation)return!0;if(this.picker.is(":not(:visible)"))27==t.keyCode&&this.show();else{var e,i,a,s,n=!1;switch(t.keyCode){case 27:this.hide(),t.preventDefault();break;case 37:case 39:if(!this.keyboardNavigation)break;e=37==t.keyCode?-1:1,t.ctrlKey?(i=this.moveYear(this.date,e),a=this.moveYear(this.viewDate,e)):t.shiftKey?(i=this.moveMonth(this.date,e),a=this.moveMonth(this.viewDate,e)):((i=new Date(this.date.valueOf())).setUTCDate(this.date.getUTCDate()+e),(a=new Date(this.viewDate.valueOf())).setUTCDate(this.viewDate.getUTCDate()+e)),this.dateWithinRange(i)&&(this.date=i,this.viewDate=a,this.setValue(),this.update(),t.preventDefault(),n=!0);break;case 38:case 40:if(!this.keyboardNavigation)break;e=38==t.keyCode?-1:1,t.ctrlKey?(i=this.moveYear(this.date,e),a=this.moveYear(this.viewDate,e)):t.shiftKey?(i=this.moveMonth(this.date,e),a=this.moveMonth(this.viewDate,e)):((i=new Date(this.date.valueOf())).setUTCDate(this.date.getUTCDate()+7*e),(a=new Date(this.viewDate.valueOf())).setUTCDate(this.viewDate.getUTCDate()+7*e)),this.dateWithinRange(i)&&(this.date=i,this.viewDate=a,this.setValue(),this.update(),t.preventDefault(),n=!0);break;case 13:this.hide(),t.preventDefault();break;case 9:this.hide()}if(n)this.element.trigger({type:"changeDate",date:this.date}),this.isInput?s=this.element:this.component&&(s=this.element.find("input")),s&&s.change()}},showMode:function(t){if(t){var e=Math.max(0,Math.min(s.modes.length-1,this.viewMode+t));e>=this.minView&&e<=this.maxView&&(this.viewMode=e)}this.picker.find(">div").hide().filter(".datepicker-"+s.modes[this.viewMode].clsName).css("display","block"),this.updateNavArrows()},changeViewDate:function(t){this.date=t,this.viewDate=t,this.fill()},reset:function(t){this._setDate(null,"date")}},t.fn.fdatepicker=function(e){var a=Array.apply(null,arguments);return a.shift(),this.each(function(){var s=t(this),n=s.data("datepicker"),h="object"==typeof e&&e;n||s.data("datepicker",n=new i(this,t.extend({},t.fn.fdatepicker.defaults,h))),"string"==typeof e&&"function"==typeof n[e]&&n[e].apply(n,a)})},t.fn.fdatepicker.defaults={onRender:function(t){return""}},t.fn.fdatepicker.Constructor=i;var a=t.fn.fdatepicker.dates={en:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],daysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sun"],daysMin:["Su","Mo","Tu","We","Th","Fr","Sa","Su"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],today:"Today",titleFormat:"MM yyyy"}},s={modes:[{clsName:"minutes",navFnc:"Hours",navStep:1},{clsName:"hours",navFnc:"Date",navStep:1},{clsName:"days",navFnc:"Month",navStep:1},{clsName:"months",navFnc:"FullYear",navStep:1},{clsName:"years",navFnc:"FullYear",navStep:10}],isLeapYear:function(t){return t%4==0&&t%100!=0||t%400==0},getDaysInMonth:function(t,e){return[31,s.isLeapYear(t)?29:28,31,30,31,30,31,31,30,31,30,31][e]},validParts:/hh?|ii?|ss?|dd?|mm?|MM?|yy(?:yy)?/g,nonpunctuation:/[^ -\/:-@\[\u3400-\u9fff-`{-~\t\n\r]+/g,parseFormat:function(t){var e=t.replace(this.validParts,"\0").split("\0"),i=t.match(this.validParts);if(!e||!e.length||!i||0===i.length)throw new Error("Invalid date format.");return this.formatText=t,{separators:e,parts:i}},parseDate:function(i,s,n){if(i instanceof Date)return new Date(i.valueOf()-6e4*i.getTimezoneOffset());if(/^\d{4}\-\d{1,2}\-\d{1,2}$/.test(i)&&(s=this.parseFormat("yyyy-mm-dd")),/^\d{4}\-\d{1,2}\-\d{1,2}[T ]\d{1,2}\:\d{1,2}$/.test(i)&&(s=this.parseFormat("yyyy-mm-dd hh:ii")),/^\d{4}\-\d{1,2}\-\d{1,2}[T ]\d{1,2}\:\d{1,2}\:\d{1,2}[Z]{0,1}$/.test(i)&&(s=this.parseFormat("yyyy-mm-dd hh:ii:ss")),/^[-+]\d+[dmwy]([\s,]+[-+]\d+[dmwy])*$/.test(i)){var h,r=/([-+]\d+)([dmwy])/,o=i.match(/([-+]\d+)([dmwy])/g);i=new Date;for(var d=0;d'+t+' '+e+" "},contTemplate:' ',footTemplate:' ',template:function(t,e,i){return''+s.headTemplate(t,e)+s.contTemplate+s.footTemplate+'
'+s.headTemplate(t,e)+s.contTemplate+s.footTemplate+'
'+s.headTemplate(t,e)+" "+s.footTemplate+'
'+s.headTemplate(t,e)+s.contTemplate+s.footTemplate+'
'+s.headTemplate(t,e)+s.contTemplate+s.footTemplate+'
'+i+" "}};t.fn.fdatepicker.DPGlobal=s}(window.jQuery),jQuery.fn.fdatepicker.dates.da={days:["Søndag","Mandag","Tirsdag","Onsdag","Torsdag","Fredag","Lørdag","Søndag"],daysShort:["Søn","Man","Tir","Ons","Tor","Fre","Lør","Søn"],daysMin:["Sø","Ma","Ti","On","To","Fr","Lø","Sø"],months:["Januar","Februar","Marts","April","Maj","Juni","Juli","August","September","Oktober","November","December"],monthsShort:["Jan","Feb","Mar","Apr","Maj","Jun","Jul","Aug","Sep","Okt","Nov","Dec"],today:"I Dag"},jQuery.fn.fdatepicker.dates.de={days:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag","Sonntag"],daysShort:["Son","Mon","Die","Mit","Don","Fre","Sam","Son"],daysMin:["So","Mo","Di","Mi","Do","Fr","Sa","So"],months:["Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"],monthsShort:["Jan","Feb","Mär","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],today:"Heute"},jQuery.fn.fdatepicker.dates.nl={days:["Zondag","Maandag","Dinsdag","Woensdag","Donderdag","Vrijdag","Zaterdag","Zondag"],daysShort:["Zo","Ma","Di","Wo","Do","Vr","Za","Zo"],daysMin:["Zo","Ma","Di","Wo","Do","Vr","Za","Zo"],months:["Januari","Februari","Maart","April","Mei","Juni","Juli","Augustus","September","Oktober","November","December"],monthsShort:["Jan","Feb","Mrt","Apr","Mei","Jun","Jul","Aug","Sep","Okt","Nov","Dec"],today:"Vandaag"},jQuery.fn.fdatepicker.dates.fr={days:["Dimanche","Lundi","Mardi","Mercredi","Jeudi","Vendredi","Samedi","Dimanche"],daysShort:["Dim","Lun","Mar","Mer","Jeu","Ven","Sam","Dim"],daysMin:["D","L","Ma","Me","J","V","S","D"],months:["Janvier","Février","Mars","Avril","Mai","Juin","Juillet","Août","Septembre","Octobre","Novembre","Décembre"],monthsShort:["Jan","Fev","Mar","Avr","Mai","Jui","Jul","Aou","Sep","Oct","Nov","Dec"],today:"Aujourd'hui",clear:"Effacer",weekStart:1,format:"dd/mm/yyyy"},jQuery.fn.fdatepicker.dates.it={days:["Domenica","Lunedi","Martedi","Mercoledi","Giovedi","Venerdi","Sabato","Domenica"],daysShort:["Dom","Lun","Mar","Mer","Gio","Ven","Sab","Dom"],daysMin:["Do","Lu","Ma","Me","Gi","Ve","Sa","Do"],months:["Gennaio","Febbraio","Marzo","Aprile","Maggio","Giugno","Luglio","Agosto","Settembre","Ottobre","Novembre","Dicembre"],monthsShort:["Gen","Feb","Mar","Apr","Mag","Giu","Lug","Ago","Set","Ott","Nov","Dic"],today:"Oggi"},jQuery.fn.fdatepicker.dates.es={days:["domingo","lunes","martes","miércoles","jueves","viernes","sábado","domingo"],daysShort:["dom","lun","mar","mié","jue","vie","sáb","dom"],daysMin:["do","lu","ma","mi","ju","vi","sa","do"],months:["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre"],monthsShort:["ene","feb","mar","abr","may","jun","jul","ago","sep","oct","nov","dic"],today:"hoy",weekStart:1,format:"dd/mm/yyyy"};
//
// awesomplete
//
!function(){var t=function(e,i){var s=this;t.count=(t.count||0)+1,this.count=t.count,this.isOpened=!1,this.input=n(e),this.input.setAttribute("autocomplete","off"),this.input.setAttribute("aria-owns","awesomplete_list_"+this.count),this.input.setAttribute("role","combobox"),this.options=i=i||{},function(t,e,i){for(var n in e){var s=e[n],r=t.input.getAttribute("data-"+n.toLowerCase());"number"==typeof s?t[n]=parseInt(r):!1===s?t[n]=null!==r:s instanceof Function?t[n]=null:t[n]=r,t[n]||0===t[n]||(t[n]=n in i?i[n]:s)}}(this,{minChars:2,maxItems:10,autoFirst:!1,data:t.DATA,filter:t.FILTER_CONTAINS,sort:!1!==i.sort&&t.SORT_BYLENGTH,container:t.CONTAINER,item:t.ITEM,replace:t.REPLACE,tabSelect:!1},i),this.index=-1,this.container=this.container(e),this.ul=n.create("ul",{hidden:"hidden",role:"listbox",id:"awesomplete_list_"+this.count,inside:this.container}),this.status=n.create("span",{className:"visually-hidden",role:"status","aria-live":"assertive","aria-atomic":!0,inside:this.container,textContent:0!=this.minChars?"Type "+this.minChars+" or more characters for results.":"Begin typing for results."}),this._events={input:{input:this.evaluate.bind(this),blur:this.close.bind(this,{reason:"blur"}),keydown:function(t){var e=t.keyCode;s.opened&&(13===e&&s.selected?(t.preventDefault(),s.select()):9===e&&s.selected&&s.tabSelect?s.select():27===e?s.close({reason:"esc"}):38!==e&&40!==e||(t.preventDefault(),s[38===e?"previous":"next"]()))}},form:{submit:this.close.bind(this,{reason:"submit"})},ul:{mousedown:function(t){t.preventDefault()},click:function(t){var e=t.target;if(e!==this){for(;e&&!/li/i.test(e.nodeName);)e=e.parentNode;e&&0===t.button&&(t.preventDefault(),s.select(e,t.target))}}}},n.bind(this.input,this._events.input),n.bind(this.input.form,this._events.form),n.bind(this.ul,this._events.ul),this.input.hasAttribute("list")?(this.list="#"+this.input.getAttribute("list"),this.input.removeAttribute("list")):this.list=this.input.getAttribute("data-list")||i.list||[],t.all.push(this)};function e(t){var e=Array.isArray(t)?{label:t[0],value:t[1]}:"object"==typeof t&&"label"in t&&"value"in t?t:{label:t,value:t};this.label=e.label||e.value,this.value=e.value}t.prototype={set list(t){if(Array.isArray(t))this._list=t;else if("string"==typeof t&&t.indexOf(",")>-1)this._list=t.split(/\s*,\s*/);else if((t=n(t))&&t.children){var e=[];i.apply(t.children).forEach(function(t){if(!t.disabled){var i=t.textContent.trim(),n=t.value||i,s=t.label||i;""!==n&&e.push({label:s,value:n})}}),this._list=e}document.activeElement===this.input&&this.evaluate()},get selected(){return this.index>-1},get opened(){return this.isOpened},close:function(t){this.opened&&(this.ul.setAttribute("hidden",""),this.isOpened=!1,this.index=-1,this.status.setAttribute("hidden",""),n.fire(this.input,"awesomplete-close",t||{}))},open:function(){this.ul.removeAttribute("hidden"),this.isOpened=!0,this.status.removeAttribute("hidden"),this.autoFirst&&-1===this.index&&this.goto(0),n.fire(this.input,"awesomplete-open")},destroy:function(){if(n.unbind(this.input,this._events.input),n.unbind(this.input.form,this._events.form),!this.options.container){var e=this.container.parentNode;e.insertBefore(this.input,this.container),e.removeChild(this.container)}this.input.removeAttribute("autocomplete"),this.input.removeAttribute("aria-autocomplete");var i=t.all.indexOf(this);-1!==i&&t.all.splice(i,1)},next:function(){var t=this.ul.children.length;this.goto(this.index-1&&e.length>0&&(e[t].setAttribute("aria-selected","true"),this.status.textContent=e[t].textContent+", list item "+(t+1)+" of "+e.length,this.input.setAttribute("aria-activedescendant",this.ul.id+"_item_"+this.index),this.ul.scrollTop=e[t].offsetTop-this.ul.clientHeight+e[t].clientHeight,n.fire(this.input,"awesomplete-highlight",{text:this.suggestions[this.index]}))},select:function(t,e){if(t?this.index=n.siblingIndex(t):t=this.ul.children[this.index],t){var i=this.suggestions[this.index];n.fire(this.input,"awesomplete-select",{text:i,origin:e||t})&&(this.replace(i),this.close({reason:"select"}),n.fire(this.input,"awesomplete-selectcomplete",{text:i}))}},evaluate:function(){var t=this,i=this.input.value;i.length>=this.minChars&&this._list&&this._list.length>0?(this.index=-1,this.ul.innerHTML="",this.suggestions=this._list.map(function(n){return new e(t.data(n,i))}).filter(function(e){return t.filter(e,i)}),!1!==this.sort&&(this.suggestions=this.suggestions.sort(this.sort)),this.suggestions=this.suggestions.slice(0,this.maxItems),this.suggestions.forEach(function(e,n){t.ul.appendChild(t.item(e,i,n))}),0===this.ul.children.length?(this.status.textContent="No results found",this.close({reason:"nomatches"})):(this.open(),this.status.textContent=this.ul.children.length+" results found")):(this.close({reason:"nomatches"}),this.status.textContent="No results found")}},t.all=[],t.FILTER_CONTAINS=function(t,e){return RegExp(n.regExpEscape(e.trim()),"i").test(t)},t.FILTER_STARTSWITH=function(t,e){return RegExp("^"+n.regExpEscape(e.trim()),"i").test(t)},t.SORT_BYLENGTH=function(t,e){return t.length!==e.length?t.length-e.length:t$&");return n.create("li",{innerHTML:s,"aria-selected":"false",id:"awesomplete_list_"+this.count+"_item_"+i})},t.REPLACE=function(t){this.input.value=t.value},t.DATA=function(t){return t},Object.defineProperty(e.prototype=Object.create(String.prototype),"length",{get:function(){return this.label.length}}),e.prototype.toString=e.prototype.valueOf=function(){return""+this.label};var i=Array.prototype.slice;function n(t,e){return"string"==typeof t?(e||document).querySelector(t):t||null}function s(t,e){return i.call((e||document).querySelectorAll(t))}function r(){s("input.awesomplete").forEach(function(e){new t(e)})}n.create=function(t,e){var i=document.createElement(t);for(var s in e){var r=e[s];if("inside"===s)n(r).appendChild(i);else if("around"===s){var o=n(r);o.parentNode.insertBefore(i,o),i.appendChild(o),null!=o.getAttribute("autofocus")&&o.focus()}else s in i?i[s]=r:i.setAttribute(s,r)}return i},n.bind=function(t,e){if(t)for(var i in e){var n=e[i];i.split(/\s+/).forEach(function(e){t.addEventListener(e,n)})}},n.unbind=function(t,e){if(t)for(var i in e){var n=e[i];i.split(/\s+/).forEach(function(e){t.removeEventListener(e,n)})}},n.fire=function(t,e,i){var n=document.createEvent("HTMLEvents");for(var s in n.initEvent(e,!0,!0),i)n[s]=i[s];return t.dispatchEvent(n)},n.regExpEscape=function(t){return t.replace(/[-\\^$*+?.()|[\]{}]/g,"\\$&")},n.siblingIndex=function(t){for(var e=0;t=t.previousElementSibling;e++);return e},"undefined"!=typeof self&&(self.Awesomplete=t),"undefined"!=typeof Document&&("loading"!==document.readyState?r():document.addEventListener("DOMContentLoaded",r)),t.$=n,t.$$=s,"object"==typeof module&&module.exports&&(module.exports=t)}();
//
// jwlib-utils
//
(function($){"use strict";jQuery.fn.exists=function(){return jQuery(this).length>0;};jQuery.getParameterByName=function(name,url){if(!url)url=window.location.href;name=name.replace(/[[\]]/g,"\\$&");var regex=new RegExp("[?&]"+name+"(=([^]*)|&|#|$)"),results=regex.exec(url);if(!results)return null;if(!results[2])return"";return decodeURIComponent(results[2].replace(/\+/g," "));};jQuery.debug=function(){if(window.debug===true)window.debug=1;var maxlevel=parseInt($.getParameterByName("debug")||window.debug)||0;if(maxlevel===0)return;var args=Array.prototype.slice.call(arguments),group="debug",loglevel=1;if(args.length>1&&typeof(args[args.length-1])==="number"){loglevel=args.pop();}
if(loglevel>maxlevel)return;if(args.length>1&&typeof(args[0])==="string"){group=args.shift();}
var debugGroup=$.getParameterByName("debugGroup")||window.debugGroup;if(debugGroup&&!group.match(debugGroup))return;console.group(group);args.forEach(function(arg){if(Array.isArray(arg)&&typeof arg[0]!=="object"){console.table(arg);}
else{console.log(arg);}});console.groupEnd();};jQuery.isMobile=jQuery.isTouch=function(){return"ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch||false;};if(jQuery.isTouch())document.documentElement.classList.add("touch");jQuery.clearBrowserCache=function(){$(window).on("pageshow",function(event){if(event.originalEvent.persisted){window.location.reload();}});};jQuery.preloadImages=function(){for(var i=0;i ").attr("src",arguments[i]);}};var triggerWindowResize=function(){$(window).trigger("resize");};if(typeof(orientationEvent)==undefined){var orientationEvent=0;}
$(window).on(orientationEvent,triggerWindowResize).on("load",triggerWindowResize);})(jQuery);
/*! jQuery Migrate v1.2.1 | (c) 2005, 2013 jQuery Foundation, Inc. and other contributors | jquery.org/license */
jQuery.migrateMute===void 0&&(jQuery.migrateMute=!0),function(e,t,n){function r(n){var r=t.console;i[n]||(i[n]=!0,e.migrateWarnings.push(n),r&&r.warn&&!e.migrateMute&&(r.warn("JQMIGRATE: "+n),e.migrateTrace&&r.trace&&r.trace()))}function a(t,a,i,o){if(Object.defineProperty)try{return Object.defineProperty(t,a,{configurable:!0,enumerable:!0,get:function(){return r(o),i},set:function(e){r(o),i=e}}),n}catch(s){}e._definePropertyBroken=!0,t[a]=i}var i={};e.migrateWarnings=[],!e.migrateMute&&t.console&&t.console.log&&t.console.log("JQMIGRATE: Logging is active"),e.migrateTrace===n&&(e.migrateTrace=!0),e.migrateReset=function(){i={},e.migrateWarnings.length=0},"BackCompat"===document.compatMode&&r("jQuery is not compatible with Quirks Mode");var o=e(" ",{size:1}).attr("size")&&e.attrFn,s=e.attr,u=e.attrHooks.value&&e.attrHooks.value.get||function(){return null},c=e.attrHooks.value&&e.attrHooks.value.set||function(){return n},l=/^(?:input|button)$/i,d=/^[238]$/,p=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,f=/^(?:checked|selected)$/i;a(e,"attrFn",o||{},"jQuery.attrFn is deprecated"),e.attr=function(t,a,i,u){var c=a.toLowerCase(),g=t&&t.nodeType;return u&&(4>s.length&&r("jQuery.fn.attr( props, pass ) is deprecated"),t&&!d.test(g)&&(o?a in o:e.isFunction(e.fn[a])))?e(t)[a](i):("type"===a&&i!==n&&l.test(t.nodeName)&&t.parentNode&&r("Can't change the 'type' of an input or button in IE 6/7/8"),!e.attrHooks[c]&&p.test(c)&&(e.attrHooks[c]={get:function(t,r){var a,i=e.prop(t,r);return i===!0||"boolean"!=typeof i&&(a=t.getAttributeNode(r))&&a.nodeValue!==!1?r.toLowerCase():n},set:function(t,n,r){var a;return n===!1?e.removeAttr(t,r):(a=e.propFix[r]||r,a in t&&(t[a]=!0),t.setAttribute(r,r.toLowerCase())),r}},f.test(c)&&r("jQuery.fn.attr('"+c+"') may use property instead of attribute")),s.call(e,t,a,i))},e.attrHooks.value={get:function(e,t){var n=(e.nodeName||"").toLowerCase();return"button"===n?u.apply(this,arguments):("input"!==n&&"option"!==n&&r("jQuery.fn.attr('value') no longer gets properties"),t in e?e.value:null)},set:function(e,t){var a=(e.nodeName||"").toLowerCase();return"button"===a?c.apply(this,arguments):("input"!==a&&"option"!==a&&r("jQuery.fn.attr('value', val) no longer sets properties"),e.value=t,n)}};var g,h,v=e.fn.init,m=e.parseJSON,y=/^([^<]*)(<[\w\W]+>)([^>]*)$/;e.fn.init=function(t,n,a){var i;return t&&"string"==typeof t&&!e.isPlainObject(n)&&(i=y.exec(e.trim(t)))&&i[0]&&("<"!==t.charAt(0)&&r("$(html) HTML strings must start with '<' character"),i[3]&&r("$(html) HTML text after last tag is ignored"),"#"===i[0].charAt(0)&&(r("HTML string cannot start with a '#' character"),e.error("JQMIGRATE: Invalid selector string (XSS)")),n&&n.context&&(n=n.context),e.parseHTML)?v.call(this,e.parseHTML(i[2],n,!0),n,a):v.apply(this,arguments)},e.fn.init.prototype=e.fn,e.parseJSON=function(e){return e||null===e?m.apply(this,arguments):(r("jQuery.parseJSON requires a valid JSON string"),null)},e.uaMatch=function(e){e=e.toLowerCase();var t=/(chrome)[ \/]([\w.]+)/.exec(e)||/(webkit)[ \/]([\w.]+)/.exec(e)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(e)||/(msie) ([\w.]+)/.exec(e)||0>e.indexOf("compatible")&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(e)||[];return{browser:t[1]||"",version:t[2]||"0"}},e.browser||(g=e.uaMatch(navigator.userAgent),h={},g.browser&&(h[g.browser]=!0,h.version=g.version),h.chrome?h.webkit=!0:h.webkit&&(h.safari=!0),e.browser=h),a(e,"browser",e.browser,"jQuery.browser is deprecated"),e.sub=function(){function t(e,n){return new t.fn.init(e,n)}e.extend(!0,t,this),t.superclass=this,t.fn=t.prototype=this(),t.fn.constructor=t,t.sub=this.sub,t.fn.init=function(r,a){return a&&a instanceof e&&!(a instanceof t)&&(a=t(a)),e.fn.init.call(this,r,a,n)},t.fn.init.prototype=t.fn;var n=t(document);return r("jQuery.sub() is deprecated"),t},e.ajaxSetup({converters:{"text json":e.parseJSON}});var b=e.fn.data;e.fn.data=function(t){var a,i,o=this[0];return!o||"events"!==t||1!==arguments.length||(a=e.data(o,t),i=e._data(o,t),a!==n&&a!==i||i===n)?b.apply(this,arguments):(r("Use of jQuery.fn.data('events') is deprecated"),i)};var j=/\/(java|ecma)script/i,w=e.fn.andSelf||e.fn.addBack;e.fn.andSelf=function(){return r("jQuery.fn.andSelf() replaced by jQuery.fn.addBack()"),w.apply(this,arguments)},e.clean||(e.clean=function(t,a,i,o){a=a||document,a=!a.nodeType&&a[0]||a,a=a.ownerDocument||a,r("jQuery.clean() is deprecated");var s,u,c,l,d=[];if(e.merge(d,e.buildFragment(t,a).childNodes),i)for(c=function(e){return!e.type||j.test(e.type)?o?o.push(e.parentNode?e.parentNode.removeChild(e):e):i.appendChild(e):n},s=0;null!=(u=d[s]);s++)e.nodeName(u,"script")&&c(u)||(i.appendChild(u),u.getElementsByTagName!==n&&(l=e.grep(e.merge([],u.getElementsByTagName("script")),c),d.splice.apply(d,[s+1,0].concat(l)),s+=l.length));return d});var Q=e.event.add,x=e.event.remove,k=e.event.trigger,N=e.fn.toggle,T=e.fn.live,M=e.fn.die,S="ajaxStart|ajaxStop|ajaxSend|ajaxComplete|ajaxError|ajaxSuccess",C=RegExp("\\b(?:"+S+")\\b"),H=/(?:^|\s)hover(\.\S+|)\b/,A=function(t){return"string"!=typeof t||e.event.special.hover?t:(H.test(t)&&r("'hover' pseudo-event is deprecated, use 'mouseenter mouseleave'"),t&&t.replace(H,"mouseenter$1 mouseleave$1"))};e.event.props&&"attrChange"!==e.event.props[0]&&e.event.props.unshift("attrChange","attrName","relatedNode","srcElement"),e.event.dispatch&&a(e.event,"handle",e.event.dispatch,"jQuery.event.handle is undocumented and deprecated"),e.event.add=function(e,t,n,a,i){e!==document&&C.test(t)&&r("AJAX events should be attached to document: "+t),Q.call(this,e,A(t||""),n,a,i)},e.event.remove=function(e,t,n,r,a){x.call(this,e,A(t)||"",n,r,a)},e.fn.error=function(){var e=Array.prototype.slice.call(arguments,0);return r("jQuery.fn.error() is deprecated"),e.splice(0,0,"error"),arguments.length?this.bind.apply(this,e):(this.triggerHandler.apply(this,e),this)},e.fn.toggle=function(t,n){if(!e.isFunction(t)||!e.isFunction(n))return N.apply(this,arguments);r("jQuery.fn.toggle(handler, handler...) is deprecated");var a=arguments,i=t.guid||e.guid++,o=0,s=function(n){var r=(e._data(this,"lastToggle"+t.guid)||0)%o;return e._data(this,"lastToggle"+t.guid,r+1),n.preventDefault(),a[r].apply(this,arguments)||!1};for(s.guid=i;a.length>o;)a[o++].guid=i;return this.click(s)},e.fn.live=function(t,n,a){return r("jQuery.fn.live() is deprecated"),T?T.apply(this,arguments):(e(this.context).on(t,this.selector,n,a),this)},e.fn.die=function(t,n){return r("jQuery.fn.die() is deprecated"),M?M.apply(this,arguments):(e(this.context).off(t,this.selector||"**",n),this)},e.event.trigger=function(e,t,n,a){return n||C.test(e)||r("Global events are undocumented and deprecated"),k.call(this,e,t,n||document,a)},e.each(S.split("|"),function(t,n){e.event.special[n]={setup:function(){var t=this;return t!==document&&(e.event.add(document,n+"."+e.guid,function(){e.event.trigger(n,null,t,!0)}),e._data(this,n,e.guid++)),!1},teardown:function(){return this!==document&&e.event.remove(document,n+"."+e._data(this,n)),!1}}})}(jQuery,window);
var stacks = {};
stacks.jQuery = jQuery.noConflict(true);
stacks.com_joeworkman_stacks_totalcms_admin_styles = {};
stacks.com_joeworkman_stacks_totalcms_admin_styles = (function(stack) {
var jQuery = stacks.jQuery;var $ = jQuery;
$(document).ready(function(){var focusedElement=false;$("body").on("focusin","textarea.format-selection,input.format-selection",function(){focusedElement=$(this);}).on("focusout","textarea.format-selection,input.format-selection",function(){setTimeout(function(){if(focusedElement!==false&&!focusedElement.is(':focus'))focusedElement=false;},500);});$(".totaltip").each(function(){if($("#totaltip").exists()){$(this).remove();}
else{$(this).appendTo('body').hide().attr('id','totaltip');}});if($("#totaltip").exists()){stacks.totalMousePos={x:-9999,y:-100};$("body").on("mousemove","textarea.format-selection",function(event){stacks.totalMousePos.x=event.pageX-window.scrollX;stacks.totalMousePos.y=event.pageY-window.scrollY;});$("textarea.format-selection").afterselect(function(){var totaltip=$("#totaltip");totaltip.hide().css({top:stacks.totalMousePos.y+15,left:stacks.totalMousePos.x-15}).fadeIn('fast');$("textarea,input").one("mousedown keydown scroll",function(event){totaltip.removeAttr('style');});$(document).one("scroll",function(event){totaltip.removeAttr('style');});});}
$('.totaltip a,.totalbar button').click(function(){if(focusedElement!==false)focusedElement.closest('form.text-form').addClass('unsaved');});$('.totalbar').first().clone().hide().appendTo('body');$("textarea").keydown(function(e){var keyCode=e.keyCode||e.which;if(keyCode==9){e.preventDefault();var selected=focusedElement.textrange();focusedElement.closest('form.text-form').addClass('unsaved');focusedElement.textrange('replace',"\t").trigger('updateInfo').focus();focusedElement.textrange('setcursor',selected.end+1);}});$('.totalbar-bold').click(function(){if(focusedElement!==false){var selected=focusedElement.textrange(),boldRegex=/^\s*\*\*(.+)\*\*.*/,markdown;if(selected.text===''){markdown="**** ";focusedElement.textrange('replace',markdown).trigger('updateInfo').focus();focusedElement.textrange('setcursor',selected.end+2);}
else if(selected.text.match(boldRegex)){markdown=selected.text.replace(boldRegex,'$1');focusedElement.textrange('replace',markdown).trigger('updateInfo').focus();}
else{markdown="**"+selected.text+"**";focusedElement.textrange('replace',markdown).trigger('updateInfo').focus();}}});$('.totalbar-italic').click(function(){if(focusedElement!==false){var selected=focusedElement.textrange(),italicRegex=/^\s*_(.+)_.*/,markdown;if(selected.text===''){markdown="__ ";focusedElement.textrange('replace',markdown).trigger('updateInfo').focus();focusedElement.textrange('setcursor',selected.end+1);}
else if(selected.text.match(italicRegex)){markdown=selected.text.replace(italicRegex,'$1');focusedElement.textrange('replace',markdown).trigger('updateInfo').focus();}
else{markdown="_"+selected.text+"_";focusedElement.textrange('replace',markdown).trigger('updateInfo').focus();}}});$('.totalbar-header').click(function(){if(focusedElement!==false){var selected=focusedElement.textrange(),alltext=focusedElement.val(),start=alltext.substr(selected.start-1,1),end=alltext.substr(selected.end,1),h3regex=/^#{3}\s*(.*)/,markdown;if(selected.text===''){markdown="### ";var setcursor=selected.end+4;if(start!=='#'&&start!=="\n"&&selected.start!==0){markdown="\n\n"+markdown;setcursor=setcursor+2;}
focusedElement.textrange('replace',markdown).trigger('updateInfo').focus();focusedElement.textrange('setcursor',setcursor);}
else if(selected.text.match(h3regex)){markdown=selected.text.replace(h3regex,'$1');focusedElement.textrange('replace',markdown).trigger('updateInfo').focus();}
else{var newstart=false,newend=false;markdown="### "+selected.text;if(start!=="\n"&&selected.start!==0){markdown="\n\n"+markdown;newstart=true;}
if(end!=="\n"){markdown=markdown+"\n\n";newend=true;}
focusedElement.textrange('replace',markdown).trigger('updateInfo').focus();var redo=focusedElement.textrange(),redoStart=redo.start,redoLength=redo.length;if(newstart){redoStart=redoStart+2;redoLength=redoLength-2;}
if(newend){redoLength=redoLength-2;}
focusedElement.textrange('set',redoStart,redoLength);}}});$('.totalbar-link').click(function(){if(focusedElement!==false){var selected=focusedElement.textrange(),question=$(this).data('ask')||"Please enter url or email address",answer=$(this).data('answer')||"http://",markdown=false,url;if(selected.text===''){url=prompt(question,answer);if(url!==null&&url!=='')markdown="<"+url+">";}
else if(!selected.text.match(/^\s*<\S+>/)&&!selected.text.match(/^\[.+\]\(\S+\)/)){url=prompt(question,answer);if(url!==null&&url!==''){if(url.match(/@/))url='mailto:'+url;markdown="["+selected.text+"]("+url+")";}}
if(markdown!==false)
focusedElement.textrange('replace',markdown).trigger('updateInfo').focus();}});$('.totalbar-list').click(function(){if(focusedElement!==false){var selected=focusedElement.textrange(),alltext=focusedElement.val(),start=alltext.substr(selected.start-1,1),end=alltext.substr(selected.end,1),startpos=selected.end,newstart=false,newend=false,listRegex=/^\*\s+(.*)/,markdown;if(selected.text===''){markdown="* ";var setcursor=selected.end+2;if(!end.match(/\S/)){markdown=markdown+"\n";}
focusedElement.textrange('replace',markdown).trigger('updateInfo').focus();focusedElement.textrange('setcursor',setcursor);}
else if(selected.text.match(listRegex)){markdown=selected.text.split(/\n/).map(function(line){return line.replace(listRegex,'$1');}).filter(function(line){return line!=='';}).join("\n");focusedElement.textrange('replace',markdown).trigger('updateInfo').focus();}
else{markdown=selected.text.split(/\n/).map(function(line){if(line==='')return'';return line.match(/^\*/)?line:"* "+line;}).join("\n");if(!start.match(/\n/)&&selected.start!==0){markdown="\n\n"+markdown;newstart=true;}
if(!end.match(/\n\n/)){markdown=markdown+"\n";newend=true;}
focusedElement.textrange('replace',markdown).trigger('updateInfo').focus();}}});$('.totalbar-numlist').click(function(){if(focusedElement!==false){var selected=focusedElement.textrange(),alltext=focusedElement.val(),start=alltext.substr(selected.start-1,1),end=alltext.substr(selected.end,1),startpos=selected.end,newstart=false,newend=false,listRegex=/^\d+\.\s+(.*)/,markdown;if(selected.text===''){markdown="1. ";var setcursor=selected.end+2;if(!end.match(/\S/)){markdown=markdown+"\n";}
focusedElement.textrange('replace',markdown).trigger('updateInfo').focus();focusedElement.textrange('setcursor',setcursor);}
else if(selected.text.match(listRegex)){markdown=selected.text.split(/\n/).map(function(line){return line.replace(listRegex,'$1');}).filter(function(line){return line!=='';}).join("\n");focusedElement.textrange('replace',markdown).trigger('updateInfo').focus();}
else{var index=1;markdown=selected.text.split(/\n/).map(function(line){var newline=line.match(/^\d\./)?line:index+". "+line;index=index+1;return newline;}).join("\n");if(!start.match(/\n/)&&selected.start!==0){markdown="\n\n"+markdown;newstart=true;}
if(!end.match(/\n\n/)){markdown=markdown+"\n";newend=true;}
focusedElement.textrange('replace',markdown).trigger('updateInfo').focus();}}});$('.totalbar-indent').click(function(){if(focusedElement!==false){var selected=focusedElement.textrange();if(selected.text===''){var alltext=focusedElement.val(),end=alltext.substr(selected.end,1);if(end.match(/[\d\*]/)){markdown="\t";focusedElement.textrange('replace',markdown).trigger('updateInfo').focus();}}
else{markdown=selected.text.split(/\n/).map(function(line){return"\t"+line;}).join("\n");focusedElement.textrange('replace',markdown).trigger('updateInfo').focus();}}});$('.totalbar-dedent').click(function(){if(focusedElement!==false){var selected=focusedElement.textrange();if(selected.text===''){var alltext=focusedElement.val(),start=alltext.substr(selected.start-1,1),end=alltext.substr(selected.end,1);if(selected.start!==0&&start==="\t"){alltext=alltext.slice(0,selected.start-1)+alltext.slice(selected.start);focusedElement.val(alltext).trigger('updateInfo').focus();focusedElement.textrange('setcursor',selected.start-1);}
else if(end==="\t"){alltext=alltext.slice(0,selected.start)+alltext.slice(selected.start+1);focusedElement.val(alltext).trigger('updateInfo').focus();focusedElement.textrange('setcursor',selected.start);}}
else{markdown=selected.text.split(/\n/).map(function(line){return line.replace(/^\t/,'');}).join("\n");focusedElement.textrange('replace',markdown).trigger('updateInfo').focus();}}});$('.totalbar-image').click(function(){if(focusedElement!==false){var selected=focusedElement.textrange(),question=$(this).data('ask')||"Please enter an image url",answer=$(this).data('answer')||"http://",imgRegex=/^\!\[.*\]\(.+\)/;if(!selected.text.match(imgRegex)){var alt=selected.text;var url=prompt(question,answer);if(url!==null&&url!==''){markdown=url.match(imgRegex)?url+' ':"!["+selected.text+"]("+url+") ";focusedElement.textrange('replace',markdown).trigger('updateInfo').focus();}}}});$('.totalbar-blockquote').click(function(){if(focusedElement!==false){var selected=focusedElement.textrange();if(selected.text===''){markdown="\n> ";focusedElement.textrange('replace',markdown).trigger('updateInfo').focus();focusedElement.textrange('setcursor',selected.start+1);}
else{markdown=selected.text.split(/\n/).map(function(line){var bqRegex=/^\>\s*/;return line.match(bqRegex)?line.replace(bqRegex,''):"> "+line;}).join("\n");focusedElement.textrange('replace',markdown).trigger('updateInfo').focus();}}});$('.totalbar-code').click(function(){if(focusedElement!==false){var selected=focusedElement.textrange(),codeStrRegex=/^\s*\`(.+)\`/,markdown;if(selected.text===''){markdown="`` ";focusedElement.textrange('replace',markdown).trigger('updateInfo').focus();focusedElement.textrange('setcursor',selected.end+1);}
else if(selected.text.match(/\n/)){if(selected.text.match(/\n\t/)){markdown=selected.text.split(/\n/).map(function(line){return line.replace(/^\t(.*)/,'$1');}).filter(function(line){return line!=='';}).join("\n");focusedElement.textrange('replace',markdown).trigger('updateInfo').focus();}
else{markdown=selected.text.split(/\n/).map(function(line){return"\t"+line;}).join("\n");focusedElement.textrange('replace',"\n"+markdown).trigger('updateInfo').focus();}}
else if(selected.text.match(codeStrRegex)){markdown=selected.text.replace(codeStrRegex,'$1');focusedElement.textrange('replace',markdown).trigger('updateInfo').focus();}
else{markdown="`"+selected.text+"`";focusedElement.textrange('replace',markdown).trigger('updateInfo').focus();}}});$('.totalbar-rule').click(function(){if(focusedElement!==false){var selected=focusedElement.textrange(),markdown="\n---\n\n";focusedElement.textrange('replace',markdown).trigger('updateInfo').focus();focusedElement.textrange('setcursor',selected.end+6);}});$('.totalbar-erase').click(function(){if(focusedElement!==false){var selected=focusedElement.textrange();var plaintext=selected.text.split(/\n/).map(function(line){line=line.replace(/^#+\s*(.+)/,'$1');line=line.replace(/\*\*(.+?)\*\*/g,'$1');line=line.replace(/\s_(.+?)_\s/g,' $1 ');line=line.replace(/^_(.+?)_$/g,'$1');line=line.replace(/^\t+(.+)/,'$1');line=line.replace(/^\*\s+(.+)/,'$1');line=line.replace(/^\d+\.\s+(.+)/,'$1');line=line.replace(/^\>+\s*(.+)/,'$1');return line;}).join("\n").replace(/\n{3}/g,"\n");focusedElement.textrange('replace',plaintext).trigger('updateInfo').focus();}});$('.totalbar-rewind').click(function(){if(focusedElement!==false){var form=focusedElement.closest('form.total-form'),slug=$('input[name=slug]',form).val(),type=$('input[name=type]',form).val(),get_url=stacks.totalcms.totalapi+'?'+$.param({'slug':slug,'type':type});$.ajax({url:get_url,cache:false,success:function(data){focusedElement.val(data.data);form.removeClass('unsaved');}});}});});
if(Cookies.get('total-interim')){$.ajax({type:'GET',url:"https://passport.weavers.space/total-cms/"+window.location.hostname+"/jsonCallback",async:true,jsonpCallback:'jsonCallback',contentType:"application/json",dataType:'jsonp',success:function(data){data.type='passport';$.debug('Interim Passport Check',data);$.ajax({type:"POST",url:stacks.totalcms.totalapi,headers:stacks.totalcms.requestheaders,data:data,});},error:function(e){console.error('Interim Passport Check Error',e.message);}});}
return stack;})(stacks.com_joeworkman_stacks_totalcms_admin_styles);
stacks.ws_directions = {};
stacks.ws_directions = (function(stack) { const googleUri="https://www.google.com/maps/dir/?api=1&destination=";const appleUri="https://maps.apple.com/?daddr=";const isApple=/(Mac|iPhone|iPod|iPad)/i.test(navigator.platform);const isMac=/Mac/i.test(navigator.platform);const destinationUri=function(d){const attrs=d.type=="gps"?[d.longitude,d.latitude]:[d.address1,d.address2,d.city,d.state,d.zip];const query=attrs.map(a=>a.trim()).filter(a=>a).join();return encodeURIComponent(query).replace(/%20/g,"+");};document.addEventListener("DOMContentLoaded",function(event){const links=Array.from(document.getElementsByClassName("directions-link"));for(const link of links){if(!link.dataset.destination)continue;const destUri=destinationUri(JSON.parse(link.dataset.destination));let forceGoogle=(link.dataset.service&&"google"==link.dataset.service);if(isMac&&link.classList.contains("google-on-mac"))forceGoogle=true;const mapsUri=isApple&&!forceGoogle?appleUri+destUri:googleUri+destUri;link.querySelector("a").setAttribute("href",mapsUri);}});
return stack;})(stacks.ws_directions);
stacks.com_joeworkman_stacks_totalcms_image = {};
stacks.com_joeworkman_stacks_totalcms_image = (function(stack) {
var jQuery = stacks.jQuery;var $ = jQuery; $(document).ready(function(){$('img.auto-lightbox').click(function(e){e.preventDefault();var path=$(this).data('img'),modal=$('#total-image-reveal'),image=$(' ').attr('src',path);$('img',modal).remove();if(modal.hasClass("reveal")){modal.prepend(image).foundation('open').one("click",function(){modal.foundation('close');});}else{modal.prepend(image).foundation('reveal','open').one("click",function(){modal.foundation('reveal','close');});}});});
return stack;})(stacks.com_joeworkman_stacks_totalcms_image);
stacks.com_joeworkman_stacks_totalcms_blog_gallery = {};
stacks.com_joeworkman_stacks_totalcms_blog_gallery = (function(stack) {
var jQuery = stacks.jQuery;var $ = jQuery; $(document).ready(function(){$('.com_joeworkman_stacks_totalcms_blog_gallery_stack img').error(function(){$(this).attr('src','../rw_common/plugins/stacks/total-cms/missing.jpg');});});
return stack;})(stacks.com_joeworkman_stacks_totalcms_blog_gallery);
stacks.stacks_in_242883 = {};
stacks.stacks_in_242883 = (function(stack) {
var jQuery = stacks.jQuery;var $ = jQuery; $.fn.serializeObject=function(){var obj={};$.each(this.serializeArray(),function(i,o){var n=o.name,v=o.value;obj[n]=obj[n]===undefined?v:$.isArray(obj[n])?obj[n].concat(v):[obj[n],v];});return obj;};$.fn.serializeAndEncode=function(){var base64_fields=['text','content','summary','extra','feed','datastore'];return $.map(this.serializeArray(),function(val){var value=val.value;if(base64_fields.indexOf(val.name)!==-1){value=$.base64.btoa(value,true);}
return[val.name,encodeURIComponent(value)].join('=');}).join('&');};$(document).ready(function(){['#feed-edit-hipwig-template','#imagebar-image-template','#altbox-template','#imagebar-link-template','#feed-edit-template','#feed-rss-template','#datastore-template','#blog-links-template'].forEach(function(name){$('body').append($($(name).html()));});$('.datastore-admin').on('click','.bulk-edit',function(e){e.stopPropagation();e.preventDefault();var dsadmin=$(this).closest('.datastore-admin'),slug=dsadmin.data('slug'),bulkedit=$('#datastore-bulk-edit');$('input[name=slug]',bulkedit).val(slug);$.ajax({url:stacks.totalcms.totalapi,data:{'slug':slug,'type':'datastore'},success:function(json){$.debug('Datastore Contents:',json.data);$('textarea[name=datastore]',bulkedit).val(json.data);}});openRevealLightbox(bulkedit);});$('.total-feed-admin-list').on('click','.feedbar-edit',function(e){e.stopPropagation();e.preventDefault();var post=$(this).closest('li.post'),feed=$(this).closest('.total-feed-admin-list'),slug=feed.data('slug'),form=$('form.feed-form[data-slug='+slug+']'),post_obj=post.data('post'),settings=form.data('settings'),type='feed';var feededit=$('.hipwig',form).exists()?$('#feed-edit-hipwig'):$('#feed-edit');$('form.feed-form',feededit).addClass(settings.hideimage);$('textarea[name=feed]',feededit).val(post_obj.content).addClass(settings.format).attr('rows',settings.rows);$('textarea.hipwig',feededit).froalaEditor('html.set',post_obj.content);$('textarea[name=feed]',feededit).val(post_obj.content);$('input[name=timestamp]',feededit).val(post_obj.timestamp);$('input[name=alt]',feededit).val(post_obj.alt);$('input[name=slug]',feededit).val(slug);$('input[name=type]',feededit).val(type);$('input[name=strip]',feededit).val(settings.strip);$('input[name=resize]',feededit).val(settings.resize);$('input[name=quality]',feededit).val(settings.quality);$('input[name=scale]',feededit).val(settings.scale);$('input[name=scale_th]',feededit).val(settings.scale_th);$('input[name=scale_sq]',feededit).val(settings.scale_sq);$('input[name=feed_title]',feededit).val(settings.feed_title);$('input[name=feed_description]',feededit).val(settings.feed_description);$('input[name=feed_link]',feededit).val(settings.feed_link);$('input[name=feed_baseurl]',feededit).val(settings.feed_baseurl);feededit.data('rules',form.data('rules'));if(post_obj.img!==undefined){var image_preview=$('.dz-preview',feededit);$('img',image_preview).remove();$(' ').appendTo(image_preview);image_preview.removeClass('empty');}
openRevealLightbox(feededit);});$('.total-feed-admin-list').on('click','.feedbar-rss',function(e){e.stopPropagation();e.preventDefault();var feed=$(this).closest('.total-feed-admin-list'),slug=feed.data('slug'),rss_path=stacks.totalcms.baseurl+'cms-data/feed/'+slug+'/'+slug+'.rss',reveal=$('#feed-rss');$('input[name=rss]',reveal).val(rss_path);$("input",reveal).click(function(){$(this).select();});openRevealLightbox(reveal);});$('.total-preview').on('click','.imagebar-image',function(e){e.stopPropagation();e.preventDefault();var form=$(this).closest('form.total-form'),preview=$(this).closest('.dz-preview'),filename=preview.data('filename'),type=$('input[name=type]',form).val(),ext=$('input[name=ext]',form).val(),slug=$('input[name=slug]',form).val(),cms_dir='cms-data/'+type,image_path,thumb_path,square_path;if(type==='blog'){var permalink=$('input[name=permalink]',form).val();if($(this).closest(".image-box").length>0){cms_dir='cms-data/blog/'+slug;ext=$(this).closest(".image-box").data("rules").ext;image_path=stacks.totalcms.baseurl+cms_dir+'/'+permalink+'/image/'+permalink+'.'+ext;thumb_path=stacks.totalcms.baseurl+cms_dir+'/'+permalink+'/image/'+permalink+'-th.'+ext;square_path=stacks.totalcms.baseurl+cms_dir+'/'+permalink+'/image/'+permalink+'-sq.'+ext;}else{cms_dir='cms-data/gallery/blog/'+slug;ext='jpg';image_path=stacks.totalcms.baseurl+cms_dir+'/'+permalink+'/'+filename+'.'+ext;thumb_path=stacks.totalcms.baseurl+cms_dir+'/'+permalink+'/'+filename+'-th.'+ext;square_path=stacks.totalcms.baseurl+cms_dir+'/'+permalink+'/'+filename+'-sq.'+ext;}}
else if(type==='image'){image_path=stacks.totalcms.baseurl+cms_dir+'/'+slug+'.'+ext;thumb_path=stacks.totalcms.baseurl+cms_dir+'/'+slug+'-th.'+ext;square_path=stacks.totalcms.baseurl+cms_dir+'/'+slug+'-sq.'+ext;}
else if(type==='gallery'){image_path=stacks.totalcms.baseurl+cms_dir+'/'+slug+'/'+filename+'.'+ext;thumb_path=stacks.totalcms.baseurl+cms_dir+'/'+slug+'/'+filename+'-th.'+ext;square_path=stacks.totalcms.baseurl+cms_dir+'/'+slug+'/'+filename+'-sq.'+ext;}
var reveal=$('#imagebar-image');$('img',reveal).attr('src',image_path);$('a.image',reveal).attr('href',image_path);$('input[name=image]',reveal).val(image_path);$('a.thumb',reveal).attr('href',thumb_path);$('input[name=thumb]',reveal).val(thumb_path);$('a.square',reveal).attr('href',square_path);$('input[name=square]',reveal).val(square_path);$("input",reveal).click(function(){$(this).select();});openRevealLightbox(reveal);});$('.total-blog-list').on('click','.blogbar-links',function(e){e.stopPropagation();e.preventDefault();var post=$(this).closest('li.post'),list=$(this).closest('.total-blog-list'),reveal=$('#blogbar-links'),slug=list.data('slug'),permalink=post.data('permalink'),rss=stacks.totalcms.baseurl+'cms-data/blog/'+slug+'/'+slug+'.rss',sitemap=stacks.totalcms.baseurl+'cms-data/blog/'+slug+'/'+slug+'-sitemap.xml',urlFile=stacks.totalcms.baseurl+'cms-data/blog/'+slug+'/'+slug+'.posturl',url;$.ajax({url:urlFile}).done(function(data){var contentUrl=data.trim();if(contentUrl.match(/^http/)){if(contentUrl.match(/permalink=$/)){url=new URI(contentUrl+permalink).normalizePathname();}else{url=new URI(contentUrl+'/'+permalink).normalizePathname();}}
else{contentUrl=window.location.protocol+'//'+window.location.host+'/'+window.location.pathname+'/'+contentUrl;url=new URI(contentUrl).addSearch("permalink",permalink).normalizePathname();}
$('a.permalink',reveal).attr('href',url.toString());$('input[name=permalink]',reveal).val(url.toString());});$('a.rss',reveal).attr('href',rss);$('input[name=rss]',reveal).val(rss);$('a.sitemap',reveal).attr('href',sitemap);$('input[name=sitemap]',reveal).val(sitemap);$("input",reveal).click(function(){$(this).select();});openRevealLightbox(reveal);});$('.total-preview').on('click','.filebar-link',function(e){e.stopPropagation();e.preventDefault();var form=$(this).closest('form.total-form'),preview=$(this).closest('.dz-preview'),slug=$('input[name=slug]',form).val(),type=$('input[name=type]',form).val(),filename=$('.filename',preview).html(),cms_dir='cms-data/'+type;if(form.hasClass('depot-form')){cms_dir=cms_dir+'/'+slug;}
file=stacks.totalcms.baseurl+cms_dir+'/'+filename;var reveal=$('#imagebar-link');$('input[name=file]',reveal).val(file);openRevealLightbox(reveal);});$('.total-preview').on('click','.filebar-trash',function(e){e.stopPropagation();e.preventDefault();var form=$(this).closest('form.total-form'),preview=$(this).closest('.dz-preview'),slug=$('input[name=slug]',form).val(),type=$('input[name=type]',form).val(),ext=$('input[name=ext]',form).val(),filename=$('.filename',preview).html(),data={'slug':slug,'type':type,'_METHOD':'DELETE'};if(ext){data.ext=ext;}
else{data.filename=filename;}
if(confirm("Are you sure that you want to delete this file?")){$.ajax({type:"POST",url:stacks.totalcms.totalapi,headers:stacks.totalcms.requestheaders,data:data,success:function(data){if(form.hasClass('depot-form')){preview.fadeOut();}
console.log("CMS DELETE Successful: "+data.message);},error:function(jqxhr,status,msg){console.error(jqxhr);var response=JSON.parse(jqxhr.responseText);console.error("CMS DELETE Error");console.error(response);preview.addClass("dz-error");}});}});$('.total-preview').on('click','.imagebar-trash',function(e){e.stopPropagation();e.preventDefault();var form=$(this).closest('form.total-form'),preview=$(this).closest('.dz-preview'),filename=preview.data('filename'),type=$('input[name=type]',form).val(),ext=$('input[name=ext]',form).val(),slug=$('input[name=slug]',form).val(),permalink=form.data('permalink'),isGallery=($(this).closest('.gallery-box').length>0);data={'slug':slug,'type':type,'isGallery':isGallery,'filename':filename,'ext':ext,'permalink':permalink,'_METHOD':'DELETE'};$.debug('Image Delete: '+filename,data);if(confirm("Are you sure that you want to delete this file?")){$.ajax({type:"POST",url:stacks.totalcms.totalapi,headers:stacks.totalcms.requestheaders,data:data,success:function(data){if($('img',preview).exists())preview.fadeOut();console.log("CMS DELETE Successful: "+data.message);},error:function(jqxhr,status,msg){console.error(jqxhr);var response=JSON.parse(jqxhr.responseText);console.error("CMS DELETE Error");console.error(response);preview.addClass("dz-error");}});}});$('.total-feed-admin-list').on('click','.feedbar-trash',function(e){e.stopPropagation();e.preventDefault();var post=$(this).closest('li.post'),post_obj=post.data('post'),slug=$(this).closest('.total-feed-admin-list').data('slug');form=$('form.feed-form[data-slug='+slug+']'),data=form.serializeObject();data.timestamp=post_obj.timestamp;data._METHOD='DELETE';console.log(data);if(confirm("Are you sure that you want to delete this post?")){$.ajax({type:"POST",url:stacks.totalcms.totalapi,headers:stacks.totalcms.requestheaders,data:data,success:function(data){post.fadeOut();console.log("CMS DELETE Successful: "+data.message);},error:function(jqxhr,status,msg){console.error(jqxhr);var response=JSON.parse(jqxhr.responseText);console.error("CMS DELETE Error");console.error(response);preview.addClass("dz-error");}});}});$('.total-blog-list').on('click','.blogbar-trash',function(e){e.stopPropagation();e.preventDefault();var post=$(this).closest('li.post'),slug=$(this).closest('.total-blog-list').data('slug'),permalink=post.data('permalink'),type='blog';if(confirm("Are you sure that you want to delete this post?")){$.ajax({type:"POST",url:stacks.totalcms.totalapi,headers:stacks.totalcms.requestheaders,data:{'slug':slug,'type':type,'permalink':permalink,'_METHOD':'DELETE'},success:function(data){post.fadeOut();console.log("CMS DELETE Successful: "+data.message);},error:function(jqxhr,status,msg){console.error(jqxhr);var response=JSON.parse(jqxhr.responseText);console.error("CMS DELETE Error");console.error(response);}});}});$('.total-blog-list').on('click','.blogbar-featured',function(e){e.stopPropagation();e.preventDefault();var post=$(this).closest('li.post'),slug=$(this).closest('.total-blog-list').data('slug'),permalink=post.data('permalink'),type='blog';$.ajax({type:"POST",url:stacks.totalcms.totalapi,headers:stacks.totalcms.requestheaders,data:{'slug':slug,'type':type,'permalink':permalink,'featured':true,'_METHOD':'PUT'},success:function(data){post.toggleClass('featured');console.log("Post Featured Success: "+data.message);},error:function(jqxhr,status,msg){console.error(jqxhr);var response=JSON.parse(jqxhr.responseText);console.error("CMS Error marking as featured");console.error(response);}});});$('.total-blog-list').on('click','.blogbar-draft',function(e){e.stopPropagation();e.preventDefault();var post=$(this).closest('li.post'),slug=$(this).closest('.total-blog-list').data('slug'),permalink=post.data('permalink'),type='blog';$.ajax({type:"POST",url:stacks.totalcms.totalapi,headers:stacks.totalcms.requestheaders,data:{'slug':slug,'type':type,'permalink':permalink,'draft':true,'_METHOD':'PUT'},success:function(data){post.toggleClass('draft');console.log("Post Draft Success: "+data.message);},error:function(jqxhr,status,msg){console.error(jqxhr);var response=JSON.parse(jqxhr.responseText);console.error("CMS Error marking as draft");console.error(response);}});});var altbox=$('#altbox'),openAltBox=function(options){$('form',altbox).removeClass('error success saving unsaved');$('img',altbox).attr('src',options.path);$('input[name=slug]',altbox).val(options.slug);$('input[name=type]',altbox).val(options.type);$('input[name=ext]',altbox).val(options.ext);$('input[name=filename]',altbox).val(options.filename);$('input[name=timestamp]',altbox).val(options.timestamp);$('input[name=permalink]',altbox).val(options.permalink);$('input[name=isGallery]',altbox).val(options.isGallery)||"false";$('textarea',altbox).val('');$.ajax({dataType:"json",url:stacks.totalcms.totalapi,cache:false,data:options,success:function(json){$.debug("Alt text",json);var alt;if(json.data.posts){alt=json.data.posts[0].alt;}
else if(json.data.image&&!options.isGallery){alt=json.data.image.alt;}
else if(json.data.gallery&&options.isGallery){var i=0;for(i=0;i0);openAltBox({'slug':slug,'type':type,'ext':ext,'path':path,'filename':filename,'permalink':permalink,'isGallery':isGallery});});$('.total-feed-admin-list').on('click','.feedbar-tag',function(e){e.stopPropagation();e.preventDefault();var post=$(this).closest('li.post'),post_obj=post.data('post'),slug=$(this).closest('.total-feed-admin-list').data('slug'),form=$('form.feed-form[data-slug='+slug+']'),data=form.serializeObject();data.timestamp=post_obj.timestamp;openAltBox(data);});$('#altbox form').submit(function(){var form=$(this);form.removeClass('success error').addClass('saving');$.ajax({type:"POST",url:stacks.totalcms.totalapi,headers:stacks.totalcms.requestheaders,data:form.serializeAndEncode(),success:function(data){console.log("CMS Put Successful: "+data.message);form.removeClass('saving unsaved').addClass('success');setTimeout(function(){closeRevealLightbox($('#altbox'));},500);},error:function(jqxhr,status,msg){console.error(jqxhr);var response=JSON.parse(jqxhr.responseText);console.error("CMS Put Error: "+response.message);form.removeClass('saving').addClass('error');}});return false;});$('.gallery-form,.blog-form').on('click','.imagebar-featured',function(e){e.stopPropagation();e.preventDefault();var form=$(this).closest('form.total-form'),preview=$(this).closest('.dz-preview'),slug=$('input[name=slug]',form).val(),permalink=$('input[name=permalink]',form).val(),type=$('input[name=type]',form).val(),filename=preview.data('filename'),featured=!preview.hasClass('featured');$.ajax({type:"POST",url:stacks.totalcms.totalapi,headers:stacks.totalcms.requestheaders,data:{'slug':slug,'type':type,'filename':filename,'permalink':permalink,'featured':featured,'_METHOD':'PUT'},success:function(data){preview.toggleClass('featured');console.log("Image Featured Success: "+data.message);},error:function(jqxhr,status,msg){console.error(jqxhr);var response=JSON.parse(jqxhr.responseText);console.error("CMS Error marking image as featured");console.error(response);}});});});
$(document).ready(function(){var toolbar=['bold','italic','underline','insertLink','|','embedly','fullscreen',],quickinsert=['image','video','embedly','table','ul','ol','hr'],fileParams={slug:'hipwig',type:'hipdepot',fileMaxSize:1024*1024*1024},videoParams={slug:'hipwig',type:'hipdepot',fileMaxSize:1024*1024*1024},imageParams={slug:'hipwig',type:'hipgallery',ext:'jpg',resize:'auto',quality:'85',scale:'1200',scale_th:'200',scale_sq:'200'},imageStyles={'fr-rounded':'Rounded','fr-bordered':'Bordered','fr-shadow':'Shadow','fr-full-width':'Full Width'};$.FroalaEditor.DEFAULTS.key='zA4B4H3D3B9A5eF5C4C3E3E2C2B3D6D4F2xJCJWECHICe1JOZWJ==';$.FroalaEditor.SHORTCUTS_MAP={69:{cmd:'show'},66:{cmd:'bold'},73:{cmd:'italic'},85:{cmd:'underline'},221:{cmd:'indent'},219:{cmd:'outdent'},90:{cmd:'undo'},'-90':{cmd:'redo'}};$('.hipwig').dblclick(function(){$('textarea',this).froalaEditor('toolbar.showInline',null,true);});$('.hipwig textarea').each(function(){$(this).froalaEditor({keepFormatOnDelete:true,charCounterCount:false,charCounterMax:$(this).data('maxcount'),colorsText:['#61BD6D', '#1ABC9C', '#54ACD2', '#2C82C9', '#9365B8', '#475577', '#CCCCCC', '#41A85F', '#00A885', '#3D8EB9', '#2969B0', '#553982', '#28324E', '#000000', '#F7DA64', '#FBA026', '#EB6B56', '#E25041', '#A38F84', '#EFEFEF', '#FFFFFF', '#FAC51C', '#F37934', '#D14841', '#B8312F', '#7C706B', '#D1D5D8', 'REMOVE'],colorsBackground:['#61BD6D', '#1ABC9C', '#54ACD2', '#2C82C9', '#9365B8', '#475577', '#CCCCCC', '#41A85F', '#00A885', '#3D8EB9', '#2969B0', '#553982', '#28324E', '#000000', '#F7DA64', '#FBA026', '#EB6B56', '#E25041', '#A38F84', '#EFEFEF', '#FFFFFF', '#FAC51C', '#F37934', '#D14841', '#B8312F', '#7C706B', '#D1D5D8', 'REMOVE'],language:stacks.totalcms.locale,toolbarInline:false,codeMirror:true,tooltips:true,shortcutsHint:false,fileUploadURL:stacks.totalcms.totalapi,fileUploadParams:fileParams,fileMaxSize:1024*1024*1024,videoUploadURL:stacks.totalcms.totalapi,videoUploadParams:videoParams,videoMaxSize:1024*1024*1024,videoEditButtons:['videoReplace','videoRemove','|','videoDisplay','videoAlign'],fontSize:['8', '9', '10', '11', '12', '14', '18', '24', '30', '36', '48', '60', '72', '96'],imageUploadURL:stacks.totalcms.totalapi,imageUploadParams:imageParams,imageManagerLoadURL:stacks.totalcms.totalapi+'?'+$.param(imageParams),imageManagerDeleteURL:stacks.totalcms.totalapi,imageDefaultWidth:0,imageResizeWithPercent:true,imageRoundPercent:true,imageStyles:imageStyles,codeMirrorOptions:{indentWithTabs:true,lineNumbers:true,lineWrapping:true,readOnly:false,mode:'text/html',tabMode:'indent',tabSize:2},alwaysVisible:false,saveInterval:9000000,pastePlain:true,placeholderText:$(this).prop('placeholder'),requestHeaders:stacks.totalcms.requestheaders,toolbarButtons:toolbar,toolbarButtonsMD:toolbar,toolbarButtonsSM:toolbar,toolbarButtonsXS:toolbar,toolbarSticky:false,quickInsertButtons:quickinsert,quickInsertTags:['p', 'div', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'pre', 'blockquote'],paragraphFormat:{N: 'Normal', H1: 'Heading 1', H2: 'Heading 2', H3: 'Heading 3', H4: 'Heading 4', PRE: 'Code'},enter:$.FroalaEditor.ENTER_P,htmlRemoveTags:['script','style'],heightMax:1000,height:$(this).data('height')}).on('froalaEditor.save.before',function(e,editor){var form=$(this).closest('form.total-form');form.submit();}).on('froalaEditor.commands.after',function(e,editor){var hipwig=$(this).closest('fieldset.text-box');hipwig.addClass('unsaved');}).on('froalaEditor.image.inserted',function(e,editor,$img,response){var hipwig=$(this).closest('fieldset.text-box');hipwig.addClass('unsaved');}).on('froalaEditor.keydown',function(e,editor,key){var hipwig=$(this).closest('fieldset.text-box');hipwig.addClass('unsaved');}).on('froalaEditor.charCounter.exceeded',function(e,editor){$(this).closest('.text-box').find('.fr-counter').addClass('exceeded');});});});
if(typeof(stacks.totalcms)!=='object')stacks.totalcms={};stacks.totalcms.requestheaders={'Total-Key':$.trim('2f10c98f8b2e7038b14a4e186282bfc8')};stacks.totalcms.baseurl='https://www.edenduvoyageur.fr//'.replace(/\/\/$/,'/');stacks.totalcms.totalapi=stacks.totalcms.baseurl+'rw_common/plugins/stacks/total-cms/totalapi.php';stacks.totalcms.totalapi=stacks.totalcms.totalapi.replace('https:','').replace('http:','');stacks.totalcms.locale='en';stacks.totalcms.banneralert=false;stacks.totalcms.moment2php_format=function(date_string){if(!date_string)return false;return date_string.toUpperCase().replace('YYYY','Y').replace('YY','y').replace('MM','m').replace('M','n').replace('DD','d').replace('D','j').replace('HH','h').replace('ii','i').replace('II','i');};stacks.totalcms.localizeStrings={imgLandscape:"Image is not lanscape.",imgPortrait:"Image is not portrait.",imgSquare:"Image is not square.",imgMaxSize:"Image is above max allowed size.",imgMinWidth:"Image is below min allowed width.",imgMaxWidth:"Image is above max allowed width.",imgMinHeight:"Image is below min allowed height.",imgMaxHeight:"Image is above max allowed height.",unknownError:"Unknown Server Error"};var openRevealLightbox=function(el){try{el.foundation("reveal","open");}
catch(error){el.foundation();el.foundation("open");}};var closeRevealLightbox=function(el){try{el.foundation("reveal","close");}
catch(error){el.foundation();el.foundation("close");}};$(document).ready(function(){$("form form").remove();$('.blog-form .dateinput').each(function(){var dateformat=$(this).data('date-format'),timestamp=$(this).parent().find('input[name=timestamp]');$(this).val(moment().format(dateformat)).fdatepicker({language:stacks.totalcms.locale,pickTime:$(this).data('pick-time'),format:dateformat.replace('mm','ii').toLowerCase()}).on('change changeDate',function(el){var time=moment($(this).val(),dateformat).unix();$.debug('Blog Date changed to '+time);timestamp.val(time);});});$('.date-form .dateinput').each(function(){var dateformat=$(this).data('date-format'),timestamp=$(this).closest('form').find('input[name=timestamp]');$(this).fdatepicker({initialDate:'',format:dateformat.replace('mm','ii').toLowerCase(),language:stacks.totalcms.locale,pickTime:$(this).data('pick-time'),startView:$(this).data('start-view')}).on('change changeDate',function(el){var time=moment($(this).val(),dateformat).unix();$.debug('Date changed to '+time);timestamp.val(time);}).on('input change',function(){$(this).closest('fieldset').addClass('unsaved').removeClass('error success saving');$(this).closest('form.total-form').addClass('unsaved').removeClass('error success saving');});});});$(window).load(function(){var project_domain=stacks.totalcms.baseurl.split('/')[2],domain_match=function(d1,d2){d1=d1.toLowerCase();d2=d2.toLowerCase();return(d1===d2);};if(!domain_match(project_domain,window.location.hostname)){var domain_error='The Web Address configured in your RapidWeaver project ('+stacks.totalcms.baseurl+') does not match the published domain in your browser ('+window.location.hostname+'). The CMS may not function properly until this is fixed. See this FAQ .
';$('.stacks_top').prepend(domain_error);}var hipwig=$('textarea.hipwig').exists();wideArea();$("form.toggle-form fieldset.switch").each(function(){var form=$(this).closest('form.total-form'),slug=$('input[name=slug]',form).val(),type=$('input[name=type]',form).val();$.ajax({dataType:"json",url:stacks.totalcms.totalapi,data:form.serializeAndEncode(),cache:false,success:function(data){if(data.data===true){$('input[name='+type+']',form).prop('checked',true);}
else{$('input[name='+type+']',form).prop('checked',false);}},error:function(data){console.error("Error retrieving Toggle data for "+slug);console.error(data);}});$('input[name='+type+']',form).click(function(){$.ajax({type:"POST",url:stacks.totalcms.totalapi,headers:stacks.totalcms.requestheaders,data:{slug:slug,type:type,state:$(this).prop('checked')},cache:false,success:function(data){console.log("CMS Post Successful: "+data.message);},error:function(data){console.error("Error submitting toggle "+slug);console.error(data);}});});});$('.ratings-admin-list').each(function(){var admin=$(this),slug=admin.data('slug'),max=admin.data('max'),icon=admin.data('icon');$.ajax({dataType:"json",url:stacks.totalcms.totalapi,cache:false,data:{slug:slug,type:'ratings',max:max},success:function(json){$.debug("Ratings JSON for "+slug,json);if(json.data===null)return;$.each(json.data.ratings,function(index,rating){var score=index+1,raty=$('').raty({readOnly:true,hints:[score,score,score,score,score,score,score,score,score,score],starOff:'empty fa fa-fw '+stacks.ratings_template[icon].empty,starHalf:'half fa fa-fw '+stacks.ratings_template[icon].half,starOn:'full fa fa-fw '+stacks.ratings_template[icon].full,space:false,score:score,number:max,});raty.append($('
'+rating+' '));admin.prepend(raty);});}}).fail(function(data){console.error("Error getting ratings json for "+slug);console.error(data);});});$('.ratings-admin-manual').each(function(){var admin=$(this),slug=admin.data('slug'),max=admin.data('max'),icon=admin.data('icon');$.ajax({dataType:"json",url:stacks.totalcms.totalapi,cache:false,data:{slug:slug,type:'ratings',max:max},success:function(json){$.debug("Ratings JSON for "+slug,json);var score=json.data?json.data.score:0;admin.raty({hints:[false,false,false,false,false,false,false,false,false,false],starOff:'empty fa fa-fw '+stacks.ratings_template[icon].empty,starHalf:'half fa fa-fw '+stacks.ratings_template[icon].half,starOn:'full fa fa-fw '+stacks.ratings_template[icon].full,half:true,space:false,score:score,number:max,click:function(score,event){console.log("Manual Score:"+score);stacks.totalcms_submit_rating({'slug':slug,'type':'ratings','score':score,'max':max,'icon':icon,'manual':true,});}});}}).fail(function(data){console.error("Error getting ratings json for "+slug);console.error(data);});});$("fieldset.text-box, fieldset.select-box").each(function(){var form=$(this).closest('form.total-form'),slug=$('input[name=slug]',form).val(),type=$('input[name=type]',form).val();if(slug.length===0)return;if(type==='feed'||type==='blog')return;$('.password-preview',form).click(function(){var input=$('input[name=text]',form);if(input.attr('type')==='password'){$(this).addClass('fa-eye-slash').removeClass('fa-eye');input.attr('type','text');}
else{$(this).addClass('fa-eye').removeClass('fa-eye-slash');input.attr('type','password');}});$('[name='+type+']',form).val('');$.ajax({dataType:"json",url:stacks.totalcms.totalapi,data:form.serializeAndEncode(),cache:false,success:function(data){var contents=data.data;if(contents){if(type==='date'){var input=$('input[name=date]',form),format=input.data('date-format').toUpperCase().replace(':MM',':mm');contents=moment(contents,'X').format(format);}
$('textarea[name='+type+'],input[name='+type+'],select[name='+type+']',form).val(contents);$("select option",form).filter(function(){return $(this).val().trim()===contents.trim();}).prop('selected',true);if(hipwig)$('textarea.hipwig',form).froalaEditor('html.set',contents);$.debug("CMS Preload: "+contents);}},error:function(data){console.warn('Error getting CMS data for '+type+'/'+slug,data);$('textarea[name='+type+'],input[name='+type+'],select[name='+type+']',form).val('');if(hipwig)$('textarea.hipwig',form).froalaEditor('html.set','');}});});jQuery.fn.total_banner_alert=function(){var alert=$(this);alert.addClass('show');window.setTimeout(function(){alert.addClass('fadeOut');},2000);window.setTimeout(function(){alert.hide().removeClass('show fadeOut');},3500);window.setTimeout(function(){alert.show();},4000);};jQuery.fn.total_success=function(response,successCallback){var form=$(this);if(typeof(response)==='object'){console.log("CMS Post Successful: "+response.message);form.removeClass('saving').addClass('success');if(stacks.totalcms.banneralert)$('#cms-alertbox-success').total_banner_alert();if(successCallback&&typeof(successCallback)==="function")successCallback();}
else{form.total_error(response,false,false);}};jQuery.fn.total_error=function(jqxhr,status,msg,errorCallback){var form=$(this);console.error(jqxhr);if(jqxhr.responseText){var response=JSON.parse(jqxhr.responseText);console.error("CMS Post Error: "+response.message);}
else{console.error("CMS Post Error: Unable to locate error message ("+status+" "+msg+")");}
form.removeClass('saving').addClass('error unsaved');if(stacks.totalcms.banneralert)$('#cms-alertbox-error').total_banner_alert();if(errorCallback&&typeof(errorCallback)==="function")errorCallback();};jQuery.fn.total_form_submit=function(successCallback,errorCallback){if(stacks.totalcmsdemo===true){console.log('Total CMS Demo mode. Submit disabled.');return false;}
var form=$(this);form.removeClass('success error unsaved');form.find('fieldset').removeClass('success error unsaved');$('input:required,textarea:required',form).each(function(){var input=$(this);if(!input.val().trim()){form.addClass('error unsaved');input.closest('fieldset').addClass('error');var name=input.attr('name');console.error('The '+name+' field is required. You must enter a value.');}});if(form.hasClass('error'))return false;var data=form.serializeAndEncode();form.addClass('saving');$.debug("CMS Post: "+stacks.totalcms.totalapi,data);$.ajax({type:"POST",url:stacks.totalcms.totalapi,headers:stacks.totalcms.requestheaders,data:data,success:function(response){form.total_success(response,successCallback);},error:function(jqxhr,status,msg){form.total_error(jqxhr,status,msg,errorCallback);}});};$("form.text-form").submit(function(event){event.preventDefault();$(this).total_form_submit();return false;});$("#datastore-bulk-edit form.datastore-form").submit(function(event){event.preventDefault();$(this).total_form_submit();return false;});$("form.date-form").submit(function(event){event.preventDefault();$(this).total_form_submit();return false;});var dz_thumbnail=function(file,dataUrl){$.debug('dz_thumbnail',file);var thumbnailElement,i,len,ref;file.previewElement.classList.remove("dz-file-preview");ref=file.previewElement.querySelectorAll("[data-dz-thumbnail]");for(i=0,len=ref.length;i
=height){msg=stacks.totalcms.localizeStrings.imgPortrait;}
else if(rules.orientation==='square'&&width!==height){msg=stacks.totalcms.localizeStrings.imgSquare;}}
if(rules.maxsize&&size>rules.maxsize){msg=stacks.totalcms.localizeStrings.imgMaxSize;}
if(rules.minheight&&heightrules.maxheight){msg=stacks.totalcms.localizeStrings.imgMaxHeight;}
if(rules.minwidth&&widthrules.maxwidth){msg=stacks.totalcms.localizeStrings.imgMaxWidth;}}
if(msg===''){file.acceptDimensions();}
else{console.error(msg);file.rejectDimensions(msg);}
return setTimeout(((function(_this){return function(){return file.previewElement.classList.add("dz-image-preview");};})(this)),1);},dz_uploadprogress=function(file,progress,bytesSent){$.debug('dz_uploadprogress');var node,i,len,ref,results;if(file.previewElement){ref=file.previewElement.querySelectorAll("[data-dz-uploadprogress]");results=[];for(i=0,len=ref.length;i0){form.removeClass('success error unsaved').addClass('saving');if($('.empty',form).exists()||$('#feed-edit-image',form).exists()){$(this).total_form_submit(function(){reset_form();});}
else{dropzone.processQueue();}}
return false;});});$(".total-feed-admin-list").each(function(){var list=$(this),type='feed',slug=list.data('slug'),dateformat=list.data('dateformat'),get_feed_json=function(onSuccess){var form=$('form.feed-form[data-slug='+slug+']');if(form.exists()){var settings=form.data('settings');$.ajax({dataType:"json",url:stacks.totalcms.totalapi,cache:false,data:settings,success:function(json){$.debug("Feed JSON for "+slug,json);if(onSuccess&&typeof(onSuccess)==="function"){$.each(json.data.posts,onSuccess);}
list.removeAttr('style');if(list.height()>list.data('maxheight'))list.addClass('overflow');}}).fail(function(data){console.error("Error getting feed json for "+slug);console.error(data);});}},new_feed_item=function(post){var template=$($('#feed-list-template').html()).data('post',post).attr('data-timestamp',post.timestamp);$('.post-text',template).html(post.content);var postdate;if(dateformat==='relative'){postdate=moment(post.date).locale(stacks.totalcms.locale).fromNow();}
else{postdate=moment(post.date).locale(stacks.totalcms.locale).format(dateformat);}
$('.post-date',template).attr('datetime',post.date).html(postdate);var image=post.img?$(' ').attr('src',stacks.totalcms.baseurl+post.thumb.sq+"?cache="+Math.random()).attr('alt',post.alt):$(' ');$('.post-image',template).append(image);return template;};get_feed_json(function(index,post){list.append(new_feed_item(post));});list.on('refresh-feed',function(callback){get_feed_json(function(index,post){if(!$('li[data-timestamp="'+post.timestamp+'"]',list).exists()){list.prepend(new_feed_item(post));}});if(callback&&typeof(callback)==="function")callback();});});$(".admin.total-blog-list").each(function(){var list=$(this),filterform=list.parent().find('form.blog-filter').first(),type='blog',slug=list.data('slug'),dateformat=list.data('dateformat'),list_template=$('#blog-list-template').html(),filter=list.data('filter');if(filter.author||filter.genre||filter.category||filter.tag||filter.label||filter.date!=='all'||filter.draft==='only'||filter.archived==='only'||filter.featured==='only'||filter.draft==='hide'||filter.archived==='hide'||filter.featured==='hide'){delete filter.all;}
var compare_permalink=function(a,b){if(a.permalinkb.permalink)
return 1;return 0;},get_blog_json=function(onSuccess){$.debug("Blog List Filter for "+slug,filter);$.ajax({dataType:"json",url:stacks.totalcms.totalapi,cache:false,data:{slug:slug,type:type,filter:filter},success:function(json){$.debug("Blog JSON for "+slug,json);if(list.hasClass('sort-alpha')){json.data.sort(compare_permalink);}
if(onSuccess&&typeof(onSuccess)==="function"){$.each(json.data,onSuccess);}
$('.total > .count',filterform).html(json.data.length).parent().fadeIn();if(list.height()>list.data('maxheight'))list.addClass('overflow');}}).fail(function(data){console.error("Error getting blog json for "+slug);console.error(data);});},new_blog_item=function(post){var template=$(list_template);if(typeof(post.labels)==='object'){post.labels=$.map(post.labels,function(value,index){return[value];});}else{post.labels=[];}
if(typeof(post.tags)==='object'){post.tags=$.map(post.tags,function(value,index){return[value];});}
if(typeof(post.categories)==='object'){post.categories=$.map(post.categories,function(value,index){return[value];});}
template.data('author',post.author.toLowerCase());template.data('genre',post.genre.toLowerCase());template.data('title',post.title.toLowerCase());template.data('tag',post.tags.join().toLowerCase());template.data('category',post.categories.join().toLowerCase());template.data('permalink',post.permalink.toString().toLowerCase());template.data('label',post.labels.join().toLowerCase());if(post.featured)template.addClass('featured');if(post.draft)template.addClass('draft');if(post.archived)template.addClass('archived');$('.post-action',template).addClass('default');var postdate;if(dateformat==='relative'){postdate=moment(post.timestamp*1000).locale(stacks.totalcms.locale).fromNow();}
else{postdate=moment(post.timestamp*1000).locale(stacks.totalcms.locale).format(dateformat);}
$('.post-date',template).attr('datetime',post.timestamp).html(postdate);$('.post-title .author',template).html(post.author);var editUrl=list.data('editurl')+"?permalink="+post.permalink.toString().toLowerCase();$('.post-title a',template).html(post.title||post.permalink).attr('href',editUrl);$('.post-tags',template).append($(' ').html(post.genre));$.each(post.categories,function(index){$('.post-tags',template).append($(' ').html(post.categories[index]));});$.each(post.tags,function(index){$('.post-tags',template).append($(' ').html(post.tags[index]));});$.each(post.labels,function(index){$('.post-tags',template).append($(' ').html(post.labels[index]));});return template;};get_blog_json(function(index,post){list.append(new_blog_item(post));});filterform.submit(function(event){event.preventDefault();var select=$('select',this).val(),search=$('input',this).val().toLowerCase();if(search){$('li.post',list).each(function(){var post=$(this);if(select==="all"){var searchAll=function(search){var found=false;$.each(["title","category","tag","author","genre","label"],function(index,field){if(post.data(field).toLowerCase().indexOf(search)!=-1){found=true;return false;}});return found;};if(!searchAll(search)){post.addClass('hide').fadeOut();return true;}}
else{if(post.data(select).toLowerCase().indexOf(search)==-1){post.addClass('hide').fadeOut();return true;}}
post.removeClass('hide').fadeIn();});$('.total > .count',filterform).html($('.post:not(.hide)',list).length);}
else{$('.total > .count',filterform).html($('.post',list).length);$('.post',list).removeClass('hide').fadeIn();}
return false;});});$("form.blog-form").each(function(){var form=$(this),permalink=form.data('permalink'),slug=form.data('slug'),type='blog',galleryzone,imagezone,dateInput=$('input[name=date]',form),authorInput=$('input[name=author][type!=hidden]',form),genreInput=$('input[name=genre][type!=hidden]',form),tagsInput=$('input[name=tags][type!=hidden]',form),labelsInput=$('input[name=labels][type!=hidden]',form),categoriesInput=$('input[name=categories][type!=hidden]',form),tagsSelect=$('select[name=tags]',form),labelsSelect=$('select[name=labels]',form),categoriesSelect=$('select[name=categories]',form),authorSelect=$('select[name=author]',form),genreSelect=$('select[name=genre]',form),reset_form=function(){setTimeout(function(){form.removeClass('success');$('.dz-preview',form).removeClass('dz-processing dz-success dz-complete');$('.image-box .dz-preview',form).addClass('empty');var contentTemplate=$('.blog-content .blog-template',form),summaryTemplate=$('.blog-summary .blog-template',form),extraTemplate=$('.blog-extra .blog-template',form),extra2Template=$('.blog-extra2 .blog-template',form),mediaTemplate=$('.blog-media .blog-template',form),defaultContent=contentTemplate.exists()?contentTemplate.html():'',defaultSummary=summaryTemplate.exists()?summaryTemplate.html():'';defaultExtra=extraTemplate.exists()?extraTemplate.html():'';defaultExtra2=extra2Template.exists()?extra2Template.html():'';defaultMedia=mediaTemplate.exists()?mediaTemplate.html():'';$('.blog-content textarea',form).val(defaultContent);$('.blog-summary textarea',form).val(defaultSummary);$('.blog-extra textarea',form).val(defaultExtra);$('.blog-extra2 textarea',form).val(defaultExtra2);$('.blog-media textarea',form).val(defaultMedia);$('.blog-content textarea.hipwig',form).froalaEditor('html.set',defaultContent);$('.blog-summary textarea.hipwig',form).froalaEditor('html.set',defaultSummary);$('.blog-extra textarea.hipwig',form).froalaEditor('html.set',defaultExtra);$('.blog-extra2 textarea.hipwig',form).froalaEditor('html.set',defaultExtra2);$('.blog-media textarea.hipwig',form).froalaEditor('html.set',defaultMedia);if(typeof grecaptcha!=='undefined')grecaptcha.reset();},1200);},populate_form=function(permalink){$.ajax({dataType:"json",url:stacks.totalcms.totalapi,cache:false,data:{slug:slug,type:type,permalink:permalink},success:function(json){$.debug("Blog JSON for "+slug+"/"+permalink,json);$('textarea[name=content]',form).val(json.data.content);$('.blog-content textarea.hipwig',form).froalaEditor('html.set',json.data.content);$('textarea[name=extra],input[name=extra]',form).val(json.data.extra);$('textarea[name=extra2],input[name=extra2]',form).val(json.data.extra2);$('textarea[name=media],input[name=media]',form).val(json.data.media);$('.blog-extra textarea.hipwig',form).froalaEditor('html.set',json.data.extra);$('.blog-extra2 textarea.hipwig',form).froalaEditor('html.set',json.data.extra2);$('.blog-media textarea.hipwig',form).froalaEditor('html.set',json.data.media);$('textarea[name=summary]',form).val(json.data.summary);$('.blog-summary textarea.hipwig',form).froalaEditor('html.set',json.data.summary);$('input[name=permalink]',form).val(json.data.permalink);$('input[name=title]',form).val(json.data.title);$('input[name=draft]',form).val(json.data.draft.toString()).prop('checked',json.data.draft);if("undefined"==typeof json.data.archived)json.data.archived=false;$('input[name=archived]',form).val(json.data.archived.toString()).prop('checked',json.data.archived);$('input[name=featured]',form).val(json.data.featured.toString()).prop('checked',json.data.featured);$('input[name=timestamp]',form).val(json.data.timestamp);if(typeof json.data.categories==='object'){json.data.categories=$.map(json.data.categories,function(value,index){return[value];});}
if(typeof json.data.tags==='object'){json.data.tags=$.map(json.data.tags,function(value,index){return[value];});}
if(typeof json.data.labels==='object'){json.data.labels=$.map(json.data.labels,function(value,index){return[value];});$('[name=labels]',form).val(json.data.labels.join());$("select[name=labels] option",form).filter(function(){return $(this).val().trim()===json.data.labels.join();}).prop('selected',true);}
$('[name=categories]',form).val(json.data.categories.join());$('[name=tags]',form).val(json.data.tags.join());$('[name=author]',form).val(json.data.author);$('[name=genre]',form).val(json.data.genre);$("select[name=author] option",form).filter(function(){return $(this).val().trim()===json.data.author;}).prop('selected',true);$("select[name=genre] option",form).filter(function(){return $(this).val().trim()===json.data.genre;}).prop('selected',true);$("select[name=categories] option",form).filter(function(){return $(this).val().trim()===json.data.categories.join();}).prop('selected',true);$("select[name=tags] option",form).filter(function(){return $(this).val().trim()===json.data.tags.join();}).prop('selected',true);if(dateInput.exists()){var dateformat=dateInput.data('date-format');dateInput.val(moment(json.data.timestamp*1000).format(dateformat));}
if(typeof json.data.image==='object'&&json.data.image!=null){const image=json.data.image;$('.image-box .dz-preview',form).removeClass('empty');$('.image-box .dz-preview',form).data('filename',permalink);$('.image-box img',form).attr('src',stacks.totalcms.baseurl+image.img+"?cache="+Math.random()).attr('alt',image.alt).attr('title',image.alt).error(function(){$(this).addClass('notfound');$('.image-box .dz-preview',form).addClass('empty');});}
$.each(json.data.gallery,function(i,image){var template=$($('#image-preview-template').html()).data('filename',image.filename);$('img',template).attr('src',stacks.totalcms.baseurl+image.thumb.sq).attr('alt',image.alt).attr('title',image.alt).error(function(){$(this).attr('src','../rw_common/plugins/stacks/total-cms/missing.jpg');});if(image.featured)template.addClass('featured');$('.actionbar',template).addClass('fill');$('.gallery-box .total-preview',form).append(template);});}}).fail(function(data){console.error("Error getting blog json "+slug+"/"+permalink);console.error(data);});},backHistory=function(){if(window.history.length>1){setTimeout(function(){document.location=document.referrer;},2500);}},urlifyTitle=function(title){return title.replace(/\s+/g,'-').replace(/[^a-zA-Z0-9\u00C0-\u017F-]/ig,'').toLowerCase();},checkPermalink=function(permalink){var textbox=permalink.closest('.text-box'),form=permalink.closest('form'),cleanTitle=urlifyTitle(permalink.val()),exists=false;if(cleanTitle.length===0){textbox.removeClass('saving success').addClass('error');console.error('Permalink cannot be empty');return true;}
if(permalink.data('suffix')&&!form.hasClass('saving')){cleanTitle=cleanTitle+'-'+permalink.data('suffix');}
permalink.val(cleanTitle);$.ajax({type:"GET",async:false,cache:false,url:stacks.totalcms.totalapi+'?'+$.param({'slug':slug,'type':type,'permalink':cleanTitle}),success:function(obj){exists=typeof(obj.data)==='object'?true:false;if(exists){textbox.removeClass('saving success').addClass('error');console.error('Permalink already exists in the blog.');}
else{textbox.removeClass('saving error').addClass('success');}},error:function(jqxhr,status,msg){console.error(jqxhr);var response=JSON.parse(jqxhr.responseText);console.error("Permalink Check Error");console.error(response);}});return exists;};$.ajax({dataType:"json",url:stacks.totalcms.totalapi,cache:false,data:{slug:slug,type:type},success:function(json){$.debug("Blog JSON for "+slug,json);var authors=[],categories=[],tags=[],genres=[],labels=[],onlyUnique=function(value,index,self){if(value)return self.indexOf(value)===index;return false;},inputFilter=function(text,input){return Awesomplete.FILTER_CONTAINS(text,input.match(/[^,]*$/)[0]);},inputReplace=function(text){var before=this.input.value.match(/^.+,\s*|/)[0];this.input.value=before+text+", ";};if(authorInput.exists())authors=authorInput.data('prefill').split(',');if(genreInput.exists())genres=genreInput.data('prefill').split(',');if(categoriesInput.exists())categories=categoriesInput.data('prefill').split(',');if(tagsInput.exists())tags=tagsInput.data('prefill').split(',');if(labelsInput.exists())labels=labelsInput.data('prefill').split(',');if(authorSelect.exists())authors=authorSelect.data('prefill').split(',');if(genreSelect.exists())genres=genreSelect.data('prefill').split(',');if(categoriesSelect.exists())categories=categoriesSelect.data('prefill').split(',');if(tagsSelect.exists())tags=tagsSelect.data('prefill').split(',');if(labelsSelect.exists())labels=labelsSelect.data('prefill').split(',');$.each(json.data,function(index,post){authors.push(post.author);genres.push(post.genre);categories=categories.concat(post.categories);tags=tags.concat(post.tags);if(post.labels){labels=labels.concat(post.labels);}});authors=authors.map(Function.prototype.call,String.prototype.trim).filter(onlyUnique);genres=genres.map(Function.prototype.call,String.prototype.trim).filter(onlyUnique);categories=categories.map(Function.prototype.call,String.prototype.trim).filter(onlyUnique);tags=tags.map(Function.prototype.call,String.prototype.trim).filter(onlyUnique);labels=labels.map(Function.prototype.call,String.prototype.trim).filter(onlyUnique);var enableplete=function(awesomplete){if(awesomplete.ul.childNodes.length===0){awesomplete.evaluate();}
else if(awesomplete.ul.hasAttribute('hidden')){awesomplete.open();}
else{awesomplete.close();}};if(labelsSelect.exists()){labels.forEach(function(label){labelsSelect.append($(''+label+' '));});}
if(tagsSelect.exists()){tags.forEach(function(tag){tagsSelect.append($(''+tag+' '));});}
if(categoriesSelect.exists()){categories.forEach(function(category){categoriesSelect.append($(''+category+' '));});}
if(genreSelect.exists()){genres.forEach(function(genre){genreSelect.append($(''+genre+' '));});}
if(authorSelect.exists()){authors.forEach(function(author){authorSelect.append($(''+author+' '));});}
if(authorInput.exists()&&authorInput.hasClass('autocomplete')){var authorplete=new Awesomplete(authorInput[0],{list:authors,minChars:0,maxItems:15});authorInput.dblclick(function(){enableplete(authorplete);form.addClass('unsaved');authorInput.closest('fieldset').addClass('unsaved');});}
if(genreInput.exists()&&genreInput.hasClass('autocomplete')){var genreplete=new Awesomplete(genreInput[0],{list:genres,minChars:0,maxItems:15});genreInput.dblclick(function(){enableplete(genreplete);form.addClass('unsaved');genreInput.closest('fieldset').addClass('unsaved');});}
if(categoriesInput.exists()&&categoriesInput.hasClass('autocomplete')){var categoryplete=new Awesomplete(categoriesInput[0],{list:categories,minChars:0,maxItems:15,filter:inputFilter,replace:inputReplace});categoriesInput.dblclick(function(){enableplete(categoryplete);form.addClass('unsaved');categoriesInput.closest('fieldset').addClass('unsaved');});}
if(tagsInput.exists()&&tagsInput.hasClass('autocomplete')){var tagsplete=new Awesomplete(tagsInput[0],{list:tags,minChars:0,maxItems:15,filter:inputFilter,replace:inputReplace});tagsInput.dblclick(function(){enableplete(tagsplete);form.addClass('unsaved');tagsInput.closest('fieldset').addClass('unsaved');});}
if(labelsInput.exists()&&labelsInput.hasClass('autocomplete')){var labelsplete=new Awesomplete(labelsInput[0],{list:labels,minChars:0,maxItems:15,filter:inputFilter,replace:inputReplace});labelsInput.dblclick(function(){enableplete(labelsplete);form.addClass('unsaved');labelsInput.closest('fieldset').addClass('unsaved');});}
if(permalink){populate_form(permalink.toString().toLowerCase());}}}).fail(function(data){console.error("Error getting blog db json for "+slug);console.error(data);});$("input[name=title]",form).change(function(){var permalink=$('input[name=permalink]',form),cleanTitle=urlifyTitle($(this).val());if(!permalink.hasClass('locked')){permalink.val(cleanTitle);checkPermalink(permalink);}});$("input[name=permalink]",form).change(function(){var permalink=$(this);permalink.addClass('locked');checkPermalink(permalink);});if(permalink){form.addClass('edit-blog').removeClass('new-blog');$('.cms-delete').show().find('a,button').click(function(e){e.stopPropagation();e.preventDefault();if(confirm("Are you sure that you want to delete this post?")){$.ajax({type:"POST",url:stacks.totalcms.totalapi,headers:stacks.totalcms.requestheaders,data:{'slug':slug,'type':type,'permalink':permalink,'_METHOD':'DELETE'},success:function(data){reset_form();if(stacks.totalcms.banneralert)$('#cms-alertbox-success').total_banner_alert();backHistory();console.log("CMS DELETE Successful: "+data.message);},error:function(jqxhr,status,msg){console.error(jqxhr);var response=JSON.parse(jqxhr.responseText);console.error("CMS DELETE Error");console.error(response);}});}});}
else{reset_form();}
$('.datepicker').click(function(){form.addClass('unsaved');if(form.hasClass('edit-blog')){$('.text-box.date',form).addClass('unsaved');}});$('.switch input',form).click(function(){form.addClass('unsaved');$(this).val($(this).prop('checked').toString());});var blogFormData=function(dropzone){const formData=form.serializeObject();const deleteFields=["summary","content","extra","extra2","media","title"];for(const field of deleteFields){delete formData[field];}
dropzone.options.params=formData;};if($('.image-box',form).exists()){$('.image-box',form).dropzone({url:stacks.totalcms.totalapi,headers:stacks.totalcms.requestheaders,paramName:"image",parallelUploads:1,autoProcessQueue:form.hasClass("edit-blog"),thumbnailWidth:null,thumbnailHeight:null,previewsContainer:'#'+form.attr('id')+' .image-box .total-preview',previewTemplate:$('#image-preview-template').html(),clickable:'#'+form.attr('id')+' .image-box .dz-overlay',forceFallback:false,acceptedFiles:'image/jpeg,image/png,image/gif',addedfile:function(file){imagezone=this;file.previewElement=window.Dropzone.createElement(this.options.previewTemplate.trim());file.previewTemplate=file.previewElement;var img_height=$('img',this.previewsContainer).height();this.previewsContainer.innerHTML='';this.previewsContainer.appendChild(file.previewElement);$('img',this.previewsContainer).height(img_height).width('100%');blogFormData(this);},thumbnail:dz_thumbnail,uploadprogress:dz_uploadprogress,drop:dz_dragleave,dragenter:dz_dragenter,dragleave:dz_dragleave,error:dz_error,accept:dz_accept,success:dz_success});}
if($('.gallery-box',form).exists()){new Dropzone($('.gallery-box',form)[0],{url:stacks.totalcms.totalapi,method:"post",headers:stacks.totalcms.requestheaders,paramName:"gallery",parallelUploads:1,autoProcessQueue:form.hasClass("edit-blog"),thumbnailWidth:null,thumbnailHeight:null,previewsContainer:'#'+form.attr('id')+' .gallery-box .total-preview',previewTemplate:$('#image-preview-template').html(),clickable:'#'+form.attr('id')+' .gallery-box .dz-preview:first-child',forceFallback:false,acceptedFiles:'image/jpeg,image/png,image/gif',addedfile:function(file){galleryzone=this;file.previewElement=window.Dropzone.createElement(this.options.previewTemplate.trim());file.previewTemplate=file.previewElement;$(file.previewElement).find('.actionbar').addClass('fill');$('.dz-preview',this.previewsContainer).first().after(file.previewElement);form.addClass("unsaved");blogFormData(this);},thumbnail:dz_thumbnail,uploadprogress:dz_uploadprogress,drop:dz_dragleave,dragenter:dz_dragenter,dragleave:dz_dragleave,error:dz_error,accept:dz_accept,success:dz_success});}
form.submit(function(event){if(stacks.totalcmsdemo===true){console.log('Total CMS Demo mode. Submit disabled.');return false;}
event.preventDefault();var form=$(this),permalink=$('input[name=permalink]',form);form.addClass('saving');var afterSumbitAction=function(){$.debug('Running afterSumbitAction');if(form.find('.error').length>0)return false;if(window.debug!==true){if((form.hasClass('edit-blog')&&form.hasClass('edit-redirect-back'))||(form.hasClass('new-blog')&&form.hasClass('new-redirect-back'))){setTimeout(function(){backHistory();},3500);}
if(form.hasClass('edit-blog')&&form.hasClass('edit-redirect')){setTimeout(function(){document.location=form.data('editurl');},3500);}
if(form.hasClass('new-blog')&&form.hasClass('new-redirect')){setTimeout(function(){document.location=form.data('newurl');},3500);}}
form.addClass('edit-blog').removeClass('new-blog');form.append(permalink.clone().attr('type','hidden'));permalink.addClass('locked').prop('disabled',true);if(stacks.totalcms.banneralert)$('#cms-alertbox-success').total_banner_alert();$('input.btoa,textarea.btoa',form).each(function(){$(this).val($(this).data('content')).removeClass('btoa');});},blogSubmit=function(successCallback,errorCallback){form.removeClass('success error unsaved');var autoSummary=$('.auto-summary',form);if(autoSummary.exists()){var content=$("
").html($('textarea[name=content]',form).val()).text(),charCount=autoSummary.data('charcount');var summary=content.substr(0,charCount);summary=summary.substr(0,Math.min(summary.length,summary.lastIndexOf(" ")));autoSummary.val(""+summary+"
");}
$('input:required,textarea:required',form).each(function(){var input=$(this);if(!input.val().trim()){form.addClass('unsaved');input.closest('fieldset').addClass('error');var name=input.attr('name');console.error('The '+name+' field is required. You must enter a value.');}});if(form.find('.error').exists())return false;var data=form.serializeAndEncode();$.debug("CMS Blog Posting: "+stacks.totalcms.totalapi,data);$.ajax({type:"POST",url:stacks.totalcms.totalapi,headers:stacks.totalcms.requestheaders,data:data,success:function(data){console.log("CMS Post Successful: "+data.message);form.removeClass('saving').addClass('success');if(successCallback&&typeof(successCallback)==="function")successCallback();},error:function(jqxhr,status,msg){console.error(jqxhr);if(jqxhr.responseText){var response=JSON.parse(jqxhr.responseText);console.error("CMS Post Error: "+response.message);}
else{console.error("CMS Post Error: Unable to locate error message ("+status+" "+msg+")");}
form.removeClass('saving').addClass('error unsaved');if(stacks.totalcms.banneralert)$('#cms-alertbox-error').total_banner_alert();if(errorCallback&&typeof(errorCallback)==="function")errorCallback();}});};if(permalink.closest('.text-box').hasClass('error'))return false;if(form.hasClass('new-blog')&&checkPermalink(permalink)===true)return false;if(typeof grecaptcha!=='undefined'){$('.g-recaptcha iframe',form).removeClass('error');var stackid=$('.g-recaptcha',form).data('stack');$.ajax({type:"POST",url:"post_files/"+stackid+"_recaptcha.php",headers:stacks.totalcms.requestheaders,data:form.serializeAndEncode(),cache:false,success:function(data){$.debug('reCAPTCHA WORKS!',data);blogSubmit(function(){if(!galleryzone&&!imagezone)afterSumbitAction();});},error:function(data){console.error("Error checking reCAPTCHA");console.error(data);$('.g-recaptcha iframe',form).addClass('error');},complete:function(){grecaptcha.reset();}});}
else{blogSubmit(function(){if(!galleryzone&&!imagezone)afterSumbitAction();});}
if(galleryzone){galleryzone.on("queuecomplete",afterSumbitAction);galleryzone.on("processing",function(){this.options.autoProcessQueue=true;});}
if(imagezone){imagezone.on("processing",function(){this.options.autoProcessQueue=true;});}
if(galleryzone&&imagezone){imagezone.on("queuecomplete",function name(params){galleryzone.processQueue();});imagezone.processQueue();}
else{if(imagezone){imagezone.on("queuecomplete",afterSumbitAction);imagezone.processQueue();}
if(galleryzone){galleryzone.processQueue();}}
return false;});});$("form.image-form").each(function(){var form=$(this),form_id=form.attr('id');form.dropzone({url:stacks.totalcms.totalapi,headers:stacks.totalcms.requestheaders,parallelUploads:1,autoProcessQueue:true,thumbnailWidth:null,thumbnailHeight:null,previewsContainer:'#'+form_id+' .total-preview',previewTemplate:$('#image-preview-template').html(),clickable:['#'+form_id+' .dz-overlay','#'+form_id+' img'],forceFallback:false,acceptedFiles:'image/jpeg,image/png,image/gif',addedfile:function(file){$.debug('dz_addedfile');file.previewElement=window.Dropzone.createElement(this.options.previewTemplate.trim());file.previewTemplate=file.previewElement;var img_height=$('img',this.previewsContainer).height();this.previewsContainer.innerHTML='';this.previewsContainer.appendChild(file.previewElement);$('img',this.previewsContainer).height(img_height).width('100%');},thumbnail:dz_thumbnail,uploadprogress:dz_uploadprogress,drop:dz_dragleave,dragenter:dz_dragenter,dragleave:dz_dragleave,error:dz_error,success:dz_success,accept:dz_accept});});$("form.gallery-form").each(function(){var form=$(this),form_id=form.attr('id'),preview=$('.total-preview',form),slug=$('input[name=slug]',form).val(),type=$('input[name=type]',form).val();$.ajax({dataType:"json",url:stacks.totalcms.totalapi,cache:false,data:{slug:slug,type:type},success:function(json){$.debug("Gallery JSON for "+slug,json);$.each(json.data.images,function(i,image){var template=$($('#image-preview-template').html()).data('filename',image.filename);$('img',template).attr('src',stacks.totalcms.baseurl+image.thumb.sq).attr('alt',image.alt).attr('title',image.alt).error(function(){$(this).attr('src','../rw_common/plugins/stacks/total-cms/missing.jpg');});if(image.featured)template.addClass('featured');$('.actionbar',template).addClass('fill');preview.append(template);});if(preview.height()>preview.data('maxheight'))preview.addClass('overflow');}}).fail(function(data){console.error("Error getting gallery json "+slug);console.error(data);});form.dropzone({url:stacks.totalcms.totalapi,headers:stacks.totalcms.requestheaders,parallelUploads:1,autoProcessQueue:true,thumbnailWidth:null,thumbnailHeight:null,previewsContainer:'#'+form_id+' .total-preview',previewTemplate:$('#image-preview-template').html(),clickable:'#'+form.attr('id')+' .dz-preview:first-child',forceFallback:false,acceptedFiles:'image/jpeg,image/png,image/gif',addedfile:function(file){$.debug('dz_addedfile');file.previewElement=window.Dropzone.createElement(this.options.previewTemplate.trim());file.previewTemplate=file.previewElement;$(file.previewElement).find('.actionbar').addClass('fill');$('.dz-preview',this.previewsContainer).first().after(file.previewElement);},thumbnail:dz_thumbnail,uploadprogress:dz_uploadprogress,drop:dz_dragleave,dragenter:dz_dragenter,dragleave:dz_dragleave,error:dz_error,success:dz_success,accept:dz_accept});});$('.gallery-box .total-preview').each(function(){var form=$(this).closest('form.total-form');Sortable.create(this,{handle:".imagebar-move",clickable:".dz-clickable",draggable:".dz-preview",animation:500,onEnd:function(event){$(event.item).removeClass('dz-success');$.debug('drag end',event);var oldIndex=event.oldIndex-1,newIndex=event.newIndex===0?event.newIndex:event.newIndex-1,data=form.serialize()+"&oldIndex="+oldIndex+"&newIndex="+newIndex;$.ajax({type:"POST",url:stacks.totalcms.totalapi,headers:stacks.totalcms.requestheaders,data:data,cache:false,success:function(data){console.log("Image Reorder Successful: "+data.message);},error:function(data){console.error("Error reordering image "+slug);console.error(data);}});}});});var mime_type={'zip':{mime:'application/zip',fa:'fa-file-archive-o'},'pdf':{mime:'application/pdf',fa:'fa-file-pdf-o'},'rtf':{mime:'application/rtf',fa:'fa-file-text-o'},'eps':{mime:'application/postscript',fa:'fa-file-image-o'},'psd':{mime:'application/octet-stream',fa:'fa-file-image-o'},'doc':{mime:'application/vnd.openxmlformats-officedocument.wordprocessingml.document',fa:'fa-file-word-o'},'xls':{mime:'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',fa:'fa-file-excel-o'},'ppt':{mime:'application/vnd.openxmlformats-officedocument.presentationml.presentation',fa:'fa-file-powerpoint-o'},'docx':{mime:'application/vnd.openxmlformats-officedocument.wordprocessingml.document',fa:'fa-file-word-o'},'xlsx':{mime:'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',fa:'fa-file-excel-o'},'pptx':{mime:'application/vnd.openxmlformats-officedocument.presentationml.presentation',fa:'fa-file-powerpoint-o'},'doc':{mime:'application/msword',fa:'fa-file-word-o'},'xls':{mime:'application/excel',fa:'fa-file-excel-o'},'ppt':{mime:'application/powerpoint',fa:'fa-file-powerpoint-o'},'mp3':{mime:'audio/mpeg',fa:'fa-file-audio-o'},'mp4':{mime:'video/mp4',fa:'fa-file-video-o'},'ogg':{mime:'audio/ogg',fa:'fa-file-audio-o'},'ogv':{mime:'video/ogg',fa:'fa-file-video-o'},'webm':{mime:'video/webm',fa:'fa-file-video-o'},'txt':{mime:'text/plain',fa:'fa-file-text-o'},'csv':{mime:'text/csv',fa:'fa-file-text-o'},'html':{mime:'text/html',fa:'fa-file-code-o'},'css':{mime:'text/css',fa:'fa-file-code-o'},'js':{mime:'text/javascript',fa:'fa-file-code-o'},'jpg':{mime:'image/jpeg',fa:'fa-file-image-o'},'png':{mime:'image/png',fa:'fa-file-image-o'},'gif':{mime:'image/gif',fa:'fa-file-image-o'},'apng':{mime:'image/apng',fa:'fa-file-image-o'},'webp':{mime:'image/webp',fa:'fa-file-image-o'},'avif':{mime:'image/avif',fa:'fa-file-image-o'},'svg':{mime:'image/svg+xml',fa:'fa-file-image-o'},'swf':{mime:'application/x-shockwave-flash',fa:'fa-file-o'}};$("form.file-form").each(function(){var form=$(this),form_id=form.attr('id'),slug=$('input[name=slug]',form).val(),type=$('input[name=type]',form).val(),ext=$('input[name=ext]',form).val();if(mime_type[ext]){$('.file-icon',form).removeClass('fa-file-o').addClass(mime_type[ext].fa);}
form.dropzone({url:stacks.totalcms.totalapi,headers:stacks.totalcms.requestheaders,parallelUploads:1,maxFilesize:1024,autoProcessQueue:true,thumbnailWidth:null,thumbnailHeight:null,previewsContainer:'#'+form_id+' .total-preview',clickable:$.isMobile()?'#'+form.attr('id')+' .total-preview':'#'+form.attr('id')+' .file-icon',forceFallback:false,acceptedFiles:mime_type[ext]?mime_type[ext].mime:`.${ext}`,addedfile:function(file){file.previewElement=document.querySelectorAll(this.options.previewsContainer+' .dz-preview')[0];file.previewTemplate=file.previewElement;},uploadprogress:dz_uploadprogress,drop:dz_dragleave,dragenter:dz_dragenter,dragleave:dz_dragleave,error:dz_error,success:dz_success});});$("form.depot-form").each(function(){var form=$(this),form_id=form.attr('id'),preview=$('.total-preview',form),slug=$('input[name=slug]',form).val(),type=$('input[name=type]',form).val(),ext=$('input[name=ext]',form).val();$.ajax({dataType:"json",url:stacks.totalcms.totalapi,cache:false,data:{slug:slug,type:type},success:function(json){$.debug("Depot JSON for "+slug,json);if(json.data.files){$.each(json.data.files.reverse(),function(i,filename){var template=$($('#file-preview-template').html()),ext=filename.split('.').pop();if(mime_type[ext]){$('.file-icon',template).removeClass('fa-file-o').addClass(mime_type[ext].fa);}
$('.filename',template).html(filename);$('.actionbar',template).addClass('fill');$('.dz-preview',preview).first().after(template);});if(preview.height()>preview.data('maxheight'))preview.addClass('overflow');}}}).fail(function(data){console.error("Error getting depot json "+slug);console.error(data);});form.dropzone({url:stacks.totalcms.totalapi,headers:stacks.totalcms.requestheaders,parallelUploads:1,maxFilesize:1024,autoProcessQueue:true,thumbnailWidth:null,thumbnailHeight:null,previewsContainer:'#'+form_id+' .total-preview',previewTemplate:$('#file-preview-template').html(),clickable:'#'+form.attr('id')+' .dz-preview:first-child',forceFallback:false,addedfile:function(file){file.previewElement=window.Dropzone.createElement(this.options.previewTemplate.trim());file.previewTemplate=file.previewElement;$(file.previewElement).find('.actionbar').addClass('fill');$('.dz-preview',this.previewsContainer).first().after(file.previewElement);},acceptedFiles:mime_type[ext]?mime_type[ext].mime:null,uploadprogress:dz_uploadprogress,drop:dz_dragleave,dragenter:dz_dragenter,dragleave:dz_dragleave,error:dz_error,success:function(file){if(file.previewElement){var ext=file.name.split('.').pop(),name=file.name.replace('.'+ext,'').replace(/\W+/g,'-'),full=(name+'.'+ext),preview=$(file.previewElement);if(mime_type[ext]){$('.file-icon',preview).removeClass('fa-file-o').addClass(mime_type[ext].fa);}
$('.filename',preview).html(full);$(file.previewElement).addClass("dz-success").removeClass('dz-processing');}}});});});$(window).load(function(){$('.cms-save a,.cms-save button,a.cms-save,button.cms-save').click(function(event){event.preventDefault();var form=$(this)[0].form;if(form){$(form).submit();}else{$('form.total-form.unsaved').submit();}
return false;});$('.hipwig textarea').on('froalaEditor.save.before',function(e,editor){$(this).closest('form.total-form').submit();}).on('froalaEditor.contentChanged',function(e,editor){$(this).closest('form.total-form').addClass('unsaved');});$('fieldset.text-box,fieldset.select-box').append(' ');$('.text-box input,.text-box textarea,.fr-view,.select-box select').on('input',function(event){$(this).closest('fieldset').addClass('unsaved').closest('form.total-form').addClass('unsaved').removeClass('error success saving');});$('.select-box select').on('input',function(event){$(this).closest('fieldset').addClass('unsaved').closest('form.total-form').addClass('unsaved').removeClass('error success saving');});if(window.navigator.userAgent.indexOf("MSIE")>0||window.navigator.userAgent.indexOf("Edge")>0){console.log("IE HACK");$('.select-box select').on('click',function(){$(this).closest('fieldset').addClass('unsaved').closest('form.total-form').addClass('unsaved').removeClass('error success saving');});}
$('.text-box a.fullscreen').on('click',function(){$(this).closest('.text-box').addClass('unsaved');$(this).closest('form.total-form').addClass('unsaved').removeClass('error success saving');});$(document).keydown(function(event){if(event.which==83){if(window.navigator.platform==='MacIntel'&&!event.metaKey)return;if(window.navigator.platform!=='MacIntel'&&!event.ctrlKey)return;if(!$('.widearea-overlayLayer').exists()){$('form.total-form.unsaved, form.blog-form').submit();event.preventDefault();return false;}}
if(event.which=='13'){if(!event.target.closest('form.blog-filter').exists()||!event.target.closest('form.blog-filter-form').exists()){event.preventDefault();return false;}}});if($.isMobile())$('input:read-only').prop('readonly',false);setTimeout(function(){$('input,textarea').each(function(){if($(this).val()!=="")$(this).attr("placeholder","");});},2000);});
return stack;})(stacks.stacks_in_242883);
stacks.stacks_in_242876 = {};
stacks.stacks_in_242876 = (function(stack) {
var jQuery = stacks.jQuery;var $ = jQuery;
stacks.fInit=function(stack){return stack;}
window.wowjsmobile=true;window.revealAnimation='fadeAndPop';window.revealNoScroll=false;$(document).on('opened.fndtn.reveal','[data-reveal]',function(){$(window).trigger('resize')});$(document).ready(function(){if($.isMobile()){$('.show-for-touch').fadeIn('fast');$("a[data-dropdown],a.menu-icon,a.touchfix").on('touchend',function(){$(this).trigger('click')});}});var useCustomSelector='True',stacksTrue='True',headerFamily='Open Sans'==='custom'?'':"Open Sans",headerFamilyFallback='sans-serif',headerSelector='h1'+',.font-family-h1',headerStyle='normal',headerGoogle=headerFamily==='Open Sans'?stacksTrue:'Open Sans'==='custom'?'False':'false',headerWeight=headerStyle==='italic'?'600italic':'600',headerWeight=headerWeight+',400'.replace(/\s/g,''),header2Family='Open Sans'==='custom'?'':'Open Sans',header2FamilyFallback='sans-serif',header2Selector='h2, h3, h4, h5, h6'+',.font-family-h2',header2Style='normal',header2Google=header2Family==='Open Sans'?stacksTrue:'Open Sans'==='custom'?'False':'false',header2Weight=header2Style==='italic'?'500italic':'500',header2Weight=header2Weight+',400'.replace(/\s/g,''),fontFamily='Verdana, Geneva, sans-serif'==='custom'?'':'Verdana, Geneva, sans-serif',fontFamilyFallback='sans-serif',fontSelector='p'+',.font-family-text',fontGoogle=fontFamily==='Open Sans'?stacksTrue:'Verdana, Geneva, sans-serif'==='custom'?'False':'false',fontWeight='400,400'.replace(/\s/g,''),getGoogleUrls=function(fontStore){var googleFonts=[];for(var family in fontStore){var weights=fontStore[family].join().replace(/,,/g,',').replace(/,$/,'');googleFonts.push('https://fonts.googleapis.com/css?family='+family+':'+weights);}
return googleFonts;},isGFont=function(family,google){if(google===stacksTrue)return family;return false;},getGoogleFonts=function(data){var fonts=data.fonts,weights=data.weights,google=data.google,fontStore=new Object();for(var i=0;i li:not(.divider)',stack),dividers=$('.menu-align-centered ul.menu > li.divider',stack);if($('.top-bar .toggle-topbar',stack).is(':visible')){items.removeAttr('style');}
else{var count=items.length;if(count>0){var width=dividers.length>0?100/count-0.2:100/count;items.width(width+"%");}}};calcMenuItemWidth();$(window).on('resize',calcMenuItemWidth);}
$(dropdowns).attr('aria-haspopup','true');$(dropdowns).hover(function(){$('> a:not(.button)',this).addClass('hovered');},function(){$('> a:not(.button)',this).removeClass('hovered');});});$(window).load(function(){var stack=$('#stacks_in_242725');if('62.563em'==='62.563em'){$('.parent-link.hide-for-medium-up',stack).removeClass('hide-for-medium-up').addClass('hide-for-large-up');}
else if('62.563em'==='9999px'){$('.parent-link.hide-for-medium-up',stack).removeClass('hide-for-medium-up');}});
return stack;})(stacks.stacks_in_242725);
stacks.stacks_in_242845 = {};
stacks.stacks_in_242845 = (function(stack) {
var jQuery = stacks.jQuery;var $ = jQuery; $(document).ready(function(){$('time.post-date').each(function(){var datetime=$(this).attr('datetime'),dateformat=$(this).data('dateformat');if(dateformat==='relative'){$(this).html(moment(datetime).locale(stacks.totalcms.locale).fromNow());}
else{$(this).html(moment(datetime).locale(stacks.totalcms.locale).format(dateformat));}});});
return stack;})(stacks.stacks_in_242845);
stacks.stacks_in_225788_236282 = {};
stacks.stacks_in_225788_236282 = (function(stack) {
var jQuery = stacks.jQuery;var $ = jQuery; $(document).ready(function(){var iconbar=$('#stacks_in_225788_236282 .icon-bar'),count=$('> a',iconbar).length,countClass=['hide','one-up','two-up','three-up','four-up','five-up','six-up','seven-up','eight-up'];iconbar.addClass(countClass[count]);});
return stack;})(stacks.stacks_in_225788_236282);
stacks.stacks_in_225788_236225 = {};
stacks.stacks_in_225788_236225 = (function(stack) {
var jQuery = stacks.jQuery;var $ = jQuery; $(document).ready(function(){var iconbar=$('#stacks_in_225788_236225 .icon-bar'),count=$('> a',iconbar).length,countClass=['hide','one-up','two-up','three-up','four-up','five-up','six-up','seven-up','eight-up'];iconbar.addClass(countClass[count]);});
return stack;})(stacks.stacks_in_225788_236225);
stacks.stacks_in_225788_236320 = {};
stacks.stacks_in_225788_236320 = (function(stack) {
var jQuery = stacks.jQuery;var $ = jQuery; if(typeof(stacks.totalcms)!=='object')stacks.totalcms={};stacks.totalcms.requestheaders={'Total-Key':$.trim('2f10c98f8b2e7038b14a4e186282bfc8')};stacks.totalcms.baseurl='https://www.edenduvoyageur.fr//'.replace(/\/\/$/,'/');stacks.totalcms.baseurl=stacks.totalcms.baseurl.replace('https:','').replace('http:','');stacks.totalcms.totalapi=stacks.totalcms.baseurl+'rw_common/plugins/stacks/total-cms/totalapi.php';stacks.totalcms.locale='fr';
return stack;})(stacks.stacks_in_225788_236320);