You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Fipamo/public/assets/scripts/dash.min.js

11 lines
89 KiB
JavaScript

!function(){"use strict";function e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function t(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function n(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}function r(e){return r=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},r(e)}function o(e,t){return o=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},o(e,t)}function i(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function a(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,o=r(e);if(t){var a=r(this).constructor;n=Reflect.construct(o,arguments,a)}else n=o.apply(this,arguments);return i(this,n)}}var s="POST",l="json",u="x-www-form-urlencoded",c="/api/v1/status",d="/api/v1/settings/publish",f="/api/v1/mailer",p="/api/v1/login",h="writeSettings",g="publishSite",m="createNewPage",v="editPage",y="deletePage",b="reIndexPages",w="getSiteSettings",E="getMemberInfo",I="apiUseAuthorized",k=function(){function t(){var n=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;e(this,t),this.percentComplete=0,this.baseURL=null,this.status=!1,r&&(this.baseURL=r),this._request(this.baseURL?this.baseURL+c:c).then((function(e){e.type===I&&(n.token=e.token)}))}return n(t,[{key:"login",value:function(e){var t=this;return new Promise((function(n,r){t.baseURL?e.remote=!0:e.remote=!1,t.key?e.key=t.key:e.key=null,t._request(t.baseURL?t.baseURL+p:p,"getAuthStatus",s,l,e).then((function(e){n(e)})).catch((function(e){r(e)}))}))}},{key:"sync",value:function(e,t){var n=this;return new Promise((function(r,o){var i="";switch(e){case"syncSite":i="/api/v1/settings/sync";break;case"syncNav":i="/api/v1/settings/nav-sync"}n._request(n.baseURL?n.baseURL+i:i,h,s,l,t).then((function(e){r(e)})).catch((function(e){o(e)}))}))}},{key:"publish",value:function(e){var t=this;return new Promise((function(n,r){t._request(t.baseURL?t.baseURL+d:d,g,s,l,e).then((function(e){n(e)})).catch((function(e){r(e)}))}))}},{key:"pageActions",value:function(e,t){var n,r,o,i=this;switch(e){case m:n="/api/v1/page/create",r=m,o=u;break;case v:n="/api/v1/page/write",r=v,o=u;break;case y:n="/api/v1/page/delete",r=y,o=l}return this.baseURL?t.remote=!0:t.remote=!1,new Promise((function(e,a){i._request(i.baseURL?i.baseURL+n:n,r,s,o,t).then((function(t){e(t)})).catch((function(e){a(e)}))}))}},{key:"sendMail",value:function(e){var t=this;return new Promise((function(n,r){t._request(t.baseURL?t.baseURL+f:f,"sendMail",s,l,e).then((function(e){n(e)})).catch((function(e){r(e)}))}))}},{key:"getInfo",value:function(e){var t,n,r=this;return"site"==e?(t="/api/v1/settings/site",n=w):(t="/api/v1/settings/member",n=E),new Promise((function(e,o){r._request(r.baseURL?r.baseURL+t:t,n).then((function(t){e(t)})).catch((function(e){o(e)}))}))}},{key:"_request",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"GET",r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:l,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,i=this;return new Promise((function(a,c){var d=new XMLHttpRequest;if(d.upload.onprogress=i.handleLoadProgress,d.open(n,e,!0),d.onload=function(){if(200==d.status){var e=JSON.parse(d.response);a(e)}else{var t=JSON.parse(d.response);c(t)}},"PUT"==n||n==s)switch(t!==h&&t!==v&&t!==m&&t!==y&&t!==g&&t!==b||d.setRequestHeader("fipamo-access-token",i.token),r){case l:d.setRequestHeader("Content-type","application/"+r),d.send(JSON.stringify(o));break;case u:d.send(o)}else
for(var t=0,n=l.animations,r=n.length;t<r;){var o=n[t],i=o.animatable,a=o.tweens,s=a.length-1,u=a[s];s&&(u=he(a,(function(t){return e<t.end}))[0]||u);for(var c=te(e-u.start-u.delay,0,u.duration)/u.duration,d=isNaN(c)?1:u.easing(c),f=u.to.strings,p=u.round,h=[],g=u.to.numbers.length,m=void 0,v=0;v<g;v++){var y=void 0,b=u.to.numbers[v],w=u.from.numbers[v]||0;y=u.isPath?Re(u.value,d*b,u.isPathTargetInsideSVG):w+d*(b-w),p&&(u.isColor&&v>2||(y=Math.round(y*p)/p)),h.push(y)}var E=f.length;if(E){m=f[0];for(var I=0;I<E;I++){f[I];var k=f[I+1],S=h[I];isNaN(S)||(m+=k?S+k:S+" ")}}else m=h[0];je[o.type](i.target,o.property,m,i.transforms),o.currentValue=m,t++}}function h(e){l[e]&&!l.passThrough&&l[e](l)}function g(e){var d=l.duration,g=l.delay,m=d-l.endDelay,v=c(e);l.progress=te(v/d*100,0,100),l.reversePlayback=v<l.currentTime,t&&function(e){if(l.reversePlayback)for(var n=i;n--;)f(e,t[n]);else for(var r=0;r<i;r++)f(e,t[r])}(v),!l.began&&l.currentTime>0&&(l.began=!0,h("begin")),!l.loopBegan&&l.currentTime>0&&(l.loopBegan=!0,h("loopBegin")),v<=g&&0!==l.currentTime&&p(0),(v>=m&&l.currentTime!==d||!d)&&p(d),v>g&&v<m?(l.changeBegan||(l.changeBegan=!0,l.changeCompleted=!1,h("changeBegin")),h("change"),p(v)):l.changeBegan&&(l.changeCompleted=!0,l.changeBegan=!1,h("changeComplete")),l.currentTime=te(v,0,d),l.began&&h("update"),e>=d&&(r=0,l.remaining&&!0!==l.remaining&&l.remaining--,l.remaining?(n=o,h("loopComplete"),l.loopBegan=!1,"alternate"===l.direction&&u()):(l.paused=!0,l.completed||(l.completed=!0,h("loopComplete"),h("complete"),!l.passThrough&&"Promise"in window&&(a(),s(l)))))}return s(l),l.reset=function(){var e=l.direction;l.passThrough=!1,l.currentTime=0,l.progress=0,l.paused=!0,l.began=!1,l.loopBegan=!1,l.changeBegan=!1,l.completed=!1,l.changeCompleted=!1,l.reversePlayback=!1,l.reversed="reverse"===e,l.remaining=l.loop,t=l.children;for(var n=i=t.length;n--;)l.children[n].reset();(l.reversed&&!0!==l.loop||"alternate"===e&&1===l.loop)&&l.remaining++,p(l.reversed?l.duration:0)},l._onDocumentVisibility=d,l.set=function(e,t){return We(e,t),l},l.tick=function(e){o=e,n||(n=o),g((o+(r-n))*Ze.speed)},l.seek=function(e){g(c(e))},l.pause=function(){l.paused=!0,d()},l.play=function(){l.paused&&(l.completed&&l.reset(),l.paused=!1,Ve.push(l),d(),Je())},l.reverse=function(){u(),l.completed=!l.reversed,d()},l.restart=function(){l.reset(),l.play()},l.remove=function(e){et(He(e),l)},l.reset(),l.autoplay&&l.play(),l}function Ke(e,t){for(var n=t.length;n--;)ve(e,t[n].animatable.target)&&t.splice(n,1)}function et(e,t){var n=t.animations,r=t.children;Ke(e,n);for(var o=r.length;o--;){var i=r[o],a=i.animations;Ke(e,a),a.length||i.children.length||r.splice(o,1)}n.length||r.length||t.pause()}Ze.version="3.2.1",Ze.speed=1,Ze.suspendWhenDocumentHidden=!0,Ze.running=Ve,Ze.remove=function(e){for(var t=He(e),n=Ve.length;n--;){et(t,Ve[n])}},Ze.get=_e,Ze.set=We,Ze.convertPx=Te,Ze.path=function(e,t){var n=oe.str(e)?pe(e)[0]:e,r=t||100;return function(e){return{property:e,el:n,svg:Ne(n),totalLength:Me(n)*(r/100)}}},Ze.setDashoffset=function(e){var t=Me(e);return e.setAttribute("stroke-dasharray",t),t},Ze.stagger=function(e,t){void 0===t&&(t={});var n=t.direction||"normal",r=t.easing?fe(t.easing):null,o=t.grid,i=t.axis,a=t.from||0,s="first"===a,l="center"===a,u="last"===a,c=oe.arr(e),d=c?parseFloat(e[0]):parseFloat(e),f=c?parseFloat(e[1]):0,p=Ie(c?e[1]:e)||0,h=t.start||0+(c?d:0),g=[],m=0;return function(e,t,v){if(s&&(a=0),l&&(a=(v-1)/2),u&&(a=v-1),!g.length){for(var y=0;y<v;y++){if(o){var b=l?(o[0]-1)/2:a%o[0],w=l?(o[1]-1)/2:Math.floor(a/o[0]),E=b-y%o[0],I=w-Math.floor(y/o[0]),k=Math.sqrt(E*E+I*I);"x"===i&&(k=-E),"y"===i&&(k=-I),g.push(k)}else g.push(Math.abs(a-y));m=Math.max.apply(Math,g)}r&&(g=g.map((function(e){return r(e/m)*m}))),"reverse"===n&&(g=g.map((function(e){return i?e<0?-1*e:-e:Math.abs(m-e)})))}return h+(c?(f-d)/m:d)*(Math.round(100*g[t])/100)+p}},Ze.timeline=function(e){void 0===e&&(e={});var t=Ze(e);return t.duration=0,t.add=function(n,r){var o=Ve.indexOf(t),i=t.children;function a(e){e.passThrough=!0}o>-1&&Ve.splice(o,1);for(var s=0;s<i.length;s++)
/**!
* Sortable 1.14.0
* @author RubaXa <trash@rubaxa.org>
* @author owenm <owen23355@gmail.com>
* @license MIT
*/
function vt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function yt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?vt(Object(n),!0).forEach((function(t){wt(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function bt(e){return bt="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},bt(e)}function wt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Et(){return Et=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Et.apply(this,arguments)}function It(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function kt(e){if("undefined"!=typeof window&&window.navigator)return!!navigator.userAgent.match(e)}var St=kt(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),Tt=kt(/Edge/i),Dt=kt(/firefox/i),Pt=kt(/safari/i)&&!kt(/chrome/i)&&!kt(/android/i),Bt=kt(/iP(ad|od|hone)/i),xt=kt(/chrome/i)&&kt(/android/i),_t={capture:!1,passive:!1};function At(e,t,n){e.addEventListener(t,n,!St&&_t)}function Ot(e,t,n){e.removeEventListener(t,n,!St&&_t)}function Lt(e,t){if(t){if(">"===t[0]&&(t=t.substring(1)),e)try{if(e.matches)return e.matches(t);if(e.msMatchesSelector)return e.msMatchesSelector(t);if(e.webkitMatchesSelector)return e.webkitMatchesSelector(t)}catch(e){return!1}return!1}}function Ct(e){return e.host&&e!==document&&e.host.nodeType?e.host:e.parentNode}function Mt(e,t,n,r){if(e){n=n||document;do{if(null!=t&&(">"===t[0]?e.parentNode===n&&Lt(e,t):Lt(e,t))||r&&e===n)return e;if(e===n)break}while(e=Ct(e))}return null}var Nt,Rt=/\s+/g;function Ut(e,t,n){if(e&&t)if(e.classList)e.classList[n?"add":"remove"](t);else{var r=(" "+e.className+" ").replace(Rt," ").replace(" "+t+" "," ");e.className=(r+(n?" "+t:"")).replace(Rt," ")}}function Ht(e,t,n){var r=e&&e.style;if(r){if(void 0===n)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(e,""):e.currentStyle&&(n=e.currentStyle),void 0===t?n:n[t];t in r||-1!==t.indexOf("webkit")||(t="-webkit-"+t),r[t]=n+("string"==typeof n?"":"px")}}function Xt(e,t){var n="";if("string"==typeof e)n=e;else do{var r=Ht(e,"transform");r&&"none"!==r&&(n=r+" "+n)}while(!t&&(e=e.parentNode));var o=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return o&&new o(n)}function Ft(e,t,n){if(e){var r=e.getElementsByTagName(t),o=0,i=r.length;if(n)for(;o<i;o++)n(r[o],o);return r}return[]}function Yt(){var e=document.scrollingElement;return e||document.documentElement}function qt(e,t,n,r,o){if(e.getBoundingClientRect||e===window){var i,a,s,l,u,c,d;if(e!==window&&e.parentNode&&e!==Yt()?(a=(i=e.getBoundingClientRect()).top,s=i.left,l=i.bottom,u=i.right,c=i.height,d=i.width):(a=0,s=0,l=window.innerHeight,u=window.innerWidth,c=window.innerHeight,d=window.innerWidth),(t||n)&&e!==window&&(o=o||e.parentNode,!St))do{if(o&&o.getBoundingClientRect&&("none"!==Ht(o,"transform")||n&&"static"!==Ht(o,"position"))){var f=o.getBoundingClientRect();a-=f.top+parseInt(Ht(o,"border-top-width")),s-=f.left+parseInt(Ht(o,"border-left-width")),l=a+i.height,u=s+i.width;break}}while(o=o.parentNode);if(r&&e!==window){var p=Xt(o||e),h=p&&p.a,g=p&&p.d;p&&(l=(a/=g)+(c/=g),u=(s/=
var o,i=(e.touches?e.touches[0]:e).clientX,a=(e.touches?e.touches[0]:e).clientY,s=t.scrollSensitivity,l=t.scrollSpeed,u=Yt(),c=!1;sr!==n&&(sr=n,hr(),ar=t.scroll,o=t.scrollFn,!0===ar&&(ar=Vt(n,!0)));var d=0,f=ar;do{var p=f,h=qt(p),g=h.top,m=h.bottom,v=h.left,y=h.right,b=h.width,w=h.height,E=void 0,I=void 0,k=p.scrollWidth,S=p.scrollHeight,T=Ht(p),D=p.scrollLeft,P=p.scrollTop;p===u?(E=b<k&&("auto"===T.overflowX||"scroll"===T.overflowX||"visible"===T.overflowX),I=w<S&&("auto"===T.overflowY||"scroll"===T.overflowY||"visible"===T.overflowY)):(E=b<k&&("auto"===T.overflowX||"scroll"===T.overflowX),I=w<S&&("auto"===T.overflowY||"scroll"===T.overflowY));var B=E&&(Math.abs(y-i)<=s&&D+b<k)-(Math.abs(v-i)<=s&&!!D),x=I&&(Math.abs(m-a)<=s&&P+w<S)-(Math.abs(g-a)<=s&&!!P);if(!fr[d])for(var _=0;_<=d;_++)fr[_]||(fr[_]={});fr[d].vx==B&&fr[d].vy==x&&fr[d].el===p||(fr[d].el=p,fr[d].vx=B,fr[d].vy=x,clearInterval(fr[d].pid),0==B&&0==x||(c=!0,fr[d].pid=setInterval(function(){r&&0===this.layer&&Kn.active._onTouchMove(cr);var t=fr[this.layer].vy?fr[this.layer].vy*l:0,n=fr[this.layer].vx?fr[this.layer].vx*l:0;"function"==typeof o&&"continue"!==o.call(Kn.dragged.parentNode[en],n,t,e,cr,fr[this.layer].el)||Zt(fr[this.layer].el,n,t)}.bind({layer:d}),24))),d++}while(t.bubbleScroll&&f!==u&&(f=Vt(f,!1)));pr=c}}),30),vr=function(e){var t=e.originalEvent,n=e.putSortable,r=e.dragEl,o=e.activeSortable,i=e.dispatchSortableEvent,a=e.hideGhostForTarget,s=e.unhideGhostForTarget;if(t){var l=n||o;a();var u=t.changedTouches&&t.changedTouches.length?t.changedTouches[0]:t,c=document.elementFromPoint(u.clientX,u.clientY);s(),l&&!l.el.contains(c)&&(i("spill"),this.onSpill({dragEl:r,putSortable:n}))}};function yr(){}function br(){}yr.prototype={startIndex:null,dragStart:function(e){var t=e.oldDraggableIndex;this.startIndex=t},onSpill:function(e){var t=e.dragEl,n=e.putSortable;this.sortable.captureAnimationState(),n&&n.captureAnimationState();var r=Wt(this.sortable.el,this.startIndex,this.options);r?this.sortable.el.insertBefore(t,r):this.sortable.el.appendChild(t),this.sortable.animateAll(),n&&n.animateAll()},drop:vr},Et(yr,{pluginName:"revertOnSpill"}),br.prototype={onSpill:function(e){var t=e.dragEl,n=e.putSortable||this.sortable;n.captureAnimationState(),t.parentNode&&t.parentNode.removeChild(t),n.animateAll()},drop:vr},Et(br,{pluginName:"removeOnSpill"}),Kn.mount(new function(){function e(){for(var e in this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0},this)"_"===e.charAt(0)&&"function"==typeof this[e]&&(this[e]=this[e].bind(this))}return e.prototype={dragStarted:function(e){var t=e.originalEvent;this.sortable.nativeDraggable?At(document,"dragover",this._handleAutoScroll):this.options.supportPointer?At(document,"pointermove",this._handleFallbackAutoScroll):t.touches?At(document,"touchmove",this._handleFallbackAutoScroll):At(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(e){var t=e.originalEvent;this.options.dragOverBubble||t.rootEl||this._handleAutoScroll(t)},drop:function(){this.sortable.nativeDraggable?Ot(document,"dragover",this._handleAutoScroll):(Ot(document,"pointermove",this._handleFallbackAutoScroll),Ot(document,"touchmove",this._handleFallbackAutoScroll),Ot(document,"mousemove",this._handleFallbackAutoScroll)),gr(),hr(),clearTimeout(Nt),Nt=void 0},nulling:function(){cr=sr=ar=pr=dr=lr=ur=null,fr.length=0},_handleFallbackAutoScroll:function(e){this._handleAutoScroll(e,!0)},_handleAutoScroll:function(e,t){var n=this,r=(e.touches?e.touches[0]:e).clientX,o=(e.touches?e.touches[0]:e).clientY,i=document.elementFromPoint(r,o);if(cr=e,t||this.options.forceAutoScrollFallback||Tt||St||Pt){mr(e,this.options,i,t);var a=Vt(i,!0);!pr||dr&&r===lr&&o===ur||(dr&&gr(),dr=setInterval((function(){var i=Vt(document.elementFromPoint(r,o),!0);i!==a&&(a=i,hr()),mr(e,n.options,i,t)}),10),lr=r,ur=o)}else{if(!this.options.bubbleScroll||Vt(i,!0)===Yt())return void hr();mr(e,this.options,Vt(i,!1),!1)}}},Et(e,{pluginName:"scroll",initializeByDefault:!0})}),Kn.mount(br,yr);var wr=new st,Er=function(
//# sourceMappingURL=dash.min.js.map