!function(){var e={7857:function(e,t,n){"use strict";n.d(t,{G:function(){return a}});var i=n(6879),o=n.n(i),a=function(e){return e===o()||JSON.stringify((null==e?void 0:e.cfg)||{})===JSON.stringify((null===o()||void 0===o()?void 0:o().cfg)||{})};t.A=o()},4885:function(e,t,n){"use strict";n.r(t);var i=n(7857);document.addEventListener("lazybeforeunveil",function(e){var t;(0,i.G)(null==e||null===(t=e.detail)||void 0===t?void 0:t.instance)&&function(e){var t=e.getAttribute("data-bg-image")||e.getAttribute("data-bg"),n=e.hasAttribute("data-bg-image")?"background-image":"background";if(t){var i,o=e.getAttribute("style")||"",a="".concat(n,": ").concat(t,";"),r=new RegExp("".concat(n,"\\s*:\\s*[^;]+;?"));i=r.test(o)?o.replace(r,a):o.length>0?o.replace(/;$/g,"")+";"+a:a,e.setAttribute("style",i.trim())}}(e.target)})},5651:function(e,t,n){"use strict";n.r(t);var i,o,a,r,s,l,u,d=n(7857);function c(e){return c="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},c(e)}function f(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,v(i.key),i)}}function v(e){var t=function(e,t){if("object"!=c(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=c(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==c(t)?t:t+""}o="smush-lazyload-video",a="smush-lazyloaded-video",r="smush-lazyload-autoplay",s="ontouchstart"in window?"touchstart":"pointerdown",l=Number(null===(i=window)||void 0===i?void 0:i.smush_video_render_delay)||0,u=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.shouldDelayVideoRenderingForMobile=this.supportsIntersectionObserver(),this.queuedVideoElements=[],this.isMobileOrSafari=null,this.init()},t=[{key:"init",value:function(){var e=this;document.addEventListener("lazybeforeunveil",function(t){return e.handleVideoLazyLoad(t)}),document.addEventListener(s,function(){return e.enableVideoRenderingForMobile()},{once:!0,passive:!0}),document.addEventListener("DOMContentLoaded",function(){l<=0?document.querySelector(".".concat(o,".").concat(r))&&e.enableVideoRenderingForMobile():setTimeout(function(){return e.enableVideoRenderingForMobile()},l)})}},{key:"handleVideoLazyLoad",value:function(e){var t,n=e.target;(0,d.G)(null==e||null===(t=e.detail)||void 0===t?void 0:t.instance)&&n.classList.contains(o)&&(this.handleButtonPlay(n),this.maybePrepareVideoForPlay(n))}},{key:"handleButtonPlay",value:function(e){var t=this,n=e.querySelector(".".concat("smush-play-btn"));if(n){var i=function(){return t.loadIframeVideoWithAutoPlay(e)};n.addEventListener("click",i),n.addEventListener("keydown",function(e){"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),i())})}else{var o;this.loadIframeVideo(e),null===(o=window.console)||void 0===o||o.warning("Missing play button [.smush-play-btn] for video element:",e)}}},{key:"maybePrepareVideoForPlay",value:function(e){var t=e.classList.contains(r);this.shouldPrepareIframeForPlay()?this.maybePrepareVideoForMobileAndSafari(e,t):t&&this.loadIframeVideoWithAutoPlay(e)}},{key:"enableVideoRenderingForMobile",value:function(){this.shouldDelayVideoRenderingForMobile&&(this.shouldDelayVideoRenderingForMobile=!1,this.maybeObserveQueuedVideoElements())}},{key:"supportsIntersectionObserver",value:function(){return"IntersectionObserver"in window}},{key:"maybeObserveQueuedVideoElements",value:function(){this.queuedVideoElements.length&&this.observeQueuedVideoElements()}},{key:"observeQueuedVideoElements",value:function(){var e=this,t=new IntersectionObserver(function(n){n.forEach(function(n){if(n.isIntersecting){var i=n.target;e.loadIframeVideo(i),t.unobserve(i)}})},{rootMargin:"0px 0px 200px 0px",threshold:.1});this.queuedVideoElements.forEach(function(e){t.observe(e)})}},{key:"maybePrepareVideoForMobileAndSafari",value:function(e,t){this.shouldDelayVideoRenderingForMobile?this.queuedVideoElements.push(e):this.loadIframeVideo(e,t)}},{key:"shouldPrepareIframeForPlay",value:function(){return null===this.isMobileOrSafari&&(this.isMobileOrSafari=this.checkIfMobileOrSafari()),this.isMobileOrSafari}},{key:"checkIfMobileOrSafari",value:function(){var e=navigator.userAgent;return e.includes("Mobi")||e.includes("Safari")&&!e.includes("Chrome")}},{key:"loadIframeVideo",value:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!e.classList.contains(a)){e.classList.add(a,"loading");var i=e.querySelector("iframe");if(i){var o=null===(t=i.dataset)||void 0===t?void 0:t.src;if(o){if(n){var r=new URL(o);r.searchParams.set("autoplay","1"),r.searchParams.set("playsinline","1"),o=r.toString()}var s=i.getAttribute("allow")||"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture";s.includes("autoplay")||(s+="; autoplay"),i.setAttribute("allow",s),i.setAttribute("allowFullscreen","true"),i.setAttribute("src",o),e.classList.remove("loading")}else{var l;null===(l=window.console)||void 0===l||l.error("Missing data-src attribute for iframe:",i)}}else{var u;null===(u=window.console)||void 0===u||u.error("Missing iframe element in video wrapper:",e)}}}},{key:"loadIframeVideoWithAutoPlay",value:function(e){this.loadIframeVideo(e,!0)}}],t&&f(e.prototype,t),n&&f(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n}(),new u},6879:function(e){!function(t){var n=function(e,t,n){"use strict";var i,o;if(function(){var t,n={lazyClass:"lazyload",loadedClass:"lazyloaded",loadingClass:"lazyloading",preloadClass:"lazypreload",errorClass:"lazyerror",autosizesClass:"lazyautosizes",fastLoadedClass:"ls-is-cached",iframeLoadMode:0,srcAttr:"data-src",srcsetAttr:"data-srcset",sizesAttr:"data-sizes",minSize:40,customMedia:{},init:!0,expFactor:1.5,hFac:.8,loadMode:2,loadHidden:!0,ricTimeout:0,throttleDelay:125};for(t in o=e.lazySizesConfig||e.lazysizesConfig||{},n)t in o||(o[t]=n[t])}(),!t||!t.getElementsByClassName)return{init:function(){},cfg:o,noSupport:!0};var a=t.documentElement,r=e.HTMLPictureElement,s="addEventListener",l="getAttribute",u=e[s].bind(e),d=e.setTimeout,c=e.requestAnimationFrame||d,f=e.requestIdleCallback,v=/^picture$/i,y=["load","error","lazyincluded","_lazyloaded"],m={},h=Array.prototype.forEach,b=function(e,t){return m[t]||(m[t]=new RegExp("(\\s|^)"+t+"(\\s|$)")),m[t].test(e[l]("class")||"")&&m[t]},g=function(e,t){b(e,t)||e.setAttribute("class",(e[l]("class")||"").trim()+" "+t)},p=function(e,t){var n;(n=b(e,t))&&e.setAttribute("class",(e[l]("class")||"").replace(n," "))},z=function(e,t,n){var i=n?s:"removeEventListener";n&&z(e,t),y.forEach(function(n){e[i](n,t)})},w=function(e,n,o,a,r){var s=t.createEvent("Event");return o||(o={}),o.instance=i,s.initEvent(n,!a,!r),s.detail=o,e.dispatchEvent(s),s},C=function(t,n){var i;!r&&(i=e.picturefill||o.pf)?(n&&n.src&&!t[l]("srcset")&&t.setAttribute("srcset",n.src),i({reevaluate:!0,elements:[t]})):n&&n.src&&(t.src=n.src)},E=function(e,t){return(getComputedStyle(e,null)||{})[t]},A=function(e,t,n){for(n=n||e.offsetWidth;n<o.minSize&&t&&!e._lazysizesWidth;)n=t.offsetWidth,t=t.parentNode;return n},M=(ge=[],pe=[],ze=ge,we=function(){var e=ze;for(ze=ge.length?pe:ge,he=!0,be=!1;e.length;)e.shift()();he=!1},Ce=function(e,n){he&&!n?e.apply(this,arguments):(ze.push(e),be||(be=!0,(t.hidden?d:c)(we)))},Ce._lsFlush=we,Ce),S=function(e,t){return t?function(){M(e)}:function(){var t=this,n=arguments;M(function(){e.apply(t,n)})}},L=function(e){var t,i=0,a=o.throttleDelay,r=o.ricTimeout,s=function(){t=!1,i=n.now(),e()},l=f&&r>49?function(){f(s,{timeout:r}),r!==o.ricTimeout&&(r=o.ricTimeout)}:S(function(){d(s)},!0);return function(e){var o;(e=!0===e)&&(r=33),t||(t=!0,(o=a-(n.now()-i))<0&&(o=0),e||o<9?l():d(l,o))}},P=function(e){var t,i,o=99,a=function(){t=null,e()},r=function(){var e=n.now()-i;e<o?d(r,o-e):(f||a)(a)};return function(){i=n.now(),t||(t=d(r,o))}},V=(U=/^img$/i,J=/^iframe$/i,K="onscroll"in e&&!/(gle|ing)bot/.test(navigator.userAgent),X=0,Y=0,Z=0,ee=-1,te=function(e){Z--,(!e||Z<0||!e.target)&&(Z=0)},ne=function(e){return null==G&&(G="hidden"==E(t.body,"visibility")),G||!("hidden"==E(e.parentNode,"visibility")&&"hidden"==E(e,"visibility"))},ie=function(e,n){var i,o=e,r=ne(e);for(j-=n,Q+=n,$-=n,H+=n;r&&(o=o.offsetParent)&&o!=t.body&&o!=a;)(r=(E(o,"opacity")||1)>0)&&"visible"!=E(o,"overflow")&&(i=o.getBoundingClientRect(),r=H>i.left&&$<i.right&&Q>i.top-1&&j<i.bottom+1);return r},oe=function(){var e,n,r,s,u,d,c,f,v,y,m,h,b=i.elements;if((W=o.loadMode)&&Z<8&&(e=b.length)){for(n=0,ee++;n<e;n++)if(b[n]&&!b[n]._lazyRace)if(!K||i.prematureUnveil&&i.prematureUnveil(b[n]))fe(b[n]);else if((f=b[n][l]("data-expand"))&&(d=1*f)||(d=Y),y||(y=!o.expand||o.expand<1?a.clientHeight>500&&a.clientWidth>500?500:370:o.expand,i._defEx=y,m=y*o.expFactor,h=o.hFac,G=null,Y<m&&Z<1&&ee>2&&W>2&&!t.hidden?(Y=m,ee=0):Y=W>1&&ee>1&&Z<6?y:X),v!==d&&(B=innerWidth+d*h,q=innerHeight+d,c=-1*d,v=d),r=b[n].getBoundingClientRect(),(Q=r.bottom)>=c&&(j=r.top)<=q&&(H=r.right)>=c*h&&($=r.left)<=B&&(Q||H||$||j)&&(o.loadHidden||ne(b[n]))&&(R&&Z<3&&!f&&(W<3||ee<4)||ie(b[n],d))){if(fe(b[n]),u=!0,Z>9)break}else!u&&R&&!s&&Z<4&&ee<4&&W>2&&(N[0]||o.preloadAfterLoad)&&(N[0]||!f&&(Q||H||$||j||"auto"!=b[n][l](o.sizesAttr)))&&(s=N[0]||b[n]);s&&!u&&fe(s)}},ae=L(oe),re=function(e){var t=e.target;t._lazyCache?delete t._lazyCache:(te(e),g(t,o.loadedClass),p(t,o.loadingClass),z(t,le),w(t,"lazyloaded"))},se=S(re),le=function(e){se({target:e.target})},ue=function(e,t){var n=e.getAttribute("data-load-mode")||o.iframeLoadMode;0==n?e.contentWindow.location.replace(t):1==n&&(e.src=t)},de=function(e){var t,n=e[l](o.srcsetAttr);(t=o.customMedia[e[l]("data-media")||e[l]("media")])&&e.setAttribute("media",t),n&&e.setAttribute("srcset",n)},ce=S(function(e,t,n,i,a){var r,s,u,c,f,y;(f=w(e,"lazybeforeunveil",t)).defaultPrevented||(i&&(n?g(e,o.autosizesClass):e.setAttribute("sizes",i)),s=e[l](o.srcsetAttr),r=e[l](o.srcAttr),a&&(c=(u=e.parentNode)&&v.test(u.nodeName||"")),y=t.firesLoad||"src"in e&&(s||r||c),f={target:e},g(e,o.loadingClass),y&&(clearTimeout(T),T=d(te,2500),z(e,le,!0)),c&&h.call(u.getElementsByTagName("source"),de),s?e.setAttribute("srcset",s):r&&!c&&(J.test(e.nodeName)?ue(e,r):e.src=r),a&&(s||c)&&C(e,{src:r})),e._lazyRace&&delete e._lazyRace,p(e,o.lazyClass),M(function(){var t=e.complete&&e.naturalWidth>1;y&&!t||(t&&g(e,o.fastLoadedClass),re(f),e._lazyCache=!0,d(function(){"_lazyCache"in e&&delete e._lazyCache},9)),"lazy"==e.loading&&Z--},!0)}),fe=function(e){if(!e._lazyRace){var t,n=U.test(e.nodeName),i=n&&(e[l](o.sizesAttr)||e[l]("sizes")),a="auto"==i;(!a&&R||!n||!e[l]("src")&&!e.srcset||e.complete||b(e,o.errorClass)||!b(e,o.lazyClass))&&(t=w(e,"lazyunveilread").detail,a&&_.updateElem(e,!0,e.offsetWidth),e._lazyRace=!0,Z++,ce(e,t,a,i,n))}},ve=P(function(){o.loadMode=3,ae()}),ye=function(){3==o.loadMode&&(o.loadMode=2),ve()},me=function(){R||(n.now()-D<999?d(me,999):(R=!0,o.loadMode=3,ae(),u("scroll",ye,!0)))},{_:function(){D=n.now(),i.elements=t.getElementsByClassName(o.lazyClass),N=t.getElementsByClassName(o.lazyClass+" "+o.preloadClass),u("scroll",ae,!0),u("resize",ae,!0),u("pageshow",function(e){if(e.persisted){var n=t.querySelectorAll("."+o.loadingClass);n.length&&n.forEach&&c(function(){n.forEach(function(e){e.complete&&fe(e)})})}}),e.MutationObserver?new MutationObserver(ae).observe(a,{childList:!0,subtree:!0,attributes:!0}):(a[s]("DOMNodeInserted",ae,!0),a[s]("DOMAttrModified",ae,!0),setInterval(ae,999)),u("hashchange",ae,!0),["focus","mouseover","click","load","transitionend","animationend"].forEach(function(e){t[s](e,ae,!0)}),/d$|^c/.test(t.readyState)?me():(u("load",me),t[s]("DOMContentLoaded",ae),d(me,2e4)),i.elements.length?(oe(),M._lsFlush()):ae()},checkElems:ae,unveil:fe,_aLSL:ye}),_=(F=S(function(e,t,n,i){var o,a,r;if(e._lazysizesWidth=i,i+="px",e.setAttribute("sizes",i),v.test(t.nodeName||""))for(a=0,r=(o=t.getElementsByTagName("source")).length;a<r;a++)o[a].setAttribute("sizes",i);n.detail.dataAttr||C(e,n.detail)}),x=function(e,t,n){var i,o=e.parentNode;o&&(n=A(e,o,n),(i=w(e,"lazybeforesizes",{width:n,dataAttr:!!t})).defaultPrevented||(n=i.detail.width)&&n!==e._lazysizesWidth&&F(e,o,i,n))},I=P(function(){var e,t=O.length;if(t)for(e=0;e<t;e++)x(O[e])}),{_:function(){O=t.getElementsByClassName(o.autosizesClass),u("resize",I)},checkElems:I,updateElem:x}),k=function(){!k.i&&t.getElementsByClassName&&(k.i=!0,_._(),V._())};var O,F,x,I;var N,R,T,W,D,B,q,j,$,H,Q,G,U,J,K,X,Y,Z,ee,te,ne,ie,oe,ae,re,se,le,ue,de,ce,fe,ve,ye,me;var he,be,ge,pe,ze,we,Ce;return d(function(){o.init&&k()}),i={cfg:o,autoSizer:_,loader:V,init:k,uP:C,aC:g,rC:p,hC:b,fire:w,gW:A,rAF:M}}(t,t.document,Date);t.lazySizes=n,e.exports&&(e.exports=n)}("undefined"!=typeof window?window:{})}},t={};function n(i){var o=t[i];if(void 0!==o)return o.exports;var a=t[i]={exports:{}};return e[i](a,a.exports,n),a.exports}n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},function(){"use strict";var e=window.lazySizesConfig||null;e&&delete window.lazySizesConfig;var t=n(7857);n(4885),n(5651),t.A.init(),e?window.lazySizesConfig=e:"lazySizesConfig"in window&&delete window.lazySizesConfig}()}();
(function webpackUniversalModuleDefinition(root, factory){
if(typeof exports==='object'&&typeof module==='object')
module.exports=factory();
else if(typeof define==='function'&&define.amd)
define([], factory);
else if(typeof exports==='object')
exports["Handlebars"]=factory();
else
root["Handlebars"]=factory();
})(this, function(){
return  (function(modules){
var installedModules={};
function __webpack_require__(moduleId){
if(installedModules[moduleId])
return installedModules[moduleId].exports;
var module=installedModules[moduleId]={
exports: {},
id: moduleId,
loaded: false
};
modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
module.loaded=true;
return module.exports;
}
__webpack_require__.m=modules;
__webpack_require__.c=installedModules;
__webpack_require__.p="";
return __webpack_require__(0);
})
([
(function(module, exports, __webpack_require__){
'use strict';
var _interopRequireDefault=__webpack_require__(1)['default'];
exports.__esModule=true;
var _handlebarsRuntime=__webpack_require__(2);
var _handlebarsRuntime2=_interopRequireDefault(_handlebarsRuntime);
var _handlebarsCompilerAst=__webpack_require__(45);
var _handlebarsCompilerAst2=_interopRequireDefault(_handlebarsCompilerAst);
var _handlebarsCompilerBase=__webpack_require__(46);
var _handlebarsCompilerCompiler=__webpack_require__(51);
var _handlebarsCompilerJavascriptCompiler=__webpack_require__(52);
var _handlebarsCompilerJavascriptCompiler2=_interopRequireDefault(_handlebarsCompilerJavascriptCompiler);
var _handlebarsCompilerVisitor=__webpack_require__(49);
var _handlebarsCompilerVisitor2=_interopRequireDefault(_handlebarsCompilerVisitor);
var _handlebarsNoConflict=__webpack_require__(44);
var _handlebarsNoConflict2=_interopRequireDefault(_handlebarsNoConflict);
var _create=_handlebarsRuntime2['default'].create;
function create(){
var hb=_create();
hb.compile=function (input, options){
return _handlebarsCompilerCompiler.compile(input, options, hb);
};
hb.precompile=function (input, options){
return _handlebarsCompilerCompiler.precompile(input, options, hb);
};
hb.AST=_handlebarsCompilerAst2['default'];
hb.Compiler=_handlebarsCompilerCompiler.Compiler;
hb.JavaScriptCompiler=_handlebarsCompilerJavascriptCompiler2['default'];
hb.Parser=_handlebarsCompilerBase.parser;
hb.parse=_handlebarsCompilerBase.parse;
hb.parseWithoutProcessing=_handlebarsCompilerBase.parseWithoutProcessing;
return hb;
}
var inst=create();
inst.create=create;
_handlebarsNoConflict2['default'](inst);
inst.Visitor=_handlebarsCompilerVisitor2['default'];
inst['default']=inst;
exports['default']=inst;
module.exports=exports['default'];
}),
(function(module, exports){
"use strict";
exports["default"]=function (obj){
return obj&&obj.__esModule ? obj:{
"default": obj
};};
exports.__esModule=true;
}),
(function(module, exports, __webpack_require__){
'use strict';
var _interopRequireWildcard=__webpack_require__(3)['default'];
var _interopRequireDefault=__webpack_require__(1)['default'];
exports.__esModule=true;
var _handlebarsBase=__webpack_require__(4);
var base=_interopRequireWildcard(_handlebarsBase);
var _handlebarsSafeString=__webpack_require__(37);
var _handlebarsSafeString2=_interopRequireDefault(_handlebarsSafeString);
var _handlebarsException=__webpack_require__(6);
var _handlebarsException2=_interopRequireDefault(_handlebarsException);
var _handlebarsUtils=__webpack_require__(5);
var Utils=_interopRequireWildcard(_handlebarsUtils);
var _handlebarsRuntime=__webpack_require__(38);
var runtime=_interopRequireWildcard(_handlebarsRuntime);
var _handlebarsNoConflict=__webpack_require__(44);
var _handlebarsNoConflict2=_interopRequireDefault(_handlebarsNoConflict);
function create(){
var hb=new base.HandlebarsEnvironment();
Utils.extend(hb, base);
hb.SafeString=_handlebarsSafeString2['default'];
hb.Exception=_handlebarsException2['default'];
hb.Utils=Utils;
hb.escapeExpression=Utils.escapeExpression;
hb.VM=runtime;
hb.template=function (spec){
return runtime.template(spec, hb);
};
return hb;
}
var inst=create();
inst.create=create;
_handlebarsNoConflict2['default'](inst);
inst['default']=inst;
exports['default']=inst;
module.exports=exports['default'];
}),
(function(module, exports){
"use strict";
exports["default"]=function (obj){
if(obj&&obj.__esModule){
return obj;
}else{
var newObj={};
if(obj!=null){
for (var key in obj){
if(Object.prototype.hasOwnProperty.call(obj, key)) newObj[key]=obj[key];
}}
newObj["default"]=obj;
return newObj;
}};
exports.__esModule=true;
}),
(function(module, exports, __webpack_require__){
'use strict';
var _interopRequireDefault=__webpack_require__(1)['default'];
exports.__esModule=true;
exports.HandlebarsEnvironment=HandlebarsEnvironment;
var _utils=__webpack_require__(5);
var _exception=__webpack_require__(6);
var _exception2=_interopRequireDefault(_exception);
var _helpers=__webpack_require__(10);
var _decorators=__webpack_require__(30);
var _logger=__webpack_require__(32);
var _logger2=_interopRequireDefault(_logger);
var _internalProtoAccess=__webpack_require__(33);
var VERSION='4.7.7';
exports.VERSION=VERSION;
var COMPILER_REVISION=8;
exports.COMPILER_REVISION=COMPILER_REVISION;
var LAST_COMPATIBLE_COMPILER_REVISION=7;
exports.LAST_COMPATIBLE_COMPILER_REVISION=LAST_COMPATIBLE_COMPILER_REVISION;
var REVISION_CHANGES={
1: '<=1.0.rc.2',
2: '==1.0.0-rc.3',
3: '==1.0.0-rc.4',
4: '==1.x.x',
5: '==2.0.0-alpha.x',
6: '>=2.0.0-beta.1',
7: '>=4.0.0 <4.3.0',
8: '>=4.3.0'
};
exports.REVISION_CHANGES=REVISION_CHANGES;
var objectType='[object Object]';
function HandlebarsEnvironment(helpers, partials, decorators){
this.helpers=helpers||{};
this.partials=partials||{};
this.decorators=decorators||{};
_helpers.registerDefaultHelpers(this);
_decorators.registerDefaultDecorators(this);
}
HandlebarsEnvironment.prototype={
constructor: HandlebarsEnvironment,
logger: _logger2['default'],
log: _logger2['default'].log,
registerHelper: function registerHelper(name, fn){
if(_utils.toString.call(name)===objectType){
if(fn){
throw new _exception2['default']('Arg not supported with multiple helpers');
}
_utils.extend(this.helpers, name);
}else{
this.helpers[name]=fn;
}},
unregisterHelper: function unregisterHelper(name){
delete this.helpers[name];
},
registerPartial: function registerPartial(name, partial){
if(_utils.toString.call(name)===objectType){
_utils.extend(this.partials, name);
}else{
if(typeof partial==='undefined'){
throw new _exception2['default']('Attempting to register a partial called "' + name + '" as undefined');
}
this.partials[name]=partial;
}},
unregisterPartial: function unregisterPartial(name){
delete this.partials[name];
},
registerDecorator: function registerDecorator(name, fn){
if(_utils.toString.call(name)===objectType){
if(fn){
throw new _exception2['default']('Arg not supported with multiple decorators');
}
_utils.extend(this.decorators, name);
}else{
this.decorators[name]=fn;
}},
unregisterDecorator: function unregisterDecorator(name){
delete this.decorators[name];
},
resetLoggedPropertyAccesses: function resetLoggedPropertyAccesses(){
_internalProtoAccess.resetLoggedProperties();
}};
var log=_logger2['default'].log;
exports.log=log;
exports.createFrame=_utils.createFrame;
exports.logger=_logger2['default'];
}),
(function(module, exports){
'use strict';
exports.__esModule=true;
exports.extend=extend;
exports.indexOf=indexOf;
exports.escapeExpression=escapeExpression;
exports.isEmpty=isEmpty;
exports.createFrame=createFrame;
exports.blockParams=blockParams;
exports.appendContextPath=appendContextPath;
var escape={
'&': '&amp;',
'<': '&lt;',
'>': '&gt;',
'"': '&quot;',
"'": '&#x27;',
'`': '&#x60;',
'=': '&#x3D;'
};
var badChars=/[&<>"'`=]/g,
possible=/[&<>"'`=]/;
function escapeChar(chr){
return escape[chr];
}
function extend(obj ){
for (var i=1; i < arguments.length; i++){
for (var key in arguments[i]){
if(Object.prototype.hasOwnProperty.call(arguments[i], key)){
obj[key]=arguments[i][key];
}}
}
return obj;
}
var toString=Object.prototype.toString;
exports.toString=toString;
var isFunction=function isFunction(value){
return typeof value==='function';
};
if(isFunction(/x/)){
exports.isFunction=isFunction=function (value){
return typeof value==='function'&&toString.call(value)==='[object Function]';
};}
exports.isFunction=isFunction;
var isArray=Array.isArray||function (value){
return value&&typeof value==='object' ? toString.call(value)==='[object Array]':false;
};
exports.isArray=isArray;
function indexOf(array, value){
for (var i=0, len=array.length; i < len; i++){
if(array[i]===value){
return i;
}}
return -1;
}
function escapeExpression(string){
if(typeof string!=='string'){
if(string&&string.toHTML){
return string.toHTML();
}else if(string==null){
return '';
}else if(!string){
return string + '';
}
string='' + string;
}
if(!possible.test(string)){
return string;
}
return string.replace(badChars, escapeChar);
}
function isEmpty(value){
if(!value&&value!==0){
return true;
}else if(isArray(value)&&value.length===0){
return true;
}else{
return false;
}}
function createFrame(object){
var frame=extend({}, object);
frame._parent=object;
return frame;
}
function blockParams(params, ids){
params.path=ids;
return params;
}
function appendContextPath(contextPath, id){
return (contextPath ? contextPath + '.':'') + id;
}
}),
(function(module, exports, __webpack_require__){
'use strict';
var _Object$defineProperty=__webpack_require__(7)['default'];
exports.__esModule=true;
var errorProps=['description', 'fileName', 'lineNumber', 'endLineNumber', 'message', 'name', 'number', 'stack'];
function Exception(message, node){
var loc=node&&node.loc,
line=undefined,
endLineNumber=undefined,
column=undefined,
endColumn=undefined;
if(loc){
line=loc.start.line;
endLineNumber=loc.end.line;
column=loc.start.column;
endColumn=loc.end.column;
message +=' - ' + line + ':' + column;
}
var tmp=Error.prototype.constructor.call(this, message);
for (var idx=0; idx < errorProps.length; idx++){
this[errorProps[idx]]=tmp[errorProps[idx]];
}
if(Error.captureStackTrace){
Error.captureStackTrace(this, Exception);
}
try {
if(loc){
this.lineNumber=line;
this.endLineNumber=endLineNumber;
if(_Object$defineProperty){
Object.defineProperty(this, 'column', {
value: column,
enumerable: true
});
Object.defineProperty(this, 'endColumn', {
value: endColumn,
enumerable: true
});
}else{
this.column=column;
this.endColumn=endColumn;
}}
} catch (nop){
}}
Exception.prototype=new Error();
exports['default']=Exception;
module.exports=exports['default'];
}),
(function(module, exports, __webpack_require__){
module.exports={ "default": __webpack_require__(8), __esModule: true };
}),
(function(module, exports, __webpack_require__){
var $=__webpack_require__(9);
module.exports=function defineProperty(it, key, desc){
return $.setDesc(it, key, desc);
};
}),
(function(module, exports){
var $Object=Object;
module.exports={
create:     $Object.create,
getProto:   $Object.getPrototypeOf,
isEnum:     {}.propertyIsEnumerable,
getDesc:    $Object.getOwnPropertyDescriptor,
setDesc:    $Object.defineProperty,
setDescs:   $Object.defineProperties,
getKeys:    $Object.keys,
getNames:   $Object.getOwnPropertyNames,
getSymbols: $Object.getOwnPropertySymbols,
each:       [].forEach
};
}),
(function(module, exports, __webpack_require__){
'use strict';
var _interopRequireDefault=__webpack_require__(1)['default'];
exports.__esModule=true;
exports.registerDefaultHelpers=registerDefaultHelpers;
exports.moveHelperToHooks=moveHelperToHooks;
var _helpersBlockHelperMissing=__webpack_require__(11);
var _helpersBlockHelperMissing2=_interopRequireDefault(_helpersBlockHelperMissing);
var _helpersEach=__webpack_require__(12);
var _helpersEach2=_interopRequireDefault(_helpersEach);
var _helpersHelperMissing=__webpack_require__(25);
var _helpersHelperMissing2=_interopRequireDefault(_helpersHelperMissing);
var _helpersIf=__webpack_require__(26);
var _helpersIf2=_interopRequireDefault(_helpersIf);
var _helpersLog=__webpack_require__(27);
var _helpersLog2=_interopRequireDefault(_helpersLog);
var _helpersLookup=__webpack_require__(28);
var _helpersLookup2=_interopRequireDefault(_helpersLookup);
var _helpersWith=__webpack_require__(29);
var _helpersWith2=_interopRequireDefault(_helpersWith);
function registerDefaultHelpers(instance){
_helpersBlockHelperMissing2['default'](instance);
_helpersEach2['default'](instance);
_helpersHelperMissing2['default'](instance);
_helpersIf2['default'](instance);
_helpersLog2['default'](instance);
_helpersLookup2['default'](instance);
_helpersWith2['default'](instance);
}
function moveHelperToHooks(instance, helperName, keepHelper){
if(instance.helpers[helperName]){
instance.hooks[helperName]=instance.helpers[helperName];
if(!keepHelper){
delete instance.helpers[helperName];
}}
}
}),
(function(module, exports, __webpack_require__){
'use strict';
exports.__esModule=true;
var _utils=__webpack_require__(5);
exports['default']=function (instance){
instance.registerHelper('blockHelperMissing', function (context, options){
var inverse=options.inverse,
fn=options.fn;
if(context===true){
return fn(this);
}else if(context===false||context==null){
return inverse(this);
}else if(_utils.isArray(context)){
if(context.length > 0){
if(options.ids){
options.ids=[options.name];
}
return instance.helpers.each(context, options);
}else{
return inverse(this);
}}else{
if(options.data&&options.ids){
var data=_utils.createFrame(options.data);
data.contextPath=_utils.appendContextPath(options.data.contextPath, options.name);
options={ data: data };}
return fn(context, options);
}});
};
module.exports=exports['default'];
}),
(function(module, exports, __webpack_require__){
(function(global){'use strict';
var _Object$keys=__webpack_require__(13)['default'];
var _interopRequireDefault=__webpack_require__(1)['default'];
exports.__esModule=true;
var _utils=__webpack_require__(5);
var _exception=__webpack_require__(6);
var _exception2=_interopRequireDefault(_exception);
exports['default']=function (instance){
instance.registerHelper('each', function (context, options){
if(!options){
throw new _exception2['default']('Must pass iterator to #each');
}
var fn=options.fn,
inverse=options.inverse,
i=0,
ret='',
data=undefined,
contextPath=undefined;
if(options.data&&options.ids){
contextPath=_utils.appendContextPath(options.data.contextPath, options.ids[0]) + '.';
}
if(_utils.isFunction(context)){
context=context.call(this);
}
if(options.data){
data=_utils.createFrame(options.data);
}
function execIteration(field, index, last){
if(data){
data.key=field;
data.index=index;
data.first=index===0;
data.last = !!last;
if(contextPath){
data.contextPath=contextPath + field;
}}
ret=ret + fn(context[field], {
data: data,
blockParams: _utils.blockParams([context[field], field], [contextPath + field, null])
});
}
if(context&&typeof context==='object'){
if(_utils.isArray(context)){
for (var j=context.length; i < j; i++){
if(i in context){
execIteration(i, i, i===context.length - 1);
}}
}else if(global.Symbol&&context[global.Symbol.iterator]){
var newContext=[];
var iterator=context[global.Symbol.iterator]();
for (var it=iterator.next(); !it.done; it=iterator.next()){
newContext.push(it.value);
}
context=newContext;
for (var j=context.length; i < j; i++){
execIteration(i, i, i===context.length - 1);
}}else{
(function (){
var priorKey=undefined;
_Object$keys(context).forEach(function (key){
if(priorKey!==undefined){
execIteration(priorKey, i - 1);
}
priorKey=key;
i++;
});
if(priorKey!==undefined){
execIteration(priorKey, i - 1, true);
}})();
}}
if(i===0){
ret=inverse(this);
}
return ret;
});
};
module.exports=exports['default'];
}.call(exports, (function(){ return this; }())))
}),
(function(module, exports, __webpack_require__){
module.exports={ "default": __webpack_require__(14), __esModule: true };
}),
(function(module, exports, __webpack_require__){
__webpack_require__(15);
module.exports=__webpack_require__(21).Object.keys;
}),
(function(module, exports, __webpack_require__){
var toObject=__webpack_require__(16);
__webpack_require__(18)('keys', function($keys){
return function keys(it){
return $keys(toObject(it));
};});
}),
(function(module, exports, __webpack_require__){
var defined=__webpack_require__(17);
module.exports=function(it){
return Object(defined(it));
};
}),
(function(module, exports){
module.exports=function(it){
if(it==undefined)throw TypeError("Can't call method on  " + it);
return it;
};
}),
(function(module, exports, __webpack_require__){
var $export=__webpack_require__(19)
, core=__webpack_require__(21)
, fails=__webpack_require__(24);
module.exports=function(KEY, exec){
var fn=(core.Object||{})[KEY]||Object[KEY]
, exp={};
exp[KEY]=exec(fn);
$export($export.S + $export.F * fails(function(){ fn(1); }), 'Object', exp);
};
}),
(function(module, exports, __webpack_require__){
var global=__webpack_require__(20)
, core=__webpack_require__(21)
, ctx=__webpack_require__(22)
, PROTOTYPE='prototype';
var $export=function(type, name, source){
var IS_FORCED=type & $export.F
, IS_GLOBAL=type & $export.G
, IS_STATIC=type & $export.S
, IS_PROTO=type & $export.P
, IS_BIND=type & $export.B
, IS_WRAP=type & $export.W
, exports=IS_GLOBAL ? core:core[name]||(core[name]={})
, target=IS_GLOBAL ? global:IS_STATIC ? global[name]:(global[name]||{})[PROTOTYPE]
, key, own, out;
if(IS_GLOBAL)source=name;
for(key in source){
own = !IS_FORCED&&target&&key in target;
if(own&&key in exports)continue;
out=own ? target[key]:source[key];
exports[key]=IS_GLOBAL&&typeof target[key]!='function' ? source[key]
: IS_BIND&&own ? ctx(out, global)
: IS_WRAP&&target[key]==out ? (function(C){
var F=function(param){
return this instanceof C ? new C(param):C(param);
};
F[PROTOTYPE]=C[PROTOTYPE];
return F;
})(out):IS_PROTO&&typeof out=='function' ? ctx(Function.call, out):out;
if(IS_PROTO)(exports[PROTOTYPE]||(exports[PROTOTYPE]={}))[key]=out;
}};
$export.F=1;
$export.G=2;
$export.S=4;
$export.P=8;
$export.B=16;
$export.W=32;
module.exports=$export;
}),
(function(module, exports){
var global=module.exports=typeof window!='undefined'&&window.Math==Math
? window:typeof self!='undefined'&&self.Math==Math ? self:Function('return this')();
if(typeof __g=='number')__g=global;
}),
(function(module, exports){
var core=module.exports={version: '1.2.6'};
if(typeof __e=='number')__e=core;
}),
(function(module, exports, __webpack_require__){
var aFunction=__webpack_require__(23);
module.exports=function(fn, that, length){
aFunction(fn);
if(that===undefined)return fn;
switch(length){
case 1: return function(a){
return fn.call(that, a);
};
case 2: return function(a, b){
return fn.call(that, a, b);
};
case 3: return function(a, b, c){
return fn.call(that, a, b, c);
};}
return function(){
return fn.apply(that, arguments);
};};
}),
(function(module, exports){
module.exports=function(it){
if(typeof it!='function')throw TypeError(it + ' is not a function!');
return it;
};
}),
(function(module, exports){
module.exports=function(exec){
try {
return !!exec();
} catch(e){
return true;
}};
}),
(function(module, exports, __webpack_require__){
'use strict';
var _interopRequireDefault=__webpack_require__(1)['default'];
exports.__esModule=true;
var _exception=__webpack_require__(6);
var _exception2=_interopRequireDefault(_exception);
exports['default']=function (instance){
instance.registerHelper('helperMissing', function () {
if(arguments.length===1){
return undefined;
}else{
throw new _exception2['default']('Missing helper: "' + arguments[arguments.length - 1].name + '"');
}});
};
module.exports=exports['default'];
}),
(function(module, exports, __webpack_require__){
'use strict';
var _interopRequireDefault=__webpack_require__(1)['default'];
exports.__esModule=true;
var _utils=__webpack_require__(5);
var _exception=__webpack_require__(6);
var _exception2=_interopRequireDefault(_exception);
exports['default']=function (instance){
instance.registerHelper('if', function (conditional, options){
if(arguments.length!=2){
throw new _exception2['default']('#if requires exactly one argument');
}
if(_utils.isFunction(conditional)){
conditional=conditional.call(this);
}
if(!options.hash.includeZero&&!conditional||_utils.isEmpty(conditional)){
return options.inverse(this);
}else{
return options.fn(this);
}});
instance.registerHelper('unless', function (conditional, options){
if(arguments.length!=2){
throw new _exception2['default']('#unless requires exactly one argument');
}
return instance.helpers['if'].call(this, conditional, {
fn: options.inverse,
inverse: options.fn,
hash: options.hash
});
});
};
module.exports=exports['default'];
}),
(function(module, exports){
'use strict';
exports.__esModule=true;
exports['default']=function (instance){
instance.registerHelper('log', function () {
var args=[undefined],
options=arguments[arguments.length - 1];
for (var i=0; i < arguments.length - 1; i++){
args.push(arguments[i]);
}
var level=1;
if(options.hash.level!=null){
level=options.hash.level;
}else if(options.data&&options.data.level!=null){
level=options.data.level;
}
args[0]=level;
instance.log.apply(instance, args);
});
};
module.exports=exports['default'];
}),
(function(module, exports){
'use strict';
exports.__esModule=true;
exports['default']=function (instance){
instance.registerHelper('lookup', function (obj, field, options){
if(!obj){
return obj;
}
return options.lookupProperty(obj, field);
});
};
module.exports=exports['default'];
}),
(function(module, exports, __webpack_require__){
'use strict';
var _interopRequireDefault=__webpack_require__(1)['default'];
exports.__esModule=true;
var _utils=__webpack_require__(5);
var _exception=__webpack_require__(6);
var _exception2=_interopRequireDefault(_exception);
exports['default']=function (instance){
instance.registerHelper('with', function (context, options){
if(arguments.length!=2){
throw new _exception2['default']('#with requires exactly one argument');
}
if(_utils.isFunction(context)){
context=context.call(this);
}
var fn=options.fn;
if(!_utils.isEmpty(context)){
var data=options.data;
if(options.data&&options.ids){
data=_utils.createFrame(options.data);
data.contextPath=_utils.appendContextPath(options.data.contextPath, options.ids[0]);
}
return fn(context, {
data: data,
blockParams: _utils.blockParams([context], [data&&data.contextPath])
});
}else{
return options.inverse(this);
}});
};
module.exports=exports['default'];
}),
(function(module, exports, __webpack_require__){
'use strict';
var _interopRequireDefault=__webpack_require__(1)['default'];
exports.__esModule=true;
exports.registerDefaultDecorators=registerDefaultDecorators;
var _decoratorsInline=__webpack_require__(31);
var _decoratorsInline2=_interopRequireDefault(_decoratorsInline);
function registerDefaultDecorators(instance){
_decoratorsInline2['default'](instance);
}
}),
(function(module, exports, __webpack_require__){
'use strict';
exports.__esModule=true;
var _utils=__webpack_require__(5);
exports['default']=function (instance){
instance.registerDecorator('inline', function (fn, props, container, options){
var ret=fn;
if(!props.partials){
props.partials={};
ret=function (context, options){
var original=container.partials;
container.partials=_utils.extend({}, original, props.partials);
var ret=fn(context, options);
container.partials=original;
return ret;
};}
props.partials[options.args[0]]=options.fn;
return ret;
});
};
module.exports=exports['default'];
}),
(function(module, exports, __webpack_require__){
'use strict';
exports.__esModule=true;
var _utils=__webpack_require__(5);
var logger={
methodMap: ['debug', 'info', 'warn', 'error'],
level: 'info',
lookupLevel: function lookupLevel(level){
if(typeof level==='string'){
var levelMap=_utils.indexOf(logger.methodMap, level.toLowerCase());
if(levelMap >=0){
level=levelMap;
}else{
level=parseInt(level, 10);
}}
return level;
},
log: function log(level){
level=logger.lookupLevel(level);
if(typeof console!=='undefined'&&logger.lookupLevel(logger.level) <=level){
var method=logger.methodMap[level];
if(!console[method]){
method='log';
}
for (var _len=arguments.length, message=Array(_len > 1 ? _len - 1:0), _key=1; _key < _len; _key++){
message[_key - 1]=arguments[_key];
}
console[method].apply(console, message);
}}
};
exports['default']=logger;
module.exports=exports['default'];
}),
(function(module, exports, __webpack_require__){
'use strict';
var _Object$create=__webpack_require__(34)['default'];
var _Object$keys=__webpack_require__(13)['default'];
var _interopRequireWildcard=__webpack_require__(3)['default'];
exports.__esModule=true;
exports.createProtoAccessControl=createProtoAccessControl;
exports.resultIsAllowed=resultIsAllowed;
exports.resetLoggedProperties=resetLoggedProperties;
var _createNewLookupObject=__webpack_require__(36);
var _logger=__webpack_require__(32);
var logger=_interopRequireWildcard(_logger);
var loggedProperties=_Object$create(null);
function createProtoAccessControl(runtimeOptions){
var defaultMethodWhiteList=_Object$create(null);
defaultMethodWhiteList['constructor']=false;
defaultMethodWhiteList['__defineGetter__']=false;
defaultMethodWhiteList['__defineSetter__']=false;
defaultMethodWhiteList['__lookupGetter__']=false;
var defaultPropertyWhiteList=_Object$create(null);
defaultPropertyWhiteList['__proto__']=false;
return {
properties: {
whitelist: _createNewLookupObject.createNewLookupObject(defaultPropertyWhiteList, runtimeOptions.allowedProtoProperties),
defaultValue: runtimeOptions.allowProtoPropertiesByDefault
},
methods: {
whitelist: _createNewLookupObject.createNewLookupObject(defaultMethodWhiteList, runtimeOptions.allowedProtoMethods),
defaultValue: runtimeOptions.allowProtoMethodsByDefault
}};}
function resultIsAllowed(result, protoAccessControl, propertyName){
if(typeof result==='function'){
return checkWhiteList(protoAccessControl.methods, propertyName);
}else{
return checkWhiteList(protoAccessControl.properties, propertyName);
}}
function checkWhiteList(protoAccessControlForType, propertyName){
if(protoAccessControlForType.whitelist[propertyName]!==undefined){
return protoAccessControlForType.whitelist[propertyName]===true;
}
if(protoAccessControlForType.defaultValue!==undefined){
return protoAccessControlForType.defaultValue;
}
logUnexpecedPropertyAccessOnce(propertyName);
return false;
}
function logUnexpecedPropertyAccessOnce(propertyName){
if(loggedProperties[propertyName]!==true){
loggedProperties[propertyName]=true;
logger.log('error', 'Handlebars: Access has been denied to resolve the property "' + propertyName + '" because it is not an "own property" of its parent.\n' + 'You can add a runtime option to disable the check or this warning:\n' + 'See https://handlebarsjs.com/api-reference/runtime-options.html#options-to-control-prototype-access for details');
}}
function resetLoggedProperties(){
_Object$keys(loggedProperties).forEach(function (propertyName){
delete loggedProperties[propertyName];
});
}
}),
(function(module, exports, __webpack_require__){
module.exports={ "default": __webpack_require__(35), __esModule: true };
}),
(function(module, exports, __webpack_require__){
var $=__webpack_require__(9);
module.exports=function create(P, D){
return $.create(P, D);
};
}),
(function(module, exports, __webpack_require__){
'use strict';
var _Object$create=__webpack_require__(34)['default'];
exports.__esModule=true;
exports.createNewLookupObject=createNewLookupObject;
var _utils=__webpack_require__(5);
function createNewLookupObject(){
for (var _len=arguments.length, sources=Array(_len), _key=0; _key < _len; _key++){
sources[_key]=arguments[_key];
}
return _utils.extend.apply(undefined, [_Object$create(null)].concat(sources));
}
}),
(function(module, exports){
'use strict';
exports.__esModule=true;
function SafeString(string){
this.string=string;
}
SafeString.prototype.toString=SafeString.prototype.toHTML=function (){
return '' + this.string;
};
exports['default']=SafeString;
module.exports=exports['default'];
}),
(function(module, exports, __webpack_require__){
'use strict';
var _Object$seal=__webpack_require__(39)['default'];
var _Object$keys=__webpack_require__(13)['default'];
var _interopRequireWildcard=__webpack_require__(3)['default'];
var _interopRequireDefault=__webpack_require__(1)['default'];
exports.__esModule=true;
exports.checkRevision=checkRevision;
exports.template=template;
exports.wrapProgram=wrapProgram;
exports.resolvePartial=resolvePartial;
exports.invokePartial=invokePartial;
exports.noop=noop;
var _utils=__webpack_require__(5);
var Utils=_interopRequireWildcard(_utils);
var _exception=__webpack_require__(6);
var _exception2=_interopRequireDefault(_exception);
var _base=__webpack_require__(4);
var _helpers=__webpack_require__(10);
var _internalWrapHelper=__webpack_require__(43);
var _internalProtoAccess=__webpack_require__(33);
function checkRevision(compilerInfo){
var compilerRevision=compilerInfo&&compilerInfo[0]||1,
currentRevision=_base.COMPILER_REVISION;
if(compilerRevision >=_base.LAST_COMPATIBLE_COMPILER_REVISION&&compilerRevision <=_base.COMPILER_REVISION){
return;
}
if(compilerRevision < _base.LAST_COMPATIBLE_COMPILER_REVISION){
var runtimeVersions=_base.REVISION_CHANGES[currentRevision],
compilerVersions=_base.REVISION_CHANGES[compilerRevision];
throw new _exception2['default']('Template was precompiled with an older version of Handlebars than the current runtime. ' + 'Please update your precompiler to a newer version (' + runtimeVersions + ') or downgrade your runtime to an older version (' + compilerVersions + ').');
}else{
throw new _exception2['default']('Template was precompiled with a newer version of Handlebars than the current runtime. ' + 'Please update your runtime to a newer version (' + compilerInfo[1] + ').');
}}
function template(templateSpec, env){
if(!env){
throw new _exception2['default']('No environment passed to template');
}
if(!templateSpec||!templateSpec.main){
throw new _exception2['default']('Unknown template object: ' + typeof templateSpec);
}
templateSpec.main.decorator=templateSpec.main_d;
env.VM.checkRevision(templateSpec.compiler);
var templateWasPrecompiledWithCompilerV7=templateSpec.compiler&&templateSpec.compiler[0]===7;
function invokePartialWrapper(partial, context, options){
if(options.hash){
context=Utils.extend({}, context, options.hash);
if(options.ids){
options.ids[0]=true;
}}
partial=env.VM.resolvePartial.call(this, partial, context, options);
var extendedOptions=Utils.extend({}, options, {
hooks: this.hooks,
protoAccessControl: this.protoAccessControl
});
var result=env.VM.invokePartial.call(this, partial, context, extendedOptions);
if(result==null&&env.compile){
options.partials[options.name]=env.compile(partial, templateSpec.compilerOptions, env);
result=options.partials[options.name](context, extendedOptions);
}
if(result!=null){
if(options.indent){
var lines=result.split('\n');
for (var i=0, l=lines.length; i < l; i++){
if(!lines[i]&&i + 1===l){
break;
}
lines[i]=options.indent + lines[i];
}
result=lines.join('\n');
}
return result;
}else{
throw new _exception2['default']('The partial ' + options.name + ' could not be compiled when running in runtime-only mode');
}}
var container={
strict: function strict(obj, name, loc){
if(!obj||!(name in obj)){
throw new _exception2['default']('"' + name + '" not defined in ' + obj, {
loc: loc
});
}
return container.lookupProperty(obj, name);
},
lookupProperty: function lookupProperty(parent, propertyName){
var result=parent[propertyName];
if(result==null){
return result;
}
if(Object.prototype.hasOwnProperty.call(parent, propertyName)){
return result;
}
if(_internalProtoAccess.resultIsAllowed(result, container.protoAccessControl, propertyName)){
return result;
}
return undefined;
},
lookup: function lookup(depths, name){
var len=depths.length;
for (var i=0; i < len; i++){
var result=depths[i]&&container.lookupProperty(depths[i], name);
if(result!=null){
return depths[i][name];
}}
},
lambda: function lambda(current, context){
return typeof current==='function' ? current.call(context):current;
},
escapeExpression: Utils.escapeExpression,
invokePartial: invokePartialWrapper,
fn: function fn(i){
var ret=templateSpec[i];
ret.decorator=templateSpec[i + '_d'];
return ret;
},
programs: [],
program: function program(i, data, declaredBlockParams, blockParams, depths){
var programWrapper=this.programs[i],
fn=this.fn(i);
if(data||depths||blockParams||declaredBlockParams){
programWrapper=wrapProgram(this, i, fn, data, declaredBlockParams, blockParams, depths);
}else if(!programWrapper){
programWrapper=this.programs[i]=wrapProgram(this, i, fn);
}
return programWrapper;
},
data: function data(value, depth){
while (value&&depth--){
value=value._parent;
}
return value;
},
mergeIfNeeded: function mergeIfNeeded(param, common){
var obj=param||common;
if(param&&common&&param!==common){
obj=Utils.extend({}, common, param);
}
return obj;
},
nullContext: _Object$seal({}),
noop: env.VM.noop,
compilerInfo: templateSpec.compiler
};
function ret(context){
var options=arguments.length <=1||arguments[1]===undefined ? {}:arguments[1];
var data=options.data;
ret._setup(options);
if(!options.partial&&templateSpec.useData){
data=initData(context, data);
}
var depths=undefined,
blockParams=templateSpec.useBlockParams ? []:undefined;
if(templateSpec.useDepths){
if(options.depths){
depths=context!=options.depths[0] ? [context].concat(options.depths):options.depths;
}else{
depths=[context];
}}
function main(context ){
return '' + templateSpec.main(container, context, container.helpers, container.partials, data, blockParams, depths);
}
main=executeDecorators(templateSpec.main, main, container, options.depths||[], data, blockParams);
return main(context, options);
}
ret.isTop=true;
ret._setup=function (options){
if(!options.partial){
var mergedHelpers=Utils.extend({}, env.helpers, options.helpers);
wrapHelpersToPassLookupProperty(mergedHelpers, container);
container.helpers=mergedHelpers;
if(templateSpec.usePartial){
container.partials=container.mergeIfNeeded(options.partials, env.partials);
}
if(templateSpec.usePartial||templateSpec.useDecorators){
container.decorators=Utils.extend({}, env.decorators, options.decorators);
}
container.hooks={};
container.protoAccessControl=_internalProtoAccess.createProtoAccessControl(options);
var keepHelperInHelpers=options.allowCallsToHelperMissing||templateWasPrecompiledWithCompilerV7;
_helpers.moveHelperToHooks(container, 'helperMissing', keepHelperInHelpers);
_helpers.moveHelperToHooks(container, 'blockHelperMissing', keepHelperInHelpers);
}else{
container.protoAccessControl=options.protoAccessControl;
container.helpers=options.helpers;
container.partials=options.partials;
container.decorators=options.decorators;
container.hooks=options.hooks;
}};
ret._child=function (i, data, blockParams, depths){
if(templateSpec.useBlockParams&&!blockParams){
throw new _exception2['default']('must pass block params');
}
if(templateSpec.useDepths&&!depths){
throw new _exception2['default']('must pass parent depths');
}
return wrapProgram(container, i, templateSpec[i], data, 0, blockParams, depths);
};
return ret;
}
function wrapProgram(container, i, fn, data, declaredBlockParams, blockParams, depths){
function prog(context){
var options=arguments.length <=1||arguments[1]===undefined ? {}:arguments[1];
var currentDepths=depths;
if(depths&&context!=depths[0]&&!(context===container.nullContext&&depths[0]===null)){
currentDepths=[context].concat(depths);
}
return fn(container, context, container.helpers, container.partials, options.data||data, blockParams&&[options.blockParams].concat(blockParams), currentDepths);
}
prog=executeDecorators(fn, prog, container, depths, data, blockParams);
prog.program=i;
prog.depth=depths ? depths.length:0;
prog.blockParams=declaredBlockParams||0;
return prog;
}
function resolvePartial(partial, context, options){
if(!partial){
if(options.name==='@partial-block'){
partial=options.data['partial-block'];
}else{
partial=options.partials[options.name];
}}else if(!partial.call&&!options.name){
options.name=partial;
partial=options.partials[partial];
}
return partial;
}
function invokePartial(partial, context, options){
var currentPartialBlock=options.data&&options.data['partial-block'];
options.partial=true;
if(options.ids){
options.data.contextPath=options.ids[0]||options.data.contextPath;
}
var partialBlock=undefined;
if(options.fn&&options.fn!==noop){
(function (){
options.data=_base.createFrame(options.data);
var fn=options.fn;
partialBlock=options.data['partial-block']=function partialBlockWrapper(context){
var options=arguments.length <=1||arguments[1]===undefined ? {}:arguments[1];
options.data=_base.createFrame(options.data);
options.data['partial-block']=currentPartialBlock;
return fn(context, options);
};
if(fn.partials){
options.partials=Utils.extend({}, options.partials, fn.partials);
}})();
}
if(partial===undefined&&partialBlock){
partial=partialBlock;
}
if(partial===undefined){
throw new _exception2['default']('The partial ' + options.name + ' could not be found');
}else if(partial instanceof Function){
return partial(context, options);
}}
function noop(){
return '';
}
function initData(context, data){
if(!data||!('root' in data)){
data=data ? _base.createFrame(data):{};
data.root=context;
}
return data;
}
function executeDecorators(fn, prog, container, depths, data, blockParams){
if(fn.decorator){
var props={};
prog=fn.decorator(prog, props, container, depths&&depths[0], data, blockParams, depths);
Utils.extend(prog, props);
}
return prog;
}
function wrapHelpersToPassLookupProperty(mergedHelpers, container){
_Object$keys(mergedHelpers).forEach(function (helperName){
var helper=mergedHelpers[helperName];
mergedHelpers[helperName]=passLookupPropertyOption(helper, container);
});
}
function passLookupPropertyOption(helper, container){
var lookupProperty=container.lookupProperty;
return _internalWrapHelper.wrapHelper(helper, function (options){
return Utils.extend({ lookupProperty: lookupProperty }, options);
});
}
}),
(function(module, exports, __webpack_require__){
module.exports={ "default": __webpack_require__(40), __esModule: true };
}),
(function(module, exports, __webpack_require__){
__webpack_require__(41);
module.exports=__webpack_require__(21).Object.seal;
}),
(function(module, exports, __webpack_require__){
var isObject=__webpack_require__(42);
__webpack_require__(18)('seal', function($seal){
return function seal(it){
return $seal&&isObject(it) ? $seal(it):it;
};});
}),
(function(module, exports){
module.exports=function(it){
return typeof it==='object' ? it!==null:typeof it==='function';
};
}),
(function(module, exports){
'use strict';
exports.__esModule=true;
exports.wrapHelper=wrapHelper;
function wrapHelper(helper, transformOptionsFn){
if(typeof helper!=='function'){
return helper;
}
var wrapper=function wrapper() {
var options=arguments[arguments.length - 1];
arguments[arguments.length - 1]=transformOptionsFn(options);
return helper.apply(this, arguments);
};
return wrapper;
}
}),
(function(module, exports){
(function(global){'use strict';
exports.__esModule=true;
exports['default']=function (Handlebars){
var root=typeof global!=='undefined' ? global:window,
$Handlebars=root.Handlebars;
Handlebars.noConflict=function (){
if(root.Handlebars===Handlebars){
root.Handlebars=$Handlebars;
}
return Handlebars;
};};
module.exports=exports['default'];
}.call(exports, (function(){ return this; }())))
}),
(function(module, exports){
'use strict';
exports.__esModule=true;
var AST={
helpers: {
helperExpression: function helperExpression(node){
return node.type==='SubExpression'||(node.type==='MustacheStatement'||node.type==='BlockStatement')&&!!(node.params&&node.params.length||node.hash);
},
scopedId: function scopedId(path){
return (/^\.|this\b/.test(path.original)
);
},
simpleId: function simpleId(path){
return path.parts.length===1&&!AST.helpers.scopedId(path)&&!path.depth;
}}
};
exports['default']=AST;
module.exports=exports['default'];
}),
(function(module, exports, __webpack_require__){
'use strict';
var _interopRequireDefault=__webpack_require__(1)['default'];
var _interopRequireWildcard=__webpack_require__(3)['default'];
exports.__esModule=true;
exports.parseWithoutProcessing=parseWithoutProcessing;
exports.parse=parse;
var _parser=__webpack_require__(47);
var _parser2=_interopRequireDefault(_parser);
var _whitespaceControl=__webpack_require__(48);
var _whitespaceControl2=_interopRequireDefault(_whitespaceControl);
var _helpers=__webpack_require__(50);
var Helpers=_interopRequireWildcard(_helpers);
var _utils=__webpack_require__(5);
exports.parser=_parser2['default'];
var yy={};
_utils.extend(yy, Helpers);
function parseWithoutProcessing(input, options){
if(input.type==='Program'){
return input;
}
_parser2['default'].yy=yy;
yy.locInfo=function (locInfo){
return new yy.SourceLocation(options&&options.srcName, locInfo);
};
var ast=_parser2['default'].parse(input);
return ast;
}
function parse(input, options){
var ast=parseWithoutProcessing(input, options);
var strip=new _whitespaceControl2['default'](options);
return strip.accept(ast);
}
}),
(function(module, exports){
"use strict";
exports.__esModule=true;
var handlebars=(function (){
var parser={ trace: function trace(){},
yy: {},
symbols_: { "error": 2, "root": 3, "program": 4, "EOF": 5, "program_repetition0": 6, "statement": 7, "mustache": 8, "block": 9, "rawBlock": 10, "partial": 11, "partialBlock": 12, "content": 13, "COMMENT": 14, "CONTENT": 15, "openRawBlock": 16, "rawBlock_repetition0": 17, "END_RAW_BLOCK": 18, "OPEN_RAW_BLOCK": 19, "helperName": 20, "openRawBlock_repetition0": 21, "openRawBlock_option0": 22, "CLOSE_RAW_BLOCK": 23, "openBlock": 24, "block_option0": 25, "closeBlock": 26, "openInverse": 27, "block_option1": 28, "OPEN_BLOCK": 29, "openBlock_repetition0": 30, "openBlock_option0": 31, "openBlock_option1": 32, "CLOSE": 33, "OPEN_INVERSE": 34, "openInverse_repetition0": 35, "openInverse_option0": 36, "openInverse_option1": 37, "openInverseChain": 38, "OPEN_INVERSE_CHAIN": 39, "openInverseChain_repetition0": 40, "openInverseChain_option0": 41, "openInverseChain_option1": 42, "inverseAndProgram": 43, "INVERSE": 44, "inverseChain": 45, "inverseChain_option0": 46, "OPEN_ENDBLOCK": 47, "OPEN": 48, "mustache_repetition0": 49, "mustache_option0": 50, "OPEN_UNESCAPED": 51, "mustache_repetition1": 52, "mustache_option1": 53, "CLOSE_UNESCAPED": 54, "OPEN_PARTIAL": 55, "partialName": 56, "partial_repetition0": 57, "partial_option0": 58, "openPartialBlock": 59, "OPEN_PARTIAL_BLOCK": 60, "openPartialBlock_repetition0": 61, "openPartialBlock_option0": 62, "param": 63, "sexpr": 64, "OPEN_SEXPR": 65, "sexpr_repetition0": 66, "sexpr_option0": 67, "CLOSE_SEXPR": 68, "hash": 69, "hash_repetition_plus0": 70, "hashSegment": 71, "ID": 72, "EQUALS": 73, "blockParams": 74, "OPEN_BLOCK_PARAMS": 75, "blockParams_repetition_plus0": 76, "CLOSE_BLOCK_PARAMS": 77, "path": 78, "dataName": 79, "STRING": 80, "NUMBER": 81, "BOOLEAN": 82, "UNDEFINED": 83, "NULL": 84, "DATA": 85, "pathSegments": 86, "SEP": 87, "$accept": 0, "$end": 1 },
terminals_: { 2: "error", 5: "EOF", 14: "COMMENT", 15: "CONTENT", 18: "END_RAW_BLOCK", 19: "OPEN_RAW_BLOCK", 23: "CLOSE_RAW_BLOCK", 29: "OPEN_BLOCK", 33: "CLOSE", 34: "OPEN_INVERSE", 39: "OPEN_INVERSE_CHAIN", 44: "INVERSE", 47: "OPEN_ENDBLOCK", 48: "OPEN", 51: "OPEN_UNESCAPED", 54: "CLOSE_UNESCAPED", 55: "OPEN_PARTIAL", 60: "OPEN_PARTIAL_BLOCK", 65: "OPEN_SEXPR", 68: "CLOSE_SEXPR", 72: "ID", 73: "EQUALS", 75: "OPEN_BLOCK_PARAMS", 77: "CLOSE_BLOCK_PARAMS", 80: "STRING", 81: "NUMBER", 82: "BOOLEAN", 83: "UNDEFINED", 84: "NULL", 85: "DATA", 87: "SEP" },
productions_: [0, [3, 2], [4, 1], [7, 1], [7, 1], [7, 1], [7, 1], [7, 1], [7, 1], [7, 1], [13, 1], [10, 3], [16, 5], [9, 4], [9, 4], [24, 6], [27, 6], [38, 6], [43, 2], [45, 3], [45, 1], [26, 3], [8, 5], [8, 5], [11, 5], [12, 3], [59, 5], [63, 1], [63, 1], [64, 5], [69, 1], [71, 3], [74, 3], [20, 1], [20, 1], [20, 1], [20, 1], [20, 1], [20, 1], [20, 1], [56, 1], [56, 1], [79, 2], [78, 1], [86, 3], [86, 1], [6, 0], [6, 2], [17, 0], [17, 2], [21, 0], [21, 2], [22, 0], [22, 1], [25, 0], [25, 1], [28, 0], [28, 1], [30, 0], [30, 2], [31, 0], [31, 1], [32, 0], [32, 1], [35, 0], [35, 2], [36, 0], [36, 1], [37, 0], [37, 1], [40, 0], [40, 2], [41, 0], [41, 1], [42, 0], [42, 1], [46, 0], [46, 1], [49, 0], [49, 2], [50, 0], [50, 1], [52, 0], [52, 2], [53, 0], [53, 1], [57, 0], [57, 2], [58, 0], [58, 1], [61, 0], [61, 2], [62, 0], [62, 1], [66, 0], [66, 2], [67, 0], [67, 1], [70, 1], [70, 2], [76, 1], [76, 2]],
performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$){
var $0=$$.length - 1;
switch (yystate){
case 1:
return $$[$0 - 1];
break;
case 2:
this.$=yy.prepareProgram($$[$0]);
break;
case 3:
this.$=$$[$0];
break;
case 4:
this.$=$$[$0];
break;
case 5:
this.$=$$[$0];
break;
case 6:
this.$=$$[$0];
break;
case 7:
this.$=$$[$0];
break;
case 8:
this.$=$$[$0];
break;
case 9:
this.$={
type: 'CommentStatement',
value: yy.stripComment($$[$0]),
strip: yy.stripFlags($$[$0], $$[$0]),
loc: yy.locInfo(this._$)
};
break;
case 10:
this.$={
type: 'ContentStatement',
original: $$[$0],
value: $$[$0],
loc: yy.locInfo(this._$)
};
break;
case 11:
this.$=yy.prepareRawBlock($$[$0 - 2], $$[$0 - 1], $$[$0], this._$);
break;
case 12:
this.$={ path: $$[$0 - 3], params: $$[$0 - 2], hash: $$[$0 - 1] };
break;
case 13:
this.$=yy.prepareBlock($$[$0 - 3], $$[$0 - 2], $$[$0 - 1], $$[$0], false, this._$);
break;
case 14:
this.$=yy.prepareBlock($$[$0 - 3], $$[$0 - 2], $$[$0 - 1], $$[$0], true, this._$);
break;
case 15:
this.$={ open: $$[$0 - 5], path: $$[$0 - 4], params: $$[$0 - 3], hash: $$[$0 - 2], blockParams: $$[$0 - 1], strip: yy.stripFlags($$[$0 - 5], $$[$0]) };
break;
case 16:
this.$={ path: $$[$0 - 4], params: $$[$0 - 3], hash: $$[$0 - 2], blockParams: $$[$0 - 1], strip: yy.stripFlags($$[$0 - 5], $$[$0]) };
break;
case 17:
this.$={ path: $$[$0 - 4], params: $$[$0 - 3], hash: $$[$0 - 2], blockParams: $$[$0 - 1], strip: yy.stripFlags($$[$0 - 5], $$[$0]) };
break;
case 18:
this.$={ strip: yy.stripFlags($$[$0 - 1], $$[$0 - 1]), program: $$[$0] };
break;
case 19:
var inverse=yy.prepareBlock($$[$0 - 2], $$[$0 - 1], $$[$0], $$[$0], false, this._$),
program=yy.prepareProgram([inverse], $$[$0 - 1].loc);
program.chained=true;
this.$={ strip: $$[$0 - 2].strip, program: program, chain: true };
break;
case 20:
this.$=$$[$0];
break;
case 21:
this.$={ path: $$[$0 - 1], strip: yy.stripFlags($$[$0 - 2], $$[$0]) };
break;
case 22:
this.$=yy.prepareMustache($$[$0 - 3], $$[$0 - 2], $$[$0 - 1], $$[$0 - 4], yy.stripFlags($$[$0 - 4], $$[$0]), this._$);
break;
case 23:
this.$=yy.prepareMustache($$[$0 - 3], $$[$0 - 2], $$[$0 - 1], $$[$0 - 4], yy.stripFlags($$[$0 - 4], $$[$0]), this._$);
break;
case 24:
this.$={
type: 'PartialStatement',
name: $$[$0 - 3],
params: $$[$0 - 2],
hash: $$[$0 - 1],
indent: '',
strip: yy.stripFlags($$[$0 - 4], $$[$0]),
loc: yy.locInfo(this._$)
};
break;
case 25:
this.$=yy.preparePartialBlock($$[$0 - 2], $$[$0 - 1], $$[$0], this._$);
break;
case 26:
this.$={ path: $$[$0 - 3], params: $$[$0 - 2], hash: $$[$0 - 1], strip: yy.stripFlags($$[$0 - 4], $$[$0]) };
break;
case 27:
this.$=$$[$0];
break;
case 28:
this.$=$$[$0];
break;
case 29:
this.$={
type: 'SubExpression',
path: $$[$0 - 3],
params: $$[$0 - 2],
hash: $$[$0 - 1],
loc: yy.locInfo(this._$)
};
break;
case 30:
this.$={ type: 'Hash', pairs: $$[$0], loc: yy.locInfo(this._$) };
break;
case 31:
this.$={ type: 'HashPair', key: yy.id($$[$0 - 2]), value: $$[$0], loc: yy.locInfo(this._$) };
break;
case 32:
this.$=yy.id($$[$0 - 1]);
break;
case 33:
this.$=$$[$0];
break;
case 34:
this.$=$$[$0];
break;
case 35:
this.$={ type: 'StringLiteral', value: $$[$0], original: $$[$0], loc: yy.locInfo(this._$) };
break;
case 36:
this.$={ type: 'NumberLiteral', value: Number($$[$0]), original: Number($$[$0]), loc: yy.locInfo(this._$) };
break;
case 37:
this.$={ type: 'BooleanLiteral', value: $$[$0]==='true', original: $$[$0]==='true', loc: yy.locInfo(this._$) };
break;
case 38:
this.$={ type: 'UndefinedLiteral', original: undefined, value: undefined, loc: yy.locInfo(this._$) };
break;
case 39:
this.$={ type: 'NullLiteral', original: null, value: null, loc: yy.locInfo(this._$) };
break;
case 40:
this.$=$$[$0];
break;
case 41:
this.$=$$[$0];
break;
case 42:
this.$=yy.preparePath(true, $$[$0], this._$);
break;
case 43:
this.$=yy.preparePath(false, $$[$0], this._$);
break;
case 44:
$$[$0 - 2].push({ part: yy.id($$[$0]), original: $$[$0], separator: $$[$0 - 1] });this.$=$$[$0 - 2];
break;
case 45:
this.$=[{ part: yy.id($$[$0]), original: $$[$0] }];
break;
case 46:
this.$=[];
break;
case 47:
$$[$0 - 1].push($$[$0]);
break;
case 48:
this.$=[];
break;
case 49:
$$[$0 - 1].push($$[$0]);
break;
case 50:
this.$=[];
break;
case 51:
$$[$0 - 1].push($$[$0]);
break;
case 58:
this.$=[];
break;
case 59:
$$[$0 - 1].push($$[$0]);
break;
case 64:
this.$=[];
break;
case 65:
$$[$0 - 1].push($$[$0]);
break;
case 70:
this.$=[];
break;
case 71:
$$[$0 - 1].push($$[$0]);
break;
case 78:
this.$=[];
break;
case 79:
$$[$0 - 1].push($$[$0]);
break;
case 82:
this.$=[];
break;
case 83:
$$[$0 - 1].push($$[$0]);
break;
case 86:
this.$=[];
break;
case 87:
$$[$0 - 1].push($$[$0]);
break;
case 90:
this.$=[];
break;
case 91:
$$[$0 - 1].push($$[$0]);
break;
case 94:
this.$=[];
break;
case 95:
$$[$0 - 1].push($$[$0]);
break;
case 98:
this.$=[$$[$0]];
break;
case 99:
$$[$0 - 1].push($$[$0]);
break;
case 100:
this.$=[$$[$0]];
break;
case 101:
$$[$0 - 1].push($$[$0]);
break;
}},
table: [{ 3: 1, 4: 2, 5: [2, 46], 6: 3, 14: [2, 46], 15: [2, 46], 19: [2, 46], 29: [2, 46], 34: [2, 46], 48: [2, 46], 51: [2, 46], 55: [2, 46], 60: [2, 46] }, { 1: [3] }, { 5: [1, 4] }, { 5: [2, 2], 7: 5, 8: 6, 9: 7, 10: 8, 11: 9, 12: 10, 13: 11, 14: [1, 12], 15: [1, 20], 16: 17, 19: [1, 23], 24: 15, 27: 16, 29: [1, 21], 34: [1, 22], 39: [2, 2], 44: [2, 2], 47: [2, 2], 48: [1, 13], 51: [1, 14], 55: [1, 18], 59: 19, 60: [1, 24] }, { 1: [2, 1] }, { 5: [2, 47], 14: [2, 47], 15: [2, 47], 19: [2, 47], 29: [2, 47], 34: [2, 47], 39: [2, 47], 44: [2, 47], 47: [2, 47], 48: [2, 47], 51: [2, 47], 55: [2, 47], 60: [2, 47] }, { 5: [2, 3], 14: [2, 3], 15: [2, 3], 19: [2, 3], 29: [2, 3], 34: [2, 3], 39: [2, 3], 44: [2, 3], 47: [2, 3], 48: [2, 3], 51: [2, 3], 55: [2, 3], 60: [2, 3] }, { 5: [2, 4], 14: [2, 4], 15: [2, 4], 19: [2, 4], 29: [2, 4], 34: [2, 4], 39: [2, 4], 44: [2, 4], 47: [2, 4], 48: [2, 4], 51: [2, 4], 55: [2, 4], 60: [2, 4] }, { 5: [2, 5], 14: [2, 5], 15: [2, 5], 19: [2, 5], 29: [2, 5], 34: [2, 5], 39: [2, 5], 44: [2, 5], 47: [2, 5], 48: [2, 5], 51: [2, 5], 55: [2, 5], 60: [2, 5] }, { 5: [2, 6], 14: [2, 6], 15: [2, 6], 19: [2, 6], 29: [2, 6], 34: [2, 6], 39: [2, 6], 44: [2, 6], 47: [2, 6], 48: [2, 6], 51: [2, 6], 55: [2, 6], 60: [2, 6] }, { 5: [2, 7], 14: [2, 7], 15: [2, 7], 19: [2, 7], 29: [2, 7], 34: [2, 7], 39: [2, 7], 44: [2, 7], 47: [2, 7], 48: [2, 7], 51: [2, 7], 55: [2, 7], 60: [2, 7] }, { 5: [2, 8], 14: [2, 8], 15: [2, 8], 19: [2, 8], 29: [2, 8], 34: [2, 8], 39: [2, 8], 44: [2, 8], 47: [2, 8], 48: [2, 8], 51: [2, 8], 55: [2, 8], 60: [2, 8] }, { 5: [2, 9], 14: [2, 9], 15: [2, 9], 19: [2, 9], 29: [2, 9], 34: [2, 9], 39: [2, 9], 44: [2, 9], 47: [2, 9], 48: [2, 9], 51: [2, 9], 55: [2, 9], 60: [2, 9] }, { 20: 25, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 36, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 4: 37, 6: 3, 14: [2, 46], 15: [2, 46], 19: [2, 46], 29: [2, 46], 34: [2, 46], 39: [2, 46], 44: [2, 46], 47: [2, 46], 48: [2, 46], 51: [2, 46], 55: [2, 46], 60: [2, 46] }, { 4: 38, 6: 3, 14: [2, 46], 15: [2, 46], 19: [2, 46], 29: [2, 46], 34: [2, 46], 44: [2, 46], 47: [2, 46], 48: [2, 46], 51: [2, 46], 55: [2, 46], 60: [2, 46] }, { 15: [2, 48], 17: 39, 18: [2, 48] }, { 20: 41, 56: 40, 64: 42, 65: [1, 43], 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 4: 44, 6: 3, 14: [2, 46], 15: [2, 46], 19: [2, 46], 29: [2, 46], 34: [2, 46], 47: [2, 46], 48: [2, 46], 51: [2, 46], 55: [2, 46], 60: [2, 46] }, { 5: [2, 10], 14: [2, 10], 15: [2, 10], 18: [2, 10], 19: [2, 10], 29: [2, 10], 34: [2, 10], 39: [2, 10], 44: [2, 10], 47: [2, 10], 48: [2, 10], 51: [2, 10], 55: [2, 10], 60: [2, 10] }, { 20: 45, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 46, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 47, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 41, 56: 48, 64: 42, 65: [1, 43], 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 33: [2, 78], 49: 49, 65: [2, 78], 72: [2, 78], 80: [2, 78], 81: [2, 78], 82: [2, 78], 83: [2, 78], 84: [2, 78], 85: [2, 78] }, { 23: [2, 33], 33: [2, 33], 54: [2, 33], 65: [2, 33], 68: [2, 33], 72: [2, 33], 75: [2, 33], 80: [2, 33], 81: [2, 33], 82: [2, 33], 83: [2, 33], 84: [2, 33], 85: [2, 33] }, { 23: [2, 34], 33: [2, 34], 54: [2, 34], 65: [2, 34], 68: [2, 34], 72: [2, 34], 75: [2, 34], 80: [2, 34], 81: [2, 34], 82: [2, 34], 83: [2, 34], 84: [2, 34], 85: [2, 34] }, { 23: [2, 35], 33: [2, 35], 54: [2, 35], 65: [2, 35], 68: [2, 35], 72: [2, 35], 75: [2, 35], 80: [2, 35], 81: [2, 35], 82: [2, 35], 83: [2, 35], 84: [2, 35], 85: [2, 35] }, { 23: [2, 36], 33: [2, 36], 54: [2, 36], 65: [2, 36], 68: [2, 36], 72: [2, 36], 75: [2, 36], 80: [2, 36], 81: [2, 36], 82: [2, 36], 83: [2, 36], 84: [2, 36], 85: [2, 36] }, { 23: [2, 37], 33: [2, 37], 54: [2, 37], 65: [2, 37], 68: [2, 37], 72: [2, 37], 75: [2, 37], 80: [2, 37], 81: [2, 37], 82: [2, 37], 83: [2, 37], 84: [2, 37], 85: [2, 37] }, { 23: [2, 38], 33: [2, 38], 54: [2, 38], 65: [2, 38], 68: [2, 38], 72: [2, 38], 75: [2, 38], 80: [2, 38], 81: [2, 38], 82: [2, 38], 83: [2, 38], 84: [2, 38], 85: [2, 38] }, { 23: [2, 39], 33: [2, 39], 54: [2, 39], 65: [2, 39], 68: [2, 39], 72: [2, 39], 75: [2, 39], 80: [2, 39], 81: [2, 39], 82: [2, 39], 83: [2, 39], 84: [2, 39], 85: [2, 39] }, { 23: [2, 43], 33: [2, 43], 54: [2, 43], 65: [2, 43], 68: [2, 43], 72: [2, 43], 75: [2, 43], 80: [2, 43], 81: [2, 43], 82: [2, 43], 83: [2, 43], 84: [2, 43], 85: [2, 43], 87: [1, 50] }, { 72: [1, 35], 86: 51 }, { 23: [2, 45], 33: [2, 45], 54: [2, 45], 65: [2, 45], 68: [2, 45], 72: [2, 45], 75: [2, 45], 80: [2, 45], 81: [2, 45], 82: [2, 45], 83: [2, 45], 84: [2, 45], 85: [2, 45], 87: [2, 45] }, { 52: 52, 54: [2, 82], 65: [2, 82], 72: [2, 82], 80: [2, 82], 81: [2, 82], 82: [2, 82], 83: [2, 82], 84: [2, 82], 85: [2, 82] }, { 25: 53, 38: 55, 39: [1, 57], 43: 56, 44: [1, 58], 45: 54, 47: [2, 54] }, { 28: 59, 43: 60, 44: [1, 58], 47: [2, 56] }, { 13: 62, 15: [1, 20], 18: [1, 61] }, { 33: [2, 86], 57: 63, 65: [2, 86], 72: [2, 86], 80: [2, 86], 81: [2, 86], 82: [2, 86], 83: [2, 86], 84: [2, 86], 85: [2, 86] }, { 33: [2, 40], 65: [2, 40], 72: [2, 40], 80: [2, 40], 81: [2, 40], 82: [2, 40], 83: [2, 40], 84: [2, 40], 85: [2, 40] }, { 33: [2, 41], 65: [2, 41], 72: [2, 41], 80: [2, 41], 81: [2, 41], 82: [2, 41], 83: [2, 41], 84: [2, 41], 85: [2, 41] }, { 20: 64, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 26: 65, 47: [1, 66] }, { 30: 67, 33: [2, 58], 65: [2, 58], 72: [2, 58], 75: [2, 58], 80: [2, 58], 81: [2, 58], 82: [2, 58], 83: [2, 58], 84: [2, 58], 85: [2, 58] }, { 33: [2, 64], 35: 68, 65: [2, 64], 72: [2, 64], 75: [2, 64], 80: [2, 64], 81: [2, 64], 82: [2, 64], 83: [2, 64], 84: [2, 64], 85: [2, 64] }, { 21: 69, 23: [2, 50], 65: [2, 50], 72: [2, 50], 80: [2, 50], 81: [2, 50], 82: [2, 50], 83: [2, 50], 84: [2, 50], 85: [2, 50] }, { 33: [2, 90], 61: 70, 65: [2, 90], 72: [2, 90], 80: [2, 90], 81: [2, 90], 82: [2, 90], 83: [2, 90], 84: [2, 90], 85: [2, 90] }, { 20: 74, 33: [2, 80], 50: 71, 63: 72, 64: 75, 65: [1, 43], 69: 73, 70: 76, 71: 77, 72: [1, 78], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 72: [1, 79] }, { 23: [2, 42], 33: [2, 42], 54: [2, 42], 65: [2, 42], 68: [2, 42], 72: [2, 42], 75: [2, 42], 80: [2, 42], 81: [2, 42], 82: [2, 42], 83: [2, 42], 84: [2, 42], 85: [2, 42], 87: [1, 50] }, { 20: 74, 53: 80, 54: [2, 84], 63: 81, 64: 75, 65: [1, 43], 69: 82, 70: 76, 71: 77, 72: [1, 78], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 26: 83, 47: [1, 66] }, { 47: [2, 55] }, { 4: 84, 6: 3, 14: [2, 46], 15: [2, 46], 19: [2, 46], 29: [2, 46], 34: [2, 46], 39: [2, 46], 44: [2, 46], 47: [2, 46], 48: [2, 46], 51: [2, 46], 55: [2, 46], 60: [2, 46] }, { 47: [2, 20] }, { 20: 85, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 4: 86, 6: 3, 14: [2, 46], 15: [2, 46], 19: [2, 46], 29: [2, 46], 34: [2, 46], 47: [2, 46], 48: [2, 46], 51: [2, 46], 55: [2, 46], 60: [2, 46] }, { 26: 87, 47: [1, 66] }, { 47: [2, 57] }, { 5: [2, 11], 14: [2, 11], 15: [2, 11], 19: [2, 11], 29: [2, 11], 34: [2, 11], 39: [2, 11], 44: [2, 11], 47: [2, 11], 48: [2, 11], 51: [2, 11], 55: [2, 11], 60: [2, 11] }, { 15: [2, 49], 18: [2, 49] }, { 20: 74, 33: [2, 88], 58: 88, 63: 89, 64: 75, 65: [1, 43], 69: 90, 70: 76, 71: 77, 72: [1, 78], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 65: [2, 94], 66: 91, 68: [2, 94], 72: [2, 94], 80: [2, 94], 81: [2, 94], 82: [2, 94], 83: [2, 94], 84: [2, 94], 85: [2, 94] }, { 5: [2, 25], 14: [2, 25], 15: [2, 25], 19: [2, 25], 29: [2, 25], 34: [2, 25], 39: [2, 25], 44: [2, 25], 47: [2, 25], 48: [2, 25], 51: [2, 25], 55: [2, 25], 60: [2, 25] }, { 20: 92, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 74, 31: 93, 33: [2, 60], 63: 94, 64: 75, 65: [1, 43], 69: 95, 70: 76, 71: 77, 72: [1, 78], 75: [2, 60], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 74, 33: [2, 66], 36: 96, 63: 97, 64: 75, 65: [1, 43], 69: 98, 70: 76, 71: 77, 72: [1, 78], 75: [2, 66], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 74, 22: 99, 23: [2, 52], 63: 100, 64: 75, 65: [1, 43], 69: 101, 70: 76, 71: 77, 72: [1, 78], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 74, 33: [2, 92], 62: 102, 63: 103, 64: 75, 65: [1, 43], 69: 104, 70: 76, 71: 77, 72: [1, 78], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 33: [1, 105] }, { 33: [2, 79], 65: [2, 79], 72: [2, 79], 80: [2, 79], 81: [2, 79], 82: [2, 79], 83: [2, 79], 84: [2, 79], 85: [2, 79] }, { 33: [2, 81] }, { 23: [2, 27], 33: [2, 27], 54: [2, 27], 65: [2, 27], 68: [2, 27], 72: [2, 27], 75: [2, 27], 80: [2, 27], 81: [2, 27], 82: [2, 27], 83: [2, 27], 84: [2, 27], 85: [2, 27] }, { 23: [2, 28], 33: [2, 28], 54: [2, 28], 65: [2, 28], 68: [2, 28], 72: [2, 28], 75: [2, 28], 80: [2, 28], 81: [2, 28], 82: [2, 28], 83: [2, 28], 84: [2, 28], 85: [2, 28] }, { 23: [2, 30], 33: [2, 30], 54: [2, 30], 68: [2, 30], 71: 106, 72: [1, 107], 75: [2, 30] }, { 23: [2, 98], 33: [2, 98], 54: [2, 98], 68: [2, 98], 72: [2, 98], 75: [2, 98] }, { 23: [2, 45], 33: [2, 45], 54: [2, 45], 65: [2, 45], 68: [2, 45], 72: [2, 45], 73: [1, 108], 75: [2, 45], 80: [2, 45], 81: [2, 45], 82: [2, 45], 83: [2, 45], 84: [2, 45], 85: [2, 45], 87: [2, 45] }, { 23: [2, 44], 33: [2, 44], 54: [2, 44], 65: [2, 44], 68: [2, 44], 72: [2, 44], 75: [2, 44], 80: [2, 44], 81: [2, 44], 82: [2, 44], 83: [2, 44], 84: [2, 44], 85: [2, 44], 87: [2, 44] }, { 54: [1, 109] }, { 54: [2, 83], 65: [2, 83], 72: [2, 83], 80: [2, 83], 81: [2, 83], 82: [2, 83], 83: [2, 83], 84: [2, 83], 85: [2, 83] }, { 54: [2, 85] }, { 5: [2, 13], 14: [2, 13], 15: [2, 13], 19: [2, 13], 29: [2, 13], 34: [2, 13], 39: [2, 13], 44: [2, 13], 47: [2, 13], 48: [2, 13], 51: [2, 13], 55: [2, 13], 60: [2, 13] }, { 38: 55, 39: [1, 57], 43: 56, 44: [1, 58], 45: 111, 46: 110, 47: [2, 76] }, { 33: [2, 70], 40: 112, 65: [2, 70], 72: [2, 70], 75: [2, 70], 80: [2, 70], 81: [2, 70], 82: [2, 70], 83: [2, 70], 84: [2, 70], 85: [2, 70] }, { 47: [2, 18] }, { 5: [2, 14], 14: [2, 14], 15: [2, 14], 19: [2, 14], 29: [2, 14], 34: [2, 14], 39: [2, 14], 44: [2, 14], 47: [2, 14], 48: [2, 14], 51: [2, 14], 55: [2, 14], 60: [2, 14] }, { 33: [1, 113] }, { 33: [2, 87], 65: [2, 87], 72: [2, 87], 80: [2, 87], 81: [2, 87], 82: [2, 87], 83: [2, 87], 84: [2, 87], 85: [2, 87] }, { 33: [2, 89] }, { 20: 74, 63: 115, 64: 75, 65: [1, 43], 67: 114, 68: [2, 96], 69: 116, 70: 76, 71: 77, 72: [1, 78], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 33: [1, 117] }, { 32: 118, 33: [2, 62], 74: 119, 75: [1, 120] }, { 33: [2, 59], 65: [2, 59], 72: [2, 59], 75: [2, 59], 80: [2, 59], 81: [2, 59], 82: [2, 59], 83: [2, 59], 84: [2, 59], 85: [2, 59] }, { 33: [2, 61], 75: [2, 61] }, { 33: [2, 68], 37: 121, 74: 122, 75: [1, 120] }, { 33: [2, 65], 65: [2, 65], 72: [2, 65], 75: [2, 65], 80: [2, 65], 81: [2, 65], 82: [2, 65], 83: [2, 65], 84: [2, 65], 85: [2, 65] }, { 33: [2, 67], 75: [2, 67] }, { 23: [1, 123] }, { 23: [2, 51], 65: [2, 51], 72: [2, 51], 80: [2, 51], 81: [2, 51], 82: [2, 51], 83: [2, 51], 84: [2, 51], 85: [2, 51] }, { 23: [2, 53] }, { 33: [1, 124] }, { 33: [2, 91], 65: [2, 91], 72: [2, 91], 80: [2, 91], 81: [2, 91], 82: [2, 91], 83: [2, 91], 84: [2, 91], 85: [2, 91] }, { 33: [2, 93] }, { 5: [2, 22], 14: [2, 22], 15: [2, 22], 19: [2, 22], 29: [2, 22], 34: [2, 22], 39: [2, 22], 44: [2, 22], 47: [2, 22], 48: [2, 22], 51: [2, 22], 55: [2, 22], 60: [2, 22] }, { 23: [2, 99], 33: [2, 99], 54: [2, 99], 68: [2, 99], 72: [2, 99], 75: [2, 99] }, { 73: [1, 108] }, { 20: 74, 63: 125, 64: 75, 65: [1, 43], 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 5: [2, 23], 14: [2, 23], 15: [2, 23], 19: [2, 23], 29: [2, 23], 34: [2, 23], 39: [2, 23], 44: [2, 23], 47: [2, 23], 48: [2, 23], 51: [2, 23], 55: [2, 23], 60: [2, 23] }, { 47: [2, 19] }, { 47: [2, 77] }, { 20: 74, 33: [2, 72], 41: 126, 63: 127, 64: 75, 65: [1, 43], 69: 128, 70: 76, 71: 77, 72: [1, 78], 75: [2, 72], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 5: [2, 24], 14: [2, 24], 15: [2, 24], 19: [2, 24], 29: [2, 24], 34: [2, 24], 39: [2, 24], 44: [2, 24], 47: [2, 24], 48: [2, 24], 51: [2, 24], 55: [2, 24], 60: [2, 24] }, { 68: [1, 129] }, { 65: [2, 95], 68: [2, 95], 72: [2, 95], 80: [2, 95], 81: [2, 95], 82: [2, 95], 83: [2, 95], 84: [2, 95], 85: [2, 95] }, { 68: [2, 97] }, { 5: [2, 21], 14: [2, 21], 15: [2, 21], 19: [2, 21], 29: [2, 21], 34: [2, 21], 39: [2, 21], 44: [2, 21], 47: [2, 21], 48: [2, 21], 51: [2, 21], 55: [2, 21], 60: [2, 21] }, { 33: [1, 130] }, { 33: [2, 63] }, { 72: [1, 132], 76: 131 }, { 33: [1, 133] }, { 33: [2, 69] }, { 15: [2, 12], 18: [2, 12] }, { 14: [2, 26], 15: [2, 26], 19: [2, 26], 29: [2, 26], 34: [2, 26], 47: [2, 26], 48: [2, 26], 51: [2, 26], 55: [2, 26], 60: [2, 26] }, { 23: [2, 31], 33: [2, 31], 54: [2, 31], 68: [2, 31], 72: [2, 31], 75: [2, 31] }, { 33: [2, 74], 42: 134, 74: 135, 75: [1, 120] }, { 33: [2, 71], 65: [2, 71], 72: [2, 71], 75: [2, 71], 80: [2, 71], 81: [2, 71], 82: [2, 71], 83: [2, 71], 84: [2, 71], 85: [2, 71] }, { 33: [2, 73], 75: [2, 73] }, { 23: [2, 29], 33: [2, 29], 54: [2, 29], 65: [2, 29], 68: [2, 29], 72: [2, 29], 75: [2, 29], 80: [2, 29], 81: [2, 29], 82: [2, 29], 83: [2, 29], 84: [2, 29], 85: [2, 29] }, { 14: [2, 15], 15: [2, 15], 19: [2, 15], 29: [2, 15], 34: [2, 15], 39: [2, 15], 44: [2, 15], 47: [2, 15], 48: [2, 15], 51: [2, 15], 55: [2, 15], 60: [2, 15] }, { 72: [1, 137], 77: [1, 136] }, { 72: [2, 100], 77: [2, 100] }, { 14: [2, 16], 15: [2, 16], 19: [2, 16], 29: [2, 16], 34: [2, 16], 44: [2, 16], 47: [2, 16], 48: [2, 16], 51: [2, 16], 55: [2, 16], 60: [2, 16] }, { 33: [1, 138] }, { 33: [2, 75] }, { 33: [2, 32] }, { 72: [2, 101], 77: [2, 101] }, { 14: [2, 17], 15: [2, 17], 19: [2, 17], 29: [2, 17], 34: [2, 17], 39: [2, 17], 44: [2, 17], 47: [2, 17], 48: [2, 17], 51: [2, 17], 55: [2, 17], 60: [2, 17] }],
defaultActions: { 4: [2, 1], 54: [2, 55], 56: [2, 20], 60: [2, 57], 73: [2, 81], 82: [2, 85], 86: [2, 18], 90: [2, 89], 101: [2, 53], 104: [2, 93], 110: [2, 19], 111: [2, 77], 116: [2, 97], 119: [2, 63], 122: [2, 69], 135: [2, 75], 136: [2, 32] },
parseError: function parseError(str, hash){
throw new Error(str);
},
parse: function parse(input){
var self=this,
stack=[0],
vstack=[null],
lstack=[],
table=this.table,
yytext="",
yylineno=0,
yyleng=0,
recovering=0,
TERROR=2,
EOF=1;
this.lexer.setInput(input);
this.lexer.yy=this.yy;
this.yy.lexer=this.lexer;
this.yy.parser=this;
if(typeof this.lexer.yylloc=="undefined") this.lexer.yylloc={};
var yyloc=this.lexer.yylloc;
lstack.push(yyloc);
var ranges=this.lexer.options&&this.lexer.options.ranges;
if(typeof this.yy.parseError==="function") this.parseError=this.yy.parseError;
function popStack(n){
stack.length=stack.length - 2 * n;
vstack.length=vstack.length - n;
lstack.length=lstack.length - n;
}
function lex(){
var token;
token=self.lexer.lex()||1;
if(typeof token!=="number"){
token=self.symbols_[token]||token;
}
return token;
}
var symbol,
preErrorSymbol,
state,
action,
a,
r,
yyval={},
p,
len,
newState,
expected;
while (true){
state=stack[stack.length - 1];
if(this.defaultActions[state]){
action=this.defaultActions[state];
}else{
if(symbol===null||typeof symbol=="undefined"){
symbol=lex();
}
action=table[state]&&table[state][symbol];
}
if(typeof action==="undefined"||!action.length||!action[0]){
var errStr="";
if(!recovering){
expected=[];
for (p in table[state]) if(this.terminals_[p]&&p > 2){
expected.push("'" + this.terminals_[p] + "'");
}
if(this.lexer.showPosition){
errStr="Parse error on line " + (yylineno + 1) + ":\n" + this.lexer.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol]||symbol) + "'";
}else{
errStr="Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol==1 ? "end of input":"'" + (this.terminals_[symbol]||symbol) + "'");
}
this.parseError(errStr, { text: this.lexer.match, token: this.terminals_[symbol]||symbol, line: this.lexer.yylineno, loc: yyloc, expected: expected });
}}
if(action[0] instanceof Array&&action.length > 1){
throw new Error("Parse Error: multiple actions possible at state: " + state + ", token: " + symbol);
}
switch (action[0]){
case 1:
stack.push(symbol);
vstack.push(this.lexer.yytext);
lstack.push(this.lexer.yylloc);
stack.push(action[1]);
symbol=null;
if(!preErrorSymbol){
yyleng=this.lexer.yyleng;
yytext=this.lexer.yytext;
yylineno=this.lexer.yylineno;
yyloc=this.lexer.yylloc;
if(recovering > 0) recovering--;
}else{
symbol=preErrorSymbol;
preErrorSymbol=null;
}
break;
case 2:
len=this.productions_[action[1]][1];
yyval.$=vstack[vstack.length - len];
yyval._$={ first_line: lstack[lstack.length - (len||1)].first_line, last_line: lstack[lstack.length - 1].last_line, first_column: lstack[lstack.length - (len||1)].first_column, last_column: lstack[lstack.length - 1].last_column };
if(ranges){
yyval._$.range=[lstack[lstack.length - (len||1)].range[0], lstack[lstack.length - 1].range[1]];
}
r=this.performAction.call(yyval, yytext, yyleng, yylineno, this.yy, action[1], vstack, lstack);
if(typeof r!=="undefined"){
return r;
}
if(len){
stack=stack.slice(0, -1 * len * 2);
vstack=vstack.slice(0, -1 * len);
lstack=lstack.slice(0, -1 * len);
}
stack.push(this.productions_[action[1]][0]);
vstack.push(yyval.$);
lstack.push(yyval._$);
newState=table[stack[stack.length - 2]][stack[stack.length - 1]];
stack.push(newState);
break;
case 3:
return true;
}}
return true;
}};
var lexer=(function (){
var lexer={ EOF: 1,
parseError: function parseError(str, hash){
if(this.yy.parser){
this.yy.parser.parseError(str, hash);
}else{
throw new Error(str);
}},
setInput: function setInput(input){
this._input=input;
this._more=this._less=this.done=false;
this.yylineno=this.yyleng=0;
this.yytext=this.matched=this.match='';
this.conditionStack=['INITIAL'];
this.yylloc={ first_line: 1, first_column: 0, last_line: 1, last_column: 0 };
if(this.options.ranges) this.yylloc.range=[0, 0];
this.offset=0;
return this;
},
input: function input(){
var ch=this._input[0];
this.yytext +=ch;
this.yyleng++;
this.offset++;
this.match +=ch;
this.matched +=ch;
var lines=ch.match(/(?:\r\n?|\n).*/g);
if(lines){
this.yylineno++;
this.yylloc.last_line++;
}else{
this.yylloc.last_column++;
}
if(this.options.ranges) this.yylloc.range[1]++;
this._input=this._input.slice(1);
return ch;
},
unput: function unput(ch){
var len=ch.length;
var lines=ch.split(/(?:\r\n?|\n)/g);
this._input=ch + this._input;
this.yytext=this.yytext.substr(0, this.yytext.length - len - 1);
this.offset -=len;
var oldLines=this.match.split(/(?:\r\n?|\n)/g);
this.match=this.match.substr(0, this.match.length - 1);
this.matched=this.matched.substr(0, this.matched.length - 1);
if(lines.length - 1) this.yylineno -=lines.length - 1;
var r=this.yylloc.range;
this.yylloc={ first_line: this.yylloc.first_line,
last_line: this.yylineno + 1,
first_column: this.yylloc.first_column,
last_column: lines ? (lines.length===oldLines.length ? this.yylloc.first_column:0) + oldLines[oldLines.length - lines.length].length - lines[0].length:this.yylloc.first_column - len
};
if(this.options.ranges){
this.yylloc.range=[r[0], r[0] + this.yyleng - len];
}
return this;
},
more: function more(){
this._more=true;
return this;
},
less: function less(n){
this.unput(this.match.slice(n));
},
pastInput: function pastInput(){
var past=this.matched.substr(0, this.matched.length - this.match.length);
return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\n/g, "");
},
upcomingInput: function upcomingInput(){
var next=this.match;
if(next.length < 20){
next +=this._input.substr(0, 20 - next.length);
}
return (next.substr(0, 20) + (next.length > 20 ? '...':'')).replace(/\n/g, "");
},
showPosition: function showPosition(){
var pre=this.pastInput();
var c=new Array(pre.length + 1).join("-");
return pre + this.upcomingInput() + "\n" + c + "^";
},
next: function next(){
if(this.done){
return this.EOF;
}
if(!this._input) this.done=true;
var token, match, tempMatch, index, col, lines;
if(!this._more){
this.yytext='';
this.match='';
}
var rules=this._currentRules();
for (var i=0; i < rules.length; i++){
tempMatch=this._input.match(this.rules[rules[i]]);
if(tempMatch&&(!match||tempMatch[0].length > match[0].length)){
match=tempMatch;
index=i;
if(!this.options.flex) break;
}}
if(match){
lines=match[0].match(/(?:\r\n?|\n).*/g);
if(lines) this.yylineno +=lines.length;
this.yylloc={ first_line: this.yylloc.last_line,
last_line: this.yylineno + 1,
first_column: this.yylloc.last_column,
last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length:this.yylloc.last_column + match[0].length };
this.yytext +=match[0];
this.match +=match[0];
this.matches=match;
this.yyleng=this.yytext.length;
if(this.options.ranges){
this.yylloc.range=[this.offset, this.offset +=this.yyleng];
}
this._more=false;
this._input=this._input.slice(match[0].length);
this.matched +=match[0];
token=this.performAction.call(this, this.yy, this, rules[index], this.conditionStack[this.conditionStack.length - 1]);
if(this.done&&this._input) this.done=false;
if(token) return token;else return;
}
if(this._input===""){
return this.EOF;
}else{
return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\n' + this.showPosition(), { text: "", token: null, line: this.yylineno });
}},
lex: function lex(){
var r=this.next();
if(typeof r!=='undefined'){
return r;
}else{
return this.lex();
}},
begin: function begin(condition){
this.conditionStack.push(condition);
},
popState: function popState(){
return this.conditionStack.pop();
},
_currentRules: function _currentRules(){
return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;
},
topState: function topState(){
return this.conditionStack[this.conditionStack.length - 2];
},
pushState: function begin(condition){
this.begin(condition);
}};
lexer.options={};
lexer.performAction=function anonymous(yy, yy_, $avoiding_name_collisions, YY_START){
function strip(start, end){
return yy_.yytext=yy_.yytext.substring(start, yy_.yyleng - end + start);
}
var YYSTATE=YY_START;
switch ($avoiding_name_collisions){
case 0:
if(yy_.yytext.slice(-2)==="\\\\"){
strip(0, 1);
this.begin("mu");
}else if(yy_.yytext.slice(-1)==="\\"){
strip(0, 1);
this.begin("emu");
}else{
this.begin("mu");
}
if(yy_.yytext) return 15;
break;
case 1:
return 15;
break;
case 2:
this.popState();
return 15;
break;
case 3:
this.begin('raw');return 15;
break;
case 4:
this.popState();
if(this.conditionStack[this.conditionStack.length - 1]==='raw'){
return 15;
}else{
strip(5, 9);
return 'END_RAW_BLOCK';
}
break;
case 5:
return 15;
break;
case 6:
this.popState();
return 14;
break;
case 7:
return 65;
break;
case 8:
return 68;
break;
case 9:
return 19;
break;
case 10:
this.popState();
this.begin('raw');
return 23;
break;
case 11:
return 55;
break;
case 12:
return 60;
break;
case 13:
return 29;
break;
case 14:
return 47;
break;
case 15:
this.popState();return 44;
break;
case 16:
this.popState();return 44;
break;
case 17:
return 34;
break;
case 18:
return 39;
break;
case 19:
return 51;
break;
case 20:
return 48;
break;
case 21:
this.unput(yy_.yytext);
this.popState();
this.begin('com');
break;
case 22:
this.popState();
return 14;
break;
case 23:
return 48;
break;
case 24:
return 73;
break;
case 25:
return 72;
break;
case 26:
return 72;
break;
case 27:
return 87;
break;
case 28:
break;
case 29:
this.popState();return 54;
break;
case 30:
this.popState();return 33;
break;
case 31:
yy_.yytext=strip(1, 2).replace(/\\"/g, '"');return 80;
break;
case 32:
yy_.yytext=strip(1, 2).replace(/\\'/g, "'");return 80;
break;
case 33:
return 85;
break;
case 34:
return 82;
break;
case 35:
return 82;
break;
case 36:
return 83;
break;
case 37:
return 84;
break;
case 38:
return 81;
break;
case 39:
return 75;
break;
case 40:
return 77;
break;
case 41:
return 72;
break;
case 42:
yy_.yytext=yy_.yytext.replace(/\\([\\\]])/g, '$1');return 72;
break;
case 43:
return 'INVALID';
break;
case 44:
return 5;
break;
}};
lexer.rules=[/^(?:[^\x00]*?(?=(\{\{)))/, /^(?:[^\x00]+)/, /^(?:[^\x00]{2,}?(?=(\{\{|\\\{\{|\\\\\{\{|$)))/, /^(?:\{\{\{\{(?=[^\/]))/, /^(?:\{\{\{\{\/[^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=[=}\s\/.])\}\}\}\})/, /^(?:[^\x00]+?(?=(\{\{\{\{)))/, /^(?:[\s\S]*?--(~)?\}\})/, /^(?:\()/, /^(?:\))/, /^(?:\{\{\{\{)/, /^(?:\}\}\}\})/, /^(?:\{\{(~)?>)/, /^(?:\{\{(~)?#>)/, /^(?:\{\{(~)?#\*?)/, /^(?:\{\{(~)?\/)/, /^(?:\{\{(~)?\^\s*(~)?\}\})/, /^(?:\{\{(~)?\s*else\s*(~)?\}\})/, /^(?:\{\{(~)?\^)/, /^(?:\{\{(~)?\s*else\b)/, /^(?:\{\{(~)?\{)/, /^(?:\{\{(~)?&)/, /^(?:\{\{(~)?!--)/, /^(?:\{\{(~)?![\s\S]*?\}\})/, /^(?:\{\{(~)?\*?)/, /^(?:=)/, /^(?:\.\.)/, /^(?:\.(?=([=~}\s\/.)|])))/, /^(?:[\/.])/, /^(?:\s+)/, /^(?:\}(~)?\}\})/, /^(?:(~)?\}\})/, /^(?:"(\\["]|[^"])*")/, /^(?:'(\\[']|[^'])*')/, /^(?:@)/, /^(?:true(?=([~}\s)])))/, /^(?:false(?=([~}\s)])))/, /^(?:undefined(?=([~}\s)])))/, /^(?:null(?=([~}\s)])))/, /^(?:-?[0-9]+(?:\.[0-9]+)?(?=([~}\s)])))/, /^(?:as\s+\|)/, /^(?:\|)/, /^(?:([^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=([=~}\s\/.)|]))))/, /^(?:\[(\\\]|[^\]])*\])/, /^(?:.)/, /^(?:$)/];
lexer.conditions={ "mu": { "rules": [7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44], "inclusive": false }, "emu": { "rules": [2], "inclusive": false }, "com": { "rules": [6], "inclusive": false }, "raw": { "rules": [3, 4, 5], "inclusive": false }, "INITIAL": { "rules": [0, 1, 44], "inclusive": true }};
return lexer;
})();
parser.lexer=lexer;
function Parser(){
this.yy={};}Parser.prototype=parser;parser.Parser=Parser;
return new Parser();
})();exports["default"]=handlebars;
module.exports=exports["default"];
}),
(function(module, exports, __webpack_require__){
'use strict';
var _interopRequireDefault=__webpack_require__(1)['default'];
exports.__esModule=true;
var _visitor=__webpack_require__(49);
var _visitor2=_interopRequireDefault(_visitor);
function WhitespaceControl(){
var options=arguments.length <=0||arguments[0]===undefined ? {}:arguments[0];
this.options=options;
}
WhitespaceControl.prototype=new _visitor2['default']();
WhitespaceControl.prototype.Program=function (program){
var doStandalone = !this.options.ignoreStandalone;
var isRoot = !this.isRootSeen;
this.isRootSeen=true;
var body=program.body;
for (var i=0, l=body.length; i < l; i++){
var current=body[i],
strip=this.accept(current);
if(!strip){
continue;
}
var _isPrevWhitespace=isPrevWhitespace(body, i, isRoot),
_isNextWhitespace=isNextWhitespace(body, i, isRoot),
openStandalone=strip.openStandalone&&_isPrevWhitespace,
closeStandalone=strip.closeStandalone&&_isNextWhitespace,
inlineStandalone=strip.inlineStandalone&&_isPrevWhitespace&&_isNextWhitespace;
if(strip.close){
omitRight(body, i, true);
}
if(strip.open){
omitLeft(body, i, true);
}
if(doStandalone&&inlineStandalone){
omitRight(body, i);
if(omitLeft(body, i)){
if(current.type==='PartialStatement'){
current.indent=/([ \t]+$)/.exec(body[i - 1].original)[1];
}}
}
if(doStandalone&&openStandalone){
omitRight((current.program||current.inverse).body);
omitLeft(body, i);
}
if(doStandalone&&closeStandalone){
omitRight(body, i);
omitLeft((current.inverse||current.program).body);
}}
return program;
};
WhitespaceControl.prototype.BlockStatement=WhitespaceControl.prototype.DecoratorBlock=WhitespaceControl.prototype.PartialBlockStatement=function (block){
this.accept(block.program);
this.accept(block.inverse);
var program=block.program||block.inverse,
inverse=block.program&&block.inverse,
firstInverse=inverse,
lastInverse=inverse;
if(inverse&&inverse.chained){
firstInverse=inverse.body[0].program;
while (lastInverse.chained){
lastInverse=lastInverse.body[lastInverse.body.length - 1].program;
}}
var strip={
open: block.openStrip.open,
close: block.closeStrip.close,
openStandalone: isNextWhitespace(program.body),
closeStandalone: isPrevWhitespace((firstInverse||program).body)
};
if(block.openStrip.close){
omitRight(program.body, null, true);
}
if(inverse){
var inverseStrip=block.inverseStrip;
if(inverseStrip.open){
omitLeft(program.body, null, true);
}
if(inverseStrip.close){
omitRight(firstInverse.body, null, true);
}
if(block.closeStrip.open){
omitLeft(lastInverse.body, null, true);
}
if(!this.options.ignoreStandalone&&isPrevWhitespace(program.body)&&isNextWhitespace(firstInverse.body)){
omitLeft(program.body);
omitRight(firstInverse.body);
}}else if(block.closeStrip.open){
omitLeft(program.body, null, true);
}
return strip;
};
WhitespaceControl.prototype.Decorator=WhitespaceControl.prototype.MustacheStatement=function (mustache){
return mustache.strip;
};
WhitespaceControl.prototype.PartialStatement=WhitespaceControl.prototype.CommentStatement=function (node){
var strip=node.strip||{};
return {
inlineStandalone: true,
open: strip.open,
close: strip.close
};};
function isPrevWhitespace(body, i, isRoot){
if(i===undefined){
i=body.length;
}
var prev=body[i - 1],
sibling=body[i - 2];
if(!prev){
return isRoot;
}
if(prev.type==='ContentStatement'){
return (sibling||!isRoot ? /\r?\n\s*?$/:/(^|\r?\n)\s*?$/).test(prev.original);
}}
function isNextWhitespace(body, i, isRoot){
if(i===undefined){
i=-1;
}
var next=body[i + 1],
sibling=body[i + 2];
if(!next){
return isRoot;
}
if(next.type==='ContentStatement'){
return (sibling||!isRoot ? /^\s*?\r?\n/:/^\s*?(\r?\n|$)/).test(next.original);
}}
function omitRight(body, i, multiple){
var current=body[i==null ? 0:i + 1];
if(!current||current.type!=='ContentStatement'||!multiple&&current.rightStripped){
return;
}
var original=current.value;
current.value=current.value.replace(multiple ? /^\s+/:/^[ \t]*\r?\n?/, '');
current.rightStripped=current.value!==original;
}
function omitLeft(body, i, multiple){
var current=body[i==null ? body.length - 1:i - 1];
if(!current||current.type!=='ContentStatement'||!multiple&&current.leftStripped){
return;
}
var original=current.value;
current.value=current.value.replace(multiple ? /\s+$/:/[ \t]+$/, '');
current.leftStripped=current.value!==original;
return current.leftStripped;
}
exports['default']=WhitespaceControl;
module.exports=exports['default'];
}),
(function(module, exports, __webpack_require__){
'use strict';
var _interopRequireDefault=__webpack_require__(1)['default'];
exports.__esModule=true;
var _exception=__webpack_require__(6);
var _exception2=_interopRequireDefault(_exception);
function Visitor(){
this.parents=[];
}
Visitor.prototype={
constructor: Visitor,
mutating: false,
acceptKey: function acceptKey(node, name){
var value=this.accept(node[name]);
if(this.mutating){
if(value&&!Visitor.prototype[value.type]){
throw new _exception2['default']('Unexpected node type "' + value.type + '" found when accepting ' + name + ' on ' + node.type);
}
node[name]=value;
}},
acceptRequired: function acceptRequired(node, name){
this.acceptKey(node, name);
if(!node[name]){
throw new _exception2['default'](node.type + ' requires ' + name);
}},
acceptArray: function acceptArray(array){
for (var i=0, l=array.length; i < l; i++){
this.acceptKey(array, i);
if(!array[i]){
array.splice(i, 1);
i--;
l--;
}}
},
accept: function accept(object){
if(!object){
return;
}
if(!this[object.type]){
throw new _exception2['default']('Unknown type: ' + object.type, object);
}
if(this.current){
this.parents.unshift(this.current);
}
this.current=object;
var ret=this[object.type](object);
this.current=this.parents.shift();
if(!this.mutating||ret){
return ret;
}else if(ret!==false){
return object;
}},
Program: function Program(program){
this.acceptArray(program.body);
},
MustacheStatement: visitSubExpression,
Decorator: visitSubExpression,
BlockStatement: visitBlock,
DecoratorBlock: visitBlock,
PartialStatement: visitPartial,
PartialBlockStatement: function PartialBlockStatement(partial){
visitPartial.call(this, partial);
this.acceptKey(partial, 'program');
},
ContentStatement: function ContentStatement() {},
CommentStatement: function CommentStatement() {},
SubExpression: visitSubExpression,
PathExpression: function PathExpression() {},
StringLiteral: function StringLiteral() {},
NumberLiteral: function NumberLiteral() {},
BooleanLiteral: function BooleanLiteral() {},
UndefinedLiteral: function UndefinedLiteral() {},
NullLiteral: function NullLiteral() {},
Hash: function Hash(hash){
this.acceptArray(hash.pairs);
},
HashPair: function HashPair(pair){
this.acceptRequired(pair, 'value');
}};
function visitSubExpression(mustache){
this.acceptRequired(mustache, 'path');
this.acceptArray(mustache.params);
this.acceptKey(mustache, 'hash');
}
function visitBlock(block){
visitSubExpression.call(this, block);
this.acceptKey(block, 'program');
this.acceptKey(block, 'inverse');
}
function visitPartial(partial){
this.acceptRequired(partial, 'name');
this.acceptArray(partial.params);
this.acceptKey(partial, 'hash');
}
exports['default']=Visitor;
module.exports=exports['default'];
}),
(function(module, exports, __webpack_require__){
'use strict';
var _interopRequireDefault=__webpack_require__(1)['default'];
exports.__esModule=true;
exports.SourceLocation=SourceLocation;
exports.id=id;
exports.stripFlags=stripFlags;
exports.stripComment=stripComment;
exports.preparePath=preparePath;
exports.prepareMustache=prepareMustache;
exports.prepareRawBlock=prepareRawBlock;
exports.prepareBlock=prepareBlock;
exports.prepareProgram=prepareProgram;
exports.preparePartialBlock=preparePartialBlock;
var _exception=__webpack_require__(6);
var _exception2=_interopRequireDefault(_exception);
function validateClose(open, close){
close=close.path ? close.path.original:close;
if(open.path.original!==close){
var errorNode={ loc: open.path.loc };
throw new _exception2['default'](open.path.original + " doesn't match " + close, errorNode);
}}
function SourceLocation(source, locInfo){
this.source=source;
this.start={
line: locInfo.first_line,
column: locInfo.first_column
};
this.end={
line: locInfo.last_line,
column: locInfo.last_column
};}
function id(token){
if(/^\[.*\]$/.test(token)){
return token.substring(1, token.length - 1);
}else{
return token;
}}
function stripFlags(open, close){
return {
open: open.charAt(2)==='~',
close: close.charAt(close.length - 3)==='~'
};}
function stripComment(comment){
return comment.replace(/^\{\{~?!-?-?/, '').replace(/-?-?~?\}\}$/, '');
}
function preparePath(data, parts, loc){
loc=this.locInfo(loc);
var original=data ? '@':'',
dig=[],
depth=0;
for (var i=0, l=parts.length; i < l; i++){
var part=parts[i].part,
isLiteral=parts[i].original!==part;
original +=(parts[i].separator||'') + part;
if(!isLiteral&&(part==='..'||part==='.'||part==='this')){
if(dig.length > 0){
throw new _exception2['default']('Invalid path: ' + original, { loc: loc });
}else if(part==='..'){
depth++;
}}else{
dig.push(part);
}}
return {
type: 'PathExpression',
data: data,
depth: depth,
parts: dig,
original: original,
loc: loc
};}
function prepareMustache(path, params, hash, open, strip, locInfo){
var escapeFlag=open.charAt(3)||open.charAt(2),
escaped=escapeFlag!=='{'&&escapeFlag!=='&';
var decorator=/\*/.test(open);
return {
type: decorator ? 'Decorator':'MustacheStatement',
path: path,
params: params,
hash: hash,
escaped: escaped,
strip: strip,
loc: this.locInfo(locInfo)
};}
function prepareRawBlock(openRawBlock, contents, close, locInfo){
validateClose(openRawBlock, close);
locInfo=this.locInfo(locInfo);
var program={
type: 'Program',
body: contents,
strip: {},
loc: locInfo
};
return {
type: 'BlockStatement',
path: openRawBlock.path,
params: openRawBlock.params,
hash: openRawBlock.hash,
program: program,
openStrip: {},
inverseStrip: {},
closeStrip: {},
loc: locInfo
};}
function prepareBlock(openBlock, program, inverseAndProgram, close, inverted, locInfo){
if(close&&close.path){
validateClose(openBlock, close);
}
var decorator=/\*/.test(openBlock.open);
program.blockParams=openBlock.blockParams;
var inverse=undefined,
inverseStrip=undefined;
if(inverseAndProgram){
if(decorator){
throw new _exception2['default']('Unexpected inverse block on decorator', inverseAndProgram);
}
if(inverseAndProgram.chain){
inverseAndProgram.program.body[0].closeStrip=close.strip;
}
inverseStrip=inverseAndProgram.strip;
inverse=inverseAndProgram.program;
}
if(inverted){
inverted=inverse;
inverse=program;
program=inverted;
}
return {
type: decorator ? 'DecoratorBlock':'BlockStatement',
path: openBlock.path,
params: openBlock.params,
hash: openBlock.hash,
program: program,
inverse: inverse,
openStrip: openBlock.strip,
inverseStrip: inverseStrip,
closeStrip: close&&close.strip,
loc: this.locInfo(locInfo)
};}
function prepareProgram(statements, loc){
if(!loc&&statements.length){
var firstLoc=statements[0].loc,
lastLoc=statements[statements.length - 1].loc;
if(firstLoc&&lastLoc){
loc={
source: firstLoc.source,
start: {
line: firstLoc.start.line,
column: firstLoc.start.column
},
end: {
line: lastLoc.end.line,
column: lastLoc.end.column
}};}}
return {
type: 'Program',
body: statements,
strip: {},
loc: loc
};}
function preparePartialBlock(open, program, close, locInfo){
validateClose(open, close);
return {
type: 'PartialBlockStatement',
name: open.path,
params: open.params,
hash: open.hash,
program: program,
openStrip: open.strip,
closeStrip: close&&close.strip,
loc: this.locInfo(locInfo)
};}
}),
(function(module, exports, __webpack_require__){
'use strict';
var _Object$create=__webpack_require__(34)['default'];
var _interopRequireDefault=__webpack_require__(1)['default'];
exports.__esModule=true;
exports.Compiler=Compiler;
exports.precompile=precompile;
exports.compile=compile;
var _exception=__webpack_require__(6);
var _exception2=_interopRequireDefault(_exception);
var _utils=__webpack_require__(5);
var _ast=__webpack_require__(45);
var _ast2=_interopRequireDefault(_ast);
var slice=[].slice;
function Compiler(){}
Compiler.prototype={
compiler: Compiler,
equals: function equals(other){
var len=this.opcodes.length;
if(other.opcodes.length!==len){
return false;
}
for (var i=0; i < len; i++){
var opcode=this.opcodes[i],
otherOpcode=other.opcodes[i];
if(opcode.opcode!==otherOpcode.opcode||!argEquals(opcode.args, otherOpcode.args)){
return false;
}}
len=this.children.length;
for (var i=0; i < len; i++){
if(!this.children[i].equals(other.children[i])){
return false;
}}
return true;
},
guid: 0,
compile: function compile(program, options){
this.sourceNode=[];
this.opcodes=[];
this.children=[];
this.options=options;
this.stringParams=options.stringParams;
this.trackIds=options.trackIds;
options.blockParams=options.blockParams||[];
options.knownHelpers=_utils.extend(_Object$create(null), {
helperMissing: true,
blockHelperMissing: true,
each: true,
'if': true,
unless: true,
'with': true,
log: true,
lookup: true
}, options.knownHelpers);
return this.accept(program);
},
compileProgram: function compileProgram(program){
var childCompiler=new this.compiler(),
result=childCompiler.compile(program, this.options),
guid=this.guid++;
this.usePartial=this.usePartial||result.usePartial;
this.children[guid]=result;
this.useDepths=this.useDepths||result.useDepths;
return guid;
},
accept: function accept(node){
if(!this[node.type]){
throw new _exception2['default']('Unknown type: ' + node.type, node);
}
this.sourceNode.unshift(node);
var ret=this[node.type](node);
this.sourceNode.shift();
return ret;
},
Program: function Program(program){
this.options.blockParams.unshift(program.blockParams);
var body=program.body,
bodyLength=body.length;
for (var i=0; i < bodyLength; i++){
this.accept(body[i]);
}
this.options.blockParams.shift();
this.isSimple=bodyLength===1;
this.blockParams=program.blockParams ? program.blockParams.length:0;
return this;
},
BlockStatement: function BlockStatement(block){
transformLiteralToPath(block);
var program=block.program,
inverse=block.inverse;
program=program&&this.compileProgram(program);
inverse=inverse&&this.compileProgram(inverse);
var type=this.classifySexpr(block);
if(type==='helper'){
this.helperSexpr(block, program, inverse);
}else if(type==='simple'){
this.simpleSexpr(block);
this.opcode('pushProgram', program);
this.opcode('pushProgram', inverse);
this.opcode('emptyHash');
this.opcode('blockValue', block.path.original);
}else{
this.ambiguousSexpr(block, program, inverse);
this.opcode('pushProgram', program);
this.opcode('pushProgram', inverse);
this.opcode('emptyHash');
this.opcode('ambiguousBlockValue');
}
this.opcode('append');
},
DecoratorBlock: function DecoratorBlock(decorator){
var program=decorator.program&&this.compileProgram(decorator.program);
var params=this.setupFullMustacheParams(decorator, program, undefined),
path=decorator.path;
this.useDecorators=true;
this.opcode('registerDecorator', params.length, path.original);
},
PartialStatement: function PartialStatement(partial){
this.usePartial=true;
var program=partial.program;
if(program){
program=this.compileProgram(partial.program);
}
var params=partial.params;
if(params.length > 1){
throw new _exception2['default']('Unsupported number of partial arguments: ' + params.length, partial);
}else if(!params.length){
if(this.options.explicitPartialContext){
this.opcode('pushLiteral', 'undefined');
}else{
params.push({ type: 'PathExpression', parts: [], depth: 0 });
}}
var partialName=partial.name.original,
isDynamic=partial.name.type==='SubExpression';
if(isDynamic){
this.accept(partial.name);
}
this.setupFullMustacheParams(partial, program, undefined, true);
var indent=partial.indent||'';
if(this.options.preventIndent&&indent){
this.opcode('appendContent', indent);
indent='';
}
this.opcode('invokePartial', isDynamic, partialName, indent);
this.opcode('append');
},
PartialBlockStatement: function PartialBlockStatement(partialBlock){
this.PartialStatement(partialBlock);
},
MustacheStatement: function MustacheStatement(mustache){
this.SubExpression(mustache);
if(mustache.escaped&&!this.options.noEscape){
this.opcode('appendEscaped');
}else{
this.opcode('append');
}},
Decorator: function Decorator(decorator){
this.DecoratorBlock(decorator);
},
ContentStatement: function ContentStatement(content){
if(content.value){
this.opcode('appendContent', content.value);
}},
CommentStatement: function CommentStatement(){},
SubExpression: function SubExpression(sexpr){
transformLiteralToPath(sexpr);
var type=this.classifySexpr(sexpr);
if(type==='simple'){
this.simpleSexpr(sexpr);
}else if(type==='helper'){
this.helperSexpr(sexpr);
}else{
this.ambiguousSexpr(sexpr);
}},
ambiguousSexpr: function ambiguousSexpr(sexpr, program, inverse){
var path=sexpr.path,
name=path.parts[0],
isBlock=program!=null||inverse!=null;
this.opcode('getContext', path.depth);
this.opcode('pushProgram', program);
this.opcode('pushProgram', inverse);
path.strict=true;
this.accept(path);
this.opcode('invokeAmbiguous', name, isBlock);
},
simpleSexpr: function simpleSexpr(sexpr){
var path=sexpr.path;
path.strict=true;
this.accept(path);
this.opcode('resolvePossibleLambda');
},
helperSexpr: function helperSexpr(sexpr, program, inverse){
var params=this.setupFullMustacheParams(sexpr, program, inverse),
path=sexpr.path,
name=path.parts[0];
if(this.options.knownHelpers[name]){
this.opcode('invokeKnownHelper', params.length, name);
}else if(this.options.knownHelpersOnly){
throw new _exception2['default']('You specified knownHelpersOnly, but used the unknown helper ' + name, sexpr);
}else{
path.strict=true;
path.falsy=true;
this.accept(path);
this.opcode('invokeHelper', params.length, path.original, _ast2['default'].helpers.simpleId(path));
}},
PathExpression: function PathExpression(path){
this.addDepth(path.depth);
this.opcode('getContext', path.depth);
var name=path.parts[0],
scoped=_ast2['default'].helpers.scopedId(path),
blockParamId = !path.depth&&!scoped&&this.blockParamIndex(name);
if(blockParamId){
this.opcode('lookupBlockParam', blockParamId, path.parts);
}else if(!name){
this.opcode('pushContext');
}else if(path.data){
this.options.data=true;
this.opcode('lookupData', path.depth, path.parts, path.strict);
}else{
this.opcode('lookupOnContext', path.parts, path.falsy, path.strict, scoped);
}},
StringLiteral: function StringLiteral(string){
this.opcode('pushString', string.value);
},
NumberLiteral: function NumberLiteral(number){
this.opcode('pushLiteral', number.value);
},
BooleanLiteral: function BooleanLiteral(bool){
this.opcode('pushLiteral', bool.value);
},
UndefinedLiteral: function UndefinedLiteral(){
this.opcode('pushLiteral', 'undefined');
},
NullLiteral: function NullLiteral(){
this.opcode('pushLiteral', 'null');
},
Hash: function Hash(hash){
var pairs=hash.pairs,
i=0,
l=pairs.length;
this.opcode('pushHash');
for (; i < l; i++){
this.pushParam(pairs[i].value);
}
while (i--){
this.opcode('assignToHash', pairs[i].key);
}
this.opcode('popHash');
},
opcode: function opcode(name){
this.opcodes.push({
opcode: name,
args: slice.call(arguments, 1),
loc: this.sourceNode[0].loc
});
},
addDepth: function addDepth(depth){
if(!depth){
return;
}
this.useDepths=true;
},
classifySexpr: function classifySexpr(sexpr){
var isSimple=_ast2['default'].helpers.simpleId(sexpr.path);
var isBlockParam=isSimple&&!!this.blockParamIndex(sexpr.path.parts[0]);
var isHelper = !isBlockParam&&_ast2['default'].helpers.helperExpression(sexpr);
var isEligible = !isBlockParam&&(isHelper||isSimple);
if(isEligible&&!isHelper){
var _name=sexpr.path.parts[0],
options=this.options;
if(options.knownHelpers[_name]){
isHelper=true;
}else if(options.knownHelpersOnly){
isEligible=false;
}}
if(isHelper){
return 'helper';
}else if(isEligible){
return 'ambiguous';
}else{
return 'simple';
}},
pushParams: function pushParams(params){
for (var i=0, l=params.length; i < l; i++){
this.pushParam(params[i]);
}},
pushParam: function pushParam(val){
var value=val.value!=null ? val.value:val.original||'';
if(this.stringParams){
if(value.replace){
value=value.replace(/^(\.?\.\/)*/g, '').replace(/\//g, '.');
}
if(val.depth){
this.addDepth(val.depth);
}
this.opcode('getContext', val.depth||0);
this.opcode('pushStringParam', value, val.type);
if(val.type==='SubExpression'){
this.accept(val);
}}else{
if(this.trackIds){
var blockParamIndex=undefined;
if(val.parts&&!_ast2['default'].helpers.scopedId(val)&&!val.depth){
blockParamIndex=this.blockParamIndex(val.parts[0]);
}
if(blockParamIndex){
var blockParamChild=val.parts.slice(1).join('.');
this.opcode('pushId', 'BlockParam', blockParamIndex, blockParamChild);
}else{
value=val.original||value;
if(value.replace){
value=value.replace(/^this(?:\.|$)/, '').replace(/^\.\//, '').replace(/^\.$/, '');
}
this.opcode('pushId', val.type, value);
}}
this.accept(val);
}},
setupFullMustacheParams: function setupFullMustacheParams(sexpr, program, inverse, omitEmpty){
var params=sexpr.params;
this.pushParams(params);
this.opcode('pushProgram', program);
this.opcode('pushProgram', inverse);
if(sexpr.hash){
this.accept(sexpr.hash);
}else{
this.opcode('emptyHash', omitEmpty);
}
return params;
},
blockParamIndex: function blockParamIndex(name){
for (var depth=0, len=this.options.blockParams.length; depth < len; depth++){
var blockParams=this.options.blockParams[depth],
param=blockParams&&_utils.indexOf(blockParams, name);
if(blockParams&&param >=0){
return [depth, param];
}}
}};
function precompile(input, options, env){
if(input==null||typeof input!=='string'&&input.type!=='Program'){
throw new _exception2['default']('You must pass a string or Handlebars AST to Handlebars.precompile. You passed ' + input);
}
options=options||{};
if(!('data' in options)){
options.data=true;
}
if(options.compat){
options.useDepths=true;
}
var ast=env.parse(input, options),
environment=new env.Compiler().compile(ast, options);
return new env.JavaScriptCompiler().compile(environment, options);
}
function compile(input, options, env){
if(options===undefined) options={};
if(input==null||typeof input!=='string'&&input.type!=='Program'){
throw new _exception2['default']('You must pass a string or Handlebars AST to Handlebars.compile. You passed ' + input);
}
options=_utils.extend({}, options);
if(!('data' in options)){
options.data=true;
}
if(options.compat){
options.useDepths=true;
}
var compiled=undefined;
function compileInput(){
var ast=env.parse(input, options),
environment=new env.Compiler().compile(ast, options),
templateSpec=new env.JavaScriptCompiler().compile(environment, options, undefined, true);
return env.template(templateSpec);
}
function ret(context, execOptions){
if(!compiled){
compiled=compileInput();
}
return compiled.call(this, context, execOptions);
}
ret._setup=function (setupOptions){
if(!compiled){
compiled=compileInput();
}
return compiled._setup(setupOptions);
};
ret._child=function (i, data, blockParams, depths){
if(!compiled){
compiled=compileInput();
}
return compiled._child(i, data, blockParams, depths);
};
return ret;
}
function argEquals(a, b){
if(a===b){
return true;
}
if(_utils.isArray(a)&&_utils.isArray(b)&&a.length===b.length){
for (var i=0; i < a.length; i++){
if(!argEquals(a[i], b[i])){
return false;
}}
return true;
}}
function transformLiteralToPath(sexpr){
if(!sexpr.path.parts){
var literal=sexpr.path;
sexpr.path={
type: 'PathExpression',
data: false,
depth: 0,
parts: [literal.original + ''],
original: literal.original + '',
loc: literal.loc
};}}
}),
(function(module, exports, __webpack_require__){
'use strict';
var _Object$keys=__webpack_require__(13)['default'];
var _interopRequireDefault=__webpack_require__(1)['default'];
exports.__esModule=true;
var _base=__webpack_require__(4);
var _exception=__webpack_require__(6);
var _exception2=_interopRequireDefault(_exception);
var _utils=__webpack_require__(5);
var _codeGen=__webpack_require__(53);
var _codeGen2=_interopRequireDefault(_codeGen);
function Literal(value){
this.value=value;
}
function JavaScriptCompiler(){}
JavaScriptCompiler.prototype={
nameLookup: function nameLookup(parent, name ){
return this.internalNameLookup(parent, name);
},
depthedLookup: function depthedLookup(name){
return [this.aliasable('container.lookup'), '(depths, ', JSON.stringify(name), ')'];
},
compilerInfo: function compilerInfo(){
var revision=_base.COMPILER_REVISION,
versions=_base.REVISION_CHANGES[revision];
return [revision, versions];
},
appendToBuffer: function appendToBuffer(source, location, explicit){
if(!_utils.isArray(source)){
source=[source];
}
source=this.source.wrap(source, location);
if(this.environment.isSimple){
return ['return ', source, ';'];
}else if(explicit){
return ['buffer +=', source, ';'];
}else{
source.appendToBuffer=true;
return source;
}},
initializeBuffer: function initializeBuffer(){
return this.quotedString('');
},
internalNameLookup: function internalNameLookup(parent, name){
this.lookupPropertyFunctionIsUsed=true;
return ['lookupProperty(', parent, ',', JSON.stringify(name), ')'];
},
lookupPropertyFunctionIsUsed: false,
compile: function compile(environment, options, context, asObject){
this.environment=environment;
this.options=options;
this.stringParams=this.options.stringParams;
this.trackIds=this.options.trackIds;
this.precompile = !asObject;
this.name=this.environment.name;
this.isChild = !!context;
this.context=context||{
decorators: [],
programs: [],
environments: []
};
this.preamble();
this.stackSlot=0;
this.stackVars=[];
this.aliases={};
this.registers={ list: [] };
this.hashes=[];
this.compileStack=[];
this.inlineStack=[];
this.blockParams=[];
this.compileChildren(environment, options);
this.useDepths=this.useDepths||environment.useDepths||environment.useDecorators||this.options.compat;
this.useBlockParams=this.useBlockParams||environment.useBlockParams;
var opcodes=environment.opcodes,
opcode=undefined,
firstLoc=undefined,
i=undefined,
l=undefined;
for (i=0, l=opcodes.length; i < l; i++){
opcode=opcodes[i];
this.source.currentLocation=opcode.loc;
firstLoc=firstLoc||opcode.loc;
this[opcode.opcode].apply(this, opcode.args);
}
this.source.currentLocation=firstLoc;
this.pushSource('');
if(this.stackSlot||this.inlineStack.length||this.compileStack.length){
throw new _exception2['default']('Compile completed with content left on stack');
}
if(!this.decorators.isEmpty()){
this.useDecorators=true;
this.decorators.prepend(['var decorators=container.decorators, ', this.lookupPropertyFunctionVarDeclaration(), ';\n']);
this.decorators.push('return fn;');
if(asObject){
this.decorators=Function.apply(this, ['fn', 'props', 'container', 'depth0', 'data', 'blockParams', 'depths', this.decorators.merge()]);
}else{
this.decorators.prepend('function(fn, props, container, depth0, data, blockParams, depths){\n');
this.decorators.push('}\n');
this.decorators=this.decorators.merge();
}}else{
this.decorators=undefined;
}
var fn=this.createFunctionContext(asObject);
if(!this.isChild){
var ret={
compiler: this.compilerInfo(),
main: fn
};
if(this.decorators){
ret.main_d=this.decorators;
ret.useDecorators=true;
}
var _context=this.context;
var programs=_context.programs;
var decorators=_context.decorators;
for (i=0, l=programs.length; i < l; i++){
if(programs[i]){
ret[i]=programs[i];
if(decorators[i]){
ret[i + '_d']=decorators[i];
ret.useDecorators=true;
}}
}
if(this.environment.usePartial){
ret.usePartial=true;
}
if(this.options.data){
ret.useData=true;
}
if(this.useDepths){
ret.useDepths=true;
}
if(this.useBlockParams){
ret.useBlockParams=true;
}
if(this.options.compat){
ret.compat=true;
}
if(!asObject){
ret.compiler=JSON.stringify(ret.compiler);
this.source.currentLocation={ start: { line: 1, column: 0 }};
ret=this.objectLiteral(ret);
if(options.srcName){
ret=ret.toStringWithSourceMap({ file: options.destName });
ret.map=ret.map&&ret.map.toString();
}else{
ret=ret.toString();
}}else{
ret.compilerOptions=this.options;
}
return ret;
}else{
return fn;
}},
preamble: function preamble(){
this.lastContext=0;
this.source=new _codeGen2['default'](this.options.srcName);
this.decorators=new _codeGen2['default'](this.options.srcName);
},
createFunctionContext: function createFunctionContext(asObject){
var _this=this;
var varDeclarations='';
var locals=this.stackVars.concat(this.registers.list);
if(locals.length > 0){
varDeclarations +=', ' + locals.join(', ');
}
var aliasCount=0;
_Object$keys(this.aliases).forEach(function (alias){
var node=_this.aliases[alias];
if(node.children&&node.referenceCount > 1){
varDeclarations +=', alias' + ++aliasCount + '=' + alias;
node.children[0]='alias' + aliasCount;
}});
if(this.lookupPropertyFunctionIsUsed){
varDeclarations +=', ' + this.lookupPropertyFunctionVarDeclaration();
}
var params=['container', 'depth0', 'helpers', 'partials', 'data'];
if(this.useBlockParams||this.useDepths){
params.push('blockParams');
}
if(this.useDepths){
params.push('depths');
}
var source=this.mergeSource(varDeclarations);
if(asObject){
params.push(source);
return Function.apply(this, params);
}else{
return this.source.wrap(['function(', params.join(','), '){\n  ', source, '}']);
}},
mergeSource: function mergeSource(varDeclarations){
var isSimple=this.environment.isSimple,
appendOnly = !this.forceBuffer,
appendFirst=undefined,
sourceSeen=undefined,
bufferStart=undefined,
bufferEnd=undefined;
this.source.each(function (line){
if(line.appendToBuffer){
if(bufferStart){
line.prepend('  + ');
}else{
bufferStart=line;
}
bufferEnd=line;
}else{
if(bufferStart){
if(!sourceSeen){
appendFirst=true;
}else{
bufferStart.prepend('buffer +=');
}
bufferEnd.add(';');
bufferStart=bufferEnd=undefined;
}
sourceSeen=true;
if(!isSimple){
appendOnly=false;
}}
});
if(appendOnly){
if(bufferStart){
bufferStart.prepend('return ');
bufferEnd.add(';');
}else if(!sourceSeen){
this.source.push('return "";');
}}else{
varDeclarations +=', buffer=' + (appendFirst ? '':this.initializeBuffer());
if(bufferStart){
bufferStart.prepend('return buffer + ');
bufferEnd.add(';');
}else{
this.source.push('return buffer;');
}}
if(varDeclarations){
this.source.prepend('var ' + varDeclarations.substring(2) + (appendFirst ? '':';\n'));
}
return this.source.merge();
},
lookupPropertyFunctionVarDeclaration: function lookupPropertyFunctionVarDeclaration(){
return '\n      lookupProperty=container.lookupProperty||function(parent, propertyName){\n        if(Object.prototype.hasOwnProperty.call(parent, propertyName)){\n          return parent[propertyName];\n        }\n        return undefined\n    }\n    '.trim();
},
blockValue: function blockValue(name){
var blockHelperMissing=this.aliasable('container.hooks.blockHelperMissing'),
params=[this.contextName(0)];
this.setupHelperArgs(name, 0, params);
var blockName=this.popStack();
params.splice(1, 0, blockName);
this.push(this.source.functionCall(blockHelperMissing, 'call', params));
},
ambiguousBlockValue: function ambiguousBlockValue(){
var blockHelperMissing=this.aliasable('container.hooks.blockHelperMissing'),
params=[this.contextName(0)];
this.setupHelperArgs('', 0, params, true);
this.flushInline();
var current=this.topStack();
params.splice(1, 0, current);
this.pushSource(['if(!', this.lastHelper, '){ ', current, '=', this.source.functionCall(blockHelperMissing, 'call', params), '}']);
},
appendContent: function appendContent(content){
if(this.pendingContent){
content=this.pendingContent + content;
}else{
this.pendingLocation=this.source.currentLocation;
}
this.pendingContent=content;
},
append: function append(){
if(this.isInline()){
this.replaceStack(function (current){
return ['!=null ? ', current, ':""'];
});
this.pushSource(this.appendToBuffer(this.popStack()));
}else{
var local=this.popStack();
this.pushSource(['if(', local, '!=null){ ', this.appendToBuffer(local, undefined, true), ' }']);
if(this.environment.isSimple){
this.pushSource(['else { ', this.appendToBuffer("''", undefined, true), ' }']);
}}
},
appendEscaped: function appendEscaped(){
this.pushSource(this.appendToBuffer([this.aliasable('container.escapeExpression'), '(', this.popStack(), ')']));
},
getContext: function getContext(depth){
this.lastContext=depth;
},
pushContext: function pushContext(){
this.pushStackLiteral(this.contextName(this.lastContext));
},
lookupOnContext: function lookupOnContext(parts, falsy, strict, scoped){
var i=0;
if(!scoped&&this.options.compat&&!this.lastContext){
this.push(this.depthedLookup(parts[i++]));
}else{
this.pushContext();
}
this.resolvePath('context', parts, i, falsy, strict);
},
lookupBlockParam: function lookupBlockParam(blockParamId, parts){
this.useBlockParams=true;
this.push(['blockParams[', blockParamId[0], '][', blockParamId[1], ']']);
this.resolvePath('context', parts, 1);
},
lookupData: function lookupData(depth, parts, strict){
if(!depth){
this.pushStackLiteral('data');
}else{
this.pushStackLiteral('container.data(data, ' + depth + ')');
}
this.resolvePath('data', parts, 0, true, strict);
},
resolvePath: function resolvePath(type, parts, i, falsy, strict){
var _this2=this;
if(this.options.strict||this.options.assumeObjects){
this.push(strictLookup(this.options.strict&&strict, this, parts, type));
return;
}
var len=parts.length;
for (; i < len; i++){
this.replaceStack(function (current){
var lookup=_this2.nameLookup(current, parts[i], type);
if(!falsy){
return ['!=null ? ', lookup, ':', current];
}else{
return ['&&', lookup];
}});
}},
resolvePossibleLambda: function resolvePossibleLambda(){
this.push([this.aliasable('container.lambda'), '(', this.popStack(), ', ', this.contextName(0), ')']);
},
pushStringParam: function pushStringParam(string, type){
this.pushContext();
this.pushString(type);
if(type!=='SubExpression'){
if(typeof string==='string'){
this.pushString(string);
}else{
this.pushStackLiteral(string);
}}
},
emptyHash: function emptyHash(omitEmpty){
if(this.trackIds){
this.push('{}');
}
if(this.stringParams){
this.push('{}');
this.push('{}');
}
this.pushStackLiteral(omitEmpty ? 'undefined':'{}');
},
pushHash: function pushHash(){
if(this.hash){
this.hashes.push(this.hash);
}
this.hash={ values: {}, types: [], contexts: [], ids: [] };},
popHash: function popHash(){
var hash=this.hash;
this.hash=this.hashes.pop();
if(this.trackIds){
this.push(this.objectLiteral(hash.ids));
}
if(this.stringParams){
this.push(this.objectLiteral(hash.contexts));
this.push(this.objectLiteral(hash.types));
}
this.push(this.objectLiteral(hash.values));
},
pushString: function pushString(string){
this.pushStackLiteral(this.quotedString(string));
},
pushLiteral: function pushLiteral(value){
this.pushStackLiteral(value);
},
pushProgram: function pushProgram(guid){
if(guid!=null){
this.pushStackLiteral(this.programExpression(guid));
}else{
this.pushStackLiteral(null);
}},
registerDecorator: function registerDecorator(paramSize, name){
var foundDecorator=this.nameLookup('decorators', name, 'decorator'),
options=this.setupHelperArgs(name, paramSize);
this.decorators.push(['fn=', this.decorators.functionCall(foundDecorator, '', ['fn', 'props', 'container', options]), '||fn;']);
},
invokeHelper: function invokeHelper(paramSize, name, isSimple){
var nonHelper=this.popStack(),
helper=this.setupHelper(paramSize, name);
var possibleFunctionCalls=[];
if(isSimple){
possibleFunctionCalls.push(helper.name);
}
possibleFunctionCalls.push(nonHelper);
if(!this.options.strict){
possibleFunctionCalls.push(this.aliasable('container.hooks.helperMissing'));
}
var functionLookupCode=['(', this.itemsSeparatedBy(possibleFunctionCalls, '||'), ')'];
var functionCall=this.source.functionCall(functionLookupCode, 'call', helper.callParams);
this.push(functionCall);
},
itemsSeparatedBy: function itemsSeparatedBy(items, separator){
var result=[];
result.push(items[0]);
for (var i=1; i < items.length; i++){
result.push(separator, items[i]);
}
return result;
},
invokeKnownHelper: function invokeKnownHelper(paramSize, name){
var helper=this.setupHelper(paramSize, name);
this.push(this.source.functionCall(helper.name, 'call', helper.callParams));
},
invokeAmbiguous: function invokeAmbiguous(name, helperCall){
this.useRegister('helper');
var nonHelper=this.popStack();
this.emptyHash();
var helper=this.setupHelper(0, name, helperCall);
var helperName=this.lastHelper=this.nameLookup('helpers', name, 'helper');
var lookup=['(', '(helper=', helperName, '||', nonHelper, ')'];
if(!this.options.strict){
lookup[0]='(helper=';
lookup.push('!=null ? helper:', this.aliasable('container.hooks.helperMissing'));
}
this.push(['(', lookup, helper.paramsInit ? ['),(', helper.paramsInit]:[], '),', '(typeof helper===', this.aliasable('"function"'), ' ? ', this.source.functionCall('helper', 'call', helper.callParams), ':helper))']);
},
invokePartial: function invokePartial(isDynamic, name, indent){
var params=[],
options=this.setupParams(name, 1, params);
if(isDynamic){
name=this.popStack();
delete options.name;
}
if(indent){
options.indent=JSON.stringify(indent);
}
options.helpers='helpers';
options.partials='partials';
options.decorators='container.decorators';
if(!isDynamic){
params.unshift(this.nameLookup('partials', name, 'partial'));
}else{
params.unshift(name);
}
if(this.options.compat){
options.depths='depths';
}
options=this.objectLiteral(options);
params.push(options);
this.push(this.source.functionCall('container.invokePartial', '', params));
},
assignToHash: function assignToHash(key){
var value=this.popStack(),
context=undefined,
type=undefined,
id=undefined;
if(this.trackIds){
id=this.popStack();
}
if(this.stringParams){
type=this.popStack();
context=this.popStack();
}
var hash=this.hash;
if(context){
hash.contexts[key]=context;
}
if(type){
hash.types[key]=type;
}
if(id){
hash.ids[key]=id;
}
hash.values[key]=value;
},
pushId: function pushId(type, name, child){
if(type==='BlockParam'){
this.pushStackLiteral('blockParams[' + name[0] + '].path[' + name[1] + ']' + (child ? ' + ' + JSON.stringify('.' + child):''));
}else if(type==='PathExpression'){
this.pushString(name);
}else if(type==='SubExpression'){
this.pushStackLiteral('true');
}else{
this.pushStackLiteral('null');
}},
compiler: JavaScriptCompiler,
compileChildren: function compileChildren(environment, options){
var children=environment.children,
child=undefined,
compiler=undefined;
for (var i=0, l=children.length; i < l; i++){
child=children[i];
compiler=new this.compiler();
var existing=this.matchExistingProgram(child);
if(existing==null){
this.context.programs.push('');
var index=this.context.programs.length;
child.index=index;
child.name='program' + index;
this.context.programs[index]=compiler.compile(child, options, this.context, !this.precompile);
this.context.decorators[index]=compiler.decorators;
this.context.environments[index]=child;
this.useDepths=this.useDepths||compiler.useDepths;
this.useBlockParams=this.useBlockParams||compiler.useBlockParams;
child.useDepths=this.useDepths;
child.useBlockParams=this.useBlockParams;
}else{
child.index=existing.index;
child.name='program' + existing.index;
this.useDepths=this.useDepths||existing.useDepths;
this.useBlockParams=this.useBlockParams||existing.useBlockParams;
}}
},
matchExistingProgram: function matchExistingProgram(child){
for (var i=0, len=this.context.environments.length; i < len; i++){
var environment=this.context.environments[i];
if(environment&&environment.equals(child)){
return environment;
}}
},
programExpression: function programExpression(guid){
var child=this.environment.children[guid],
programParams=[child.index, 'data', child.blockParams];
if(this.useBlockParams||this.useDepths){
programParams.push('blockParams');
}
if(this.useDepths){
programParams.push('depths');
}
return 'container.program(' + programParams.join(', ') + ')';
},
useRegister: function useRegister(name){
if(!this.registers[name]){
this.registers[name]=true;
this.registers.list.push(name);
}},
push: function push(expr){
if(!(expr instanceof Literal)){
expr=this.source.wrap(expr);
}
this.inlineStack.push(expr);
return expr;
},
pushStackLiteral: function pushStackLiteral(item){
this.push(new Literal(item));
},
pushSource: function pushSource(source){
if(this.pendingContent){
this.source.push(this.appendToBuffer(this.source.quotedString(this.pendingContent), this.pendingLocation));
this.pendingContent=undefined;
}
if(source){
this.source.push(source);
}},
replaceStack: function replaceStack(callback){
var prefix=['('],
stack=undefined,
createdStack=undefined,
usedLiteral=undefined;
if(!this.isInline()){
throw new _exception2['default']('replaceStack on non-inline');
}
var top=this.popStack(true);
if(top instanceof Literal){
stack=[top.value];
prefix=['(', stack];
usedLiteral=true;
}else{
createdStack=true;
var _name=this.incrStack();
prefix=['((', this.push(_name), '=', top, ')'];
stack=this.topStack();
}
var item=callback.call(this, stack);
if(!usedLiteral){
this.popStack();
}
if(createdStack){
this.stackSlot--;
}
this.push(prefix.concat(item, ')'));
},
incrStack: function incrStack(){
this.stackSlot++;
if(this.stackSlot > this.stackVars.length){
this.stackVars.push('stack' + this.stackSlot);
}
return this.topStackName();
},
topStackName: function topStackName(){
return 'stack' + this.stackSlot;
},
flushInline: function flushInline(){
var inlineStack=this.inlineStack;
this.inlineStack=[];
for (var i=0, len=inlineStack.length; i < len; i++){
var entry=inlineStack[i];
if(entry instanceof Literal){
this.compileStack.push(entry);
}else{
var stack=this.incrStack();
this.pushSource([stack, '=', entry, ';']);
this.compileStack.push(stack);
}}
},
isInline: function isInline(){
return this.inlineStack.length;
},
popStack: function popStack(wrapped){
var inline=this.isInline(),
item=(inline ? this.inlineStack:this.compileStack).pop();
if(!wrapped&&item instanceof Literal){
return item.value;
}else{
if(!inline){
if(!this.stackSlot){
throw new _exception2['default']('Invalid stack pop');
}
this.stackSlot--;
}
return item;
}},
topStack: function topStack(){
var stack=this.isInline() ? this.inlineStack:this.compileStack,
item=stack[stack.length - 1];
if(item instanceof Literal){
return item.value;
}else{
return item;
}},
contextName: function contextName(context){
if(this.useDepths&&context){
return 'depths[' + context + ']';
}else{
return 'depth' + context;
}},
quotedString: function quotedString(str){
return this.source.quotedString(str);
},
objectLiteral: function objectLiteral(obj){
return this.source.objectLiteral(obj);
},
aliasable: function aliasable(name){
var ret=this.aliases[name];
if(ret){
ret.referenceCount++;
return ret;
}
ret=this.aliases[name]=this.source.wrap(name);
ret.aliasable=true;
ret.referenceCount=1;
return ret;
},
setupHelper: function setupHelper(paramSize, name, blockHelper){
var params=[],
paramsInit=this.setupHelperArgs(name, paramSize, params, blockHelper);
var foundHelper=this.nameLookup('helpers', name, 'helper'),
callContext=this.aliasable(this.contextName(0) + '!=null ? ' + this.contextName(0) + ':(container.nullContext||{})');
return {
params: params,
paramsInit: paramsInit,
name: foundHelper,
callParams: [callContext].concat(params)
};},
setupParams: function setupParams(helper, paramSize, params){
var options={},
contexts=[],
types=[],
ids=[],
objectArgs = !params,
param=undefined;
if(objectArgs){
params=[];
}
options.name=this.quotedString(helper);
options.hash=this.popStack();
if(this.trackIds){
options.hashIds=this.popStack();
}
if(this.stringParams){
options.hashTypes=this.popStack();
options.hashContexts=this.popStack();
}
var inverse=this.popStack(),
program=this.popStack();
if(program||inverse){
options.fn=program||'container.noop';
options.inverse=inverse||'container.noop';
}
var i=paramSize;
while (i--){
param=this.popStack();
params[i]=param;
if(this.trackIds){
ids[i]=this.popStack();
}
if(this.stringParams){
types[i]=this.popStack();
contexts[i]=this.popStack();
}}
if(objectArgs){
options.args=this.source.generateArray(params);
}
if(this.trackIds){
options.ids=this.source.generateArray(ids);
}
if(this.stringParams){
options.types=this.source.generateArray(types);
options.contexts=this.source.generateArray(contexts);
}
if(this.options.data){
options.data='data';
}
if(this.useBlockParams){
options.blockParams='blockParams';
}
return options;
},
setupHelperArgs: function setupHelperArgs(helper, paramSize, params, useRegister){
var options=this.setupParams(helper, paramSize, params);
options.loc=JSON.stringify(this.source.currentLocation);
options=this.objectLiteral(options);
if(useRegister){
this.useRegister('options');
params.push('options');
return ['options=', options];
}else if(params){
params.push(options);
return '';
}else{
return options;
}}
};
(function (){
var reservedWords=('break else new var' + ' case finally return void' + ' catch for switch while' + ' continue function this with' + ' default if throw' + ' delete in try' + ' do instanceof typeof' + ' abstract enum int short' + ' boolean export interface static' + ' byte extends long super' + ' char final native synchronized' + ' class float package throws' + ' const goto private transient' + ' debugger implements protected volatile' + ' double import public let yield await' + ' null true false').split(' ');
var compilerWords=JavaScriptCompiler.RESERVED_WORDS={};
for (var i=0, l=reservedWords.length; i < l; i++){
compilerWords[reservedWords[i]]=true;
}})();
JavaScriptCompiler.isValidJavaScriptVariableName=function (name){
return !JavaScriptCompiler.RESERVED_WORDS[name]&&/^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(name);
};
function strictLookup(requireTerminal, compiler, parts, type){
var stack=compiler.popStack(),
i=0,
len=parts.length;
if(requireTerminal){
len--;
}
for (; i < len; i++){
stack=compiler.nameLookup(stack, parts[i], type);
}
if(requireTerminal){
return [compiler.aliasable('container.strict'), '(', stack, ', ', compiler.quotedString(parts[i]), ', ', JSON.stringify(compiler.source.currentLocation), ')'];
}else{
return stack;
}}
exports['default']=JavaScriptCompiler;
module.exports=exports['default'];
}),
(function(module, exports, __webpack_require__){
'use strict';
var _Object$keys=__webpack_require__(13)['default'];
exports.__esModule=true;
var _utils=__webpack_require__(5);
var SourceNode=undefined;
try {
if(false){
var SourceMap=require('source-map');
SourceNode=SourceMap.SourceNode;
}} catch (err){}
if(!SourceNode){
SourceNode=function (line, column, srcFile, chunks){
this.src='';
if(chunks){
this.add(chunks);
}};
SourceNode.prototype={
add: function add(chunks){
if(_utils.isArray(chunks)){
chunks=chunks.join('');
}
this.src +=chunks;
},
prepend: function prepend(chunks){
if(_utils.isArray(chunks)){
chunks=chunks.join('');
}
this.src=chunks + this.src;
},
toStringWithSourceMap: function toStringWithSourceMap(){
return { code: this.toString() };},
toString: function toString(){
return this.src;
}};}
function castChunk(chunk, codeGen, loc){
if(_utils.isArray(chunk)){
var ret=[];
for (var i=0, len=chunk.length; i < len; i++){
ret.push(codeGen.wrap(chunk[i], loc));
}
return ret;
}else if(typeof chunk==='boolean'||typeof chunk==='number'){
return chunk + '';
}
return chunk;
}
function CodeGen(srcFile){
this.srcFile=srcFile;
this.source=[];
}
CodeGen.prototype={
isEmpty: function isEmpty(){
return !this.source.length;
},
prepend: function prepend(source, loc){
this.source.unshift(this.wrap(source, loc));
},
push: function push(source, loc){
this.source.push(this.wrap(source, loc));
},
merge: function merge(){
var source=this.empty();
this.each(function (line){
source.add(['  ', line, '\n']);
});
return source;
},
each: function each(iter){
for (var i=0, len=this.source.length; i < len; i++){
iter(this.source[i]);
}},
empty: function empty(){
var loc=this.currentLocation||{ start: {}};
return new SourceNode(loc.start.line, loc.start.column, this.srcFile);
},
wrap: function wrap(chunk){
var loc=arguments.length <=1||arguments[1]===undefined ? this.currentLocation||{ start: {}}:arguments[1];
if(chunk instanceof SourceNode){
return chunk;
}
chunk=castChunk(chunk, this, loc);
return new SourceNode(loc.start.line, loc.start.column, this.srcFile, chunk);
},
functionCall: function functionCall(fn, type, params){
params=this.generateList(params);
return this.wrap([fn, type ? '.' + type + '(':'(', params, ')']);
},
quotedString: function quotedString(str){
return '"' + (str + '').replace(/\\/g, '\\\\').replace(/"/g, '\\"').replace(/\n/g, '\\n').replace(/\r/g, '\\r').replace(/\u2028/g, '\\u2028')
.replace(/\u2029/g, '\\u2029') + '"';
},
objectLiteral: function objectLiteral(obj){
var _this=this;
var pairs=[];
_Object$keys(obj).forEach(function (key){
var value=castChunk(obj[key], _this);
if(value!=='undefined'){
pairs.push([_this.quotedString(key), ':', value]);
}});
var ret=this.generateList(pairs);
ret.prepend('{');
ret.add('}');
return ret;
},
generateList: function generateList(entries){
var ret=this.empty();
for (var i=0, len=entries.length; i < len; i++){
if(i){
ret.add(',');
}
ret.add(castChunk(entries[i], this));
}
return ret;
},
generateArray: function generateArray(entries){
var ret=this.generateList(entries);
ret.prepend('[');
ret.add(']');
return ret;
}};
exports['default']=CodeGen;
module.exports=exports['default'];
})
])
});
;
function preloader(){
jQuery('.wpfd-loading').css('background', "transparent url(" + wpfdfrontend.pluginurl + "/app/site/assets/images/theme/loadingfile.svg) no-repeat center center");
}
function addLoadEvent(func){
var oldonload=window.onload;
if(typeof window.onload!='function'){
window.onload=func;
}else{
window.onload=function (){
if(oldonload){
oldonload();
}
func();
}}
}
function wpfdSendTrackingEventThenDownload(Action, Label, Url){
"use strict";
var rtn=false;
if(typeof (_gaq)!=="undefined"){
_gaq.push(['_trackEvent', 'WPFD', Action, Label]);
rtn=true;
}
if(typeof (ga)!=="undefined"){
try {
var trackers=window.ga.getAll();
trackers.forEach(function (tracker){
var trackerName=tracker.get('name');
if(trackerName){
ga(trackerName + '.send', 'event', 'WPFD', Action, Label);
}});
} catch (error){
console.log(error);
}
rtn=true;
}
if(typeof (gtag)!=="undefined"){
gtag('event', Action, {
'event_category': 'WPFD',
'event_label': Label
});
rtn=true;
}
return rtn;
}
function wpfdTrackDownload(){
if(typeof (wpfdparams)!=="undefined"&&wpfdparams.ga_download_tracking==="1"){
jQuery(document).on('click', 'a.wpfd_downloadlink', function (e){
var href=jQuery(this).attr('href');
var extLink=href.replace(/^https?\:\/\//i, '');
wpfdSendTrackingEventThenDownload('Download', extLink, href);
})
.on('click', 'a.wpfd_previewlink', function (e){
var href=jQuery(this).attr('href');
var extLink=href.replace(/^https?\:\/\//i, '');
wpfdSendTrackingEventThenDownload('Preview', extLink, href);
});
}}
function wpfd_remove_loading(el){
jQuery('.wpfd-loading', el).remove();
}
cleanObj=function (obj){
for (var k in obj){
if(obj.hasOwnProperty(k)){
if(!obj[k]) delete obj[k];
}}
return obj;
};
window.wpfdAjax={};
jQuery(document).ready(function ($){
addLoadEvent(preloader);
wpfdTrackDownload();
$(document).on('click', '.wpfd-open-tree', function (e){
var $this=$(this);
var tree=$this.parent().find('.wpfd-foldertree');
if(tree.hasClass('tree-open')){
tree.slideUp(500).removeClass('tree-open');
}else{
tree.slideDown(500).addClass('tree-open');
}});
$(document).on('wpfd:category-loaded', function (e){
var tree2=$('.wpfd-foldertree');
if(tree2.hasClass('tree-open')){
tree2.slideUp(500).removeClass('tree-open');
}});
var wpfd_category_content=$('.wpfd-all-file-category');
if(wpfd_category_content.length){
var hash_category_id='';
var default_hash=window.location.hash;
default_hash=default_hash.replace('#', '');
if(default_hash!==''&&default_hash.indexOf('-wpfd-')!==-1){
var hasha=default_hash.split('-');
var re=new RegExp("^(p[0-9]+)$");
var page=null;
var stringpage=hasha.pop();
if(re.test(stringpage)){
page=stringpage.replace('p', '');
}
hash_category_id=hasha[0];
}
if(hash_category_id!='all_0'){
wpfd_category_content.each(function (){
var curCatContentTheme=$(this).attr('data-theme');
var atts_shortcode=window["wpfdfrontend_" + curCatContentTheme];
var curCatContent=$(this);
$.ajax({
method: "POST",
url: wpfdparams.wpfdajaxurl + "task=categories.contentAllCat",
data: {
atts_shortcode: atts_shortcode.shortcode_param,
wpfdajaxnone: atts_shortcode.wpfdajaxnone
},
beforeSend: function (){
var htmlToAppend=$('#wpfd-loading-wrap').html();
curCatContent.html(htmlToAppend);
},
success: function (result){
if(result.success){
curCatContent.html(result.content);
var script=document.createElement('script');
script.src=atts_shortcode.wpfdscripturl;
document.body.appendChild(script);
}}
})
})
}}
setTimeout(function (){
if($('.wpfd_root_category_default_open').length > 0){
$('.wpfd_root_category_default_open').each(function (){
$('.wpfdcategory.catlink[data-idcat="' + $(this).val() + '"]').trigger('click');
});
}}, 1000);
function wpfdDownloadFiles(){
if(!wpfdparams.offRedirectLinkDownloadImageFile){
$('.wpfd-single-file.png .wpfd_downloadlink, .wpfd-single-file.jpg .wpfd_downloadlink, .wpfd-single-file.jpeg .wpfd_downloadlink, .wpfd-single-file.gif .wpfd_downloadlink').on('click', function (event){
event.preventDefault();
var fileId=$(this).parents('.wpfd-single-file').data('id');
var categoryId=$(this).parents('.wpfd-single-file').data('catid');
var cloudType=$(this).parents('.wpfd-single-file').find('.wpfd_root_category_type').val();
if(!fileId||!categoryId){
return false;
}
if($(this).find('.wpfd-add-to-cart').length){
return false;
}
window.location.href=wpfdparams.site_url + "?wpfd_action=wpfd_download_file&wpfd_file_id=" + fileId + "&wpfd_category_id=" + categoryId + "&cloudType=" + cloudType;
});
}}
wpfdDownloadFiles();
function wpfdPreviewFileNewName(){
$('.wpfd-button-preview').click(function (e){
var newWindow=$(this).attr('target');
var previewLink=$(this).attr('href');
var fileTitle=$(this).parents('.wpfd-single-file').find('.wpfd_file_preview_link_download').attr('data-filetitle');
var fileExt=$(this).parents('.wpfd-single-file').find('.wpfd_file_ext').val();
var fileName=fileExt ? fileTitle + '.' + fileExt:fileTitle;
fileName=fileName ? fileName:'WPFD Preview File';
if(newWindow==='_blank'&&(previewLink.indexOf('previews')!==-1)&&previewLink.indexOf('docs.google.com')===-1){
e.preventDefault();
var win=window.open(previewLink, '_blank');
win.onload=function (){
setTimeout(function (){
win.document.title=fileName;
}, 100);
setTimeout(function (){
$(win.document.head).append('<title>' + fileName + '</title>');
}, 3000);
};
setTimeout(function (){
if(win.document.title!==fileName){
win.document.title=fileName;
}}, 1000);
setTimeout(function (){
if(win.document.title!==fileName){
win.document.title=fileName;
}}, 3000);
}});
}
wpfdPreviewFileNewName();
if($('.wpfd-single-file .file-custom-field.file-url').length){
var link=typeof (wpfdparams.translates.wpfd_url_custom_field)!=='undefined' ? wpfdparams.translates.wpfd_url_custom_field:'Link';
$('.wpfd-single-file .file-custom-field.file-url').each(function (){
var label=$(this).attr('data-field-label');
var url=$(this).attr('data-field-val');
var urlContents='<div><span>' + label + ': </span><a href="' + url + '" target="_blank">' + link + '</a></div>';
$(this).empty().append(urlContents);
});
}});
(function ($){
var options={
'root': '/',
'script': 'connectors/jaoconnector.php',
'showroot': 'root',
'onclick': function (elem, type, file){
},
'oncheck': function (elem, checked, type, file){
},
'expanded': false,
'expandedParent': false,
'usecheckboxes': true,
'expandSpeed': 0,
'collapseSpeed': 0,
'expandEasing': null,
'collapseEasing': null,
'canselect': true
};
var methods={
init: function (o){
if($(this).length==0){
return;
}
$this=$(this);
$.extend(options, o);
$(this).data('jaofiletree', $.extend({}, options));
if(typeof wpfdparams!=='undefined'&&wpfdparams.hasOwnProperty('allow_category_tree_parent_expanded')){
options.expandedParent=parseInt(wpfdparams.allow_category_tree_parent_expanded)===1 ? true:false;
}
firstload(options.root, $this);
},
open: function (dir, $this){
openfolder(dir, $this);
},
close: function (dir, $this){
closedir(dir, $this);
},
getchecked: function (){
var list=new Array();
var ik=0;
$this.find('input:checked + a').each(function (){
list[ik]={
type: $(this).attr('data-type'),
file: $(this).attr('data-file')
}
ik++;
});
return list;
},
getselected: function (){
var list=new Array();
var ik=0;
$this.find('li.selected > a').each(function (){
list[ik]={
type: $(this).attr('data-type'),
file: $(this).attr('data-file')
}
ik++;
});
return list;
}};
firstload=function (dir, $this){
$.ajax({
url: options.script,
data: {dir: dir},
context: $this,
dataType: 'json',
beforeSend: function (){
this.find('a[data-file="' + dir + '"]').parent().addClass('wait');
}}).done(function (datas){
if(typeof datas!=='undefined'&&datas.success){
if(typeof datas.data!=='undefined'&&datas.data){
var tree=buildtree(datas.data, true, dir);
$this.html(tree);
if(options.expandedParent){
setTimeout(function (){
if($('.icon-open-close[data-parent_id=0]').length){
$this.find('.icon-open-close[data-parent_id=0]').click();
}else{
if(typeof datas.data[0].term_id!=='undefined'&&$('.icon-open-close[data-id=' + datas.data[0].term_id + ']').length){
$this.find('.icon-open-close[data-id=' + datas.data[0].term_id + ']').click();
}}
}, 100);
}
setevents($this);
}else{
$this.html('No cat found');
}}else{
if(typeof datas.message!=='undefined'){
$this.html(datas.message);
}else{
$this.html('Something wrong! Please reload this page.');
}}
});
};
buildtree=function (datas, display, dir){
var sortable=[];
for (var key in datas){
sortable.push(datas[key]);
}
datas=[];
sortable.forEach(function (data){
if(typeof data!=='function'){
datas.push(data);
}});
ret='<ul class="jaofiletree" ';
if(options.expanded){
display===true;
}
if(display){
ret +='>';
}else{
ret +='style="display: none">';
}
for (var id=0; id < datas.length; id++){
classe='directory collapsed';
var parent_id=datas[id].parent;
var cat_id=datas[id].term_id;
if(typeof parent_id==='undefined'){
parent_id=0;
}
if(options.expanded){
classe='directory';
if(typeof dir!=='undefined'){
classe +=' selected';
}
if(typeof datas[id].children!=='undefined'&&datas[id].children.length > 0){
classe +=' expanded';
}}
if(datas[id].term_id===0){
cat_id='all_0';
classe='directory selected';
if(typeof datas[id].children!=='undefined'&&datas[id].children.length > 0){
classe +=' expanded';
}}
ret +='<li class="' + classe + '">';
if(typeof datas[id].children!=='undefined'&&datas[id].children.length > 0){
ret +='<div class="icon-open-close" data-id="' + datas[id].term_id + '" data-parent_id="' + parent_id + '" data-file="' + datas[id].term_id + '" ></div>';
}
var classIcon='';
var color='';
if(typeof (datas[id].color)!=='undefined'&&datas[id].color!==''){
color='color: ' + datas[id].color;
}else{
color='color: #b2b2b2';
}
if(typeof datas[id].cloudType!=='undefined'&&typeof datas[id].cloudType!=='number'&&datas[id].cloudType!==false){
classIcon=' wpfd-icon-cloud wpfd-icon-' + datas[id].cloudType;
}
if(datas[id].term_id===dir){
ret +='<i class="zmdi zmdi-folder zmdi-folder-open' + classIcon + '" style="' + color + '"></i>';
}else{
ret +='<i class="zmdi zmdi-folder' + classIcon + '" style="' + color + '"></i>';
}
ret +='<a href="#" data-file="' + datas[id].term_id + '" data-catid="' + cat_id + '" data-parent_id="' + parent_id + '">' + datas[id].name + '</a>';
if(typeof datas[id].children!=='undefined'){
var display=options.expanded;
if(datas[id].term_id===0){
display=true;
}
ret +=buildtree(datas[id].children, display);
}
ret +='</li>';
}
ret +='</ul>';
return ret;
};
openfolder=function (dir, $this){
if($this.find('a[data-file="' + dir + '"]').parent().hasClass('expanded')){
return;
}
$this.find('a[data-file="' + dir + '"]').parent().removeClass('wait').removeClass('collapsed').addClass('expanded');
$this.find('a[data-file="' + dir + '"]').parent().find(' > .zmdi.zmdi-folder').removeClass('zmdi-folder').addClass('zmdi-folder-outline');
$this.find('a[data-file="' + dir + '"]').next().slideDown(options.expandSpeed, options.expandEasing);
setevents($this);
$this.trigger('afteropen');
$this.trigger('afterupdate');
};
closedir=function (dir, $this){
$this.find('a[data-file="' + dir + '"]').next().slideUp(options.collapseSpeed, options.collapseEasing);
$this.find('a[data-file="' + dir + '"]').parent().removeClass('expanded').addClass('collapsed');
$this.find('a[data-file="' + dir + '"]').parent().find(' > .zmdi.zmdi-folder-outline').removeClass('zmdi-folder-outline').addClass('zmdi-folder');
setevents($this);
$this.trigger('afterclose');
$this.trigger('afterupdate');
};
setevents=function ($this){
var options=$this.data('jaofiletree');
var allow_category_tree_click_scroll_up=false;
if(typeof wpfdparams!=='undefined'&&wpfdparams.hasOwnProperty('allow_category_tree_click_scroll_up')){
allow_category_tree_click_scroll_up=parseInt(wpfdparams.allow_category_tree_click_scroll_up)===1 ? true:false;
}
$this.find('li a, li .icon-open-close').unbind('click');
$this.find('li.directory a').bind('click', function (e){
$this.find('li').removeClass('selected');
$this.find('i.zmdi').removeClass('zmdi-folder-open').addClass("zmdi-folder");
$(this).parent().addClass('selected');
$(this).parents('li.directory.expanded').find(' > i.zmdi').removeClass('zmdi-folder').removeClass('zmdi-folder-outline').addClass('zmdi-folder-outline');
$(this).parent().find(' > i.zmdi').removeClass('zmdi-folder').addClass("zmdi-folder-open").addClass("zmdi-folder-outline");
if($this.find('i.zmdi.zmdi-folder.zmdi-folder-outline').parent().length){
$this.find('i.zmdi.zmdi-folder.zmdi-folder-outline').parent().each(function (){
if($(this).find(' > .jaofiletree li.directory').length){
$(this).find('i.zmdi.zmdi-folder.zmdi-folder-outline').removeClass('zmdi-folder');
}else{
$(this).find('i.zmdi.zmdi-folder-outline').removeClass('zmdi-folder-outline').addClass('zmdi-folder');
}});
}
var $el=$(this);
if($el.data('clicked')){
e.preventDefault();
e.stopPropagation();
}else{
$el.data('clicked', true);
options.onclick(this, $(this).attr('data-file'));
window.setTimeout(function (){
$el.removeData('clicked');
}, 1000)
}
if(allow_category_tree_click_scroll_up){
var offsetTop=$(this).closest(".wpfd-content").offset().top - 200;
$('html, body').animate({
scrollTop: offsetTop
}, 1000);
}
return false;
});
$this.find('li.directory.collapsed .icon-open-close').bind('click', function (e){
e.preventDefault;
var $el=$(this);
if($el.data('clicked')){
e.preventDefault();
e.stopPropagation();
}else{
$el.data('clicked', true);
methods.open($(this).attr('data-file'), $this);
window.setTimeout(function (){
$el.removeData('clicked');
}, 1000)
}});
$this.find('li.directory.expanded .icon-open-close').bind('click', function (e){
e.preventDefault;
var $el=$(this);
if($el.data('clicked')){
e.preventDefault();
e.stopPropagation();
}else{
$el.data('clicked', true);
methods.close($(this).attr('data-file'), $this);
window.setTimeout(function (){
$el.removeData('clicked');
}, 1000)
}});
};
$.fn.jaofiletree=function (method){
if(methods[method]){
return methods[method].apply(this, Array.prototype.slice.call(arguments, 1));
}else if(typeof method==='object'||!method){
return methods.init.apply(this, arguments);
}else{
}};})(jQuery);
bytesToSize=function(bytes){
var sizes=[];
if(typeof (window.wpfdHelper)!=='undefined'&&typeof (window.wpfdHelper.fileMeasure)!=='undefined'&&window.wpfdHelper.fileMeasure.length > 0){
sizes=window.wpfdHelper.fileMeasure;
}else{
sizes=['B', 'KB', 'MB', 'GB', 'TB', 'PB'];
}
if(bytes <=0) return 'N/A';
var i=parseInt(Math.floor(Math.log(bytes) / Math.log(1024)));
return (bytes / Math.pow(1024, i)).toFixed(2) + ' ' + sizes[i];
};
jQuery(document).ready(function ($){
var sourcefiles=$("#wpfd-template-tree-files").html();
var sourcecategories=$("#wpfd-template-tree-categories").html();
var sourcefile=$("#wpfd-template-tree-box").html();
var tree_hash=window.location.hash;
var tree_cParents={};
var tree_root_category_id=$(".wpfd-content.wpfd-content-tree").length ? $(".wpfd-content.wpfd-content-tree").data('category'):null;
var allCategoriesBreadcrumbs='<li><a class="wpfd-all-categories-link" data-idcat="all_0" href="javascript:void(0);">' + wpfdparams.translates.wpfd_all_categories + '</a></li>';
var allCategoriesDividerBreadcrumbs='<li><a class="wpfd-all-categories-link" data-idcat="all_0" href="javascript:void(0);">' + wpfdparams.translates.wpfd_all_categories + '</a><span class="divider"> &gt; </span></li>';
initInputSelected();
Handlebars.registerHelper('bytesToSize', function (bytes){
if(typeof bytes==="undefined"){
return 'n/a';
}
return bytes.toString().toLowerCase()==='n/a' ? bytes:bytesToSize(bytes);
});
treeInitClickFile();
if(typeof wpfdColorboxInit!=='undefined'){
wpfdColorboxInit();
}
function wpfd_tree_menu_category_link_handlers(){
if($('.wpfd_menu_category_links .elementor-icon-list-item').length){
$('.wpfd_menu_category_links .elementor-icon-list-item').unbind('click').on('click', function (e){
var hashSubUrl=$(this).find('a').attr('href');
var hashGoId='';
if(hashSubUrl.indexOf('/')!==-1){
var hashParams=hashSubUrl.split('/');
hashGoId=hashParams[hashParams.length - 1];
hashGoId=hashGoId.replace('#', '');
if(hashGoId!==''){
var hashGoIda=hashGoId.split('-');
var hashGoIda_sourcecat=hashGoIda[0];
var hashGoIda_category_id=hashGoIda[1];
setTimeout(function (){
tree_loadcategory(hashGoIda_sourcecat, hashGoIda_category_id);
if($('#e-n-menu-content-1872').length){
$('#e-n-menu-content-1872').hide();
}}, 100);
}}
});
}}
wpfd_tree_menu_category_link_handlers();
tree_hash=tree_hash.replace('#', '');
if(tree_hash!==''){
var hasha=tree_hash.split('-');
var hash_category_id=hasha[1];
var hash_sourcecat=hasha[0];
if(parseInt(hash_category_id) > 0){
setTimeout(function (){
tree_loadcategory(hash_category_id, hash_sourcecat);
}, 100);
}}
$('.wpfd-content-tree a.catlink').unbind('click.cat').bind('click.cat', function (e){
e.preventDefault();
tree_load($(this).parents('.wpfd-content-tree').data('category'), $(this).data('idcat'), $(this));
tree_breadcrum($(this).parents('.wpfd-content-tree').data('category'), $(this).data('idcat'), $(this));
$(this).parent().removeClass('collapsed').addClass('expanded');
$(this).parent().find('.zmdi.zmdi-folder').removeClass('zmdi-folder').addClass('zmdi-folder-outline');
});
function initInputSelected(){
$(document).on('change', ".wpfd-content-tree.wpfd-content-multi input.cbox_file_download:not('.search-download-checkbox')", function (){
inputSelect($(this).parents('.wpfd-content')[0]);
});
}
function inputSelect(context){
var sc=$(context).data('category');
var selectedFiles=$("input.cbox_file_download:checked", context);
var filesId=[];
if(selectedFiles.length){
selectedFiles.each(function (index, file){
filesId.push($(file).data('id'));
});
}
if(filesId.length > 0){
$(".wpfdSelectedFiles", context).remove();
$('<input type="hidden" class="wpfdSelectedFiles" value="' + filesId.join(',') + '" />')
.insertAfter($("#current_category_slug_" + sc));
hideDownloadAllBtn(context, true);
$(".tree-download-selected", context).remove();
var downloadSelectedBtn=$('<a href="javascript:void(0);" class="tree-download-selected" style="display: block;">' + wpfdparams.translates.download_selected + '<i class="zmdi zmdi-check-all wpfd-download-category"></i></a>');
downloadSelectedBtn.insertAfter($("#current_category_slug_" + sc));
var rootCat=$("#current_category_slug_" + sc).parent();
if($(rootCat).find("ul.breadcrumbs").length){
downloadSelectedBtn.insertBefore($(rootCat).find("ul.breadcrumbs"));
}else{
if($(rootCat).find('.wpfd-category-theme-title').length){
downloadSelectedBtn.insertBefore($(rootCat).find(".wpfd-category-theme-title"));
}else{
downloadSelectedBtn.insertBefore($(rootCat).find("ul.wpfd-tree-categories-files"));
}}
initDownloadSelected();
}else{
$(".wpfdSelectedFiles", context).remove();
$(".tree-download-selected", context).remove();
hideDownloadAllBtn(context);
}}
function hideDownloadAllBtn(context, hide){
var downloadCatButton=$(".tree-download-category", context);
if(downloadCatButton.length===0||downloadCatButton.hasClass('display-download-category')){
return;
}
if(hide){
$(".tree-download-category", context).hide();
}else{
$(".tree-download-category", context).show();
}}
function initDownloadSelected(){
$('.wpfd-content-tree.wpfd-content-multi .tree-download-selected').on('click', function (){
var context=$(this).parents('.wpfd-content')[0];
var sc=$(context).data('category');
if($('.wpfdSelectedFiles', context).length > 0){
var category_name=$("#current_category_slug_" + sc).val();
var selectedFilesId=$('.wpfdSelectedFiles', context).val();
$.ajax({
url: wpfdparams.wpfdajaxurl + "?action=wpfd&task=files.zipSeletedFiles&filesId=" + selectedFilesId + "&wpfd_category_id=" + $(context).attr('data-category'),
dataType: "json"
}).done(function (results){
if(results.success){
var hash=results.data.hash;
window.location.href=wpfdparams.wpfdajaxurl + "?action=wpfd&task=files.downloadZipedFile&hash=" + hash + "&wpfd_category_id=" + $(context).attr('data-category') + "&wpfd_category_name=" + category_name;
}else{
alert(results.data.message);
}})
}});
}
function tree_loadcategory($catid, $sourcecat){
$.ajax({
url: wpfdparams.wpfdajaxurl + "task=categories.getParentsCats&id=" + $catid + "&displaycatid=" + $sourcecat,
dataType: "json"
}).done(function (ob){
tree_load($sourcecat, ob[0], $('.wpfd-content-tree [data-idcat="' + ob[0] + '"]'), ob);
});
}
function treeInitClickFile(){
$('.wpfd-content-tree .wpfd-file-link').unbind('click').click(function (e){
var context=$(this).parents('.wpfd-content')[0];
var atthref=$(this).attr('href');
if(atthref!=='#'){
return;
}
e.preventDefault();
var fileid=$(this).data('id');
var categoryid=$(this).data('category_id');
$.ajax({
url: wpfdparams.wpfdajaxurl + "task=file.display&view=file&id=" + fileid + "&categoryid=" + categoryid + "&rootcat=" + $(context).attr('data-category'),
dataType: "json",
beforeSend: function (){
if($('body').has('wpfd-tree-box-loader')!==true){
$('body').append('<div class="wpfd-tree-box-loader"></div>');
}}
}).done(function (file){
var template=Handlebars.compile(sourcefile);
var html=template(file);
var box=$("#tree-wpfd-box");
$('.wpfd-tree-box-loader').each(function (){
$(this).remove();
});
if(box.length===0){
$('body').append('<div id="tree-wpfd-box" style="display: hidden;"></div>');
box=$("#tree-wpfd-box");
}
box.empty();
box.prepend(html);
box.attr('data-id', fileid);
box.attr('data-catid', categoryid);
box.attr('class', 'tree-wpfd-box wpfd-download-box');
if(typeof (file.file.ext)!=='undefined'){
box.attr('data-type', file.file.ext);
box.addClass(file.file.ext);
}
box.click(function (e){
if($(e.target).is('#tree-wpfd-box')){
box.hide();
}
$('#tree-wpfd-box').unbind('click.box').bind('click.box', function (e){
if($(e.target).is('#tree-wpfd-box')){
box.hide();
}});
});
if($("#tree-wpfd-box .file-custom-field.file-url").length){
var link=typeof (wpfdparams.translates.wpfd_url_custom_field)!=='undefined' ? wpfdparams.translates.wpfd_url_custom_field:'Link';
$("#tree-wpfd-box .file-custom-field.file-url").each(function (){
var label=$(this).attr('data-field-label');
var url=$(this).attr('data-field-val');
var urlContents='<div><span>' + label + ': </span><a href="' + url + '" target="_blank">' + link + '</a></div>';
$(this).empty().append(urlContents);
});
}
if(typeof (file.file.linkdownload)!=='undefined'){
var previewLinkDownload='<input type="hidden" class="wpfd_file_preview_link_download" value="'+ file.file.linkdownload +'" data-filetitle="'+ file.file.post_title +'" />';
box.prepend(previewLinkDownload);
}
$('#tree-wpfd-box .wpfd-close').click(function (e){
e.preventDefault();
box.hide();
});
box.show();
var dropblock=box.find('.dropblock');
if($(window).width() < 400){
dropblock.css('margin-top', '0');
dropblock.css('margin-left', '0');
dropblock.css('top', '0');
dropblock.css('left', '0');
dropblock.height($(window).height() - parseInt(dropblock.css('padding-top'), 10) - parseInt(dropblock.css('padding-bottom'), 10));
dropblock.width($(window).width() - parseInt(dropblock.css('padding-left'), 10) - parseInt(dropblock.css('padding-right'), 10));
}else{
dropblock.css('margin-top', (-(dropblock.height() / 2) - 20) + 'px');
dropblock.css('margin-left', (-(dropblock.width() / 2) - 20) + 'px');
dropblock.css('height', '');
dropblock.css('width', '');
dropblock.css('top', '');
dropblock.css('left', '');
}
if(dropblock&&typeof (file.file.ID)!=='undefined'){
dropblock.attr('data-id', file.file.ID);
}
if(typeof wpfdColorboxInit!=='undefined'){
wpfdColorboxInit();
}
wpfdTrackDownload();
$('body.elementor-default #tree-wpfd-box a.wpfd_downloadlink').on('click', function (e){
e.preventDefault();
e.stopPropagation();
var link=$(this).attr('href');
window.location.href=link;
});
wpfdTreeDisplayDownloadedFiles();
wpfdTreeDownloadFiles();
wpfdPreviewFileNewName();
});
});
}
function wantDelete(item, arr){
for (var i=0; i < arr.length; i++){
if(arr[i]===item){
arr.splice(i, 1);
break;
}}
}
_wpfd_text=function (text){
if(typeof (l10n)!=='undefined'){
return l10n[text];
}
return text;
};
function toMB(mb){
return mb * 1024 * 1024;
}
var allowedExt=wpfdparams.allowed;
allowedExt=allowedExt.split(',');
allowedExt.sort();
var initUploader=function (currentContainer){
var current_category=currentContainer.parents('.wpfd-content-tree').find('li.directory.active .catlink').data('idcat');
var uploader=new Resumable({
target: wpfdparams.wpfduploadajax + '?action=wpfd&task=files.upload&upload_from=front',
query: {
id_category: currentContainer.parents('.wpfd-content-tree').find('li.directory.active .catlink').data('idcat'),
},
fileParameterName: 'file_upload',
simultaneousUploads: 2,
maxFileSize: toMB(wpfdparams.maxFileSize),
maxFileSizeErrorCallback: function (file){
bootbox.alert(file.name + ' ' + _wpfd_text('is too large, please upload file(s) less than ') + wpfdparams.maxFileSize + 'Mb!');
},
chunkSize: wpfdparams.serverUploadLimit - 50 * 1024,
forceChunkSize: true,
fileType: allowedExt,
fileTypeErrorCallback: function (file){
bootbox.alert(file.name + ' cannot upload!<br/><br/>' + _wpfd_text('This type of file is not allowed to be uploaded. You can add new file types in the plugin configuration'));
},
generateUniqueIdentifier: function (file, event){
var relativePath=file.webkitRelativePath||file.fileName||file.name;
var size=file.size;
var prefix=Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15);
return (prefix + size + '-' + relativePath.replace(/[^0-9a-zA-Z_-]/img, ''));
}});
if(!uploader.support){
bootbox.alert(_wpfd_text('Your browser does not support HTML5 file uploads!'));
}
if(typeof (willUpload)==='undefined'){
var willUpload=true;
}
uploader.on('createFolders', function (files){
var currentRootCat=currentContainer.find('input[name=id_category]').val();
var paths=files.map(function(file){
if(file.hasOwnProperty('catId')){
currentRootCat=file.catId;
}
var filePath=(file.hasOwnProperty('relativePath')) ? file.relativePath:file.webkitRelativePath;
var namePos=filePath.lastIndexOf(file.name);
return filePath.substr(0,namePos);
});
paths=paths.filter(function(item, i, ar){ return item&&ar.indexOf(item)===i });
if(paths.length > 0){
var categoryType=currentContainer.find('input[name=category_type]').val();
$.ajax({
url: wpfdparams.wpfduploadajax + '?action=wpfd&task=categories.createCategoriesDeep',
data: {
paths: paths.join('|'),
category_id: currentRootCat,
type: categoryType
},
method: 'POST',
success: function (data){
}});
}})
uploader.on('filesAdded', function (files){
files.forEach(function (file){
var progressBlock='<div class="wpfd_process_block" id="' + file.uniqueIdentifier + '">'
+ '<div class="wpfd_process_fileinfo">'
+ '<span class="wpfd_process_filename">' + file.fileName + '</span>'
+ '<span class="wpfd_process_cancel">Cancel</span>'
+ '</div>'
+ '<div class="wpfd_process_full" style="display: block;">'
+ '<div class="wpfd_process_run" data-w="0" style="width: 0%;"></div>'
+ '</div></div>';
currentContainer.find('#preview', '.wpreview').before(progressBlock);
$(currentContainer).find('.wpfd_process_cancel').unbind('click').click(function (){
fileID=$(this).parents('.wpfd_process_block').attr('id');
fileObj=uploader.getFromUniqueIdentifier(fileID);
uploader.removeFile(fileObj);
$(this).parents('.wpfd_process_block').fadeOut('normal', function (){
$(this).remove();
});
if(uploader.files.length===0){
$(currentContainer).find('.wpfd_process_pause').fadeOut('normal', function (){
$(this).remove();
});
}
$.ajax({
url: wpfdparams.wpfduploadajax + '?action=wpfd&task=files.upload',
method: 'POST',
dataType: 'json',
data: {
id_category: $('input[name=id_category]').val(),
deleteChunks: fileID
},
success: function (res, stt){
if(res.response===true){
}}
})
});
});
if(files.length > 0){
uploadPauseBtn=$(currentContainer).find('.wpreview').find('.wpfd_process_pause').length;
restableBlock=$(currentContainer).find('.wpfd_process_block');
if(!uploadPauseBtn){
restableBlock.before('<div class="wpfd_process_pause">Pause</div>');
$(currentContainer).find('.wpfd_process_pause').unbind('click').click(function (){
if(uploader.isUploading()){
uploader.pause();
$(this).text('Start');
$(this).addClass('paused');
willUpload=false;
}else{
uploader.upload();
$(this).text('Pause');
$(this).removeClass('paused');
willUpload=true;
}});
}
uploader.opts.query={
id_category: currentContainer.find('input[name=id_category]').val()
};
if(willUpload){
setTimeout(function (){uploader.upload();}, 1000);
}}
});
uploader.on('fileProgress', function (file){
$(currentContainer).find('.wpfd_process_block#' + file.uniqueIdentifier)
.find('.wpfd_process_run').width(Math.floor(file.progress() * 100) + '%');
});
uploader.on('fileSuccess', function (file, res){
var thisUploadBlock=currentContainer.find('.wpfd_process_block#' + file.uniqueIdentifier);
thisUploadBlock.find('.wpfd_process_cancel').addClass('uploadDone').text('OK').unbind('click');
thisUploadBlock.find('.wpfd_process_full').remove();
var response=JSON.parse(res);
if(response.response===false&&typeof(response.datas)!=='undefined'){
if(typeof(response.datas.code)!=='undefined'&&response.datas.code > 20){
bootbox.alert('<div>' + response.datas.message + '</div>');
return false;
}}
if(typeof(response)==='string'){
bootbox.alert('<div>' + response + '</div>');
return false;
}
if(response.response!==true){
bootbox.alert(response.response);
return false;
}});
uploader.on('fileError', function (file, msg){
thisUploadBlock=currentContainer.find('.wpfd_process_block#' + file.uniqueIdentifier);
thisUploadBlock.find('.wpfd_process_cancel').addClass('uploadError').text('Error').unbind('click');
thisUploadBlock.find('.wpfd_process_full').remove();
});
uploader.on('complete', function (){
var sourcecat=currentContainer.parents('.wpfd-content.wpfd-content-multi').data('category');
var current_category=currentContainer.parents('.wpfd-content-tree').find('li.directory.active .catlink').data('idcat');
if(!current_category){
current_category=$('input[name=id_category]').val();
}
var categoryAjaxUrl=wpfdparams.wpfdajaxurl + "task=categories.display&view=categories&id=" + current_category + "&top=" + sourcecat;
$.ajax({
url: categoryAjaxUrl,
dataType: "json"
}).done(function (categories){
var sourcecategories=$("#wpfd-template-tree-categories").html();
if(sourcecategories){
var template=Handlebars.compile(sourcecategories);
var html=template(categories);
var current_category_obj=categories.category;
var sourceCatName=$(".wpfd-content-tree[data-category=" + sourcecat + "]").find('.wpfd-category-theme-title').text();
if(sourcecat=='all_0'){
tree_cParents[sourcecat]={parent: 0, term_id: 0, name: wpfdparams.translates.wpfd_all_categories};}else{
tree_cParents[sourcecat]={parent: 0, term_id: parseInt(sourcecat), name: sourceCatName};}
tree_cParents[current_category_obj.term_id]={parent: current_category_obj.parent, term_id: current_category_obj.term_id, name: current_category_obj.name};
if(categories.categories.length > 0){
if(current_category==sourcecat){
var list=$(".wpfd-content-tree[data-category=" + sourcecat + "] > ul:not(.breadcrumbs)");
}else{
var list=$(".wpfd-content-tree[data-category=" + sourcecat + "] li.directory.active > ul");
}
list.find('li.directory').remove();
list.append(html);
var listChildCategories=categories.categories;
for (var i=0; i < listChildCategories.length; i++){
var childCategory=listChildCategories[i];
tree_cParents[childCategory.term_id]={parent: childCategory.parent, term_id: childCategory.term_id, name: childCategory.name};}
$(".wpfd-content-tree[data-category=" + sourcecat + "] a.catlink:not(.breadcrumbs a.catlink)").unbind('click.cat').bind('click.cat', function (e){
e.preventDefault();
tree_load($(this).parents('.wpfd-content-tree').data('category'), $(this).data('idcat'), $(this));
tree_breadcrum($(this).parents('.wpfd-content-tree').data('category'), $(this).data('idcat'), $(this));
$('.wpfd-content-tree[data-category=' + sourcecat + '] input[name="id_category"]').val($(this).data('idcat'));
});
}}
});
var fileCount=$(currentContainer).find('.wpfd_process_cancel').length;
var categoryId=$(currentContainer).find('input[name=id_category]').val();
$.ajax({
url: wpfdparams.wpfduploadajax + '?action=wpfd&task=files.wpfdPendingUploadFiles',
method: 'POST',
dataType: 'json',
data: {
uploadedFiles: fileCount,
id_category: categoryId,
},
success: function (res){
currentContainer.find('.progress').delay(300).fadeIn(300).hide(300, function (){
$(this).remove();
});
currentContainer.find('.uploaded').delay(300).fadeIn(300).hide(300, function (){
$(this).remove();
});
$('#wpreview .file').delay(1200).show(1200, function (){
$(this).removeClass('done placeholder');
});
$('.gritter-item-wrapper ').remove();
$(currentContainer).find('#wpfd-upload-messages').append(wpfdparams.translates.msg_upload_file);
$(currentContainer).find('#wpfd-upload-messages').delay(1200).fadeIn(1200, function (){
$(currentContainer).find('#wpfd-upload-messages').empty();
$(currentContainer).find('.wpfd_process_pause').remove();
$(currentContainer).find('.wpfd_process_block').remove();
});
if(currentContainer.parent('.wpfd-upload-form').length){
var tree_sourcecat=currentContainer.parents('.wpfd-content-tree').data('category');
var current_category=currentContainer.parents('.wpfd-content-tree').find('li.directory.active .catlink').data('idcat');
if(typeof (tree_sourcecat)==='undefined'){
tree_sourcecat=currentContainer.parents('.wpfd-content-tree').find('.wpfd_root_category_id').length ?
currentContainer.parents('.wpfd-content-tree').find('.wpfd_root_category_id').val():$('.wpfd_root_category_id').val();
}
if(typeof (tree_sourcecat)==='undefined'&&tree_root_category_id!==null){
tree_sourcecat=tree_root_category_id;
}
if(typeof (current_category)==='undefined'){
current_category=tree_sourcecat;
}
$.ajax({
url: wpfdparams.wpfdajaxurl + "task=files.display&view=files&id=" + current_category + "&rootcat=" + tree_sourcecat,
dataType: "json"
}).done(function (content){
if(content.files.length){
$(".wpfd-content-tree[data-category=" + tree_sourcecat + "] .tree-download-category").removeClass("display-download-category");
}else{
$(".wpfd-content-tree[data-category=" + tree_sourcecat + "] .tree-download-category").addClass("display-download-category");
}
var template=Handlebars.compile(sourcefiles);
var html=template(content);
html=$('<textarea/>').html(html).val();
if(parseInt(current_category)===parseInt(tree_sourcecat)){
$('.wpfd-content-tree[data-category="' + tree_sourcecat + '"] .wpfd-tree-categories-files > li.ext').remove();
$('.wpfd-content-tree[data-category="' + tree_sourcecat + '"] .wpfd-tree-categories-files').append(html);
}else{
$('.wpfd-content-tree[data-category="' + tree_sourcecat + '"] .catlink[data-idcat="' + current_category + '"] + ul > li:not(.directory)').remove();
$('.wpfd-content-tree[data-category="' + tree_sourcecat + '"] .catlink[data-idcat="' + current_category + '"] + ul').append(html);
}
treeInitClickFile();
wpfdTreeDisplayDownloadedFiles();
wpfdTreeDownloadFiles();
wpfdPreviewFileNewName();
var treeCategoriesAjaxUrl=wpfdparams.wpfdajaxurl + "task=categories.display&view=categories&id=" + current_category;
if(wpfdTreeCategoriesLocalCache.exist(treeCategoriesAjaxUrl)){
wpfdTreeCategoriesLocalCache.remove(treeCategoriesAjaxUrl);
}
var ordering=$(".wpfd-content-tree.wpfd-content-multi[data-category=" + sourcecat + "]").find('#current_ordering_' + sourcecat).val();
var orderingDirection=$(".wpfd-content-tree.wpfd-content-multi[data-category=" + sourcecat + "]").find('#current_ordering_direction_' + sourcecat).val();
var params=$.param({
task: 'files.display',
view: 'files',
id: current_category,
rootcat: sourcecat,
orderCol: ordering,
orderDir: orderingDirection,
show_files: 1
});
var treeFilesAjaxUrl=wpfdparams.wpfdajaxurl + params;
if(wpfdTreeFilesLocalCache.exist(treeFilesAjaxUrl)){
wpfdTreeFilesLocalCache.remove(treeFilesAjaxUrl);
}});
}}
});
});
uploader.assignBrowse($(currentContainer).find('#upload_button'));
uploader.assignBrowse($(currentContainer).find('#upload_folder_button'), true);
uploader.assignDrop($(currentContainer).find('.jsWpfdFrontUpload'));
};
window.tree_load=function (sourcecat, category, elem, loadcats){
if(!jQuery.isEmptyObject(loadcats)){
wantDelete(category, loadcats);
}
var pathname=window.location.href.replace(window.location.hash, '');
var ul=elem.parent().children('ul');
$('.wpfd-content-tree').find('.active').removeClass('active');
elem.parent().addClass('active');
if(ul.length > 0){
ul.slideUp(400, null, function (){
$(this).remove();
elem.parent().removeClass('open expanded').addClass('collapsed');
elem.parent().removeClass('wpfd-loading-tree');
elem.parent().find('.wpfd-loading-tree-bg').remove();
inputSelect(sourcecat);
});
var root_linkdownload_cat=$(".wpfd-content-tree[data-category=" + sourcecat + "] #root_linkdownload_cat").val();
var root_countfile_cat=$(".wpfd-content-tree[data-category=" + sourcecat + "] #root_countfile_cat").val();
$(".wpfd-content-tree[data-category=" + sourcecat + "] .tree-download-category").attr('href', root_linkdownload_cat);
if(root_countfile_cat!=="0"){
$(".wpfd-content-tree[data-category=" + sourcecat + "] .tree-download-category").removeClass("display-download-category");
}else{
$(".wpfd-content-tree[data-category=" + sourcecat + "] .tree-download-category").addClass("display-download-category");
}
return;
}else{
elem.parent().addClass('wpfd-loading-tree');
elem.parent().prepend($('#wpfd-loading-tree-wrap').html());
}
if($(elem).hasClass('clicked')){
return;
}
$(elem).addClass('clicked');
var tree_empty_subcategories=$(".wpfd-content-tree[data-category=" + sourcecat + "] #wpfd_is_empty_subcategories");
var tree_empty_files=$(".wpfd-content-tree[data-category=" + sourcecat + "] #wpfd_is_empty_files");
var treeCategoriesAjaxUrl=wpfdparams.wpfdajaxurl + "task=categories.display&view=categories&id=" + category;
if(tree_empty_subcategories.length){
tree_empty_subcategories.val('1');
}
if(tree_empty_files.length){
tree_empty_files.val('1');
}
$.ajax({
url: treeCategoriesAjaxUrl,
dataType: "json",
cache: true,
beforeSend: function (){
if($(".wpfd-content-tree[data-category=" + sourcecat + "]").find('.wpfd-form-search-file-category').length){
$(".wpfd-content-tree[data-category=" + sourcecat + "]").find('.wpfd-form-search-file-category').remove();
}
if(wpfdTreeCategoriesLocalCache.exist(treeCategoriesAjaxUrl)){
var treeCategoriesTrigger=wpfdTreeCategoriesLocalCache.get(treeCategoriesAjaxUrl);
wpfdTreeCategoriesLocalCacheTrigger(treeCategoriesTrigger, sourcecat, elem, loadcats, category, pathname, tree_empty_subcategories, tree_empty_files);
$('.wpfd-content-tree[data-category=' + sourcecat + '] input[name="id_category"]').val(category);
return false;
}
return true;
}}).done(function (categories){
wpfdTreeCategoriesLocalCache.set(treeCategoriesAjaxUrl, categories);
var current_category_obj=categories.category;
var sourceCatName=$(".wpfd-content-tree[data-category=" + sourcecat + "]").find('.wpfd-category-theme-title').text();
if(sourcecat=='all_0'){
tree_cParents[sourcecat]={parent: 0, term_id: 0, name: wpfdparams.translates.wpfd_all_categories};}else{
tree_cParents[sourcecat]={parent: 0, term_id: parseInt(sourcecat), name: sourceCatName};}
tree_cParents[current_category_obj.term_id]={parent: current_category_obj.parent, term_id: current_category_obj.term_id, name: current_category_obj.name};
if(categories.categories.length){
var listChildCategories=categories.categories;
for (var i=0; i < listChildCategories.length; i++){
var childCategory=listChildCategories[i];
tree_cParents[childCategory.term_id]={parent: childCategory.parent, term_id: childCategory.term_id, name: childCategory.name};}}
var $displayFileSearch=$(".wpfd-content-tree[data-category=" + sourcecat + "]").find('.wpfd_root_category_display_file_search');
if($displayFileSearch.length){
var $themeName=$(".wpfd-content-tree[data-category=" + sourcecat + "]").find('.wpfd_root_category_theme').val();
if(typeof (categories.category.correctConvertCategoryId)==='undefined'){
categories.category.correctConvertCategoryId=0;
}
var $searchContent='<form action="" id="adminForm-'+ categories.category.term_id +'" class="wpfd-adminForm wpfd-form-search-file-category" name="adminForm" method="post">' +
'<div id="loader" style="display:none; text-align: center">' +
'<img src="'+ wpfdparams.wpfd_plugin_url +'/app/site/assets/images/searchloader.svg" style="margin: 0 auto"/>' +
'</div>' +
'<div class="box-search-filter wpfd-category-search-section">' +
'<div class="searchSection">' +
'<div class="only-file input-group clearfix wpfd_search_input" id="Search_container">' +
'<img src="'+ wpfdparams.wpfd_plugin_url +'/app/site/assets/images/search-24.svg" class="material-icons wpfd-icon-search wpfd-search-file-category-icon" />' +
'<input type="text" class="pull-left required txtfilename" name="q" id="txtfilename" autocomplete="off" placeholder="'+ wpfdparams.translates.msg_search_file_category_placeholder +'" value="" />' +
'</div>' +
'<button id="btnsearchbelow" class="btnsearchbelow wpfd-btnsearchbelow" type="button">'+ wpfdparams.translates.msg_search_file_category_search +'</button>' +
'</div>' +
'<input type="hidden" id="filter_catid" class="chzn-select filter_catid" name="catid" value="'+ categories.category.correctConvertCategoryId +'" data-cattype="" data-slug="" />' +
'<input type="hidden" name="theme" value="'+ $themeName +'">' +
'<input type="hidden" name="limit" value="15">' +
'<div id="wpfd-results" class="wpfd-results list-results"></div>' +
'</div>' +
'</form>';
$(".wpfd-content-tree[data-category=" + sourcecat + "]").prepend($searchContent);
wpfdTreeSearchFileCategoryHandle();
}
window.history.pushState('', document.title, pathname + '#' + sourcecat + '-' + category + '-' + categories.category.slug);
if(typeof (sourcecategories)==='undefined'){
sourcecategories=$('#wpfd-template-tree-categories').html();
}
var template=Handlebars.compile(sourcecategories);
var html=template(categories);
if(categories.categories.length > 0){
elem.parents('li').append('<ul style="display:none;">' + html + '</ul>');
$(".wpfd-content-tree[data-category=" + sourcecat + "] a.catlink:not(.breadcrumbs a.catlink)").unbind('click.cat').bind('click.cat', function (e){
e.preventDefault();
tree_load($(this).parents('.wpfd-content-tree').data('category'), $(this).data('idcat'), $(this));
tree_breadcrum(sourcecat, $(this).data('idcat'), $(this));
$('.wpfd-content-tree[data-category=' + sourcecat + '] input[name="id_category"]').val($(this).data('idcat'));
treeInitClickFile();
var folderClass=$(this).parent().attr('class');
if(folderClass.indexOf('expanded')!==-1||folderClass.indexOf('open')!==-1){
$(this).parent().find('> .catlink .zmdi.zmdi-folder-outline').removeClass('zmdi-folder-outline').addClass('zmdi-folder');
}else if(folderClass.indexOf('collapsed')!==-1){
$(this).parent().find('> .catlink .zmdi.zmdi-folder').removeClass('zmdi-folder').addClass('zmdi-folder-outline');
}else{
}});
}
if(categories.category.breadcrumbs!==undefined){
if(sourcecat.toString()==='all_0'){
categories.category.breadcrumbs=allCategoriesDividerBreadcrumbs + categories.category.breadcrumbs;
}
$(".wpfd-content-tree[data-category=" + sourcecat + "] .breadcrumbs").html(categories.category.breadcrumbs);
$('.wpfd-content-tree[data-category=' + sourcecat + '] .breadcrumbs a.catlink').addClass('breadcrumblink');
$('.wpfd-content-tree[data-category=' + sourcecat + '] .breadcrumbs a.catlink').unbind('click.cat').bind('click.cat', function (e){
e.preventDefault();
$(this).parents('.wpfd-content-tree').find('a.catlink[data-idcat='+ $(this).data('idcat') +']:not(.breadcrumblink)').parent().find('ul li.directory').removeClass('expanded').addClass('collapsed');
$(this).parents('.wpfd-content-tree').find('a.catlink[data-idcat='+ $(this).data('idcat') +']:not(.breadcrumblink)').parent().find('ul li.directory > ul').hide();
if(parseInt($(this).data('idcat'))===parseInt(sourcecat)){
$(this).parents('.wpfd-content-tree').find('.wpfd-tree-categories-files > li.directory').removeClass('expanded').addClass('collapsed');
$(this).parents('.wpfd-content-tree').find('.wpfd-tree-categories-files > li.directory > ul').hide();
}
tree_load($(this).parents('.wpfd-content-tree').data('category'), $(this).data('idcat'), $(this));
tree_breadcrum($(this).parents('.wpfd-content-tree').data('category'), $(this).data('idcat'), $(this));
$(this).parents('.wpfd-content-tree').find('a.catlink[data-idcat='+ $(this).data('idcat') +']:not(.breadcrumblink)').parent().addClass('active');
treeInitClickFile();
});
$('.wpfd-all-categories-link').on('click', function (e){
e.preventDefault();
$('.wpfd-content-tree[data-category=' + sourcecat + ']').find('ul li.directory').removeClass('expanded').addClass('collapsed');
$('.wpfd-content-tree[data-category=' + sourcecat + ']').find('ul li.directory > ul').hide();
$('.wpfd-content-tree[data-category=' + sourcecat + ']').find('.wpfd-upload-form').remove();
$('.wpfd-content-tree[data-category=' + sourcecat + '] .breadcrumbs').empty().html(allCategoriesBreadcrumbs);
treeInitClickFile();
window.history.pushState('', document.title, pathname + '#' + sourcecat + '-all_0-' + categories.category.slug);
});
}
tree_breadcrum(sourcecat, category, elem);
$('.wpfd-content-tree[data-category=' + sourcecat + '] input[name="id_category"]').val(category);
$(".wpfd-content-tree[data-category=" + sourcecat + "] .tree-download-category").attr('href', categories.category.linkdownload_cat);
var ordering=$(".wpfd-content-tree.wpfd-content-multi[data-category=" + sourcecat + "]").find('#current_ordering_' + sourcecat).val();
var orderingDirection=$(".wpfd-content-tree.wpfd-content-multi[data-category=" + sourcecat + "]").find('#current_ordering_direction_' + sourcecat).val();
var rootCategoryTheme=$(".wpfd-content-tree.wpfd-content-multi[data-category=" + sourcecat + "]").find('#wpfd_root_category_theme').val();
var params=$.param({
task: 'files.display',
view: 'files',
id: category,
rootcat: sourcecat,
orderCol: ordering,
orderDir: orderingDirection,
show_files: 1,
rootCategoryTheme: rootCategoryTheme
});
if(tree_empty_subcategories.length){
tree_empty_subcategories.val(categories.categories.length);
tree_fire_empty_category_message(sourcecat, elem);
}
var treeFilesAjaxUrl=wpfdparams.wpfdajaxurl + params;
$.ajax({
url: treeFilesAjaxUrl,
dataType: "json",
cache: true,
beforeSend: function (){
if(wpfdTreeFilesLocalCache.exist(treeFilesAjaxUrl)){
var treeFilesTrigger=wpfdTreeFilesLocalCache.get(treeFilesAjaxUrl);
wpfdTreeFilesLocalCacheTrigger(treeFilesTrigger, sourcecat, elem, loadcats, tree_empty_files, treeFilesAjaxUrl);
return false;
}
return true;
}}).done(function (content){
wpfdTreeFilesLocalCache.set(treeFilesAjaxUrl, content);
if(typeof (content.categoryPassword)!=='undefined'&&content.categoryPassword.length){
$(".wpfd-content-tree[data-category=" + sourcecat + "] .tree-download-category").hide();
$(".wpfd-content-tree[data-category=" + sourcecat + "] .tree-download-category").attr('href', '#');
$(".wpfd-content-tree[data-category=" + sourcecat + "] .tree-download-category").addClass('tree-download-category-password-protection');
var category_pwf='<div class="category-pw-form" style="color: #999999">' + content.categoryPassword + '</div>';
if(elem.parent().children('ul').length===0){
elem.parent().append('<ul style="display:none;">' + category_pwf + '</ul>');
}else{
elem.parent().children('ul li.directory').remove();
elem.parent().children('ul').prepend(category_pwf);
}
treeInitClickFile();
elem.parent().children('ul').slideDown(400, null, function (){
elem.parent().addClass('open expanded');
elem.parent().removeClass('wpfd-loading-tree collapsed');
elem.parent().find('.wpfd-loading-tree-bg').remove();
});
$('.category-pw-form').parent().find('li.directory').hide();
}else{
if(content.files.length){
$(".wpfd-content-tree[data-category=" + sourcecat + "] .tree-download-category").removeClass("display-download-category");
}else{
$(".wpfd-content-tree[data-category=" + sourcecat + "] .tree-download-category").addClass("display-download-category");
}
if($(".wpfd-content-tree[data-category=" + sourcecat + "] .tree-download-category").hasClass('tree-download-category-password-protection')){
$(".wpfd-content-tree[data-category=" + sourcecat + "] .tree-download-category").removeClass('tree-download-category-password-protection');
$(".wpfd-content-tree[data-category=" + sourcecat + "] .tree-download-category").show();
}
if(typeof (sourcefiles)==='undefined'){
sourcefiles=$("#wpfd-template-tree-files").html();
}
var template=Handlebars.compile(sourcefiles);
var html=template(content);
html=$('<textarea/>').html(html).val();
if(elem.parent().children('ul').length===0){
elem.parent().append('<ul style="display:none;">' + html + '</ul>');
}else{
elem.parent().children('ul').append(html);
}
if($(".wpfd-content-tree[data-category=" + sourcecat + "] .wpfd-upload-form").length){
$(".wpfd-content-tree[data-category=" + sourcecat + "] .wpfd-upload-form").remove();
}
if(typeof (content.filepasswords)!=='undefined'){
$.each(content.filepasswords, function(file_id, pw_form){
var protected_file=$(".wpfd-content-tree[data-category=" + sourcecat + "]").find('.wpfd-file-link[data-id="' + file_id + '"]').parent();
protected_file.empty();
protected_file.addClass('wpfd-password-protection-form');
protected_file.append(pw_form);
});
}
if(content.uploadform!==undefined&&content.uploadform.length){
var upload_form_html='<div class="wpfd-upload-form" style="margin: 20px 10px">';
upload_form_html +=content.uploadform;
upload_form_html +='</div>';
$(".wpfd-content-tree[data-category=" + sourcecat + "]").append(upload_form_html);
if(typeof (Wpfd)==='undefined'){
Wpfd={};}
var containers=$(".wpfd-content-tree[data-category=" + sourcecat + "] div[class*=wpfdUploadForm]");
if(containers.length > 0){
containers.each(function (i, el){
initUploader($(el));
});
}}
treeInitClickFile();
elem.parent().children('ul').slideDown(400, null, function (){
elem.parent().addClass('open expanded');
elem.parent().removeClass('wpfd-loading-tree collapsed');
elem.parent().find('.wpfd-loading-tree-bg').remove();
});
if(!jQuery.isEmptyObject(loadcats)){
var ccat=loadcats[0];
tree_load(sourcecat, ccat, $('.wpfd-content-tree [data-idcat="' + ccat + '"]'), loadcats);
}
inputSelect(sourcecat);
if(tree_empty_files.length){
tree_empty_files.val(content.files.length);
tree_fire_empty_category_message(sourcecat, elem);
}
if($(".wpfd-content-tree[data-category=" + sourcecat + "] + .wpfd-pagination").length){
$(".wpfd-content-tree[data-category=" + sourcecat + "] + .wpfd-pagination").remove();
}
wpfdTreeDisplayDownloadedFiles();
wpfdTreeDownloadFiles();
wpfdPreviewFileNewName();
}});
$(elem).removeClass('clicked');
});
}
window.tree_breadcrum=function (sourcecat, catid, category, tree_cParents2){
var links=[];
var current_Cat=tree_cParents[catid];
if(current_Cat==undefined){
if(!jQuery.isEmptyObject(tree_cParents2)){
tree_cParents=tree_cParents2;
current_Cat=tree_cParents2[catid];
}else{
return;
}}
links.unshift(current_Cat);
if(current_Cat.parent!==0){
while (tree_cParents[current_Cat.parent]){
current_Cat=tree_cParents[current_Cat.parent];
links.unshift(current_Cat);
}}
var html='';
if(sourcecat.toString()==='all_0'&&catid.toString()!=='all_0'&&parseInt(catid)!==0){
html=allCategoriesDividerBreadcrumbs;
}
for (var i=0; i < links.length; i++){
if(i < links.length - 1){
if(links[i].term_id!="all_0"){
html +='<li><a class="catlink" data-idcat="' + links[i].term_id + '" href="javascript:void(0)">';
html +=links[i].name + '</a><span class="divider"> &gt; </span></li>';
}}else{
if(links[i].term_id!="all_0"){
html +='<li><span>' + links[i].name + '</span></li>';
}else{
html +='<li><span>' + wpfdparams.translates.wpfd_all_categories + '</span></li>';
}}
}
$(".wpfd-content-tree.wpfd-content-multi[data-category=" + sourcecat + "] .wpfd-breadcrumbs-tree").html(html);
$(".wpfd-content-tree.wpfd-content-multi[data-category=" + sourcecat + "] .wpfd-breadcrumbs-tree .catlink").click(function (e){
e.preventDefault();
tree_load($(this).parents('.wpfd-content-tree').data('category'), $(this).data('idcat'), $(this));
$(".wpfd-content-tree.wpfd-content-multi[data-category=" + sourcecat + "] .wpfd-tree-categories-files").find('.directory').removeClass('active');
$(".wpfd-content-tree.wpfd-content-multi[data-category=" + sourcecat + "] .wpfd-tree-categories-files .catlink[data-idcat="+$(this).data('idcat')+"]").parent().addClass('active');
tree_breadcrum(sourcecat, $(this).data('idcat'), $(this));
treeInitClickFile();
});
}
function tree_fire_empty_category_message(category_id, element){
if(!category_id){
return;
}
var root_category='.wpfd-content-tree[data-category=' + category_id + ']';
var display_empty_category_message=$(root_category).find('#wpfd_display_empty_category_message').val();
var empty_category_message_val=$(root_category).find('#wpfd_empty_category_message_val').val();
var is_empty_subcategories=$(root_category).find('#wpfd_is_empty_subcategories').val();
var is_empty_files=$(root_category).find('#wpfd_is_empty_files').val();
if(parseInt(display_empty_category_message)!==1
|| parseInt(is_empty_subcategories)!==0||parseInt(is_empty_files)!==0){
return;
}
var code='<li class="wpfd-empty-category-message">';
code +=empty_category_message_val;
code +='</li>';
$(root_category).find('.wpfd-empty-category-message').remove();
element.parent().children('ul').prepend(code);
}
var destroy_upload=$('.wpfd-upload-form.destroy');
if(destroy_upload.length){
destroy_upload.remove();
}
function wpfdTreeCategoriesLocalCacheTrigger(treeCategoriesTrigger, sourcecat, elem, loadcats, category, pathname, tree_empty_subcategories, tree_empty_files){
var $displayFileSearch=$(".wpfd-content-tree[data-category=" + sourcecat + "]").find('.wpfd_root_category_display_file_search');
if($displayFileSearch.length){
var $themeName=$(".wpfd-content-tree[data-category=" + sourcecat + "]").find('.wpfd_root_category_theme').val();
var $searchContent='<form action="" id="adminForm-'+ treeCategoriesTrigger.category.term_id +'" class="wpfd-adminForm wpfd-form-search-file-category" name="adminForm" method="post">' +
'<div id="loader" style="display:none; text-align: center">' +
'<img src="'+ wpfdparams.wpfd_plugin_url +'/app/site/assets/images/searchloader.svg" style="margin: 0 auto"/>' +
'</div>' +
'<div class="box-search-filter wpfd-category-search-section">' +
'<div class="searchSection">' +
'<div class="only-file input-group clearfix wpfd_search_input" id="Search_container">' +
'<img src="'+ wpfdparams.wpfd_plugin_url +'/app/site/assets/images/search-24.svg" class="material-icons wpfd-icon-search wpfd-search-file-category-icon" />' +
'<input type="text" class="pull-left required txtfilename" name="q" id="txtfilename" autocomplete="off" placeholder="'+ wpfdparams.translates.msg_search_file_category_placeholder +'" value="" />' +
'</div>' +
'<button id="btnsearchbelow" class="btnsearchbelow wpfd-btnsearchbelow" type="button">'+ wpfdparams.translates.msg_search_file_category_search +'</button>' +
'</div>' +
'<input type="hidden" id="filter_catid" class="chzn-select filter_catid" name="catid" value="'+ treeCategoriesTrigger.category.correctConvertCategoryId +'" data-cattype="" data-slug="" />' +
'<input type="hidden" name="theme" value="'+ $themeName +'">' +
'<input type="hidden" name="limit" value="15">' +
'<div id="wpfd-results" class="wpfd-results list-results"></div>' +
'</div>' +
'</form>';
$(".wpfd-content-tree[data-category=" + sourcecat + "]").prepend($searchContent);
wpfdTreeSearchFileCategoryHandle();
}
window.history.pushState('', document.title, pathname + '#' + sourcecat + '-' + category + '-' + treeCategoriesTrigger.category.slug);
var template=Handlebars.compile(sourcecategories);
var html=template(treeCategoriesTrigger);
if(treeCategoriesTrigger.categories.length > 0){
elem.parents('li').append('<ul style="display:none;">' + html + '</ul>');
$(".wpfd-content-tree[data-category=" + sourcecat + "] a.catlink").unbind('click.cat').bind('click.cat', function (e){
e.preventDefault();
tree_load($(this).parents('.wpfd-content-tree').data('category'), $(this).data('idcat'), $(this));
tree_breadcrum(sourcecat, $(this).data('idcat'), $(this));
treeInitClickFile();
var folderClass=$(this).parent().attr('class');
if(folderClass.indexOf('expanded')!==-1||folderClass.indexOf('open')!==-1){
$(this).parent().find('> .catlink .zmdi.zmdi-folder-outline').removeClass('zmdi-folder-outline').addClass('zmdi-folder');
}else if(folderClass.indexOf('collapsed')!==-1){
$(this).parent().find('> .catlink .zmdi.zmdi-folder').removeClass('zmdi-folder').addClass('zmdi-folder-outline');
}else{
}});
}
if(treeCategoriesTrigger.category.breadcrumbs!==undefined){
$(".wpfd-content-tree[data-category=" + sourcecat + "] .breadcrumbs").html(treeCategoriesTrigger.category.breadcrumbs);
$('.wpfd-content-tree[data-category=' + sourcecat + '] .breadcrumbs a.catlink').addClass('breadcrumblink');
$('.wpfd-content-tree[data-category=' + sourcecat + '] .breadcrumbs a.catlink').unbind('click.cat').bind('click.cat', function (e){
e.preventDefault();
$(this).parents('.wpfd-content-tree').find('a.catlink[data-idcat='+ $(this).data('idcat') +']:not(.breadcrumblink)').parent().find('ul li.directory').removeClass('expanded').addClass('collapsed');
$(this).parents('.wpfd-content-tree').find('a.catlink[data-idcat='+ $(this).data('idcat') +']:not(.breadcrumblink)').parent().find('ul li.directory > ul').hide();
if(parseInt($(this).data('idcat'))===parseInt(sourcecat)){
$(this).parents('.wpfd-content-tree').find('.wpfd-tree-categories-files > li.directory').removeClass('expanded').addClass('collapsed');
$(this).parents('.wpfd-content-tree').find('.wpfd-tree-categories-files > li.directory > ul').hide();
}
tree_load($(this).parents('.wpfd-content-tree').data('category'), $(this).data('idcat'), $(this));
tree_breadcrum($(this).parents('.wpfd-content-tree').data('category'), $(this).data('idcat'), $(this));
$(this).parents('.wpfd-content-tree').find('a.catlink[data-idcat='+ $(this).data('idcat') +']:not(.breadcrumblink)').parent().addClass('active');
treeInitClickFile();
});
$('.wpfd-all-categories-link').on('click', function (e){
e.preventDefault();
$('.wpfd-content-tree[data-category=' + sourcecat + ']').find('ul li.directory').removeClass('expanded').addClass('collapsed');
$('.wpfd-content-tree[data-category=' + sourcecat + ']').find('ul li.directory > ul').hide();
$('.wpfd-content-tree[data-category=' + sourcecat + ']').find('.wpfd-upload-form').remove();
$('.wpfd-content-tree[data-category=' + sourcecat + '] .breadcrumbs').empty().html(allCategoriesBreadcrumbs);
treeInitClickFile();
});
}
$(".wpfd-content-tree[data-category=" + sourcecat + "] .tree-download-category").attr('href', treeCategoriesTrigger.category.linkdownload_cat);
var ordering=$(".wpfd-content-tree.wpfd-content-multi[data-category=" + sourcecat + "]").find('#current_ordering_' + sourcecat).val();
var orderingDirection=$(".wpfd-content-tree.wpfd-content-multi[data-category=" + sourcecat + "]").find('#current_ordering_direction_' + sourcecat).val();
var params=$.param({
task: 'files.display',
view: 'files',
id: category,
rootcat: sourcecat,
orderCol: ordering,
orderDir: orderingDirection,
show_files: 1
});
if(tree_empty_subcategories.length){
tree_empty_subcategories.val(treeCategoriesTrigger.categories.length);
tree_fire_empty_category_message(sourcecat, elem);
}
var treeFilesAjaxUrl=wpfdparams.wpfdajaxurl + params;
$.ajax({
url: treeFilesAjaxUrl,
dataType: "json",
cache: true,
beforeSend: function (){
if(wpfdTreeFilesLocalCache.exist(treeFilesAjaxUrl)){
var treeFilesTrigger=wpfdTreeFilesLocalCache.get(treeFilesAjaxUrl);
wpfdTreeFilesLocalCacheTrigger(treeFilesTrigger, sourcecat, elem, loadcats, tree_empty_files, treeFilesAjaxUrl);
return false;
}
return true;
}}).done(function (content){
wpfdTreeFilesLocalCache.set(treeFilesAjaxUrl, content);
if(typeof (content.categoryPassword)!=='undefined'&&content.categoryPassword.length){
$(".wpfd-content-tree[data-category=" + sourcecat + "] .tree-download-category").hide();
$(".wpfd-content-tree[data-category=" + sourcecat + "] .tree-download-category").attr('href', '#');
$(".wpfd-content-tree[data-category=" + sourcecat + "] .tree-download-category").addClass('tree-download-category-password-protection');
var category_pwf='<div class="category-pw-form" style="color: #999999">' + content.categoryPassword + '</div>';
if(elem.parent().children('ul').length===0){
elem.parent().append('<ul style="display:none;">' + category_pwf + '</ul>');
}else{
elem.parent().children('ul li.directory').remove();
elem.parent().children('ul').prepend(category_pwf);
}
treeInitClickFile();
elem.parent().children('ul').slideDown(400, null, function (){
elem.parent().addClass('open expanded');
elem.parent().removeClass('wpfd-loading-tree collapsed');
elem.parent().find('.wpfd-loading-tree-bg').remove();
});
$('.category-pw-form').parent().find('li.directory').hide();
}else{
if(content.files.length){
$(".wpfd-content-tree[data-category=" + sourcecat + "] .tree-download-category").removeClass("display-download-category");
}else{
$(".wpfd-content-tree[data-category=" + sourcecat + "] .tree-download-category").addClass("display-download-category");
}
if($(".wpfd-content-tree[data-category=" + sourcecat + "] .tree-download-category").hasClass('tree-download-category-password-protection')){
$(".wpfd-content-tree[data-category=" + sourcecat + "] .tree-download-category").removeClass('tree-download-category-password-protection');
$(".wpfd-content-tree[data-category=" + sourcecat + "] .tree-download-category").show();
}
var template=Handlebars.compile(sourcefiles);
var html=template(content);
html=$('<textarea/>').html(html).val();
if(elem.parent().children('ul').length===0){
elem.parent().append('<ul style="display:none;">' + html + '</ul>');
}else{
elem.parent().children('ul').append(html);
}
if($(".wpfd-content-tree[data-category=" + sourcecat + "] .wpfd-upload-form").length){
$(".wpfd-content-tree[data-category=" + sourcecat + "] .wpfd-upload-form").remove();
}
if(typeof (content.filepasswords)!=='undefined'){
$.each(content.filepasswords, function(file_id, pw_form){
var protected_file=$(".wpfd-content-tree[data-category=" + sourcecat + "]").find('.wpfd-file-link[data-id="' + file_id + '"]').parent();
protected_file.empty();
protected_file.addClass('wpfd-password-protection-form');
protected_file.append(pw_form);
});
}
if(content.uploadform!==undefined&&content.uploadform.length){
var upload_form_html='<div class="wpfd-upload-form" style="margin: 20px 10px">';
upload_form_html +=content.uploadform;
upload_form_html +='</div>';
$(".wpfd-content-tree[data-category=" + sourcecat + "]").append(upload_form_html);
if(typeof (Wpfd)==='undefined'){
Wpfd={};}
var containers=$(".wpfd-content-tree[data-category=" + sourcecat + "] div[class*=wpfdUploadForm]");
if(containers.length > 0){
containers.each(function (i, el){
initUploader($(el));
});
}}
treeInitClickFile();
elem.parent().children('ul').slideDown(400, null, function (){
elem.parent().addClass('open expanded');
elem.parent().removeClass('wpfd-loading-tree collapsed');
elem.parent().find('.wpfd-loading-tree-bg').remove();
});
if(!jQuery.isEmptyObject(loadcats)){
var ccat=loadcats[0];
tree_load(sourcecat, ccat, $('.wpfd-content-tree [data-idcat="' + ccat + '"]'), loadcats);
}
inputSelect(sourcecat);
if(tree_empty_files.length){
tree_empty_files.val(content.files.length);
tree_fire_empty_category_message(sourcecat, elem);
}
wpfdTreeDisplayDownloadedFiles();
wpfdTreeDownloadFiles();
wpfdPreviewFileNewName();
}});
$(elem).removeClass('clicked');
}
function wpfdTreeFilesLocalCacheTrigger(treeFilesTrigger, sourcecat, elem, loadcats, tree_empty_files, treeFilesAjaxUrl){
if(typeof (treeFilesTrigger.categoryPassword)!=='undefined'&&treeFilesTrigger.categoryPassword.length){
$(".wpfd-content-tree[data-category=" + sourcecat + "] .tree-download-category").hide();
$(".wpfd-content-tree[data-category=" + sourcecat + "] .tree-download-category").attr('href', '#');
$(".wpfd-content-tree[data-category=" + sourcecat + "] .tree-download-category").addClass('tree-download-category-password-protection');
var category_pwf='<div class="category-pw-form" style="color: #999999">' + treeFilesTrigger.categoryPassword + '</div>';
if(elem.parent().children('ul').length===0){
elem.parent().append('<ul style="display:none;">' + category_pwf + '</ul>');
}else{
elem.parent().children('ul li.directory').remove();
elem.parent().children('ul').prepend(category_pwf);
}
treeInitClickFile();
elem.parent().children('ul').slideDown(400, null, function (){
elem.parent().addClass('open expanded');
elem.parent().removeClass('wpfd-loading-tree collapsed');
elem.parent().find('.wpfd-loading-tree-bg').remove();
});
$('.category-pw-form').parent().find('li.directory').hide();
}else{
if(treeFilesTrigger.files.length){
$(".wpfd-content-tree[data-category=" + sourcecat + "] .tree-download-category").removeClass("display-download-category");
}else{
$(".wpfd-content-tree[data-category=" + sourcecat + "] .tree-download-category").addClass("display-download-category");
}
if($(".wpfd-content-tree[data-category=" + sourcecat + "] .tree-download-category").hasClass('tree-download-category-password-protection')){
$(".wpfd-content-tree[data-category=" + sourcecat + "] .tree-download-category").removeClass('tree-download-category-password-protection');
$(".wpfd-content-tree[data-category=" + sourcecat + "] .tree-download-category").show();
}
var template=Handlebars.compile(sourcefiles);
var html=template(treeFilesTrigger);
html=$('<textarea/>').html(html).val();
if(elem.parent().children('ul').length===0){
elem.parent().append('<ul style="display:none;">' + html + '</ul>');
}else{
elem.parent().children('ul').append(html);
}
if($(".wpfd-content-tree[data-category=" + sourcecat + "] .wpfd-upload-form").length){
$(".wpfd-content-tree[data-category=" + sourcecat + "] .wpfd-upload-form").remove();
}
if(typeof (treeFilesTrigger.filepasswords)!=='undefined'){
$.each(treeFilesTrigger.filepasswords, function(file_id, pw_form){
var protected_file=$(".wpfd-content-tree[data-category=" + sourcecat + "]").find('.wpfd-file-link[data-id="' + file_id + '"]').parent();
protected_file.empty();
protected_file.addClass('wpfd-password-protection-form');
protected_file.append(pw_form);
});
}
if(treeFilesTrigger.uploadform!==undefined&&treeFilesTrigger.uploadform.length){
var upload_form_html='<div class="wpfd-upload-form" style="margin: 20px 10px">';
upload_form_html +=treeFilesTrigger.uploadform;
upload_form_html +='</div>';
$(".wpfd-content-tree[data-category=" + sourcecat + "]").append(upload_form_html);
if(typeof (Wpfd)==='undefined'){
Wpfd={};}
var containers=$(".wpfd-content-tree[data-category=" + sourcecat + "] div[class*=wpfdUploadForm]");
if(containers.length > 0){
containers.each(function (i, el){
initUploader($(el));
});
}}
treeInitClickFile();
elem.parent().children('ul').slideDown(400, null, function (){
elem.parent().addClass('open expanded');
elem.parent().removeClass('wpfd-loading-tree collapsed');
elem.parent().find('.wpfd-loading-tree-bg').remove();
});
if(!jQuery.isEmptyObject(loadcats)){
var ccat=loadcats[0];
tree_load(sourcecat, ccat, $('.wpfd-content-tree [data-idcat="' + ccat + '"]'), loadcats);
}
inputSelect(sourcecat);
if(tree_empty_files.length){
tree_empty_files.val(treeFilesTrigger.files.length);
tree_fire_empty_category_message(sourcecat, elem);
}
wpfdTreeDisplayDownloadedFiles();
wpfdTreeDownloadFiles();
wpfdPreviewFileNewName();
}}
function wpfdTreeCategoryAjaxSearch(element, ordering, direction, pushState=true){
var $=jQuery;
var sform=element;
var $key=$(sform).find('input[name=q]').val();
var $placeholder=$(sform).find('input[name=q]').attr('placeholder');
if($key.toString()===$placeholder.toString()){
$key='';
}
var formData={
'q': $key,
'catid': $(sform).find('[name=catid]').val(),
'theme': $(sform).find('[name=theme]').val(),
'limit': $(sform).find('[name=limit]').val()
};
formData=cleanObj(formData);
if(jQuery.isEmptyObject(formData) ||
(typeof (formData.q)==='undefined' &&
typeof (formData.catid)!=='undefined' &&
parseInt(formData.catid)===0)||typeof (formData.q)==='undefined'){
$(element).find(".txtfilename").focus();
return false;
}
if((typeof ordering!=='undefined')&&ordering) formData.ordering=ordering;
if((typeof direction!=='undefined')&&direction) formData.dir=direction;
if(pushState){
var filter_url=jQuery.param(formData);
var currentUrl=window.location.search;
var pushUrl;
if(typeof URLSearchParams!=='undefined'){
var currentFilters=new URLSearchParams(currentUrl.substring(1));
Object.keys(formData).forEach(function (key){
if(currentFilters.has(key)){
currentFilters.delete(key);
}});
if(currentUrl.substring(1)==='?'&&currentFilters.toString()!==''){
pushUrl=currentFilters.toString() + '&' + filter_url;
}else{
pushUrl='?' + filter_url;
}
window.history.pushState(formData, "", pushUrl);
}}
$.ajax({
method: "POST",
url: wpfdparams.wpfdajaxurl + "task=search.display",
data: formData,
beforeSend: function (){
$(element).find(".wpfd-results").html('');
$(element).find(".wpfd-results").prepend($(element).find("#loader").clone().show());
},
success: function (result){
$(element).find(".wpfd_search_file_suggestion").html('');
$(element).find(".wpfd_search_file_suggestion").fadeOut(300);
$(element).find(".wpfd-results").html(result);
if($(element).find(".wpfd-results .wpfd-form-search-file-category").length){
$(element).find(".wpfd-results .wpfd-form-search-file-category").remove();
}
wpfdTreeInitSorting();
if(typeof wpfdColorboxInit!=='undefined'){
wpfdColorboxInit();
}}
});
}
function wpfdTreeInitSorting(){
jQuery('.orderingCol').click(function (e){
e.preventDefault();
var ordering=jQuery(this).data('ordering');
var direction=jQuery(this).data('direction');
wpfdTreeCategoryAjaxSearch(ordering, direction);
});
jQuery(".list-results #limit").change(function (e){
e.preventDefault();
jQuery('input[name="limit"]').val(jQuery(this).val());
var formID='#' + jQuery(this).closest('form').attr('id');
wpfdTreeCategoryAjaxSearch(formID);
return false;
});
}
function wpfdTreeSearchFileCategoryHandle(){
$(".wpfd-content .wpfd-adminForm").submit(function (e){
e.preventDefault();
return false;
});
$('.wpfd-content .txtfilename').on('keyup', function (e){
var $this=$(this);
if(e.keyCode===13||e.which===13||e.key==='Enter'){
e.preventDefault();
if($this.val()===''){
return;
}
var formID='#' + $this.closest('form').attr('id');
wpfdTreeCategoryAjaxSearch(formID);
return;
}});
$(".wpfd-content .btnsearchbelow").on('click', function (e){
e.preventDefault();
var formID='#' + $(this).closest('form').attr('id');
wpfdTreeCategoryAjaxSearch(formID);
return false;
});
}
wpfdTreeSearchFileCategoryHandle();
function wpfdTreeDisplayDownloadedFiles(){
var fileDownload=$('.wpfd-content.wpfd-content-tree li.ext');
var linkDownload=$('.dropblock .wpfd_downloadlink');
var user_login_id=wpfdparams.wpfd_user_login_id;
if(linkDownload.length){
linkDownload.on('click', function (){
var fileId=$(this).parents('.dropblock').data('id');
var isDownloadedFile=localStorage.getItem('wpfd_downloaded_file_' + user_login_id + '_' + fileId);
if(isDownloadedFile===null){
localStorage.setItem('wpfd_downloaded_file_' + user_login_id + '_' + fileId, 'yes');
$('.wpfd-file-link[data-id="'+ fileId +'"]').parents('li.ext').addClass('is_downloaded');
}});
}
if(fileDownload.length){
fileDownload.each(function (){
var id=$(this).find('.wpfd-file-link').data('id');
var isFileDownload=localStorage.getItem('wpfd_downloaded_file_' + user_login_id + '_' + id);
if(isFileDownload){
$(this).addClass('is_downloaded');
}});
}}
wpfdTreeDisplayDownloadedFiles();
function wpfdTreeDownloadFiles(){
if(!wpfdparams.offRedirectLinkDownloadImageFile){
$('.tree-wpfd-box.png .wpfd_downloadlink, .tree-wpfd-box.jpg .wpfd_downloadlink, .tree-wpfd-box.jpeg .wpfd_downloadlink, .tree-wpfd-box.gif .wpfd_downloadlink').on('click', function (event){
event.preventDefault();
var fileId=$(this).parents('.tree-wpfd-box').attr('data-id');
var categoryId=$(this).parents('.tree-wpfd-box').attr('data-catid');
var cloudType=$('.wpfd-content-tree').find('.wpfd_root_category_type').val();
if(!fileId||!categoryId){
return false;
}
if($(this).find('.wpfd-add-to-cart').length){
return false;
}
window.location.href=wpfdparams.site_url + "?wpfd_action=wpfd_download_file&wpfd_file_id=" + fileId + "&wpfd_category_id=" + categoryId + "&cloudType=" + cloudType;
});
}}
wpfdTreeDownloadFiles();
function wpfdPreviewFileNewName(){
$('.wpfd_previewlink').click(function (e){
var newWindow=$(this).attr('target');
var previewLink=$(this).attr('href');
var fileTitle=$(this).parents('.dropblock').find('.wpfd_downloadlink').attr('title');
var fileName=fileTitle;
fileName=fileName ? fileName:'WPFD Preview File';
if(newWindow==='_blank'&&(previewLink.indexOf('previews')!==-1)&&previewLink.indexOf('docs.google.com')===-1){
e.preventDefault();
var win=window.open(previewLink, '_blank');
win.onload=function (){
setTimeout(function (){
win.document.title=fileName;
}, 100);
setTimeout(function (){
$(win.document.head).append('<title>'+ fileName +'</title>');
}, 3000);
};
setTimeout(function (){
if(win.document.title!==fileName){
win.document.title=fileName;
}}, 1000);
setTimeout(function (){
if(win.document.title!==fileName){
win.document.title=fileName;
}}, 3000);
}});
}
wpfdPreviewFileNewName();
});
var wpfdTreeCategoriesLocalCache={
data: {},
remove: function (url){
delete wpfdTreeCategoriesLocalCache.data[url];
},
exist: function (url){
return wpfdTreeCategoriesLocalCache.data.hasOwnProperty(url)&&wpfdTreeCategoriesLocalCache.data[url]!==null;
},
get: function (url){
return wpfdTreeCategoriesLocalCache.data[url];
},
set: function (url, cachedData){
wpfdTreeCategoriesLocalCache.remove(url);
wpfdTreeCategoriesLocalCache.data[url]=cachedData;
}};
var wpfdTreeFilesLocalCache={
data: {},
remove: function (url){
delete wpfdTreeFilesLocalCache.data[url];
},
exist: function (url){
return wpfdTreeFilesLocalCache.data.hasOwnProperty(url)&&wpfdTreeFilesLocalCache.data[url]!==null;
},
get: function (url){
return wpfdTreeFilesLocalCache.data[url];
},
set: function(url, cachedData){
wpfdTreeFilesLocalCache.remove(url);
wpfdTreeFilesLocalCache.data[url]=cachedData;
}};
(function(){
"use strict";
var Resumable=function(opts){
if(!(this instanceof Resumable)){
return new Resumable(opts);
}
this.version=1.0;
this.support=(
(typeof(File)!=='undefined')
&&
(typeof(Blob)!=='undefined')
&&
(typeof(FileList)!=='undefined')
&&
(!!Blob.prototype.webkitSlice||!!Blob.prototype.mozSlice||!!Blob.prototype.slice||false)
);
if(!this.support) return(false);
var $=this;
$.files=[];
$.defaults={
chunkSize:1*1024*1024,
forceChunkSize:false,
simultaneousUploads:3,
fileParameterName:'file',
chunkNumberParameterName: 'resumableChunkNumber',
chunkSizeParameterName: 'resumableChunkSize',
currentChunkSizeParameterName: 'resumableCurrentChunkSize',
totalSizeParameterName: 'resumableTotalSize',
typeParameterName: 'resumableType',
identifierParameterName: 'resumableIdentifier',
fileNameParameterName: 'resumableFilename',
relativePathParameterName: 'resumableRelativePath',
totalChunksParameterName: 'resumableTotalChunks',
dragOverClass: 'dragover',
throttleProgressCallbacks: 0.5,
query:{},
headers:{},
preprocess:null,
preprocessFile:null,
method:'multipart',
uploadMethod: 'POST',
testMethod: 'GET',
prioritizeFirstAndLastChunk:false,
target:'/',
testTarget: null,
parameterNamespace:'',
testChunks:true,
generateUniqueIdentifier:null,
getTarget:null,
maxChunkRetries:100,
chunkRetryInterval:undefined,
permanentErrors:[400, 401, 403, 404, 409, 415, 500, 501],
maxFiles:undefined,
withCredentials:false,
xhrTimeout:0,
clearInput:true,
chunkFormat:'blob',
setChunkTypeFromFile:false,
maxFilesErrorCallback:function (files, errorCount){
var maxFiles=$.getOpt('maxFiles');
alert('Please upload no more than ' + maxFiles + ' file' + (maxFiles===1 ? '':'s') + ' at a time.');
},
minFileSize:1,
minFileSizeErrorCallback:function(file, errorCount){
alert(file.fileName||file.name +' is too small, please upload files larger than ' + $h.formatSize($.getOpt('minFileSize')) + '.');
},
maxFileSize:undefined,
maxFileSizeErrorCallback:function(file, errorCount){
alert(file.fileName||file.name +' is too large, please upload files less than ' + $h.formatSize($.getOpt('maxFileSize')) + '.');
},
fileType: [],
fileTypeErrorCallback: function(file, errorCount){
alert(file.fileName||file.name +' has type not allowed, please upload files of type ' + $.getOpt('fileType') + '.');
}};
$.opts=opts||{};
$.getOpt=function(o){
var $opt=this;
if(o instanceof Array){
var options={};
$h.each(o, function(option){
options[option]=$opt.getOpt(option);
});
return options;
}
if($opt instanceof ResumableChunk){
if(typeof $opt.opts[o]!=='undefined'){ return $opt.opts[o]; }else{ $opt=$opt.fileObj; }}
if($opt instanceof ResumableFile){
if(typeof $opt.opts[o]!=='undefined'){ return $opt.opts[o]; }else{ $opt=$opt.resumableObj; }}
if($opt instanceof Resumable){
if(typeof $opt.opts[o]!=='undefined'){ return $opt.opts[o]; }else{ return $opt.defaults[o]; }}
};
$.indexOf=function(array, obj){
if(array.indexOf){ return array.indexOf(obj); }
for (var i=0; i < array.length; i++){
if(array[i]===obj){ return i; }}
return -1;
}
$.events=[];
$.on=function(event,callback){
$.events.push(event.toLowerCase(), callback);
};
$.fire=function(){
var args=[];
for (var i=0; i<arguments.length; i++) args.push(arguments[i]);
var event=args[0].toLowerCase();
for (var i=0; i<=$.events.length; i+=2){
if($.events[i]==event) $.events[i+1].apply($,args.slice(1));
if($.events[i]=='catchall') $.events[i+1].apply(null,args);
}
if(event=='fileerror') $.fire('error', args[2], args[1]);
if(event=='fileprogress') $.fire('progress');
};
var $h={
stopEvent: function(e){
e.stopPropagation();
e.preventDefault();
},
each: function(o,callback){
if(typeof(o.length)!=='undefined'){
for (var i=0; i<o.length; i++){
if(callback(o[i])===false) return;
}}else{
for (i in o){
if(callback(i,o[i])===false) return;
}}
},
generateUniqueIdentifier:function(file, event){
var custom=$.getOpt('generateUniqueIdentifier');
if(typeof custom==='function'){
return custom(file, event);
}
var relativePath=file.webkitRelativePath||file.relativePath||file.fileName||file.name;
var size=file.size;
return(size + '-' + relativePath.replace(/[^0-9a-zA-Z_-]/img, ''));
},
contains:function(array,test){
var result=false;
$h.each(array, function(value){
if(value==test){
result=true;
return false;
}
return true;
});
return result;
},
formatSize:function(size){
if(size<1024){
return size + ' bytes';
}else if(size<1024*1024){
return (size/1024.0).toFixed(0) + ' KB';
}else if(size<1024*1024*1024){
return (size/1024.0/1024.0).toFixed(1) + ' MB';
}else{
return (size/1024.0/1024.0/1024.0).toFixed(1) + ' GB';
}},
getTarget:function(request, params){
var target=$.getOpt('target');
if(request==='test'&&$.getOpt('testTarget')){
target=$.getOpt('testTarget')==='/' ? $.getOpt('target'):$.getOpt('testTarget');
}
if(typeof target==='function'){
return target(params);
}
var separator=target.indexOf('?') < 0 ? '?':'&';
var joinedParams=params.join('&');
if(joinedParams) target=target + separator + joinedParams;
return target;
}};
var onDrop=function(e){
e.currentTarget.classList.remove($.getOpt('dragOverClass'));
$h.stopEvent(e);
if(e.dataTransfer&&e.dataTransfer.items){
loadFiles(e.dataTransfer.items, e);
}
else if(e.dataTransfer&&e.dataTransfer.files){
loadFiles(e.dataTransfer.files, e);
}};
var onDragLeave=function(e){
e.currentTarget.classList.remove($.getOpt('dragOverClass'));
};
var onDragOverEnter=function(e){
e.preventDefault();
var dt=e.dataTransfer;
if($.indexOf(dt.types, "Files") >=0){
e.stopPropagation();
dt.dropEffect="copy";
dt.effectAllowed="copy";
e.currentTarget.classList.add($.getOpt('dragOverClass'));
}else{
dt.dropEffect="none";
dt.effectAllowed="none";
}};
function processItem(item, path, items, cb){
var entry;
if(item.isFile){
return item.file(function(file){
file.relativePath=path + file.name;
items.push(file);
cb();
});
}else if(item.isDirectory){
entry=item;
}else if(item instanceof File){
items.push(item);
}
if('function'===typeof item.webkitGetAsEntry){
entry=item.webkitGetAsEntry();
}
if(entry&&entry.isDirectory){
return processDirectory(entry, path + entry.name + '/', items, cb);
}
if('function'===typeof item.getAsFile){
item=item.getAsFile();
if(item instanceof File){
item.relativePath=path + item.name;
items.push(item);
}}
cb();
}
function processCallbacks(items, cb){
if(!items||items.length===0){
return cb();
}
items[0](function(){
processCallbacks(items.slice(1), cb);
});
}
function processDirectory (directory, path, items, cb){
var dirReader=directory.createReader();
var allEntries=[];
function readEntries (){
dirReader.readEntries(function(entries){
if(entries.length){
allEntries=allEntries.concat(entries);
return readEntries();
}
processCallbacks(
allEntries.map(function(entry){
return processItem.bind(null, entry, path, items);
}),
cb
);
});
}
readEntries();
}
function loadFiles(items, event){
if(!items.length){
return;
}
$.fire('beforeAdd');
var files=[];
processCallbacks(
Array.prototype.map.call(items, function(item){
var entry=item;
if('function'===typeof item.webkitGetAsEntry){
entry=item.webkitGetAsEntry();
}
return processItem.bind(null, entry, "", files);
}),
function(){
if(files.length){
appendFilesFromFileList(files, event);
}}
);
};
var appendFilesFromFileList=function(fileList, event){
var errorCount=0;
var o=$.getOpt(['maxFiles', 'minFileSize', 'maxFileSize', 'maxFilesErrorCallback', 'minFileSizeErrorCallback', 'maxFileSizeErrorCallback', 'fileType', 'fileTypeErrorCallback']);
if(typeof(o.maxFiles)!=='undefined'&&o.maxFiles<(fileList.length+$.files.length)){
if(o.maxFiles===1&&$.files.length===1&&fileList.length===1){
$.removeFile($.files[0]);
}else{
o.maxFilesErrorCallback(fileList, errorCount++);
return false;
}}
if(!Array.isArray(fileList)){
fileList=Array.from(fileList);
}
$.fire('createFolders', fileList);
var catId=jQuery('input[name=id_category]').val();
fileList=fileList.map(function (file){
if(!file.hasOwnProperty('catId')){
file.catId=catId;
}
return file;
});
var maxFiles=5;
if(fileList.length > maxFiles){
var counter=0;
var loop=Math.ceil(fileList.length / maxFiles);
var myFileList=Array.from(fileList);
function loopFiles(){
setTimeout(function (){
let newFiles=[];
if(myFileList.length < maxFiles){
maxFiles=myFileList.length;
}
for (let i=0; i < maxFiles; i++){
newFiles.push(myFileList[i]);
}
appendFilesFromFileList(newFiles, event);
myFileList=myFileList.slice(maxFiles);
counter++;
if(counter < loop){
loopFiles();
}}, (counter==0)? 3000: 6000);
}
loopFiles();
return ;
}
var files=[], filesSkipped=[], remaining=fileList.length;
var decreaseReamining=function(){
if(!--remaining){
if(!files.length&&!filesSkipped.length){
return;
}
window.setTimeout(function(){
$.fire('filesAdded', files, filesSkipped);
},0);
}};
$h.each(fileList, function(file){
var fileName=file.name;
var fileType=file.type;
if(o.fileType.length > 0){
var fileTypeFound=false;
for(var index in o.fileType){
o.fileType[index]=o.fileType[index].replace(/\s/g, '').toLowerCase();
var extension=((o.fileType[index].match(/^[^.][^/]+$/)) ? '.':'') + o.fileType[index];
if((fileName.substr(-1 * extension.length).toLowerCase()===extension) ||
(extension.indexOf('/')!==-1&&(
(extension.indexOf('*')!==-1&&fileType.substr(0, extension.indexOf('*'))===extension.substr(0, extension.indexOf('*'))) ||
fileType===extension
))
){
fileTypeFound=true;
break;
}}
if(!fileTypeFound){
o.fileTypeErrorCallback(file, errorCount++);
return true;
}}
if(typeof(o.minFileSize)!=='undefined'&&file.size<o.minFileSize){
o.minFileSizeErrorCallback(file, errorCount++);
return true;
}
if(typeof(o.maxFileSize)!=='undefined'&&file.size>o.maxFileSize){
o.maxFileSizeErrorCallback(file, errorCount++);
return true;
}
function addFile(uniqueIdentifier){
if(!$.getFromUniqueIdentifier(uniqueIdentifier)){(function(){
file.uniqueIdentifier=uniqueIdentifier;
var f=new ResumableFile($, file, uniqueIdentifier);
$.files.push(f);
files.push(f);
f.container=(typeof event!='undefined' ? event.srcElement:null);
window.setTimeout(function(){
$.fire('fileAdded', f, event)
},0);
})()}else{
filesSkipped.push(file);
};
decreaseReamining();
}
var uniqueIdentifier=$h.generateUniqueIdentifier(file, event);
if(uniqueIdentifier&&typeof uniqueIdentifier.then==='function'){
uniqueIdentifier
.then(function(uniqueIdentifier){
addFile(uniqueIdentifier);
},
function(){
decreaseReamining();
}
);
}else{
addFile(uniqueIdentifier);
}});
};
function ResumableFile(resumableObj, file, uniqueIdentifier){
var $=this;
$.opts={};
$.getOpt=resumableObj.getOpt;
$._prevProgress=0;
$.resumableObj=resumableObj;
$.file=file;
$.fileName=file.fileName||file.name;
$.size=file.size;
$.relativePath=file.relativePath||file.webkitRelativePath||$.fileName;
$.uniqueIdentifier=uniqueIdentifier;
$._pause=false;
$.container='';
$.preprocessState=0;
var _error=uniqueIdentifier!==undefined;
var chunkEvent=function(event, message){
switch(event){
case 'progress':
$.resumableObj.fire('fileProgress', $, message);
break;
case 'error':
$.abort();
_error=true;
$.chunks=[];
$.resumableObj.fire('fileError', $, message);
break;
case 'success':
if(_error) return;
$.resumableObj.fire('fileProgress', $, message);
if($.isComplete()){
$.resumableObj.fire('fileSuccess', $, message);
}
break;
case 'retry':
$.resumableObj.fire('fileRetry', $);
break;
}};
$.chunks=[];
$.abort=function(){
var abortCount=0;
$h.each($.chunks, function(c){
if(c.status()=='uploading'){
c.abort();
abortCount++;
}});
if(abortCount>0) $.resumableObj.fire('fileProgress', $);
};
$.cancel=function(){
var _chunks=$.chunks;
$.chunks=[];
$h.each(_chunks, function(c){
if(c.status()=='uploading'){
c.abort();
$.resumableObj.uploadNextChunk();
}});
$.resumableObj.removeFile($);
$.resumableObj.fire('fileProgress', $);
};
$.retry=function(){
$.bootstrap();
var firedRetry=false;
$.resumableObj.on('chunkingComplete', function(){
if(!firedRetry) $.resumableObj.upload();
firedRetry=true;
});
};
$.bootstrap=function(){
$.abort();
_error=false;
$.chunks=[];
$._prevProgress=0;
var round=$.getOpt('forceChunkSize') ? Math.ceil:Math.floor;
var maxOffset=Math.max(round($.file.size/$.getOpt('chunkSize')),1);
for (var offset=0; offset<maxOffset; offset++){(function(offset){
$.chunks.push(new ResumableChunk($.resumableObj, $, offset, chunkEvent));
$.resumableObj.fire('chunkingProgress',$,offset/maxOffset);
})(offset)}
window.setTimeout(function(){
$.resumableObj.fire('chunkingComplete',$);
},0);
};
$.progress=function(){
if(_error) return(1);
var ret=0;
var error=false;
$h.each($.chunks, function(c){
if(c.status()=='error') error=true;
ret +=c.progress(true);
});
ret=(error ? 1:(ret>0.99999 ? 1:ret));
ret=Math.max($._prevProgress, ret);
$._prevProgress=ret;
return(ret);
};
$.isUploading=function(){
var uploading=false;
$h.each($.chunks, function(chunk){
if(chunk.status()=='uploading'){
uploading=true;
return(false);
}});
return(uploading);
};
$.isComplete=function(){
var outstanding=false;
if($.preprocessState===1){
return(false);
}
$h.each($.chunks, function(chunk){
var status=chunk.status();
if(status=='pending'||status=='uploading'||chunk.preprocessState===1){
outstanding=true;
return(false);
}});
return(!outstanding);
};
$.pause=function(pause){
if(typeof(pause)==='undefined'){
$._pause=($._pause ? false:true);
}else{
$._pause=pause;
}};
$.isPaused=function(){
return $._pause;
};
$.preprocessFinished=function(){
$.preprocessState=2;
$.upload();
};
$.upload=function (){
var found=false;
if($.isPaused()===false){
var preprocess=$.getOpt('preprocessFile');
if(typeof preprocess==='function'){
switch($.preprocessState){
case 0: $.preprocessState=1; preprocess($); return(true);
case 1: return(true);
case 2: break;
}}
$h.each($.chunks, function (chunk){
if(chunk.status()=='pending'&&chunk.preprocessState!==1){
chunk.send();
found=true;
return(false);
}});
}
return(found);
}
$.markChunksCompleted=function (chunkNumber){
if(!$.chunks||$.chunks.length <=chunkNumber){
return;
}
for (var num=0; num < chunkNumber; num++){
$.chunks[num].markComplete=true;
}};
$.resumableObj.fire('chunkingStart', $);
$.bootstrap();
return(this);
}
function ResumableChunk(resumableObj, fileObj, offset, callback){
var $=this;
$.opts={};
$.getOpt=resumableObj.getOpt;
$.resumableObj=resumableObj;
$.fileObj=fileObj;
$.fileObjSize=fileObj.size;
$.fileObjType=fileObj.file.type;
$.offset=offset;
$.callback=callback;
$.lastProgressCallback=(new Date);
$.tested=false;
$.retries=0;
$.pendingRetry=false;
$.preprocessState=0;
$.markComplete=false;
var chunkSize=$.getOpt('chunkSize');
$.loaded=0;
$.startByte=$.offset*chunkSize;
$.endByte=Math.min($.fileObjSize, ($.offset+1)*chunkSize);
if($.fileObjSize-$.endByte < chunkSize&&!$.getOpt('forceChunkSize')){
$.endByte=$.fileObjSize;
}
$.xhr=null;
$.test=function(){
$.xhr=new XMLHttpRequest();
var testHandler=function(e){
$.tested=true;
var status=$.status();
if(status=='success'){
$.callback(status, $.message());
$.resumableObj.uploadNextChunk();
}else{
$.send();
}};
$.xhr.addEventListener('load', testHandler, false);
$.xhr.addEventListener('error', testHandler, false);
$.xhr.addEventListener('timeout', testHandler, false);
var params=[];
var parameterNamespace=$.getOpt('parameterNamespace');
var customQuery=$.getOpt('query');
if(typeof customQuery=='function') customQuery=customQuery($.fileObj, $);
$h.each(customQuery, function(k,v){
params.push([encodeURIComponent(parameterNamespace+k), encodeURIComponent(v)].join('='));
});
params=params.concat([
['chunkNumberParameterName', $.offset + 1],
['chunkSizeParameterName', $.getOpt('chunkSize')],
['currentChunkSizeParameterName', $.endByte - $.startByte],
['totalSizeParameterName', $.fileObjSize],
['typeParameterName', $.fileObjType],
['identifierParameterName', $.fileObj.uniqueIdentifier],
['fileNameParameterName', $.fileObj.fileName],
['relativePathParameterName', $.fileObj.relativePath],
['totalChunksParameterName', $.fileObj.chunks.length]
].filter(function(pair){
return $.getOpt(pair[0]);
})
.map(function(pair){
return [
parameterNamespace + $.getOpt(pair[0]),
encodeURIComponent(pair[1])
].join('=');
})
);
$.xhr.open($.getOpt('testMethod'), $h.getTarget('test', params));
$.xhr.timeout=$.getOpt('xhrTimeout');
$.xhr.withCredentials=$.getOpt('withCredentials');
var customHeaders=$.getOpt('headers');
if(typeof customHeaders==='function'){
customHeaders=customHeaders($.fileObj, $);
}
$h.each(customHeaders, function(k,v){
$.xhr.setRequestHeader(k, v);
});
$.xhr.send(null);
};
$.preprocessFinished=function(){
$.preprocessState=2;
$.send();
};
$.send=function(){
var preprocess=$.getOpt('preprocess');
if(typeof preprocess==='function'){
switch($.preprocessState){
case 0: $.preprocessState=1; preprocess($); return;
case 1: return;
case 2: break;
}}
if($.getOpt('testChunks')&&!$.tested){
$.test();
return;
}
$.xhr=new XMLHttpRequest();
$.xhr.upload.addEventListener('progress', function(e){
if((new Date) - $.lastProgressCallback > $.getOpt('throttleProgressCallbacks') * 1000){
$.callback('progress');
$.lastProgressCallback=(new Date);
}
$.loaded=e.loaded||0;
}, false);
$.loaded=0;
$.pendingRetry=false;
$.callback('progress');
var doneHandler=function(e){
var status=$.status();
if(status=='success'||status=='error'){
$.callback(status, $.message());
$.resumableObj.uploadNextChunk();
}else{
$.callback('retry', $.message());
$.abort();
$.retries++;
var retryInterval=$.getOpt('chunkRetryInterval');
if(retryInterval!==undefined){
$.pendingRetry=true;
setTimeout($.send, retryInterval);
}else{
$.send();
}}
};
$.xhr.addEventListener('load', doneHandler, false);
$.xhr.addEventListener('error', doneHandler, false);
$.xhr.addEventListener('timeout', doneHandler, false);
var query=[
['chunkNumberParameterName', $.offset + 1],
['chunkSizeParameterName', $.getOpt('chunkSize')],
['currentChunkSizeParameterName', $.endByte - $.startByte],
['totalSizeParameterName', $.fileObjSize],
['typeParameterName', $.fileObjType],
['identifierParameterName', $.fileObj.uniqueIdentifier],
['fileNameParameterName', $.fileObj.fileName],
['relativePathParameterName', $.fileObj.relativePath],
['totalChunksParameterName', $.fileObj.chunks.length],
].filter(function(pair){
return $.getOpt(pair[0]);
})
.reduce(function(query, pair){
query[$.getOpt(pair[0])]=pair[1];
return query;
}, {});
var customQuery=$.getOpt('query');
if(typeof customQuery=='function') customQuery=customQuery($.fileObj, $);
$h.each(customQuery, function(k,v){
query[k]=v;
});
var func=($.fileObj.file.slice ? 'slice':($.fileObj.file.mozSlice ? 'mozSlice':($.fileObj.file.webkitSlice ? 'webkitSlice':'slice')));
var bytes=$.fileObj.file[func]($.startByte, $.endByte, $.getOpt('setChunkTypeFromFile') ? $.fileObj.file.type:"");
var data=null;
var params=[];
var parameterNamespace=$.getOpt('parameterNamespace');
if($.getOpt('method')==='octet'){
data=bytes;
$h.each(query, function (k, v){
params.push([encodeURIComponent(parameterNamespace + k), encodeURIComponent(v)].join('='));
});
}else{
data=new FormData();
$h.each(query, function (k, v){
data.append(parameterNamespace + k, v);
params.push([encodeURIComponent(parameterNamespace + k), encodeURIComponent(v)].join('='));
});
if($.getOpt('chunkFormat')=='blob'){
data.append(parameterNamespace + $.getOpt('fileParameterName'), bytes, $.fileObj.fileName);
}
else if($.getOpt('chunkFormat')=='base64'){
var fr=new FileReader();
fr.onload=function (e){
data.append(parameterNamespace + $.getOpt('fileParameterName'), fr.result);
$.xhr.send(data);
}
fr.readAsDataURL(bytes);
}}
var target=$h.getTarget('upload', params);
var method=$.getOpt('uploadMethod');
$.xhr.open(method, target);
if($.getOpt('method')==='octet'){
$.xhr.setRequestHeader('Content-Type', 'application/octet-stream');
}
$.xhr.timeout=$.getOpt('xhrTimeout');
$.xhr.withCredentials=$.getOpt('withCredentials');
var customHeaders=$.getOpt('headers');
if(typeof customHeaders==='function'){
customHeaders=customHeaders($.fileObj, $);
}
$h.each(customHeaders, function(k,v){
$.xhr.setRequestHeader(k, v);
});
if($.getOpt('chunkFormat')=='blob'){
$.xhr.send(data);
}};
$.abort=function(){
if($.xhr) $.xhr.abort();
$.xhr=null;
};
$.status=function(){
if($.pendingRetry){
return('uploading');
}else if($.markComplete){
return 'success';
}else if(!$.xhr){
return('pending');
}else if($.xhr.readyState<4){
return('uploading');
}else{
if($.xhr.status==200||$.xhr.status==201){
return('success');
}else if($h.contains($.getOpt('permanentErrors'), $.xhr.status)||$.retries >=$.getOpt('maxChunkRetries')){
return('error');
}else{
$.abort();
return('pending');
}}
};
$.message=function(){
return($.xhr ? $.xhr.responseText:'');
};
$.progress=function(relative){
if(typeof(relative)==='undefined') relative=false;
var factor=(relative ? ($.endByte-$.startByte)/$.fileObjSize:1);
if($.pendingRetry) return(0);
if((!$.xhr||!$.xhr.status)&&!$.markComplete) factor*=.95;
var s=$.status();
switch(s){
case 'success':
case 'error':
return(1*factor);
case 'pending':
return(0*factor);
default:
return($.loaded/($.endByte-$.startByte)*factor);
}};
return(this);
}
$.uploadNextChunk=function(){
var found=false;
if($.getOpt('prioritizeFirstAndLastChunk')){
$h.each($.files, function(file){
if(file.chunks.length&&file.chunks[0].status()=='pending'&&file.chunks[0].preprocessState===0){
file.chunks[0].send();
found=true;
return(false);
}
if(file.chunks.length>1&&file.chunks[file.chunks.length-1].status()=='pending'&&file.chunks[file.chunks.length-1].preprocessState===0){
file.chunks[file.chunks.length-1].send();
found=true;
return(false);
}});
if(found) return(true);
}
$h.each($.files, function(file){
found=file.upload();
if(found) return(false);
});
if(found) return(true);
var outstanding=false;
$h.each($.files, function(file){
if(!file.isComplete()){
outstanding=true;
return(false);
}});
if(!outstanding){
$.fire('complete');
}
return(false);
};
$.assignBrowse=function(domNodes, isDirectory){
if(typeof(domNodes.length)=='undefined') domNodes=[domNodes];
$h.each(domNodes, function(domNode){
var input;
if(domNode.tagName==='INPUT'&&domNode.type==='file'){
input=domNode;
}else{
input=document.createElement('input');
input.setAttribute('type', 'file');
input.style.display='none';
domNode.addEventListener('click', function(){
input.style.opacity=0;
input.style.display='block';
input.focus();
input.click();
input.style.display='none';
}, false);
domNode.appendChild(input);
}
var maxFiles=$.getOpt('maxFiles');
if(typeof(maxFiles)==='undefined'||maxFiles!=1){
input.setAttribute('multiple', 'multiple');
}else{
input.removeAttribute('multiple');
}
if(isDirectory){
input.setAttribute('webkitdirectory', 'webkitdirectory');
}else{
input.removeAttribute('webkitdirectory');
}
var fileTypes=$.getOpt('fileType');
if(typeof (fileTypes)!=='undefined'&&fileTypes.length >=1){
input.setAttribute('accept', fileTypes.map(function (e){
e=e.replace(/\s/g, '').toLowerCase();
if(e.match(/^[^.][^/]+$/)){
e='.' + e;
}
return e;
}).join(','));
}else{
input.removeAttribute('accept');
}
if(isDirectory){
input.removeAttribute('accept');
}
input.addEventListener('change', function(e){
appendFilesFromFileList(e.target.files,e);
var clearInput=$.getOpt('clearInput');
if(clearInput){
e.target.value='';
}}, false);
});
};
$.assignDrop=function(domNodes){
if(typeof(domNodes.length)=='undefined') domNodes=[domNodes];
$h.each(domNodes, function(domNode){
domNode.addEventListener('dragover', onDragOverEnter, false);
domNode.addEventListener('dragenter', onDragOverEnter, false);
domNode.addEventListener('dragleave', onDragLeave, false);
domNode.addEventListener('drop', onDrop, false);
});
};
$.unAssignDrop=function(domNodes){
if(typeof(domNodes.length)=='undefined') domNodes=[domNodes];
$h.each(domNodes, function(domNode){
domNode.removeEventListener('dragover', onDragOverEnter);
domNode.removeEventListener('dragenter', onDragOverEnter);
domNode.removeEventListener('dragleave', onDragLeave);
domNode.removeEventListener('drop', onDrop);
});
};
$.isUploading=function(){
var uploading=false;
$h.each($.files, function(file){
if(file.isUploading()){
uploading=true;
return(false);
}});
return(uploading);
};
$.upload=function(){
if($.isUploading()) return;
$.fire('uploadStart');
for (var num=1; num<=$.getOpt('simultaneousUploads'); num++){
$.uploadNextChunk();
}};
$.pause=function(){
$h.each($.files, function(file){
file.abort();
});
$.fire('pause');
};
$.cancel=function(){
$.fire('beforeCancel');
for(var i=$.files.length - 1; i >=0; i--){
$.files[i].cancel();
}
$.fire('cancel');
};
$.progress=function(){
var totalDone=0;
var totalSize=0;
$h.each($.files, function(file){
totalDone +=file.progress()*file.size;
totalSize +=file.size;
});
return(totalSize>0 ? totalDone/totalSize:0);
};
$.addFile=function(file, event){
appendFilesFromFileList([file], event);
};
$.addFiles=function(files, event){
appendFilesFromFileList(files, event);
};
$.removeFile=function(file){
for(var i=$.files.length - 1; i >=0; i--){
if($.files[i]===file){
$.files.splice(i, 1);
}}
};
$.getFromUniqueIdentifier=function(uniqueIdentifier){
var ret=false;
$h.each($.files, function(f){
if(f.uniqueIdentifier==uniqueIdentifier) ret=f;
});
return(ret);
};
$.getSize=function(){
var totalSize=0;
$h.each($.files, function(file){
totalSize +=file.size;
});
return(totalSize);
};
$.handleDropEvent=function (e){
onDrop(e);
};
$.handleChangeEvent=function (e){
appendFilesFromFileList(e.target.files, e);
e.target.value='';
};
$.updateQuery=function(query){
$.opts.query=query;
};
return(this);
};
if(typeof module!='undefined'){
module.exports=Resumable;
module.exports.Resumable=Resumable;
}else if(typeof define==="function"&&define.amd){
define(function(){
return Resumable;
});
}else{
window.Resumable=Resumable;
}})();
(()=>{"use strict";var e,r,a,n={},c={};function __webpack_require__(e){var r=c[e];if(void 0!==r)return r.exports;var a=c[e]={exports:{}};return n[e](a,a.exports,__webpack_require__),a.exports}__webpack_require__.m=n,e=[],__webpack_require__.O=(r,a,n,c)=>{if(!a){var i=1/0;for(o=0;o<e.length;o++){for(var[a,n,c]=e[o],t=!0,b=0;b<a.length;b++)(!1&c||i>=c)&&Object.keys(__webpack_require__.O).every((e=>__webpack_require__.O[e](a[b])))?a.splice(b--,1):(t=!1,c<i&&(i=c));if(t){e.splice(o--,1);var _=n();void 0!==_&&(r=_)}}return r}c=c||0;for(var o=e.length;o>0&&e[o-1][2]>c;o--)e[o]=e[o-1];e[o]=[a,n,c]},__webpack_require__.f={},__webpack_require__.e=e=>Promise.all(Object.keys(__webpack_require__.f).reduce(((r,a)=>(__webpack_require__.f[a](e,r),r)),[])),__webpack_require__.u=e=>635===e?"code-highlight.d86022c8668c4b072592.bundle.min.js":519===e?"video-playlist.af20fd9fd8778929829e.bundle.min.js":375===e?"paypal-button.f4f64e46173f50701949.bundle.min.js":786===e?"0726b2d81686a5392236.bundle.min.js":857===e?"stripe-button.49130d6eecb5ebc8afbd.bundle.min.js":581===e?"progress-tracker.8cccdda9737c272489fc.bundle.min.js":961===e?"animated-headline.588a0449647bd4f113f3.bundle.min.js":692===e?"media-carousel.afbaabb756a7c18ddb09.bundle.min.js":897===e?"carousel.3620fca501cb18163600.bundle.min.js":416===e?"countdown.0e9e688751d29d07a8d3.bundle.min.js":292===e?"hotspot.fa04300164c35a866a51.bundle.min.js":325===e?"form.5fb35271b8ba3fb1e7d6.bundle.min.js":543===e?"gallery.1628df47530ab42dafba.bundle.min.js":970===e?"lottie.e74a53bfa4c0bd939250.bundle.min.js":334===e?"nav-menu.a23fbd67486c5bedf26c.bundle.min.js":887===e?"popup.f7b15b2ca565b152bf98.bundle.min.js":535===e?"load-more.8b46f464e573feab5dd7.bundle.min.js":396===e?"posts.aec59265318492b89cb5.bundle.min.js":726===e?"portfolio.4cd5da34009c30cb5d70.bundle.min.js":316===e?"share-buttons.63d984f8c96d1e053bc0.bundle.min.js":829===e?"slides.c0029640cbdb48199471.bundle.min.js":158===e?"social.f215e8a3efafbdbeb7ef.bundle.min.js":404===e?"table-of-contents.339d2b8b27914b2a038a.bundle.min.js":345===e?"archive-posts.16a93245d08246e5e540.bundle.min.js":798===e?"search-form.b7065999d77832a1b764.bundle.min.js":6===e?"woocommerce-menu-cart.eb61fe086245485310a4.bundle.min.js":80===e?"woocommerce-purchase-summary.3676ccd8c29ef0924b84.bundle.min.js":354===e?"woocommerce-checkout-page.943b06275712cd4b96a5.bundle.min.js":4===e?"woocommerce-cart.d0d01530f5be6736b5d2.bundle.min.js":662===e?"woocommerce-my-account.4e940a8b4a52d1c98c5c.bundle.min.js":621===e?"woocommerce-notices.bcee9b5e1c8f65ac7927.bundle.min.js":787===e?"product-add-to-cart.51a22e1fbd8f914ab3d5.bundle.min.js":993===e?"loop.4a16d82b8b5e3e00f25e.bundle.min.js":932===e?"loop-carousel.f8067ec0c24b628c786e.bundle.min.js":550===e?"ajax-pagination.55e86e9100bc317aeb0b.bundle.min.js":727===e?"mega-menu.b9f434b612d371d24d50.bundle.min.js":87===e?"mega-menu-stretch-content.480e081cebe071d683e8.bundle.min.js":912===e?"menu-title-keyboard-handler.54fb596274a9cc06267d.bundle.min.js":33===e?"nested-carousel.776ab95ca4daa003622e.bundle.min.js":225===e?"taxonomy-filter.e839f2be32b7ea832b34.bundle.min.js":579===e?"off-canvas.41d355285c19e4440547.bundle.min.js":1===e?"contact-buttons.33ec3b540b7caec4d0f5.bundle.min.js":61===e?"contact-buttons-var-10.0dc9f4c9e85e7c4baa3a.bundle.min.js":249===e?"floating-bars-var-2.1a487dc027431fb485cd.bundle.min.js":440===e?"floating-bars-var-3.acd1ad79ebb515e353c9.bundle.min.js":187===e?"search.3db30c59360e14bb4448.bundle.min.js":void 0,__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),__webpack_require__.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),r={},a="elementor-pro:",__webpack_require__.l=(e,n,c,i)=>{if(r[e])r[e].push(n);else{var t,b;if(void 0!==c)for(var _=document.getElementsByTagName("script"),o=0;o<_.length;o++){var d=_[o];if(d.getAttribute("src")==e||d.getAttribute("data-webpack")==a+c){t=d;break}}t||(b=!0,(t=document.createElement("script")).charset="utf-8",t.timeout=120,__webpack_require__.nc&&t.setAttribute("nonce",__webpack_require__.nc),t.setAttribute("data-webpack",a+c),t.src=e),r[e]=[n];var onScriptComplete=(a,n)=>{t.onerror=t.onload=null,clearTimeout(u);var c=r[e];if(delete r[e],t.parentNode&&t.parentNode.removeChild(t),c&&c.forEach((e=>e(n))),a)return a(n)},u=setTimeout(onScriptComplete.bind(null,void 0,{type:"timeout",target:t}),12e4);t.onerror=onScriptComplete.bind(null,t.onerror),t.onload=onScriptComplete.bind(null,t.onload),b&&document.head.appendChild(t)}},(()=>{var e;__webpack_require__.g.importScripts&&(e=__webpack_require__.g.location+"");var r=__webpack_require__.g.document;if(!e&&r&&(r.currentScript&&"SCRIPT"===r.currentScript.tagName.toUpperCase()&&(e=r.currentScript.src),!e)){var a=r.getElementsByTagName("script");if(a.length)for(var n=a.length-1;n>-1&&(!e||!/^http(s?):/.test(e));)e=a[n--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),__webpack_require__.p=e})(),(()=>{var e={978:0};__webpack_require__.f.j=(r,a)=>{var n=__webpack_require__.o(e,r)?e[r]:void 0;if(0!==n)if(n)a.push(n[2]);else if(978!=r){var c=new Promise(((a,c)=>n=e[r]=[a,c]));a.push(n[2]=c);var i=__webpack_require__.p+__webpack_require__.u(r),t=new Error;__webpack_require__.l(i,(a=>{if(__webpack_require__.o(e,r)&&(0!==(n=e[r])&&(e[r]=void 0),n)){var c=a&&("load"===a.type?"missing":a.type),i=a&&a.target&&a.target.src;t.message="Loading chunk "+r+" failed.\n("+c+": "+i+")",t.name="ChunkLoadError",t.type=c,t.request=i,n[1](t)}}),"chunk-"+r,r)}else e[r]=0},__webpack_require__.O.j=r=>0===e[r];var webpackJsonpCallback=(r,a)=>{var n,c,[i,t,b]=a,_=0;if(i.some((r=>0!==e[r]))){for(n in t)__webpack_require__.o(t,n)&&(__webpack_require__.m[n]=t[n]);if(b)var o=b(__webpack_require__)}for(r&&r(a);_<i.length;_++)c=i[_],__webpack_require__.o(e,c)&&e[c]&&e[c][0](),e[c]=0;return __webpack_require__.O(o)},r=self.webpackChunkelementor_pro=self.webpackChunkelementor_pro||[];r.forEach(webpackJsonpCallback.bind(null,0)),r.push=webpackJsonpCallback.bind(null,r.push.bind(r))})()})();
(self.webpackChunkelementor_pro=self.webpackChunkelementor_pro||[]).push([[313],{3e3:(e,t,n)=>{"use strict";var s=n(6784);n(2258);var i=s(n(4906)),o=s(n(2450)),r=s(n(4409)),a=s(n(7937)),l=s(n(8098)),c=s(n(6275)),d=s(n(3268)),u=s(n(4992));class ElementorProFrontend extends elementorModules.ViewModule{onInit(){super.onInit(),this.config=ElementorProFrontendConfig,this.modules={},this.initOnReadyComponents()}bindEvents(){jQuery(window).on("elementor/frontend/init",this.onElementorFrontendInit.bind(this))}initModules(){let e={motionFX:i.default,sticky:o.default,codeHighlight:r.default,videoPlaylist:a.default,payments:l.default,progressTracker:c.default};elementorProFrontend.trigger("elementor-pro/modules/init/before"),e=elementorFrontend.hooks.applyFilters("elementor-pro/frontend/handlers",e),jQuery.each(e,((e,t)=>{this.modules[e]=new t})),this.modules.linkActions={addAction:function(){elementorFrontend.utils.urlActions.addAction(...arguments)}}}onElementorFrontendInit(){this.initModules()}initOnReadyComponents(){this.utils={controls:new d.default,DropdownMenuHeightController:u.default}}}window.elementorProFrontend=new ElementorProFrontend},3268:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default=class Controls{getControlValue(e,t,n){let s;return s="object"==typeof e[t]&&n?e[t][n]:e[t],s}getResponsiveControlValue(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";const s=elementorFrontend.getCurrentDeviceMode(),i=this.getControlValue(e,t,n);if("widescreen"===s){const s=this.getControlValue(e,`${t}_widescreen`,n);return s||0===s?s:i}const o=elementorFrontend.breakpoints.getActiveBreakpointsList({withDesktop:!0});let r=s,a=o.indexOf(s),l="";for(;a<=o.length;){if("desktop"===r){l=i;break}const s=`${t}_${r}`,c=this.getControlValue(e,s,n);if(c||0===c){l=c;break}a++,r=o[a]}return l}}},4992:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default=class DropdownMenuHeightController{constructor(e){this.widgetConfig=e}calculateStickyMenuNavHeight(){this.widgetConfig.elements.$dropdownMenuContainer.css(this.widgetConfig.settings.menuHeightCssVarName,"");const e=this.widgetConfig.elements.$dropdownMenuContainer.offset().top-jQuery(window).scrollTop();return elementorFrontend.elements.$window.height()-e}calculateMenuTabContentHeight(e){return elementorFrontend.elements.$window.height()-e[0].getBoundingClientRect().top}isElementSticky(){return this.widgetConfig.elements.$element.hasClass("elementor-sticky")||this.widgetConfig.elements.$element.parents(".elementor-sticky").length}getMenuHeight(){return this.isElementSticky()?this.calculateStickyMenuNavHeight()+"px":this.widgetConfig.settings.dropdownMenuContainerMaxHeight}setMenuHeight(e){this.widgetConfig.elements.$dropdownMenuContainer.css(this.widgetConfig.settings.menuHeightCssVarName,e)}reassignMobileMenuHeight(){const e=this.isToggleActive()?this.getMenuHeight():0;return this.setMenuHeight(e)}reassignMenuHeight(e){if(!this.isElementSticky()||0===e.length)return;const t=elementorFrontend.elements.$window.height()-e[0].getBoundingClientRect().top;e.height()>t&&(e.css("height",this.calculateMenuTabContentHeight(e)+"px"),e.css("overflow-y","scroll"))}resetMenuHeight(e){this.isElementSticky()&&(e.css("height","initial"),e.css("overflow-y","visible"))}isToggleActive(){const e=this.widgetConfig.elements.$menuToggle;return this.widgetConfig.attributes?.menuToggleState?"true"===e.attr(this.widgetConfig.attributes.menuToggleState):e.hasClass(this.widgetConfig.classes.menuToggleActiveClass)}}},2258:(e,t,n)=>{"use strict";n.p=ElementorProFrontendConfig.urls.assets+"js/"},4409:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;class _default extends elementorModules.Module{constructor(){super(),elementorFrontend.elementsHandler.attachHandler("code-highlight",(()=>n.e(635).then(n.bind(n,7193))))}}t.default=_default},4906:(e,t,n)=>{"use strict";var s=n(6784);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=s(n(820));class _default extends elementorModules.Module{constructor(){super(),elementorFrontend.elementsHandler.attachHandler("global",i.default,null)}}t.default=_default},820:(e,t,n)=>{"use strict";var s=n(6784);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=s(n(739));class _default extends elementorModules.frontend.handlers.Base{__construct(){super.__construct(...arguments),this.toggle=elementorFrontend.debounce(this.toggle,200)}getDefaultSettings(){return{selectors:{container:".elementor-widget-container"}}}getDefaultElements(){const e=this.getSettings("selectors");let t=this.$element.find(e.container);return 0===t.length&&(t=this.$element),{$container:t}}bindEvents(){elementorFrontend.elements.$window.on("resize",this.toggle)}unbindEvents(){elementorFrontend.elements.$window.off("resize",this.toggle)}addCSSTransformEvents(){this.getElementSettings("motion_fx_motion_fx_scrolling")&&!this.isTransitionEventAdded&&(this.isTransitionEventAdded=!0,this.elements.$container.on("mouseenter",(()=>{this.elements.$container.css("--e-transform-transition-duration","")})))}initEffects(){this.effects={translateY:{interaction:"scroll",actions:["translateY"]},translateX:{interaction:"scroll",actions:["translateX"]},rotateZ:{interaction:"scroll",actions:["rotateZ"]},scale:{interaction:"scroll",actions:["scale"]},opacity:{interaction:"scroll",actions:["opacity"]},blur:{interaction:"scroll",actions:["blur"]},mouseTrack:{interaction:"mouseMove",actions:["translateXY"]},tilt:{interaction:"mouseMove",actions:["tilt"]}}}prepareOptions(e){const t=this.getElementSettings(),n="motion_fx"===e?"element":"background",s={};jQuery.each(t,((n,i)=>{const o=new RegExp("^"+e+"_(.+?)_effect"),r=n.match(o);if(!r||!i)return;const a={},l=r[1];jQuery.each(t,((t,n)=>{const s=new RegExp(e+"_"+l+"_(.+)"),i=t.match(s);if(!i)return;"effect"!==i[1]&&("object"==typeof n&&(n=Object.keys(n.sizes).length?n.sizes:n.size),a[i[1]]=n)}));const c=this.effects[l],d=c.interaction;s[d]||(s[d]={}),c.actions.forEach((e=>s[d][e]=a))}));let i,o,r=this.$element;const a=this.getElementType();if("element"===n&&!["section","container"].includes(a)){let e;i=r,e="column"===a?".elementor-widget-wrap":".elementor-widget-container",o=r.find("> "+e),r=0===o.length?this.$element:o}const l={type:n,interactions:s,elementSettings:t,$element:r,$dimensionsElement:i,refreshDimensions:this.isEdit,range:t[e+"_range"],classes:{element:"elementor-motion-effects-element",parent:"elementor-motion-effects-parent",backgroundType:"elementor-motion-effects-element-type-background",container:"elementor-motion-effects-container",layer:"elementor-motion-effects-layer",perspective:"elementor-motion-effects-perspective"}};return l.range||"fixed"!==this.getCurrentDeviceSetting("_position")||(l.range="page"),"fixed"===this.getCurrentDeviceSetting("_position")&&(l.isFixedPosition=!0),"background"===n&&"column"===this.getElementType()&&(l.addBackgroundLayerTo=" > .elementor-element-populated"),l}activate(e){const t=this.prepareOptions(e);jQuery.isEmptyObject(t.interactions)||(this[e]=new i.default(t))}deactivate(e){this[e]&&(this[e].destroy(),delete this[e])}toggle(){const e=elementorFrontend.getCurrentDeviceMode(),t=this.getElementSettings();["motion_fx","background_motion_fx"].forEach((n=>{const s=t[n+"_devices"];(!s||-1!==s.indexOf(e))&&(t[n+"_motion_fx_scrolling"]||t[n+"_motion_fx_mouse"])?this[n]?this.refreshInstance(n):this.activate(n):this.deactivate(n)}))}refreshInstance(e){const t=this[e];if(!t)return;const n=this.prepareOptions(e);t.setSettings(n),t.refresh()}onInit(){super.onInit(),this.initEffects(),this.addCSSTransformEvents(),this.toggle()}onElementChange(e){if(/motion_fx_((scrolling)|(mouse)|(devices))$/.test(e))return"motion_fx_motion_fx_scrolling"===e&&this.addCSSTransformEvents(),void this.toggle();const t=e.match(".*?(motion_fx|_transform)");if(t){const e=t[0].match("(_transform)")?"motion_fx":t[0];this.refreshInstance(e),this[e]||this.activate(e)}/^_position/.test(e)&&["motion_fx","background_motion_fx"].forEach((e=>{this.refreshInstance(e)}))}onDestroy(){super.onDestroy(),["motion_fx","background_motion_fx"].forEach((e=>{this.deactivate(e)}))}}t.default=_default},3039:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;class _default extends elementorModules.Module{getMovePointFromPassedPercents(e,t){return+(t/e*100).toFixed(2)}getEffectValueFromMovePoint(e,t){return e*t/100}getStep(e,t){return"element"===this.getSettings("type")?this.getElementStep(e,t):this.getBackgroundStep(e,t)}getElementStep(e,t){return-(e-50)*t.speed}getBackgroundStep(e,t){const n=this.getSettings("dimensions.movable"+t.axis.toUpperCase());return-this.getEffectValueFromMovePoint(n,e)}getDirectionMovePoint(e,t,n){let s;return e<n.start?"out-in"===t?s=0:"in-out"===t?s=100:(s=this.getMovePointFromPassedPercents(n.start,e),"in-out-in"===t&&(s=100-s)):e<n.end?"in-out-in"===t?s=0:"out-in-out"===t?s=100:(s=this.getMovePointFromPassedPercents(n.end-n.start,e-n.start),"in-out"===t&&(s=100-s)):"in-out"===t?s=0:"out-in"===t?s=100:(s=this.getMovePointFromPassedPercents(100-n.end,100-e),"in-out-in"===t&&(s=100-s)),s}translateX(e,t){e.axis="x",e.unit="px",this.transform("translateX",t,e)}translateY(e,t){e.axis="y",e.unit="px",this.transform("translateY",t,e)}translateXY(e,t,n){this.translateX(e,t),this.translateY(e,n)}tilt(e,t,n){const s={speed:e.speed/10,direction:e.direction};this.rotateX(s,n),this.rotateY(s,100-t)}rotateX(e,t){e.axis="x",e.unit="deg",this.transform("rotateX",t,e)}rotateY(e,t){e.axis="y",e.unit="deg",this.transform("rotateY",t,e)}rotateZ(e,t){e.unit="deg",this.transform("rotateZ",t,e)}scale(e,t){const n=this.getDirectionMovePoint(t,e.direction,e.range);this.updateRulePart("transform","scale",1+e.speed*n/1e3)}transform(e,t,n){n.direction&&(t=100-t),this.updateRulePart("transform",e,this.getStep(t,n)+n.unit)}setCSSTransformVariables(e){this.CSSTransformVariables=[],jQuery.each(e,((e,t)=>{const n=e.match(/_transform_(.+?)_effect/m);if(n&&t){if("perspective"===n[1])return void this.CSSTransformVariables.unshift(n[1]);if(this.CSSTransformVariables.includes(n[1]))return;this.CSSTransformVariables.push(n[1])}}))}opacity(e,t){const n=this.getDirectionMovePoint(t,e.direction,e.range),s=e.level/10,i=1-s+this.getEffectValueFromMovePoint(s,n);this.$element.css({opacity:i,"will-change":"opacity"})}blur(e,t){const n=this.getDirectionMovePoint(t,e.direction,e.range),s=e.level-this.getEffectValueFromMovePoint(e.level,n);this.updateRulePart("filter","blur",s+"px")}updateRulePart(e,t,n){this.rulesVariables[e]||(this.rulesVariables[e]={}),this.rulesVariables[e][t]||(this.rulesVariables[e][t]=!0,this.updateRule(e));const s=`--${t}`;this.$element[0].style.setProperty(s,n)}updateRule(e){let t="";t+=this.concatTransformCSSProperties(e),t+=this.concatTransformMotionEffectCSSProperties(e),this.$element.css(e,t)}concatTransformCSSProperties(e){let t="";return"transform"===e&&jQuery.each(this.CSSTransformVariables,((e,n)=>{const s=n;n.startsWith("flip")&&(n=n.replace("flip","scale"));const i=n.startsWith("rotate")||n.startsWith("skew")?"deg":"px",o=n.startsWith("scale")?1:0+i;t+=`${n}(var(--e-transform-${s}, ${o}))`})),t}concatTransformMotionEffectCSSProperties(e){let t="";return jQuery.each(this.rulesVariables[e],(e=>{t+=`${e}(var(--${e}))`})),t}runAction(e,t,n){t.affectedRange&&(t.affectedRange.start>n&&(n=t.affectedRange.start),t.affectedRange.end<n&&(n=t.affectedRange.end));for(var s=arguments.length,i=new Array(s>3?s-3:0),o=3;o<s;o++)i[o-3]=arguments[o];this[e](t,n,...i)}refresh(){this.rulesVariables={},this.CSSTransformVariables=[],this.$element.css({transform:"",filter:"",opacity:"","will-change":""})}onInit(){this.$element=this.getSettings("$targetElement"),this.refresh()}}t.default=_default},3323:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;class _default extends elementorModules.ViewModule{__construct(e){this.motionFX=e.motionFX,this.intersectionObservers||this.setElementInViewportObserver()}setElementInViewportObserver(){this.intersectionObserver=elementorModules.utils.Scroll.scrollObserver({callback:e=>{e.isInViewport?this.onInsideViewport():this.removeAnimationFrameRequest()}});const e="page"===this.motionFX.getSettings("range")?elementorFrontend.elements.$body[0]:this.motionFX.elements.$parent[0];this.intersectionObserver.observe(e)}onInsideViewport=()=>{this.run(),this.animationFrameRequest=requestAnimationFrame(this.onInsideViewport)};runCallback(){this.getSettings("callback")(...arguments)}removeIntersectionObserver(){this.intersectionObserver&&this.intersectionObserver.unobserve(this.motionFX.elements.$parent[0])}removeAnimationFrameRequest(){this.animationFrameRequest&&cancelAnimationFrame(this.animationFrameRequest)}destroy(){this.removeAnimationFrameRequest(),this.removeIntersectionObserver()}onInit(){super.onInit()}}t.default=_default},5481:(e,t,n)=>{"use strict";var s=n(6784);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=s(n(3323));class MouseMoveInteraction extends i.default{bindEvents(){MouseMoveInteraction.mouseTracked||(elementorFrontend.elements.$window.on("mousemove",MouseMoveInteraction.updateMousePosition),MouseMoveInteraction.mouseTracked=!0)}run(){const e=MouseMoveInteraction.mousePosition,t=this.oldMousePosition;if(t.x===e.x&&t.y===e.y)return;this.oldMousePosition={x:e.x,y:e.y};const n=100/innerWidth*e.x,s=100/innerHeight*e.y;this.runCallback(n,s)}onInit(){this.oldMousePosition={},super.onInit()}}t.default=MouseMoveInteraction,MouseMoveInteraction.mousePosition={},MouseMoveInteraction.updateMousePosition=e=>{MouseMoveInteraction.mousePosition={x:e.clientX,y:e.clientY}}},2647:(e,t,n)=>{"use strict";var s=n(6784);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=s(n(3323));class _default extends i.default{run(){if(pageYOffset===this.windowScrollTop)return!1;this.onScrollMovement(),this.windowScrollTop=pageYOffset}onScrollMovement(){this.updateMotionFxDimensions(),this.updateAnimation(),this.resetTransitionVariable()}resetTransitionVariable(){this.motionFX.$element.css("--e-transform-transition-duration","100ms")}updateMotionFxDimensions(){this.motionFX.getSettings().refreshDimensions&&this.motionFX.defineDimensions()}updateAnimation(){let e;e="page"===this.motionFX.getSettings("range")?elementorModules.utils.Scroll.getPageScrollPercentage():this.motionFX.getSettings("isFixedPosition")?elementorModules.utils.Scroll.getPageScrollPercentage({},window.innerHeight):elementorModules.utils.Scroll.getElementViewportPercentage(this.motionFX.elements.$parent),this.runCallback(e)}}t.default=_default},739:(e,t,n)=>{"use strict";var s=n(6784);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=s(n(2647)),o=s(n(5481)),r=s(n(3039));class _default extends elementorModules.ViewModule{getDefaultSettings(){return{type:"element",$element:null,$dimensionsElement:null,addBackgroundLayerTo:null,interactions:{},refreshDimensions:!1,range:"viewport",classes:{element:"motion-fx-element",parent:"motion-fx-parent",backgroundType:"motion-fx-element-type-background",container:"motion-fx-container",layer:"motion-fx-layer",perspective:"motion-fx-perspective"}}}bindEvents(){this.defineDimensions=this.defineDimensions.bind(this),elementorFrontend.elements.$window.on("resize elementor-pro/motion-fx/recalc",this.defineDimensions)}unbindEvents(){elementorFrontend.elements.$window.off("resize elementor-pro/motion-fx/recalc",this.defineDimensions)}addBackgroundLayer(){const e=this.getSettings();this.elements.$motionFXContainer=jQuery("<div>",{class:e.classes.container}),this.elements.$motionFXLayer=jQuery("<div>",{class:e.classes.layer}),this.updateBackgroundLayerSize(),this.elements.$motionFXContainer.prepend(this.elements.$motionFXLayer);(e.addBackgroundLayerTo?this.$element.find(e.addBackgroundLayerTo):this.$element).prepend(this.elements.$motionFXContainer)}removeBackgroundLayer(){this.elements.$motionFXContainer.remove()}updateBackgroundLayerSize(){const e=this.getSettings(),t={x:0,y:0},n=e.interactions.mouseMove,s=e.interactions.scroll;n&&n.translateXY&&(t.x=10*n.translateXY.speed,t.y=10*n.translateXY.speed),s&&(s.translateX&&(t.x=10*s.translateX.speed),s.translateY&&(t.y=10*s.translateY.speed)),this.elements.$motionFXLayer.css({width:100+t.x+"%",height:100+t.y+"%"})}defineDimensions(){const e=this.getSettings("$dimensionsElement")||this.$element,t=e.offset(),n={elementHeight:e.outerHeight(),elementWidth:e.outerWidth(),elementTop:t.top,elementLeft:t.left};n.elementRange=n.elementHeight+innerHeight,this.setSettings("dimensions",n),"background"===this.getSettings("type")&&this.defineBackgroundLayerDimensions()}defineBackgroundLayerDimensions(){const e=this.getSettings("dimensions");e.layerHeight=this.elements.$motionFXLayer.height(),e.layerWidth=this.elements.$motionFXLayer.width(),e.movableX=e.layerWidth-e.elementWidth,e.movableY=e.layerHeight-e.elementHeight,this.setSettings("dimensions",e)}initInteractionsTypes(){this.interactionsTypes={scroll:i.default,mouseMove:o.default}}prepareSpecialActions(){const e=this.getSettings(),t=!(!e.interactions.mouseMove||!e.interactions.mouseMove.tilt);this.elements.$parent.toggleClass(e.classes.perspective,t)}cleanSpecialActions(){const e=this.getSettings();this.elements.$parent.removeClass(e.classes.perspective)}runInteractions(){var e=this;const t=this.getSettings();this.actions.setCSSTransformVariables(t.elementSettings),this.prepareSpecialActions(),jQuery.each(t.interactions,((t,n)=>{this.interactions[t]=new this.interactionsTypes[t]({motionFX:this,callback:function(){for(var t=arguments.length,s=new Array(t),i=0;i<t;i++)s[i]=arguments[i];jQuery.each(n,((t,n)=>e.actions.runAction(t,n,...s)))}}),this.interactions[t].run()}))}destroyInteractions(){this.cleanSpecialActions(),jQuery.each(this.interactions,((e,t)=>t.destroy())),this.interactions={}}refresh(){this.actions.setSettings(this.getSettings()),"background"===this.getSettings("type")&&(this.updateBackgroundLayerSize(),this.defineBackgroundLayerDimensions()),this.actions.refresh(),this.destroyInteractions(),this.runInteractions()}destroy(){this.destroyInteractions(),this.actions.refresh();const e=this.getSettings();this.$element.removeClass(e.classes.element),this.elements.$parent.removeClass(e.classes.parent),"background"===e.type&&(this.$element.removeClass(e.classes.backgroundType),this.removeBackgroundLayer())}onInit(){super.onInit();const e=this.getSettings();this.$element=e.$element,this.elements.$parent=this.$element.parent(),this.$element.addClass(e.classes.element),this.elements.$parent=this.$element.parent(),this.elements.$parent.addClass(e.classes.parent),"background"===e.type&&(this.$element.addClass(e.classes.backgroundType),this.addBackgroundLayer()),this.defineDimensions(),e.$targetElement="element"===e.type?this.$element:this.elements.$motionFXLayer,this.interactions={},this.actions=new r.default(e),this.initInteractionsTypes(),this.runInteractions()}}t.default=_default},8098:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;class _default extends elementorModules.Module{constructor(){super(),elementorFrontend.elementsHandler.attachHandler("paypal-button",(()=>n.e(375).then(n.bind(n,466)))),elementorFrontend.elementsHandler.attachHandler("stripe-button",(()=>Promise.all([n.e(786),n.e(857)]).then(n.bind(n,9036))))}}t.default=_default},6275:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;class _default extends elementorModules.Module{constructor(){super(),elementorFrontend.elementsHandler.attachHandler("progress-tracker",(()=>n.e(581).then(n.bind(n,287))))}}t.default=_default},2450:(e,t,n)=>{"use strict";var s=n(6784);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=s(n(2121));class _default extends elementorModules.Module{constructor(){super(),elementorFrontend.elementsHandler.attachHandler("section",i.default,null),elementorFrontend.elementsHandler.attachHandler("container",i.default,null),elementorFrontend.elementsHandler.attachHandler("widget",i.default,null)}}t.default=_default},2121:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var s=n(6550);t.default=elementorModules.frontend.handlers.Base.extend({currentConfig:{},debouncedReactivate:null,bindEvents(){elementorFrontend.addListenerOnce(this.getUniqueHandlerID()+"sticky","resize",this.reactivateOnResize)},unbindEvents(){elementorFrontend.removeListeners(this.getUniqueHandlerID()+"sticky","resize",this.reactivateOnResize)},isStickyInstanceActive(){return void 0!==this.$element.data("sticky")},getResponsiveSetting(e){const t=this.getElementSettings();return elementorFrontend.getCurrentDeviceSetting(t,e)},getResponsiveSettingList:e=>["",...Object.keys(elementorFrontend.config.responsive.activeBreakpoints)].map((t=>t?`${e}_${t}`:e)),getConfig(){const e=this.getElementSettings(),t={to:e.sticky,offset:this.getResponsiveSetting("sticky_offset"),effectsOffset:this.getResponsiveSetting("sticky_effects_offset"),classes:{sticky:"elementor-sticky",stickyActive:"elementor-sticky--active elementor-section--handles-inside",stickyEffects:"elementor-sticky--effects",spacer:"elementor-sticky__spacer"},isRTL:elementorFrontend.config.is_rtl,isScrollSnapActive:(0,s.isScrollSnapActive)(),handleScrollbarWidth:elementorFrontend.isEditMode()},n=elementorFrontend.elements.$wpAdminBar,i=this.isContainerElement(this.$element[0])&&!this.isContainerElement(this.$element[0].parentElement);return n.length&&"top"===e.sticky&&"fixed"===n.css("position")&&(t.offset+=n.height()),e.sticky_parent&&!i&&(t.parent=".e-con, .e-con-inner, .elementor-widget-wrap"),t},activate(){this.currentConfig=this.getConfig(),this.$element.sticky(this.currentConfig)},deactivate(){this.isStickyInstanceActive()&&this.$element.sticky("destroy")},run(e){if(this.getElementSettings("sticky")){var t=elementorFrontend.getCurrentDeviceMode();-1!==this.getElementSettings("sticky_on").indexOf(t)?!0===e?this.reactivate():this.isStickyInstanceActive()||this.activate():this.deactivate()}else this.deactivate()},reactivateOnResize(){clearTimeout(this.debouncedReactivate),this.debouncedReactivate=setTimeout((()=>{const e=this.getConfig();JSON.stringify(e)!==JSON.stringify(this.currentConfig)&&this.run(!0)}),300)},reactivate(){this.deactivate(),this.activate()},onElementChange(e){-1!==["sticky","sticky_on"].indexOf(e)&&this.run(!0);-1!==[...this.getResponsiveSettingList("sticky_offset"),...this.getResponsiveSettingList("sticky_effects_offset"),"sticky_parent"].indexOf(e)&&this.reactivate()},onDeviceModeChange(){setTimeout((()=>this.run(!0)))},onInit(){elementorModules.frontend.handlers.Base.prototype.onInit.apply(this,arguments),elementorFrontend.isEditMode()&&elementor.listenTo(elementor.channels.deviceMode,"change",(()=>this.onDeviceModeChange())),this.run()},onDestroy(){elementorModules.frontend.handlers.Base.prototype.onDestroy.apply(this,arguments),this.deactivate()},isContainerElement:e=>["e-con","e-con-inner"].some((t=>e?.classList.contains(t)))})},7937:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;class _default extends elementorModules.Module{constructor(){super(),elementorFrontend.hooks.addAction("frontend/element_ready/video-playlist.default",(e=>{n.e(519).then(n.bind(n,4161)).then((t=>{let{default:n}=t;elementorFrontend.elementsHandler.addHandler(n,{$element:e,toggleSelf:!1})}))}))}}t.default=_default},6550:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isScrollSnapActive=t.escapeHTML=void 0;t.escapeHTML=e=>{const t={"&":"&amp;","<":"&lt;",">":"&gt;","'":"&#39;",'"':"&quot;"};return e.replace(/[&<>'"]/g,(e=>t[e]||e))};t.isScrollSnapActive=()=>"yes"===(elementorFrontend.isEditMode()?elementor.settings.page.model.attributes?.scroll_snap:elementorFrontend.config.settings.page?.scroll_snap)},6784:e=>{e.exports=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}},e.exports.__esModule=!0,e.exports.default=e.exports}},e=>{var t;t=3e3,e(e.s=t)}]);