diff --git a/brain/data/Render.inc.php b/brain/data/Render.inc.php
index 7098f1d..6856860 100644
--- a/brain/data/Render.inc.php
+++ b/brain/data/Render.inc.php
@@ -21,7 +21,8 @@ class Render
? $settings["global"]["keywords"]
: "fipamo, blog, jamstack, php, markdown, js",
"description" => $settings["global"]["descriptions"],
- "image" => $settings["global"]["background"],
+ "image" =>
+ $settings["global"]["base_url"] . $settings["global"]["background"],
];
//copy current theme assets to public
if (is_file("../public/assets/css/base.css")) {
diff --git a/content/themes/fipamo-default/frame.twig b/content/themes/fipamo-default/frame.twig
index dfc5041..e08d756 100644
--- a/content/themes/fipamo-default/frame.twig
+++ b/content/themes/fipamo-default/frame.twig
@@ -15,7 +15,7 @@
-
+
diff --git a/public/assets/scripts/dash.min.js b/public/assets/scripts/dash.min.js
index f42f4bd..08a8360 100644
--- a/public/assets/scripts/dash.min.js
+++ b/public/assets/scripts/dash.min.js
@@ -1,11 +1,11 @@
-!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;n2&&void 0!==arguments[2]?arguments[2]:D,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:P,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,a=this;return new Promise((function(t,i){var l=new XMLHttpRequest;if(l.upload.onprogress=a.handleLoadProgress,l.open(n,e,!0),l.onload=function(){if(200==l.status){var e=JSON.parse(l.response);t(e)}else{var n=JSON.parse(l.response);i(n)}},"PUT"==n||n==x)switch(r){case P:l.setRequestHeader("Content-type","application/"+r),l.send(JSON.stringify(o));break;case _:l.send(o)}else l.send()}))}},{key:"handleLoadProgress",value:function(e){this.percentComplete=Math.ceil(e.loaded/e.total*100)}}]),t}(),O="POST",C="createNewPage",A="editPage",M="deletePage",N="json",L="x-www-form-urlencoded",R=function(){function t(){var n=this;e(this,t),this.percentComplete=0,this.token=null,this._request("/api/v1/status").then((function(e){e.type===s&&(n.token=e.token)}))}return n(t,[{key:"syncSettings",value:function(e){var t=this;return new Promise((function(n,r){t._request("/api/v1/settings/sync",v,O,N,e).then((function(e){n(e)})).catch((function(e){r(e)}))}))}},{key:"imageUpload",value:function(e,t){var n=this;return new Promise((function(r,o){var a="";switch(e){case"avatar-upload":a="/api/v1/settings/add-avatar";break;case"background-upload":a="/api/v1/settings/add-feature-background";break;default:a="/api/v1/page/add-entry-image"}for(var i=new FormData,l=0;l2&&void 0!==arguments[2]?arguments[2]:"GET",r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:N,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,a=this;return new Promise((function(i,l){var u=new XMLHttpRequest;if(u.upload.onprogress=a.handleLoadProgress,u.open(n,e,!0),u.onload=function(){if(200==u.status){var e=JSON.parse(u.response);i(e)}else{var t=JSON.parse(u.response);l(t)}},"PUT"==n||n==O)switch(t!==g&&t!==w&&t!==v&&t!==m&&t!==E&&t!==y&&t!==b&&t!==I||u.setRequestHeader("fipamo-access-token",a.token),r){case N:u.setRequestHeader("Content-type","application/"+r),u.send(JSON.stringify(o));break;case L:u.send(o)}else u.send()}))}},{key:"handleLoadProgress",value:function(e){this.percentComplete=Math.ceil(e.loaded/e.total*100)}}]),t}(),H=function(){function t(){e(this,t)}return n(t,[{key:"imgLoad",value:function(e){return new Promise((function(t,n){var r=new XMLHttpRequest;r.open("GET",e),r.responseType="blob",r.onload=function(){200===r.status?t(r.response):n(new Error("Image didn't load successfully; error code:"+r.statusText))},r.onerror=function(){n(new Error("There was a network error."))},r.send()}))}},{key:"loadImage",value:function(e){var t=this;return new Promise((function(n,r){(new Image).crossOrigin="",t.imgLoad(e).then((function(e){var t=window.URL.createObjectURL(e);n(t)}),(function(e){r(e)}))}))}},{key:"formDataToJSON",value:function(e){var t={};return new FormData(e).forEach((function(e,n){t.hasOwnProperty(n)?(Array.isArray(t[n])||(t[n]=[t[n]]),t[n].push(e)):t[n]=e})),t}}]),t}(),F=function(){function t(){e(this,t)}return n(t,[{key:"cleanString",value:function(e){return e.replace(/(^\-+|[^a-zA-Z0-9\/_| -]+|\-+$)/g,"").toLowerCase().replace(/[\/_| -]+/g,"-")}},{key:"decodeHTML",value:function(e,t){var n=0,r=0,o=!1;void 0===t&&(t=2),e=e.toString().replace(/</g,"<").replace(/>/g,">");var a={ENT_NOQUOTES:0,ENT_HTML_QUOTE_SINGLE:1,ENT_HTML_QUOTE_DOUBLE:2,ENT_COMPAT:2,ENT_QUOTES:3,ENT_IGNORE:4};if(0===t&&(o=!0),"number"!=typeof t){for(t=[].concat(t),r=0;r]*>/g,"\n"),r.append("id",document.getElementById("post-edit-index").getAttribute("data-index")),r.append("uuid",document.getElementById("post-edit-index").getAttribute("data-uuid")),r.append("layout",document.getElementById("post-edit-index").getAttribute("data-layout")),r.append("current_title",document.getElementById("post-edit-index").getAttribute("data-slug")),r.append("content",a),r.append("title",document.getElementById("post_title").value),r.append("created",document.getElementById("post-date").getAttribute("data-raw")),r.append("slug",(new F).cleanString(document.getElementById("post_title").value)),r.append("tags",document.getElementById("post_tags").value),r.append("menu",document.getElementById("option-menu-pin").getAttribute("data-active")),r.append("featured",document.getElementById("option-feature").getAttribute("data-active")),r.append("published",document.getElementById("option-published").getAttribute("data-active")),null!=e||null!=e)e.type.match("image.*")?r.append("feature_image",e,e.name):n("Not an image file");else{var i=document.getElementById("featured-image").src;null!=i||null!=i?r.append("feature_image",i):r.append("feature_image",null)}t(r)}))}}]),t}(),q="editorDelete",U="editorUploadImage",Y="editorSave",j="editorUpdate";new function t(){e(this,t)};var W=["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopStyle","borderRightStyle","borderBottomStyle","borderLeftStyle","borderTopWidth","boxSizing","fontFamily","fontSize","fontWeight","height","letterSpacing","lineHeight","marginBottom","marginLeft","marginRight","marginTop","outlineWidth","overflow","overflowX","overflowY","paddingBottom","paddingLeft","paddingRight","paddingTop","textAlign","textOverflow","textTransform","whiteSpace","wordBreak","wordWrap"],z=function(e,t){var n=document.createElement("div");return function(t){var r=function(){var t={position:"absolute",left:-9999,top:0,zIndex:-2e3};return"TEXTAREA"===e.tagName&&W.push("width"),W.forEach((function(n){t[n]=getComputedStyle(e)[n]})),t}();Object.keys(r).forEach((function(e){n.style[e]=r[e]})),n.innerHTML=t,e.parentNode.insertBefore(n,e.nextSibling)}(t),{rect:function(){var e=n.ownerDocument.getElementById("caret-position-marker"),t={left:e.offsetLeft,top:e.offsetTop,height:e.offsetHeight};return n.parentNode.removeChild(n),t}}};function G(e){return(G="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var Q=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.customPos,n=e.iframe,r=e.noShadowCaret;return n?{iframe:n,window:n.contentWindow,document:n.contentDocument||n.contentWindow.document,noShadowCaret:r,customPos:t}:{window:window,document:document,noShadowCaret:r,customPos:t}},V=function(e){return"object"===G(e)&&null!==e},J=function(e,t){var n=function(){return e.selectionStart},r=function(r){var o=function(e){return e.replace(/<|>|`|"|&/g,"?").replace(/\r\n|\r|\n/g,"
")};(t.customPos||0===t.customPos)&&(r=t.customPos);var a=void 0===r?n():r,i=e.value.slice(0,a),l=e.value.slice(a),u=''.concat(o(i),"");u+='|',u+=''.concat(o(l),"");var s=z(e,u).rect();return s.pos=n(),s};return{getPos:n,setPos:function(t){return e.setSelectionRange(t,t),e},getOffset:function(n){var o=function(e,t){var n=t&&t.window||window,r=t&&t.document||document,o=e.getBoundingClientRect(),a=r.documentElement,i=n.pageXOffset||a.scrollLeft,l=n.pageYOffset||a.scrollTop;return{top:o.top+l,left:o.left+i}}(e),a=r(n);return{top:o.top+a.top+t.document.body.scrollTop,left:o.left+a.left+t.document.body.scrollLeft,height:a.height}},getPosition:r}},$=function(e,t){return function(e){return!!(e.contentEditable?"true"===e.contentEditable:"true"===e.getAttribute("contenteditable"))}(e)?function(e,t){var n=function(){var n=r(),o={height:0,left:0,right:0};if(!n)return o;var a=t.customPos||0===t.customPos;if(n.endOffset-1>0&&n.endContainer!==e||a){var i=n.cloneRange(),l=a?t.customPos:n.endOffset;i.setStart(n.endContainer,l-1<0?0:l-1),i.setEnd(n.endContainer,l);var u=i.getBoundingClientRect();o={height:u.height,left:u.left+u.width,top:u.top},i.detach()}if((!o||o&&0===o.height)&&!t.noShadowCaret){var s=n.cloneRange(),c=t.document.createTextNode("|");s.insertNode(c),s.selectNode(c);var d=s.getBoundingClientRect();o={height:d.height,left:d.left,top:d.top},c.parentNode.removeChild(c),s.detach()}if(o){var f=t.document.documentElement;o.top+=t.window.pageYOffset-(f.clientTop||0),o.left+=t.window.pageXOffset-(f.clientLeft||0)}return o},r=function(){if(t.window.getSelection){var e=t.window.getSelection();return e.rangeCount>0?e.getRangeAt(0):null}},o=function(){var t=r(),n=t.cloneRange();n.selectNodeContents(e),n.setEnd(t.endContainer,t.endOffset);var o=n.toString().length;return n.detach(),o};return{getPos:o,setPos:function(n){var r=t.window.getSelection();if(r){var o=0,a=!1;!function e(i,l){for(var u=0;u=i){a=!0;var c=t.document.createRange();c.setStart(s,i-o),r.removeAllRanges(),r.addRange(c);break}o+=s.length}else e(n,s)}}(n,e)}return e},getPosition:function(){var r=n(),a=o(),i=e.getBoundingClientRect(),l=i.top+t.document.body.scrollTop,u=i.left+t.document.body.scrollLeft;return r.left-=u,r.top-=l,r.pos=a,r},getOffset:n,getRange:r}}(e,t):J(e,t)},Z=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n;V(t)&&(r=t,t=null);var o=Q(r),a=$(e,o);return t||0===t?a.setPos(t):a.getPosition()},K=function(t){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&o(e,t)}(a,t);var r=i(a);function a(t,n){var o;return e(this,a),(o=r.call(this)).textEditor=t,o.fixLimit=n,o.caretPos=null,o.url="",o.setInputs(),window.addEventListener("scroll",(function(){})),o.refresh(),o}return n(a,[{key:"setInputs",value:function(){for(var e=this,t=this,n=document.querySelectorAll(".editor-button"),r=0,o=n.length;r/g)>-1){var o=Z(e.textEditor).pos;t.refresh(),Z(e.textEditor,o)}}))}},{key:"refresh",value:function(){var e=this.textEditor.innerText;e=e.replace(new RegExp("\r?\n","g"),"
");var t=document.createElement("div");t.innerText=e,this.textEditor.innerHTML=t.innerText,this.textEditor.style.maxWidth="900px"}},{key:"notify",value:function(e,t){switch(e){case void 0:document.getElementById("submit-update").classList.add("icon-hide"),document.getElementById("submit-good").classList.remove("icon-hide"),document.getElementById("edit-update").classList.remove("submit-start"),document.getElementById("edit-update").classList.add("submit-cool"),setTimeout((function(){document.getElementById("submit-update").classList.remove("icon-hide"),document.getElementById("submit-good").classList.add("icon-hide"),document.getElementById("edit-update").classList.add("submit-start"),document.getElementById("edit-update").classList.remove("submit-cool")}),2e3);break;case void 0:break;case U:var n,r;Z(this.textEditor,this.caretPos),(n=window.getSelection()).rangeCount&&((r=n.getRangeAt(0)).deleteContents(),r.insertNode(document.createTextNode("![image alt text]("+t+" 'image title')"))),this.refresh()}}},{key:"handleEditorOption",value:function(e){var t,n,r;if(e.preventDefault(),(t=window.getSelection()).rangeCount)switch(n=t.getRangeAt(0),r=t.getRangeAt(0).toString(),n.deleteContents(),e.target.id){case"edit-bold":n.insertNode(document.createTextNode("**"+r+"**"));break;case"edit-italic":n.insertNode(document.createTextNode("*"+r+"*"));break;case"edit-strikethrough":n.insertNode(document.createTextNode(""+r+""));break;case"edit-header1":n.insertNode(document.createTextNode("# "+r));break;case"edit-header2":n.insertNode(document.createTextNode("## "+r));break;case"edit-header3":n.insertNode(document.createTextNode("### "+r));break;case"edit-image":this.caretPos=Z(this.textEditor).pos,this.emitEvent(U);break;case"submit-save":case"edit-save":this.emitEvent(Y);break;case"submit-update":case"edit-update":this.emitEvent(j);break;case"edit-link":n.insertNode(document.createTextNode("["+r+"](PASTE URL HERE)"));break;case"edit-delete":this.emitEvent(q)}this.refresh()}}]),a}(function(){function t(){e(this,t),this.listeners=new Map}return n(t,[{key:"addListener",value:function(e,t){this.listeners.has(e)||this.listeners.set(e,[]),this.listeners.get(e).push(t)}},{key:"removeListener",value:function(e,t){var n,r=this.listeners.get(e);return!!(r&&r.length&&(n=r.reduce((function(e,n,r){return"function"==typeof n&&n===t?e=r:e}),-1))>-1)&&(r.splice(n,1),this.listeners.set(e,r),!0)}},{key:"emitEvent",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r-1}function ie(e,t){return e.apply(null,t)}var le={arr:function(e){return Array.isArray(e)},obj:function(e){return ae(Object.prototype.toString.call(e),"Object")},pth:function(e){return le.obj(e)&&e.hasOwnProperty("totalLength")},svg:function(e){return e instanceof SVGElement},inp:function(e){return e instanceof HTMLInputElement},dom:function(e){return e.nodeType||le.svg(e)},str:function(e){return"string"==typeof e},fnc:function(e){return"function"==typeof e},und:function(e){return void 0===e},nil:function(e){return le.und(e)||null===e},hex:function(e){return/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(e)},rgb:function(e){return/^rgb/.test(e)},hsl:function(e){return/^hsl/.test(e)},col:function(e){return le.hex(e)||le.rgb(e)||le.hsl(e)},key:function(e){return!ee.hasOwnProperty(e)&&!te.hasOwnProperty(e)&&"targets"!==e&&"keyframes"!==e}};function ue(e){var t=/\(([^)]+)\)/.exec(e);return t?t[1].split(",").map((function(e){return parseFloat(e)})):[]}function se(e,t){var n=ue(e),r=oe(le.und(n[0])?1:n[0],.1,100),o=oe(le.und(n[1])?100:n[1],.1,100),a=oe(le.und(n[2])?10:n[2],.1,100),i=oe(le.und(n[3])?0:n[3],.1,100),l=Math.sqrt(o/r),u=a/(2*Math.sqrt(o*r)),s=u<1?l*Math.sqrt(1-u*u):0,c=u<1?(u*l-i)/s:-i+l;function d(e){var n=t?t*e/1e3:e;return n=u<1?Math.exp(-n*u*l)*(1*Math.cos(s*n)+c*Math.sin(s*n)):(1+c*n)*Math.exp(-n*l),0===e||1===e?e:1-n}return t?d:function(){var t=re.springs[e];if(t)return t;for(var n=1/6,r=0,o=0;;)if(1===d(r+=n)){if(++o>=16)break}else o=0;var a=r*n*1e3;return re.springs[e]=a,a}}function ce(e){return void 0===e&&(e=10),function(t){return Math.ceil(oe(t,1e-6,1)*e)*(1/e)}}var de,fe,he=function(){var e=.1;function t(e,t){return 1-3*t+3*e}function n(e,t){return 3*t-6*e}function r(e){return 3*e}function o(e,o,a){return((t(o,a)*e+n(o,a))*e+r(o))*e}function a(e,o,a){return 3*t(o,a)*e*e+2*n(o,a)*e+r(o)}return function(t,n,r,i){if(0<=t&&t<=1&&0<=r&&r<=1){var l=new Float32Array(11);if(t!==n||r!==i)for(var u=0;u<11;++u)l[u]=o(u*e,t,r);return function(e){return t===n&&r===i||0===e||1===e?e:o(s(e),n,i)}}function s(n){for(var i=0,u=1;10!==u&&l[u]<=n;++u)i+=e;--u;var s=i+(n-l[u])/(l[u+1]-l[u])*e,c=a(s,t,r);return c>=.001?function(e,t,n,r){for(var i=0;i<4;++i){var l=a(t,n,r);if(0===l)return t;t-=(o(t,n,r)-e)/l}return t}(n,s,t,r):0===c?s:function(e,t,n,r,a){var i,l,u=0;do{(i=o(l=t+(n-t)/2,r,a)-e)>0?n=l:t=l}while(Math.abs(i)>1e-7&&++u<10);return l}(n,i,i+e,t,r)}}}(),pe=(de={linear:function(){return function(e){return e}}},fe={Sine:function(){return function(e){return 1-Math.cos(e*Math.PI/2)}},Circ:function(){return function(e){return 1-Math.sqrt(1-e*e)}},Back:function(){return function(e){return e*e*(3*e-2)}},Bounce:function(){return function(e){for(var t,n=4;e<((t=Math.pow(2,--n))-1)/11;);return 1/Math.pow(4,3-n)-7.5625*Math.pow((3*t-2)/22-e,2)}},Elastic:function(e,t){void 0===e&&(e=1),void 0===t&&(t=.5);var n=oe(e,1,10),r=oe(t,.1,2);return function(e){return 0===e||1===e?e:-n*Math.pow(2,10*(e-1))*Math.sin((e-1-r/(2*Math.PI)*Math.asin(1/n))*(2*Math.PI)/r)}}},["Quad","Cubic","Quart","Quint","Expo"].forEach((function(e,t){fe[e]=function(){return function(e){return Math.pow(e,t+2)}}})),Object.keys(fe).forEach((function(e){var t=fe[e];de["easeIn"+e]=t,de["easeOut"+e]=function(e,n){return function(r){return 1-t(e,n)(1-r)}},de["easeInOut"+e]=function(e,n){return function(r){return r<.5?t(e,n)(2*r)/2:1-t(e,n)(-2*r+2)/2}},de["easeOutIn"+e]=function(e,n){return function(r){return r<.5?(1-t(e,n)(1-2*r))/2:(t(e,n)(2*r-1)+1)/2}}})),de);function ge(e,t){if(le.fnc(e))return e;var n=e.split("(")[0],r=pe[n],o=ue(e);switch(n){case"spring":return se(e,t);case"cubicBezier":return ie(he,o);case"steps":return ie(ce,o);default:return ie(r,o)}}function me(e){try{return document.querySelectorAll(e)}catch(e){return}}function ve(e,t){for(var n=e.length,r=arguments.length>=2?t:void 0,o=[],a=0;a1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}if(0==i)t=n=r=l;else{var c=l<.5?l*(1+i):l+i-l*i,d=2*l-c;t=s(d,c,a+1/3),n=s(d,c,a),r=s(d,c,a-1/3)}return"rgba("+255*t+","+255*n+","+255*r+","+u+")"}(e):void 0;var t,n}function Te(e){var t=/[+-]?\d*\.?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?(%|px|pt|em|rem|in|cm|mm|ex|ch|pc|vw|vh|vmin|vmax|deg|rad|turn)?$/.exec(e);if(t)return t[1]}function xe(e,t){return le.fnc(e)?e(t.target,t.id,t.total):e}function De(e,t){return e.getAttribute(t)}function Pe(e,t,n){if(we([n,"deg","rad","turn"],Te(t)))return t;var r=re.CSS[t+n];if(!le.und(r))return r;var o=document.createElement(e.tagName),a=e.parentNode&&e.parentNode!==document?e.parentNode:document.body;a.appendChild(o),o.style.position="absolute",o.style.width=100+n;var i=100/o.offsetWidth;a.removeChild(o);var l=i*parseFloat(t);return re.CSS[t+n]=l,l}function _e(e,t,n){if(t in e.style){var r=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),o=e.style[t]||getComputedStyle(e).getPropertyValue(r)||"0";return n?Pe(e,o,n):o}}function Be(e,t){return le.dom(e)&&!le.inp(e)&&(!le.nil(De(e,t))||le.svg(e)&&e[t])?"attribute":le.dom(e)&&we(ne,t)?"transform":le.dom(e)&&"transform"!==t&&_e(e,t)?"css":null!=e[t]?"object":void 0}function Oe(e){if(le.dom(e)){for(var t,n=e.style.transform||"",r=/(\w+)\(([^)]*)\)/g,o=new Map;t=r.exec(n);)o.set(t[1],t[2]);return o}}function Ce(e,t,n,r){var o=ae(t,"scale")?1:0+function(e){return ae(e,"translate")||"perspective"===e?"px":ae(e,"rotate")||ae(e,"skew")?"deg":void 0}(t),a=Oe(e).get(t)||o;return n&&(n.transforms.list.set(t,a),n.transforms.last=t),r?Pe(e,a,r):a}function Ae(e,t,n,r){switch(Be(e,t)){case"transform":return Ce(e,t,r,n);case"css":return _e(e,t,n);case"attribute":return De(e,t);default:return e[t]||0}}function Me(e,t){var n=/^(\*=|\+=|-=)/.exec(e);if(!n)return e;var r=Te(e)||0,o=parseFloat(t),a=parseFloat(e.replace(n[0],""));switch(n[0][0]){case"+":return o+a+r;case"-":return o-a+r;case"*":return o*a+r}}function Ne(e,t){if(le.col(e))return Se(e);if(/\s/g.test(e))return e;var n=Te(e),r=n?e.substr(0,e.length-n.length):e;return t?r+t:r}function Le(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function Re(e){for(var t,n=e.points,r=0,o=0;o0&&(r+=Le(t,a)),t=a}return r}function He(e){if(e.getTotalLength)return e.getTotalLength();switch(e.tagName.toLowerCase()){case"circle":return function(e){return 2*Math.PI*De(e,"r")}(e);case"rect":return function(e){return 2*De(e,"width")+2*De(e,"height")}(e);case"line":return function(e){return Le({x:De(e,"x1"),y:De(e,"y1")},{x:De(e,"x2"),y:De(e,"y2")})}(e);case"polyline":return Re(e);case"polygon":return function(e){var t=e.points;return Re(e)+Le(t.getItem(t.numberOfItems-1),t.getItem(0))}(e)}}function Fe(e,t){var n=t||{},r=n.el||function(e){for(var t=e.parentNode;le.svg(t)&&le.svg(t.parentNode);)t=t.parentNode;return t}(e),o=r.getBoundingClientRect(),a=De(r,"viewBox"),i=o.width,l=o.height,u=n.viewBox||(a?a.split(" "):[0,0,i,l]);return{el:r,viewBox:u,x:u[0]/1,y:u[1]/1,w:i,h:l,vW:u[2],vH:u[3]}}function Xe(e,t,n){function r(n){void 0===n&&(n=0);var r=t+n>=1?t+n:0;return e.el.getPointAtLength(r)}var o=Fe(e.el,e.svg),a=r(),i=r(-1),l=r(1),u=n?1:o.w/o.vW,s=n?1:o.h/o.vH;switch(e.property){case"x":return(a.x-o.x)*u;case"y":return(a.y-o.y)*s;case"angle":return 180*Math.atan2(l.y-i.y,l.x-i.x)/Math.PI}}function qe(e,t){var n=/[+-]?\d*\.?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?/g,r=Ne(le.pth(e)?e.totalLength:e,t)+"";return{original:r,numbers:r.match(n)?r.match(n).map(Number):[0],strings:le.str(e)||t?r.split(n):[]}}function Ue(e){return ve(e?ye(le.arr(e)?e.map(be):be(e)):[],(function(e,t,n){return n.indexOf(e)===t}))}function Ye(e){var t=Ue(e);return t.map((function(e,n){return{target:e,id:n,total:t.length,transforms:{list:Oe(e)}}}))}function je(e,t){var n=Ee(t);if(/^spring/.test(n.easing)&&(n.duration=se(n.easing)),le.arr(e)){var r=e.length;2===r&&!le.obj(e[0])?e={value:e}:le.fnc(t.duration)||(n.duration=t.duration/r)}var o=le.arr(e)?e:[e];return o.map((function(e,n){var r=le.obj(e)&&!le.pth(e)?e:{value:e};return le.und(r.delay)&&(r.delay=n?0:t.delay),le.und(r.endDelay)&&(r.endDelay=n===o.length-1?t.endDelay:0),r})).map((function(e){return ke(e,n)}))}function We(e,t){var n=[],r=t.keyframes;for(var o in r&&(t=ke(function(e){for(var t=ve(ye(e.map((function(e){return Object.keys(e)}))),(function(e){return le.key(e)})).reduce((function(e,t){return e.indexOf(t)<0&&e.push(t),e}),[]),n={},r=function(r){var o=t[r];n[o]=e.map((function(e){var t={};for(var n in e)le.key(n)?n==o&&(t.value=e[n]):t[n]=e[n];return t}))},o=0;o0?requestAnimationFrame(t):void 0}return"undefined"!=typeof document&&document.addEventListener("visibilitychange",(function(){tt.suspendWhenDocumentHidden&&(et()?e=cancelAnimationFrame(e):(Ze.forEach((function(e){return e._onDocumentVisibility()})),Ke()))})),function(){e||et()&&tt.suspendWhenDocumentHidden||!(Ze.length>0)||(e=requestAnimationFrame(t))}}();function et(){return!!document&&document.hidden}function tt(e){void 0===e&&(e={});var t,n=0,r=0,o=0,a=0,i=null;function l(e){var t=window.Promise&&new Promise((function(e){return i=e}));return e.finished=t,t}var u=function(e){var t=Ie(ee,e),n=Ie(te,e),r=We(n,e),o=Ye(e.targets),a=Ve(o,r),i=Je(a,n),l=$e;return $e++,ke(t,{id:l,children:[],animatables:o,animations:a,duration:i.duration,delay:i.delay,endDelay:i.endDelay})}(e);function s(){var e=u.direction;"alternate"!==e&&(u.direction="normal"!==e?"normal":"reverse"),u.reversed=!u.reversed,t.forEach((function(e){return e.reversed=u.reversed}))}function c(e){return u.reversed?u.duration-e:e}function d(){n=0,r=c(u.currentTime)*(1/tt.speed)}function f(e,t){t&&t.seek(e-t.timelineOffset)}function h(e){for(var t=0,n=u.animations,r=n.length;t2||(y=Math.round(y*h)/h)),p.push(y)}var E=f.length;if(E){m=f[0];for(var I=0;I0&&(u.began=!0,p("begin")),!u.loopBegan&&u.currentTime>0&&(u.loopBegan=!0,p("loopBegin")),v<=g&&0!==u.currentTime&&h(0),(v>=m&&u.currentTime!==d||!d)&&h(d),v>g&&v=d&&(r=0,u.remaining&&!0!==u.remaining&&u.remaining--,u.remaining?(n=o,p("loopComplete"),u.loopBegan=!1,"alternate"===u.direction&&s()):(u.paused=!0,u.completed||(u.completed=!0,p("loopComplete"),p("complete"),!u.passThrough&&"Promise"in window&&(i(),l(u)))))}return l(u),u.reset=function(){var e=u.direction;u.passThrough=!1,u.currentTime=0,u.progress=0,u.paused=!0,u.began=!1,u.loopBegan=!1,u.changeBegan=!1,u.completed=!1,u.changeCompleted=!1,u.reversePlayback=!1,u.reversed="reverse"===e,u.remaining=u.loop,t=u.children;for(var n=a=t.length;n--;)u.children[n].reset();(u.reversed&&!0!==u.loop||"alternate"===e&&1===u.loop)&&u.remaining++,h(u.reversed?u.duration:0)},u._onDocumentVisibility=d,u.set=function(e,t){return Qe(e,t),u},u.tick=function(e){o=e,n||(n=o),g((o+(r-n))*tt.speed)},u.seek=function(e){g(c(e))},u.pause=function(){u.paused=!0,d()},u.play=function(){u.paused&&(u.completed&&u.reset(),u.paused=!1,Ze.push(u),d(),Ke())},u.reverse=function(){s(),u.completed=!u.reversed,d()},u.restart=function(){u.reset(),u.play()},u.remove=function(e){rt(Ue(e),u)},u.reset(),u.autoplay&&u.play(),u}function nt(e,t){for(var n=t.length;n--;)we(e,t[n].animatable.target)&&t.splice(n,1)}function rt(e,t){var n=t.animations,r=t.children;nt(e,n);for(var o=r.length;o--;){var a=r[o],i=a.animations;nt(e,i),i.length||a.children.length||r.splice(o,1)}n.length||r.length||t.pause()}tt.version="3.2.1",tt.speed=1,tt.suspendWhenDocumentHidden=!0,tt.running=Ze,tt.remove=function(e){for(var t=Ue(e),n=Ze.length;n--;){rt(t,Ze[n])}},tt.get=Ae,tt.set=Qe,tt.convertPx=Pe,tt.path=function(e,t){var n=le.str(e)?me(e)[0]:e,r=t||100;return function(e){return{property:e,el:n,svg:Fe(n),totalLength:He(n)*(r/100)}}},tt.setDashoffset=function(e){var t=He(e);return e.setAttribute("stroke-dasharray",t),t},tt.stagger=function(e,t){void 0===t&&(t={});var n=t.direction||"normal",r=t.easing?ge(t.easing):null,o=t.grid,a=t.axis,i=t.from||0,l="first"===i,u="center"===i,s="last"===i,c=le.arr(e),d=c?parseFloat(e[0]):parseFloat(e),f=c?parseFloat(e[1]):0,h=Te(c?e[1]:e)||0,p=t.start||0+(c?d:0),g=[],m=0;return function(e,t,v){if(l&&(i=0),u&&(i=(v-1)/2),s&&(i=v-1),!g.length){for(var y=0;y-1&&Ze.splice(o,1);for(var l=0;l'].join(""),document.getElementById("featured-image-drop").innerHTML="",document.getElementById("featured-image-drop").appendChild(n)}}(n),o.readAsDataURL(n)}}}},{key:"handleImageUpload",value:function(e,t){var n=this;dt.alert("Uploading Image",null),this.admin.imageUpload(e,t).then((function(e){e.type==d&&n.editor.notify(U,e.url),dt.alert("Image Added to Entry",!0)})).catch((function(){dt.alert("Uh oh. Image not added",!1)}))}}]),t}();ft.uploadFiles=[];var ht=function(){function t(n){e(this,t),this.currentPage=null,this.choosePage(n),this.start()}return n(t,[{key:"start",value:function(){}},{key:"choosePage",value:function(e){switch(this.currentPage="",e){case"edit":case"add":this.currentPage=new ft}}}]),t}(),pt=function(){function t(){e(this,t)}return n(t,[{key:"getInfo",value:function(){var e,t,n=document.getElementById("settings-handle").value,r=document.getElementById("settings-email").value,o=document.getElementById("settings-url").value,a=document.getElementById("settings-title").value,i=document.getElementById("settings-desc").value,l=document.getElementById("render-toggle").getAttribute("data-render"),u=document.getElementById("background").src,s="",c=document.querySelectorAll(".theme-select"),d=document.getElementById("smtp-domain").value,f=document.getElementById("smtp-email").value,h=document.getElementById("smtp-pass").value,p=document.getElementById("mg-domain").value,g=document.getElementById("mg-key").value,m="",v=document.querySelectorAll(".mail-option");for(e=0,t=c.length;e2&&void 0!==arguments[2]?arguments[2]:D,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:P,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,i=this;return new Promise((function(t,a){var l=new XMLHttpRequest;if(l.upload.onprogress=i.handleLoadProgress,l.open(n,e,!0),l.onload=function(){if(200==l.status){var e=JSON.parse(l.response);t(e)}else{var n=JSON.parse(l.response);a(n)}},"PUT"==n||n==x)switch(r){case P:l.setRequestHeader("Content-type","application/"+r),l.send(JSON.stringify(o));break;case _:l.send(o)}else l.send()}))}},{key:"handleLoadProgress",value:function(e){this.percentComplete=Math.ceil(e.loaded/e.total*100)}}]),t}(),O="POST",C="createNewPage",A="editPage",M="deletePage",N="json",L="x-www-form-urlencoded",R=function(){function t(){var n=this;e(this,t),this.percentComplete=0,this.token=null,this._request("/api/v1/status").then((function(e){e.type===u&&(n.token=e.token)}))}return n(t,[{key:"syncSettings",value:function(e){var t=this;return new Promise((function(n,r){t._request("/api/v1/settings/sync",v,O,N,e).then((function(e){n(e)})).catch((function(e){r(e)}))}))}},{key:"imageUpload",value:function(e,t){var n=this;return new Promise((function(r,o){var i="";switch(e){case"avatar-upload":i="/api/v1/settings/add-avatar";break;case"background-upload":i="/api/v1/settings/add-feature-background";break;default:i="/api/v1/page/add-entry-image"}for(var a=new FormData,l=0;l2&&void 0!==arguments[2]?arguments[2]:"GET",r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:N,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,i=this;return new Promise((function(a,l){var s=new XMLHttpRequest;if(s.upload.onprogress=i.handleLoadProgress,s.open(n,e,!0),s.onload=function(){if(200==s.status){var e=JSON.parse(s.response);a(e)}else{var t=JSON.parse(s.response);l(t)}},"PUT"==n||n==O)switch(t!==g&&t!==w&&t!==v&&t!==m&&t!==E&&t!==y&&t!==b&&t!==I||s.setRequestHeader("fipamo-access-token",i.token),r){case N:s.setRequestHeader("Content-type","application/"+r),s.send(JSON.stringify(o));break;case L:s.send(o)}else s.send()}))}},{key:"handleLoadProgress",value:function(e){this.percentComplete=Math.ceil(e.loaded/e.total*100)}}]),t}(),H=function(){function t(){e(this,t)}return n(t,[{key:"imgLoad",value:function(e){return new Promise((function(t,n){var r=new XMLHttpRequest;r.open("GET",e),r.responseType="blob",r.onload=function(){200===r.status?t(r.response):n(new Error("Image didn't load successfully; error code:"+r.statusText))},r.onerror=function(){n(new Error("There was a network error."))},r.send()}))}},{key:"loadImage",value:function(e){var t=this;return new Promise((function(n,r){(new Image).crossOrigin="",t.imgLoad(e).then((function(e){var t=window.URL.createObjectURL(e);n(t)}),(function(e){r(e)}))}))}},{key:"formDataToJSON",value:function(e){var t={};return new FormData(e).forEach((function(e,n){t.hasOwnProperty(n)?(Array.isArray(t[n])||(t[n]=[t[n]]),t[n].push(e)):t[n]=e})),t}}]),t}(),F=function(){function t(){e(this,t)}return n(t,[{key:"cleanString",value:function(e){return e.replace(/(^\-+|[^a-zA-Z0-9\/_| -]+|\-+$)/g,"").toLowerCase().replace(/[\/_| -]+/g,"-")}},{key:"decodeHTML",value:function(e,t){var n=0,r=0,o=!1;void 0===t&&(t=2),e=e.toString().replace(/</g,"<").replace(/>/g,">");var i={ENT_NOQUOTES:0,ENT_HTML_QUOTE_SINGLE:1,ENT_HTML_QUOTE_DOUBLE:2,ENT_COMPAT:2,ENT_QUOTES:3,ENT_IGNORE:4};if(0===t&&(o=!0),"number"!=typeof t){for(t=[].concat(t),r=0;r]*>/g,"\n"),r.append("id",document.getElementById("post-edit-index").getAttribute("data-index")),r.append("uuid",document.getElementById("post-edit-index").getAttribute("data-uuid")),r.append("layout",document.getElementById("post-edit-index").getAttribute("data-layout")),r.append("current_title",document.getElementById("post-edit-index").getAttribute("data-slug")),r.append("content",i),r.append("title",document.getElementById("post_title").value),r.append("created",document.getElementById("post-date").getAttribute("data-raw")),r.append("slug",(new F).cleanString(document.getElementById("post_title").value)),r.append("tags",document.getElementById("post_tags").value),r.append("menu",document.getElementById("option-menu-pin").getAttribute("data-active")),r.append("featured",document.getElementById("option-feature").getAttribute("data-active")),r.append("published",document.getElementById("option-published").getAttribute("data-active")),null!=e||null!=e)e.type.match("image.*")?r.append("feature_image",e,e.name):n("Not an image file");else{var a=document.getElementById("featured-image").src;null!=a||null!=a?r.append("feature_image",a):r.append("feature_image",null)}t(r)}))}}]),t}(),q="editorDelete",U="editorUploadImage",Y="editorSave",j="editorUpdate";new function t(){e(this,t)};var W=["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopStyle","borderRightStyle","borderBottomStyle","borderLeftStyle","borderTopWidth","boxSizing","fontFamily","fontSize","fontWeight","height","letterSpacing","lineHeight","marginBottom","marginLeft","marginRight","marginTop","outlineWidth","overflow","overflowX","overflowY","paddingBottom","paddingLeft","paddingRight","paddingTop","textAlign","textOverflow","textTransform","whiteSpace","wordBreak","wordWrap"],z=function(e,t){var n=document.createElement("div");return function(t){var r=function(){var t={position:"absolute",left:-9999,top:0,zIndex:-2e3};return"TEXTAREA"===e.tagName&&W.push("width"),W.forEach((function(n){t[n]=getComputedStyle(e)[n]})),t}();Object.keys(r).forEach((function(e){n.style[e]=r[e]})),n.innerHTML=t,e.parentNode.insertBefore(n,e.nextSibling)}(t),{rect:function(){var e=n.ownerDocument.getElementById("caret-position-marker"),t={left:e.offsetLeft,top:e.offsetTop,height:e.offsetHeight};return n.parentNode.removeChild(n),t}}};function G(e){return(G="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var Q=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.customPos,n=e.iframe,r=e.noShadowCaret;return n?{iframe:n,window:n.contentWindow,document:n.contentDocument||n.contentWindow.document,noShadowCaret:r,customPos:t}:{window:window,document:document,noShadowCaret:r,customPos:t}},V=function(e){return"object"===G(e)&&null!==e},J=function(e,t){var n=function(){return e.selectionStart},r=function(r){var o=function(e){return e.replace(/<|>|`|"|&/g,"?").replace(/\r\n|\r|\n/g,"
")};(t.customPos||0===t.customPos)&&(r=t.customPos);var i=void 0===r?n():r,a=e.value.slice(0,i),l=e.value.slice(i),s=''.concat(o(a),"");s+='|',s+=''.concat(o(l),"");var u=z(e,s).rect();return u.pos=n(),u};return{getPos:n,setPos:function(t){return e.setSelectionRange(t,t),e},getOffset:function(n){var o=function(e,t){var n=t&&t.window||window,r=t&&t.document||document,o=e.getBoundingClientRect(),i=r.documentElement,a=n.pageXOffset||i.scrollLeft,l=n.pageYOffset||i.scrollTop;return{top:o.top+l,left:o.left+a}}(e),i=r(n);return{top:o.top+i.top+t.document.body.scrollTop,left:o.left+i.left+t.document.body.scrollLeft,height:i.height}},getPosition:r}},$=function(e,t){return function(e){return!!(e.contentEditable?"true"===e.contentEditable:"true"===e.getAttribute("contenteditable"))}(e)?function(e,t){var n=function(){var n=r(),o={height:0,left:0,right:0};if(!n)return o;var i=t.customPos||0===t.customPos;if(n.endOffset-1>0&&n.endContainer!==e||i){var a=n.cloneRange(),l=i?t.customPos:n.endOffset;a.setStart(n.endContainer,l-1<0?0:l-1),a.setEnd(n.endContainer,l);var s=a.getBoundingClientRect();o={height:s.height,left:s.left+s.width,top:s.top},a.detach()}if((!o||o&&0===o.height)&&!t.noShadowCaret){var u=n.cloneRange(),c=t.document.createTextNode("|");u.insertNode(c),u.selectNode(c);var d=u.getBoundingClientRect();o={height:d.height,left:d.left,top:d.top},c.parentNode.removeChild(c),u.detach()}if(o){var f=t.document.documentElement;o.top+=t.window.pageYOffset-(f.clientTop||0),o.left+=t.window.pageXOffset-(f.clientLeft||0)}return o},r=function(){if(t.window.getSelection){var e=t.window.getSelection();return e.rangeCount>0?e.getRangeAt(0):null}},o=function(){var t=r(),n=t.cloneRange();n.selectNodeContents(e),n.setEnd(t.endContainer,t.endOffset);var o=n.toString().length;return n.detach(),o};return{getPos:o,setPos:function(n){var r=t.window.getSelection();if(r){var o=0,i=!1;!function e(a,l){for(var s=0;s=a){i=!0;var c=t.document.createRange();c.setStart(u,a-o),r.removeAllRanges(),r.addRange(c);break}o+=u.length}else e(n,u)}}(n,e)}return e},getPosition:function(){var r=n(),i=o(),a=e.getBoundingClientRect(),l=a.top+t.document.body.scrollTop,s=a.left+t.document.body.scrollLeft;return r.left-=s,r.top-=l,r.pos=i,r},getOffset:n,getRange:r}}(e,t):J(e,t)},Z=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n;V(t)&&(r=t,t=null);var o=Q(r),i=$(e,o);return t||0===t?i.setPos(t):i.getPosition()},K=function(t){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&o(e,t)}(i,t);var r=a(i);function i(t,n){var o;return e(this,i),(o=r.call(this)).textEditor=t,o.fixLimit=n,o.caretPos=null,o.url="",o.setInputs(),window.addEventListener("scroll",(function(){})),o.refresh(),o}return n(i,[{key:"setInputs",value:function(){for(var e=this,t=this,n=document.querySelectorAll(".editor-button"),r=0,o=n.length;r/g)>-1){var o=Z(e.textEditor).pos;t.refresh(),Z(e.textEditor,o)}}))}},{key:"refresh",value:function(){var e=this.textEditor.innerText;e=e.replace(new RegExp("\r?\n","g"),"
");var t=document.createElement("div");t.innerText=e,this.textEditor.innerHTML=t.innerText,this.textEditor.style.maxWidth="900px"}},{key:"notify",value:function(e,t){switch(e){case void 0:document.getElementById("submit-update").classList.add("icon-hide"),document.getElementById("submit-good").classList.remove("icon-hide"),document.getElementById("edit-update").classList.remove("submit-start"),document.getElementById("edit-update").classList.add("submit-cool"),setTimeout((function(){document.getElementById("submit-update").classList.remove("icon-hide"),document.getElementById("submit-good").classList.add("icon-hide"),document.getElementById("edit-update").classList.add("submit-start"),document.getElementById("edit-update").classList.remove("submit-cool")}),2e3);break;case void 0:break;case U:var n,r;Z(this.textEditor,this.caretPos),(n=window.getSelection()).rangeCount&&((r=n.getRangeAt(0)).deleteContents(),r.insertNode(document.createTextNode("![image alt text]("+t+" 'image title')"))),this.refresh()}}},{key:"handleEditorOption",value:function(e){var t,n,r;if(e.preventDefault(),(t=window.getSelection()).rangeCount)switch(n=t.getRangeAt(0),r=t.getRangeAt(0).toString(),n.deleteContents(),e.target.id){case"edit-bold":n.insertNode(document.createTextNode("**"+r+"**"));break;case"edit-italic":n.insertNode(document.createTextNode("*"+r+"*"));break;case"edit-strikethrough":n.insertNode(document.createTextNode(""+r+""));break;case"edit-header1":n.insertNode(document.createTextNode("# "+r));break;case"edit-header2":n.insertNode(document.createTextNode("## "+r));break;case"edit-header3":n.insertNode(document.createTextNode("### "+r));break;case"edit-image":this.caretPos=Z(this.textEditor).pos,this.emitEvent(U);break;case"submit-save":case"edit-save":this.emitEvent(Y);break;case"submit-update":case"edit-update":this.emitEvent(j);break;case"edit-link":n.insertNode(document.createTextNode("["+r+"](PASTE URL HERE)"));break;case"edit-delete":this.emitEvent(q)}this.refresh()}}]),i}(function(){function t(){e(this,t),this.listeners=new Map}return n(t,[{key:"addListener",value:function(e,t){this.listeners.has(e)||this.listeners.set(e,[]),this.listeners.get(e).push(t)}},{key:"removeListener",value:function(e,t){var n,r=this.listeners.get(e);return!!(r&&r.length&&(n=r.reduce((function(e,n,r){return"function"==typeof n&&n===t?e=r:e}),-1))>-1)&&(r.splice(n,1),this.listeners.set(e,r),!0)}},{key:"emitEvent",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r-1}function ae(e,t){return e.apply(null,t)}var le={arr:function(e){return Array.isArray(e)},obj:function(e){return ie(Object.prototype.toString.call(e),"Object")},pth:function(e){return le.obj(e)&&e.hasOwnProperty("totalLength")},svg:function(e){return e instanceof SVGElement},inp:function(e){return e instanceof HTMLInputElement},dom:function(e){return e.nodeType||le.svg(e)},str:function(e){return"string"==typeof e},fnc:function(e){return"function"==typeof e},und:function(e){return void 0===e},nil:function(e){return le.und(e)||null===e},hex:function(e){return/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(e)},rgb:function(e){return/^rgb/.test(e)},hsl:function(e){return/^hsl/.test(e)},col:function(e){return le.hex(e)||le.rgb(e)||le.hsl(e)},key:function(e){return!ee.hasOwnProperty(e)&&!te.hasOwnProperty(e)&&"targets"!==e&&"keyframes"!==e}};function se(e){var t=/\(([^)]+)\)/.exec(e);return t?t[1].split(",").map((function(e){return parseFloat(e)})):[]}function ue(e,t){var n=se(e),r=oe(le.und(n[0])?1:n[0],.1,100),o=oe(le.und(n[1])?100:n[1],.1,100),i=oe(le.und(n[2])?10:n[2],.1,100),a=oe(le.und(n[3])?0:n[3],.1,100),l=Math.sqrt(o/r),s=i/(2*Math.sqrt(o*r)),u=s<1?l*Math.sqrt(1-s*s):0,c=s<1?(s*l-a)/u:-a+l;function d(e){var n=t?t*e/1e3:e;return n=s<1?Math.exp(-n*s*l)*(1*Math.cos(u*n)+c*Math.sin(u*n)):(1+c*n)*Math.exp(-n*l),0===e||1===e?e:1-n}return t?d:function(){var t=re.springs[e];if(t)return t;for(var n=1/6,r=0,o=0;;)if(1===d(r+=n)){if(++o>=16)break}else o=0;var i=r*n*1e3;return re.springs[e]=i,i}}function ce(e){return void 0===e&&(e=10),function(t){return Math.ceil(oe(t,1e-6,1)*e)*(1/e)}}var de,fe,he=function(){var e=.1;function t(e,t){return 1-3*t+3*e}function n(e,t){return 3*t-6*e}function r(e){return 3*e}function o(e,o,i){return((t(o,i)*e+n(o,i))*e+r(o))*e}function i(e,o,i){return 3*t(o,i)*e*e+2*n(o,i)*e+r(o)}return function(t,n,r,a){if(0<=t&&t<=1&&0<=r&&r<=1){var l=new Float32Array(11);if(t!==n||r!==a)for(var s=0;s<11;++s)l[s]=o(s*e,t,r);return function(e){return t===n&&r===a||0===e||1===e?e:o(u(e),n,a)}}function u(n){for(var a=0,s=1;10!==s&&l[s]<=n;++s)a+=e;--s;var u=a+(n-l[s])/(l[s+1]-l[s])*e,c=i(u,t,r);return c>=.001?function(e,t,n,r){for(var a=0;a<4;++a){var l=i(t,n,r);if(0===l)return t;t-=(o(t,n,r)-e)/l}return t}(n,u,t,r):0===c?u:function(e,t,n,r,i){var a,l,s=0;do{(a=o(l=t+(n-t)/2,r,i)-e)>0?n=l:t=l}while(Math.abs(a)>1e-7&&++s<10);return l}(n,a,a+e,t,r)}}}(),pe=(de={linear:function(){return function(e){return e}}},fe={Sine:function(){return function(e){return 1-Math.cos(e*Math.PI/2)}},Circ:function(){return function(e){return 1-Math.sqrt(1-e*e)}},Back:function(){return function(e){return e*e*(3*e-2)}},Bounce:function(){return function(e){for(var t,n=4;e<((t=Math.pow(2,--n))-1)/11;);return 1/Math.pow(4,3-n)-7.5625*Math.pow((3*t-2)/22-e,2)}},Elastic:function(e,t){void 0===e&&(e=1),void 0===t&&(t=.5);var n=oe(e,1,10),r=oe(t,.1,2);return function(e){return 0===e||1===e?e:-n*Math.pow(2,10*(e-1))*Math.sin((e-1-r/(2*Math.PI)*Math.asin(1/n))*(2*Math.PI)/r)}}},["Quad","Cubic","Quart","Quint","Expo"].forEach((function(e,t){fe[e]=function(){return function(e){return Math.pow(e,t+2)}}})),Object.keys(fe).forEach((function(e){var t=fe[e];de["easeIn"+e]=t,de["easeOut"+e]=function(e,n){return function(r){return 1-t(e,n)(1-r)}},de["easeInOut"+e]=function(e,n){return function(r){return r<.5?t(e,n)(2*r)/2:1-t(e,n)(-2*r+2)/2}},de["easeOutIn"+e]=function(e,n){return function(r){return r<.5?(1-t(e,n)(1-2*r))/2:(t(e,n)(2*r-1)+1)/2}}})),de);function ge(e,t){if(le.fnc(e))return e;var n=e.split("(")[0],r=pe[n],o=se(e);switch(n){case"spring":return ue(e,t);case"cubicBezier":return ae(he,o);case"steps":return ae(ce,o);default:return ae(r,o)}}function me(e){try{return document.querySelectorAll(e)}catch(e){return}}function ve(e,t){for(var n=e.length,r=arguments.length>=2?t:void 0,o=[],i=0;i1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}if(0==a)t=n=r=l;else{var c=l<.5?l*(1+a):l+a-l*a,d=2*l-c;t=u(d,c,i+1/3),n=u(d,c,i),r=u(d,c,i-1/3)}return"rgba("+255*t+","+255*n+","+255*r+","+s+")"}(e):void 0;var t,n}function Te(e){var t=/[+-]?\d*\.?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?(%|px|pt|em|rem|in|cm|mm|ex|ch|pc|vw|vh|vmin|vmax|deg|rad|turn)?$/.exec(e);if(t)return t[1]}function xe(e,t){return le.fnc(e)?e(t.target,t.id,t.total):e}function De(e,t){return e.getAttribute(t)}function Pe(e,t,n){if(we([n,"deg","rad","turn"],Te(t)))return t;var r=re.CSS[t+n];if(!le.und(r))return r;var o=document.createElement(e.tagName),i=e.parentNode&&e.parentNode!==document?e.parentNode:document.body;i.appendChild(o),o.style.position="absolute",o.style.width=100+n;var a=100/o.offsetWidth;i.removeChild(o);var l=a*parseFloat(t);return re.CSS[t+n]=l,l}function _e(e,t,n){if(t in e.style){var r=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),o=e.style[t]||getComputedStyle(e).getPropertyValue(r)||"0";return n?Pe(e,o,n):o}}function Be(e,t){return le.dom(e)&&!le.inp(e)&&(!le.nil(De(e,t))||le.svg(e)&&e[t])?"attribute":le.dom(e)&&we(ne,t)?"transform":le.dom(e)&&"transform"!==t&&_e(e,t)?"css":null!=e[t]?"object":void 0}function Oe(e){if(le.dom(e)){for(var t,n=e.style.transform||"",r=/(\w+)\(([^)]*)\)/g,o=new Map;t=r.exec(n);)o.set(t[1],t[2]);return o}}function Ce(e,t,n,r){var o=ie(t,"scale")?1:0+function(e){return ie(e,"translate")||"perspective"===e?"px":ie(e,"rotate")||ie(e,"skew")?"deg":void 0}(t),i=Oe(e).get(t)||o;return n&&(n.transforms.list.set(t,i),n.transforms.last=t),r?Pe(e,i,r):i}function Ae(e,t,n,r){switch(Be(e,t)){case"transform":return Ce(e,t,r,n);case"css":return _e(e,t,n);case"attribute":return De(e,t);default:return e[t]||0}}function Me(e,t){var n=/^(\*=|\+=|-=)/.exec(e);if(!n)return e;var r=Te(e)||0,o=parseFloat(t),i=parseFloat(e.replace(n[0],""));switch(n[0][0]){case"+":return o+i+r;case"-":return o-i+r;case"*":return o*i+r}}function Ne(e,t){if(le.col(e))return Se(e);if(/\s/g.test(e))return e;var n=Te(e),r=n?e.substr(0,e.length-n.length):e;return t?r+t:r}function Le(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function Re(e){for(var t,n=e.points,r=0,o=0;o0&&(r+=Le(t,i)),t=i}return r}function He(e){if(e.getTotalLength)return e.getTotalLength();switch(e.tagName.toLowerCase()){case"circle":return function(e){return 2*Math.PI*De(e,"r")}(e);case"rect":return function(e){return 2*De(e,"width")+2*De(e,"height")}(e);case"line":return function(e){return Le({x:De(e,"x1"),y:De(e,"y1")},{x:De(e,"x2"),y:De(e,"y2")})}(e);case"polyline":return Re(e);case"polygon":return function(e){var t=e.points;return Re(e)+Le(t.getItem(t.numberOfItems-1),t.getItem(0))}(e)}}function Fe(e,t){var n=t||{},r=n.el||function(e){for(var t=e.parentNode;le.svg(t)&&le.svg(t.parentNode);)t=t.parentNode;return t}(e),o=r.getBoundingClientRect(),i=De(r,"viewBox"),a=o.width,l=o.height,s=n.viewBox||(i?i.split(" "):[0,0,a,l]);return{el:r,viewBox:s,x:s[0]/1,y:s[1]/1,w:a,h:l,vW:s[2],vH:s[3]}}function Xe(e,t,n){function r(n){void 0===n&&(n=0);var r=t+n>=1?t+n:0;return e.el.getPointAtLength(r)}var o=Fe(e.el,e.svg),i=r(),a=r(-1),l=r(1),s=n?1:o.w/o.vW,u=n?1:o.h/o.vH;switch(e.property){case"x":return(i.x-o.x)*s;case"y":return(i.y-o.y)*u;case"angle":return 180*Math.atan2(l.y-a.y,l.x-a.x)/Math.PI}}function qe(e,t){var n=/[+-]?\d*\.?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?/g,r=Ne(le.pth(e)?e.totalLength:e,t)+"";return{original:r,numbers:r.match(n)?r.match(n).map(Number):[0],strings:le.str(e)||t?r.split(n):[]}}function Ue(e){return ve(e?ye(le.arr(e)?e.map(be):be(e)):[],(function(e,t,n){return n.indexOf(e)===t}))}function Ye(e){var t=Ue(e);return t.map((function(e,n){return{target:e,id:n,total:t.length,transforms:{list:Oe(e)}}}))}function je(e,t){var n=Ee(t);if(/^spring/.test(n.easing)&&(n.duration=ue(n.easing)),le.arr(e)){var r=e.length;2===r&&!le.obj(e[0])?e={value:e}:le.fnc(t.duration)||(n.duration=t.duration/r)}var o=le.arr(e)?e:[e];return o.map((function(e,n){var r=le.obj(e)&&!le.pth(e)?e:{value:e};return le.und(r.delay)&&(r.delay=n?0:t.delay),le.und(r.endDelay)&&(r.endDelay=n===o.length-1?t.endDelay:0),r})).map((function(e){return ke(e,n)}))}function We(e,t){var n=[],r=t.keyframes;for(var o in r&&(t=ke(function(e){for(var t=ve(ye(e.map((function(e){return Object.keys(e)}))),(function(e){return le.key(e)})).reduce((function(e,t){return e.indexOf(t)<0&&e.push(t),e}),[]),n={},r=function(r){var o=t[r];n[o]=e.map((function(e){var t={};for(var n in e)le.key(n)?n==o&&(t.value=e[n]):t[n]=e[n];return t}))},o=0;o0?requestAnimationFrame(t):void 0}return"undefined"!=typeof document&&document.addEventListener("visibilitychange",(function(){tt.suspendWhenDocumentHidden&&(et()?e=cancelAnimationFrame(e):(Ze.forEach((function(e){return e._onDocumentVisibility()})),Ke()))})),function(){e||et()&&tt.suspendWhenDocumentHidden||!(Ze.length>0)||(e=requestAnimationFrame(t))}}();function et(){return!!document&&document.hidden}function tt(e){void 0===e&&(e={});var t,n=0,r=0,o=0,i=0,a=null;function l(e){var t=window.Promise&&new Promise((function(e){return a=e}));return e.finished=t,t}var s=function(e){var t=Ie(ee,e),n=Ie(te,e),r=We(n,e),o=Ye(e.targets),i=Ve(o,r),a=Je(i,n),l=$e;return $e++,ke(t,{id:l,children:[],animatables:o,animations:i,duration:a.duration,delay:a.delay,endDelay:a.endDelay})}(e);function u(){var e=s.direction;"alternate"!==e&&(s.direction="normal"!==e?"normal":"reverse"),s.reversed=!s.reversed,t.forEach((function(e){return e.reversed=s.reversed}))}function c(e){return s.reversed?s.duration-e:e}function d(){n=0,r=c(s.currentTime)*(1/tt.speed)}function f(e,t){t&&t.seek(e-t.timelineOffset)}function h(e){for(var t=0,n=s.animations,r=n.length;t2||(y=Math.round(y*h)/h)),p.push(y)}var E=f.length;if(E){m=f[0];for(var I=0;I0&&(s.began=!0,p("begin")),!s.loopBegan&&s.currentTime>0&&(s.loopBegan=!0,p("loopBegin")),v<=g&&0!==s.currentTime&&h(0),(v>=m&&s.currentTime!==d||!d)&&h(d),v>g&&v=d&&(r=0,s.remaining&&!0!==s.remaining&&s.remaining--,s.remaining?(n=o,p("loopComplete"),s.loopBegan=!1,"alternate"===s.direction&&u()):(s.paused=!0,s.completed||(s.completed=!0,p("loopComplete"),p("complete"),!s.passThrough&&"Promise"in window&&(a(),l(s)))))}return l(s),s.reset=function(){var e=s.direction;s.passThrough=!1,s.currentTime=0,s.progress=0,s.paused=!0,s.began=!1,s.loopBegan=!1,s.changeBegan=!1,s.completed=!1,s.changeCompleted=!1,s.reversePlayback=!1,s.reversed="reverse"===e,s.remaining=s.loop,t=s.children;for(var n=i=t.length;n--;)s.children[n].reset();(s.reversed&&!0!==s.loop||"alternate"===e&&1===s.loop)&&s.remaining++,h(s.reversed?s.duration:0)},s._onDocumentVisibility=d,s.set=function(e,t){return Qe(e,t),s},s.tick=function(e){o=e,n||(n=o),g((o+(r-n))*tt.speed)},s.seek=function(e){g(c(e))},s.pause=function(){s.paused=!0,d()},s.play=function(){s.paused&&(s.completed&&s.reset(),s.paused=!1,Ze.push(s),d(),Ke())},s.reverse=function(){u(),s.completed=!s.reversed,d()},s.restart=function(){s.reset(),s.play()},s.remove=function(e){rt(Ue(e),s)},s.reset(),s.autoplay&&s.play(),s}function nt(e,t){for(var n=t.length;n--;)we(e,t[n].animatable.target)&&t.splice(n,1)}function rt(e,t){var n=t.animations,r=t.children;nt(e,n);for(var o=r.length;o--;){var i=r[o],a=i.animations;nt(e,a),a.length||i.children.length||r.splice(o,1)}n.length||r.length||t.pause()}tt.version="3.2.1",tt.speed=1,tt.suspendWhenDocumentHidden=!0,tt.running=Ze,tt.remove=function(e){for(var t=Ue(e),n=Ze.length;n--;){rt(t,Ze[n])}},tt.get=Ae,tt.set=Qe,tt.convertPx=Pe,tt.path=function(e,t){var n=le.str(e)?me(e)[0]:e,r=t||100;return function(e){return{property:e,el:n,svg:Fe(n),totalLength:He(n)*(r/100)}}},tt.setDashoffset=function(e){var t=He(e);return e.setAttribute("stroke-dasharray",t),t},tt.stagger=function(e,t){void 0===t&&(t={});var n=t.direction||"normal",r=t.easing?ge(t.easing):null,o=t.grid,i=t.axis,a=t.from||0,l="first"===a,s="center"===a,u="last"===a,c=le.arr(e),d=c?parseFloat(e[0]):parseFloat(e),f=c?parseFloat(e[1]):0,h=Te(c?e[1]:e)||0,p=t.start||0+(c?d:0),g=[],m=0;return function(e,t,v){if(l&&(a=0),s&&(a=(v-1)/2),u&&(a=v-1),!g.length){for(var y=0;y-1&&Ze.splice(o,1);for(var l=0;l'].join(""),document.getElementById("featured-image-drop").innerHTML="",document.getElementById("featured-image-drop").appendChild(n)}}(n),o.readAsDataURL(n)}}}},{key:"handleImageUpload",value:function(e,t){var n=this;dt.alert("Uploading Image",null),this.admin.imageUpload(e,t).then((function(e){e.type==d&&n.editor.notify(U,e.url),dt.alert("Image Added to Entry",!0)})).catch((function(){dt.alert("Uh oh. Image not added",!1)}))}}]),t}();ft.uploadFiles=[];var ht=function(){function t(n){e(this,t),this.currentPage=null,this.choosePage(n),this.start()}return n(t,[{key:"start",value:function(){}},{key:"choosePage",value:function(e){switch(this.currentPage="",e){case"edit":case"add":this.currentPage=new ft}}}]),t}(),pt=function(){function t(){e(this,t)}return n(t,[{key:"getInfo",value:function(){var e,t,n=document.getElementById("settings-handle").value,r=document.getElementById("settings-email").value,o=document.getElementById("settings-url").value,i=document.getElementById("settings-title").value,a=document.getElementById("settings-desc").value,l=document.getElementById("render-toggle").getAttribute("data-render"),s=document.getElementById("background").src,u="",c=document.querySelectorAll(".theme-select"),d=document.getElementById("smtp-domain").value,f=document.getElementById("smtp-email").value,h=document.getElementById("smtp-pass").value,p=document.getElementById("mg-domain").value,g=document.getElementById("mg-key").value,m="",v=document.querySelectorAll(".mail-option");for(e=0,t=c.length;e
* @author owenm
* @license MIT
*/
-function yt(e){return(yt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function bt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function wt(){return(wt=Object.assign||function(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=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),xt=kt(/firefox/i),Dt=kt(/safari/i)&&!kt(/chrome/i)&&!kt(/android/i),Pt=kt(/iP(ad|od|hone)/i),_t=kt(/chrome/i)&&kt(/android/i),Bt={capture:!1,passive:!1};function Ot(e,t,n){e.addEventListener(t,n,!St&&Bt)}function Ct(e,t,n){e.removeEventListener(t,n,!St&&Bt)}function At(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 Mt(e){return e.host&&e!==document&&e.host.nodeType?e.host:e.parentNode}function Nt(e,t,n,r){if(e){n=n||document;do{if(null!=t&&(">"===t[0]?e.parentNode===n&&At(e,t):At(e,t))||r&&e===n)return e;if(e===n)break}while(e=Mt(e))}return null}var Lt,Rt=/\s+/g;function Ht(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 Ft(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=Ft(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 qt(e,t,n){if(e){var r=e.getElementsByTagName(t),o=0,a=r.length;if(n)for(;o=a:o<=a))return r;if(r===Ut())break;r=Vt(r,!1)}return!1}function Wt(e,t,n){for(var r=0,o=0,a=e.children;o2&&void 0!==arguments[2]?arguments[2]:{},r=n.evt,o=It(n,["evt"]);on.pluginEvent.bind(Zn)(e,t,Et({dragEl:un,parentEl:sn,ghostEl:cn,rootEl:dn,nextEl:fn,lastDownEl:hn,cloneEl:pn,cloneHidden:gn,dragStarted:Pn,putSortable:En,activeSortable:Zn.active,originalEvent:r,oldIndex:mn,oldDraggableIndex:yn,newIndex:vn,newDraggableIndex:bn,hideGhostForTarget:Qn,unhideGhostForTarget:Vn,cloneNowHidden:function(){gn=!0},cloneNowShown:function(){gn=!1},dispatchSortableEvent:function(e){ln({sortable:t,name:e,originalEvent:r})}},o))};function ln(e){!function(e){var t=e.sortable,n=e.rootEl,r=e.name,o=e.targetEl,a=e.cloneEl,i=e.toEl,l=e.fromEl,u=e.oldIndex,s=e.newIndex,c=e.oldDraggableIndex,d=e.newDraggableIndex,f=e.originalEvent,h=e.putSortable,p=e.extraEventProperties;if(t=t||n&&n[en]){var g,m=t.options,v="on"+r.charAt(0).toUpperCase()+r.substr(1);!window.CustomEvent||St||Tt?(g=document.createEvent("Event")).initEvent(r,!0,!0):g=new CustomEvent(r,{bubbles:!0,cancelable:!0}),g.to=i||n,g.from=l||n,g.item=o||n,g.clone=a,g.oldIndex=u,g.newIndex=s,g.oldDraggableIndex=c,g.newDraggableIndex=d,g.originalEvent=f,g.pullMode=h?h.lastPutMode:void 0;var y=Et({},p,on.getEventProperties(r,t));for(var b in y)g[b]=y[b];n&&n.dispatchEvent(g),m[v]&&m[v].call(t,g)}}(Et({putSortable:En,cloneEl:pn,targetEl:un,rootEl:dn,oldIndex:mn,oldDraggableIndex:yn,newIndex:vn,newDraggableIndex:bn},e))}var un,sn,cn,dn,fn,hn,pn,gn,mn,vn,yn,bn,wn,En,In,kn,Sn,Tn,xn,Dn,Pn,_n,Bn,On,Cn,An=!1,Mn=!1,Nn=[],Ln=!1,Rn=!1,Hn=[],Fn=!1,Xn=[],qn="undefined"!=typeof document,Un=Pt,Yn=Tt||St?"cssFloat":"float",jn=qn&&!_t&&!Pt&&"draggable"in document.createElement("div"),Wn=function(){if(qn){if(St)return!1;var e=document.createElement("x");return e.style.cssText="pointer-events:auto","auto"===e.style.pointerEvents}}(),zn=function(e,t){var n=Ft(e),r=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),o=Wt(e,0,t),a=Wt(e,1,t),i=o&&Ft(o),l=a&&Ft(a),u=i&&parseInt(i.marginLeft)+parseInt(i.marginRight)+Yt(o).width,s=l&&parseInt(l.marginLeft)+parseInt(l.marginRight)+Yt(a).width;if("flex"===n.display)return"column"===n.flexDirection||"column-reverse"===n.flexDirection?"vertical":"horizontal";if("grid"===n.display)return n.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(o&&i.float&&"none"!==i.float){var c="left"===i.float?"left":"right";return!a||"both"!==l.clear&&l.clear!==c?"horizontal":"vertical"}return o&&("block"===i.display||"flex"===i.display||"table"===i.display||"grid"===i.display||u>=r&&"none"===n[Yn]||a&&"none"===n[Yn]&&u+s>r)?"vertical":"horizontal"},Gn=function(e){function t(e,n){return function(r,o,a,i){var l=r.options.group.name&&o.options.group.name&&r.options.group.name===o.options.group.name;if(null==e&&(n||l))return!0;if(null==e||!1===e)return!1;if(n&&"clone"===e)return e;if("function"==typeof e)return t(e(r,o,a,i),n)(r,o,a,i);var u=(n?r:o).options.group.name;return!0===e||"string"==typeof e&&e===u||e.join&&e.indexOf(u)>-1}}var n={},r=e.group;r&&"object"==yt(r)||(r={name:r}),n.name=r.name,n.checkPull=t(r.pull,!0),n.checkPut=t(r.put),n.revertClone=r.revertClone,e.group=n},Qn=function(){!Wn&&cn&&Ft(cn,"display","none")},Vn=function(){!Wn&&cn&&Ft(cn,"display","")};qn&&document.addEventListener("click",(function(e){if(Mn)return e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.stopImmediatePropagation&&e.stopImmediatePropagation(),Mn=!1,!1}),!0);var Jn=function(e){if(un){e=e.touches?e.touches[0]:e;var t=(o=e.clientX,a=e.clientY,Nn.some((function(e){if(!zt(e)){var t=Yt(e),n=e[en].options.emptyInsertThreshold,r=o>=t.left-n&&o<=t.right+n,l=a>=t.top-n&&a<=t.bottom+n;return n&&r&&l?i=e:void 0}})),i);if(t){var n={};for(var r in e)e.hasOwnProperty(r)&&(n[r]=e[r]);n.target=n.rootEl=t,n.preventDefault=void 0,n.stopPropagation=void 0,t[en]._onDragOver(n)}}var o,a,i},$n=function(e){un&&un.parentNode[en]._isOutsideThisEl(e.target)};function Zn(e,t){if(!e||!e.nodeType||1!==e.nodeType)throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(e));this.el=e,this.options=t=wt({},t),e[en]=this;var n={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(e.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return zn(e,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(e,t){e.setData("Text",t.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:!1!==Zn.supportPointer&&"PointerEvent"in window&&!Dt,emptyInsertThreshold:5};for(var r in on.initializePlugins(this,e,n),n)!(r in t)&&(t[r]=n[r]);for(var o in Gn(t),this)"_"===o.charAt(0)&&"function"==typeof this[o]&&(this[o]=this[o].bind(this));this.nativeDraggable=!t.forceFallback&&jn,this.nativeDraggable&&(this.options.touchStartThreshold=1),t.supportPointer?Ot(e,"pointerdown",this._onTapStart):(Ot(e,"mousedown",this._onTapStart),Ot(e,"touchstart",this._onTapStart)),this.nativeDraggable&&(Ot(e,"dragover",this),Ot(e,"dragenter",this)),Nn.push(this.el),t.store&&t.store.get&&this.sort(t.store.get(this)||[]),wt(this,tn())}function Kn(e,t,n,r,o,a,i,l){var u,s,c=e[en],d=c.options.onMove;return!window.CustomEvent||St||Tt?(u=document.createEvent("Event")).initEvent("move",!0,!0):u=new CustomEvent("move",{bubbles:!0,cancelable:!0}),u.to=t,u.from=e,u.dragged=n,u.draggedRect=r,u.related=o||t,u.relatedRect=a||Yt(t),u.willInsertAfter=l,u.originalEvent=i,e.dispatchEvent(u),d&&(s=d.call(c,u,i)),s}function er(e){e.draggable=!1}function tr(){Fn=!1}function nr(e){for(var t=e.tagName+e.className+e.src+e.href+e.textContent,n=t.length,r=0;n--;)r+=t.charCodeAt(n);return r.toString(36)}function rr(e){return setTimeout(e,0)}function or(e){return clearTimeout(e)}Zn.prototype={constructor:Zn,_isOutsideThisEl:function(e){this.el.contains(e)||e===this.el||(_n=null)},_getDirection:function(e,t){return"function"==typeof this.options.direction?this.options.direction.call(this,e,t,un):this.options.direction},_onTapStart:function(e){if(e.cancelable){var t=this,n=this.el,r=this.options,o=r.preventOnFilter,a=e.type,i=e.touches&&e.touches[0]||e.pointerType&&"touch"===e.pointerType&&e,l=(i||e).target,u=e.target.shadowRoot&&(e.path&&e.path[0]||e.composedPath&&e.composedPath()[0])||l,s=r.filter;if(function(e){Xn.length=0;var t=e.getElementsByTagName("input"),n=t.length;for(;n--;){var r=t[n];r.checked&&Xn.push(r)}}(n),!un&&!(/mousedown|pointerdown/.test(a)&&0!==e.button||r.disabled)&&!u.isContentEditable&&(this.nativeDraggable||!Dt||!l||"SELECT"!==l.tagName.toUpperCase())&&!((l=Nt(l,r.draggable,n,!1))&&l.animated||hn===l)){if(mn=Gt(l),yn=Gt(l,r.draggable),"function"==typeof s){if(s.call(this,e,l,this))return ln({sortable:t,rootEl:u,name:"filter",targetEl:l,toEl:n,fromEl:n}),an("filter",t,{evt:e}),void(o&&e.cancelable&&e.preventDefault())}else if(s&&(s=s.split(",").some((function(r){if(r=Nt(u,r.trim(),n,!1))return ln({sortable:t,rootEl:r,name:"filter",targetEl:l,fromEl:n,toEl:n}),an("filter",t,{evt:e}),!0}))))return void(o&&e.cancelable&&e.preventDefault());r.handle&&!Nt(u,r.handle,n,!1)||this._prepareDragStart(e,i,l)}}},_prepareDragStart:function(e,t,n){var r,o=this,a=o.el,i=o.options,l=a.ownerDocument;if(n&&!un&&n.parentNode===a){var u=Yt(n);if(dn=a,sn=(un=n).parentNode,fn=un.nextSibling,hn=n,wn=i.group,Zn.dragged=un,In={target:un,clientX:(t||e).clientX,clientY:(t||e).clientY},xn=In.clientX-u.left,Dn=In.clientY-u.top,this._lastX=(t||e).clientX,this._lastY=(t||e).clientY,un.style["will-change"]="all",r=function(){an("delayEnded",o,{evt:e}),Zn.eventCanceled?o._onDrop():(o._disableDelayedDragEvents(),!xt&&o.nativeDraggable&&(un.draggable=!0),o._triggerDragStart(e,t),ln({sortable:o,name:"choose",originalEvent:e}),Ht(un,i.chosenClass,!0))},i.ignore.split(",").forEach((function(e){qt(un,e.trim(),er)})),Ot(l,"dragover",Jn),Ot(l,"mousemove",Jn),Ot(l,"touchmove",Jn),Ot(l,"mouseup",o._onDrop),Ot(l,"touchend",o._onDrop),Ot(l,"touchcancel",o._onDrop),xt&&this.nativeDraggable&&(this.options.touchStartThreshold=4,un.draggable=!0),an("delayStart",this,{evt:e}),!i.delay||i.delayOnTouchOnly&&!t||this.nativeDraggable&&(Tt||St))r();else{if(Zn.eventCanceled)return void this._onDrop();Ot(l,"mouseup",o._disableDelayedDrag),Ot(l,"touchend",o._disableDelayedDrag),Ot(l,"touchcancel",o._disableDelayedDrag),Ot(l,"mousemove",o._delayedDragTouchMoveHandler),Ot(l,"touchmove",o._delayedDragTouchMoveHandler),i.supportPointer&&Ot(l,"pointermove",o._delayedDragTouchMoveHandler),o._dragStartTimer=setTimeout(r,i.delay)}}},_delayedDragTouchMoveHandler:function(e){var t=e.touches?e.touches[0]:e;Math.max(Math.abs(t.clientX-this._lastX),Math.abs(t.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){un&&er(un),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var e=this.el.ownerDocument;Ct(e,"mouseup",this._disableDelayedDrag),Ct(e,"touchend",this._disableDelayedDrag),Ct(e,"touchcancel",this._disableDelayedDrag),Ct(e,"mousemove",this._delayedDragTouchMoveHandler),Ct(e,"touchmove",this._delayedDragTouchMoveHandler),Ct(e,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(e,t){t=t||"touch"==e.pointerType&&e,!this.nativeDraggable||t?this.options.supportPointer?Ot(document,"pointermove",this._onTouchMove):Ot(document,t?"touchmove":"mousemove",this._onTouchMove):(Ot(un,"dragend",this),Ot(dn,"dragstart",this._onDragStart));try{document.selection?rr((function(){document.selection.empty()})):window.getSelection().removeAllRanges()}catch(e){}},_dragStarted:function(e,t){if(An=!1,dn&&un){an("dragStarted",this,{evt:t}),this.nativeDraggable&&Ot(document,"dragover",$n);var n=this.options;!e&&Ht(un,n.dragClass,!1),Ht(un,n.ghostClass,!0),Zn.active=this,e&&this._appendGhost(),ln({sortable:this,name:"start",originalEvent:t})}else this._nulling()},_emulateDragOver:function(){if(kn){this._lastX=kn.clientX,this._lastY=kn.clientY,Qn();for(var e=document.elementFromPoint(kn.clientX,kn.clientY),t=e;e&&e.shadowRoot&&(e=e.shadowRoot.elementFromPoint(kn.clientX,kn.clientY))!==t;)t=e;if(un.parentNode[en]._isOutsideThisEl(e),t)do{if(t[en]){if(t[en]._onDragOver({clientX:kn.clientX,clientY:kn.clientY,target:e,rootEl:t})&&!this.options.dragoverBubble)break}e=t}while(t=t.parentNode);Vn()}},_onTouchMove:function(e){if(In){var t=this.options,n=t.fallbackTolerance,r=t.fallbackOffset,o=e.touches?e.touches[0]:e,a=cn&&Xt(cn,!0),i=cn&&a&&a.a,l=cn&&a&&a.d,u=Un&&Cn&&Qt(Cn),s=(o.clientX-In.clientX+r.x)/(i||1)+(u?u[0]-Hn[0]:0)/(i||1),c=(o.clientY-In.clientY+r.y)/(l||1)+(u?u[1]-Hn[1]:0)/(l||1);if(!Zn.active&&!An){if(n&&Math.max(Math.abs(o.clientX-this._lastX),Math.abs(o.clientY-this._lastY))r.right+o||e.clientX<=r.right&&e.clientY>r.bottom&&e.clientX>=r.left:e.clientX>r.right&&e.clientY>r.top||e.clientX<=r.right&&e.clientY>r.bottom+o}(e,o,this)&&!g.animated){if(g===un)return B(!1);if(g&&a===e.target&&(i=g),i&&(n=Yt(i)),!1!==Kn(dn,a,un,t,i,n,e,!!i))return _(),a.appendChild(un),sn=a,O(),B(!0)}else if(i.parentNode===a){n=Yt(i);var m,v,y,b=un.parentNode!==a,w=!function(e,t,n){var r=n?e.left:e.top,o=n?e.right:e.bottom,a=n?e.width:e.height,i=n?t.left:t.top,l=n?t.right:t.bottom,u=n?t.width:t.height;return r===i||o===l||r+a/2===i+u/2}(un.animated&&un.toRect||t,i.animated&&i.toRect||n,o),E=o?"top":"left",I=jt(i,"top","top")||jt(un,"top","top"),k=I?I.scrollTop:void 0;if(_n!==i&&(v=n[E],Ln=!1,Rn=!w&&l.invertSwap||b),0!==(m=function(e,t,n,r,o,a,i,l){var u=r?e.clientY:e.clientX,s=r?n.height:n.width,c=r?n.top:n.left,d=r?n.bottom:n.right,f=!1;if(!i)if(l&&Onc+s*a/2:ud-On)return-Bn}else if(u>c+s*(1-o)/2&&ud-s*a/2))return u>c+s/2?1:-1;return 0}(e,i,n,o,w?1:l.swapThreshold,null==l.invertedSwapThreshold?l.swapThreshold:l.invertedSwapThreshold,Rn,_n===i))){var S=Gt(un);do{S-=m,y=sn.children[S]}while(y&&("none"===Ft(y,"display")||y===cn))}if(0===m||y===i)return B(!1);_n=i,Bn=m;var T=i.nextElementSibling,x=!1,D=Kn(dn,a,un,t,i,n,e,x=1===m);if(!1!==D)return 1!==D&&-1!==D||(x=1===D),Fn=!0,setTimeout(tr,30),_(),x&&!T?a.appendChild(un):i.parentNode.insertBefore(un,x?T:i),I&&Zt(I,0,k-I.scrollTop),sn=un.parentNode,void 0===v||Rn||(On=Math.abs(v-Yt(i)[E])),O(),B(!0)}if(a.contains(un))return B(!1)}return!1}function P(l,u){an(l,h,Et({evt:e,isOwner:c,axis:o?"vertical":"horizontal",revert:r,dragRect:t,targetRect:n,canSort:d,fromSortable:f,target:i,completed:B,onMove:function(n,r){return Kn(dn,a,un,t,n,Yt(n),e,r)},changed:O},u))}function _(){P("dragOverAnimationCapture"),h.captureAnimationState(),h!==f&&f.captureAnimationState()}function B(t){return P("dragOverCompleted",{insertion:t}),t&&(c?s._hideClone():s._showClone(h),h!==f&&(Ht(un,En?En.options.ghostClass:s.options.ghostClass,!1),Ht(un,l.ghostClass,!0)),En!==h&&h!==Zn.active?En=h:h===Zn.active&&En&&(En=null),f===h&&(h._ignoreWhileAnimating=i),h.animateAll((function(){P("dragOverAnimationComplete"),h._ignoreWhileAnimating=null})),h!==f&&(f.animateAll(),f._ignoreWhileAnimating=null)),(i===un&&!un.animated||i===a&&!i.animated)&&(_n=null),l.dragoverBubble||e.rootEl||i===document||(un.parentNode[en]._isOutsideThisEl(e.target),!t&&Jn(e)),!l.dragoverBubble&&e.stopPropagation&&e.stopPropagation(),p=!0}function O(){vn=Gt(un),bn=Gt(un,l.draggable),ln({sortable:h,name:"change",toEl:a,newIndex:vn,newDraggableIndex:bn,originalEvent:e})}},_ignoreWhileAnimating:null,_offMoveEvents:function(){Ct(document,"mousemove",this._onTouchMove),Ct(document,"touchmove",this._onTouchMove),Ct(document,"pointermove",this._onTouchMove),Ct(document,"dragover",Jn),Ct(document,"mousemove",Jn),Ct(document,"touchmove",Jn)},_offUpEvents:function(){var e=this.el.ownerDocument;Ct(e,"mouseup",this._onDrop),Ct(e,"touchend",this._onDrop),Ct(e,"pointerup",this._onDrop),Ct(e,"touchcancel",this._onDrop),Ct(document,"selectstart",this)},_onDrop:function(e){var t=this.el,n=this.options;vn=Gt(un),bn=Gt(un,n.draggable),an("drop",this,{evt:e}),sn=un&&un.parentNode,vn=Gt(un),bn=Gt(un,n.draggable),Zn.eventCanceled||(An=!1,Rn=!1,Ln=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),or(this.cloneId),or(this._dragStartId),this.nativeDraggable&&(Ct(document,"drop",this),Ct(t,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),Dt&&Ft(document.body,"user-select",""),Ft(un,"transform",""),e&&(Pn&&(e.cancelable&&e.preventDefault(),!n.dropBubble&&e.stopPropagation()),cn&&cn.parentNode&&cn.parentNode.removeChild(cn),(dn===sn||En&&"clone"!==En.lastPutMode)&&pn&&pn.parentNode&&pn.parentNode.removeChild(pn),un&&(this.nativeDraggable&&Ct(un,"dragend",this),er(un),un.style["will-change"]="",Pn&&!An&&Ht(un,En?En.options.ghostClass:this.options.ghostClass,!1),Ht(un,this.options.chosenClass,!1),ln({sortable:this,name:"unchoose",toEl:sn,newIndex:null,newDraggableIndex:null,originalEvent:e}),dn!==sn?(vn>=0&&(ln({rootEl:sn,name:"add",toEl:sn,fromEl:dn,originalEvent:e}),ln({sortable:this,name:"remove",toEl:sn,originalEvent:e}),ln({rootEl:sn,name:"sort",toEl:sn,fromEl:dn,originalEvent:e}),ln({sortable:this,name:"sort",toEl:sn,originalEvent:e})),En&&En.save()):vn!==mn&&vn>=0&&(ln({sortable:this,name:"update",toEl:sn,originalEvent:e}),ln({sortable:this,name:"sort",toEl:sn,originalEvent:e})),Zn.active&&(null!=vn&&-1!==vn||(vn=mn,bn=yn),ln({sortable:this,name:"end",toEl:sn,originalEvent:e}),this.save())))),this._nulling()},_nulling:function(){an("nulling",this),dn=un=sn=cn=fn=pn=hn=gn=In=kn=Pn=vn=bn=mn=yn=_n=Bn=En=wn=Zn.dragged=Zn.ghost=Zn.clone=Zn.active=null,Xn.forEach((function(e){e.checked=!0})),Xn.length=Sn=Tn=0},handleEvent:function(e){switch(e.type){case"drop":case"dragend":this._onDrop(e);break;case"dragenter":case"dragover":un&&(this._onDragOver(e),function(e){e.dataTransfer&&(e.dataTransfer.dropEffect="move");e.cancelable&&e.preventDefault()}(e));break;case"selectstart":e.preventDefault()}},toArray:function(){for(var e,t=[],n=this.el.children,r=0,o=n.length,a=this.options;r=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=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),xt=kt(/firefox/i),Dt=kt(/safari/i)&&!kt(/chrome/i)&&!kt(/android/i),Pt=kt(/iP(ad|od|hone)/i),_t=kt(/chrome/i)&&kt(/android/i),Bt={capture:!1,passive:!1};function Ot(e,t,n){e.addEventListener(t,n,!St&&Bt)}function Ct(e,t,n){e.removeEventListener(t,n,!St&&Bt)}function At(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 Mt(e){return e.host&&e!==document&&e.host.nodeType?e.host:e.parentNode}function Nt(e,t,n,r){if(e){n=n||document;do{if(null!=t&&(">"===t[0]?e.parentNode===n&&At(e,t):At(e,t))||r&&e===n)return e;if(e===n)break}while(e=Mt(e))}return null}var Lt,Rt=/\s+/g;function Ht(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 Ft(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=Ft(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 qt(e,t,n){if(e){var r=e.getElementsByTagName(t),o=0,i=r.length;if(n)for(;o=i:o<=i))return r;if(r===Ut())break;r=Vt(r,!1)}return!1}function Wt(e,t,n){for(var r=0,o=0,i=e.children;o2&&void 0!==arguments[2]?arguments[2]:{},r=n.evt,o=It(n,["evt"]);on.pluginEvent.bind(Zn)(e,t,Et({dragEl:sn,parentEl:un,ghostEl:cn,rootEl:dn,nextEl:fn,lastDownEl:hn,cloneEl:pn,cloneHidden:gn,dragStarted:Pn,putSortable:En,activeSortable:Zn.active,originalEvent:r,oldIndex:mn,oldDraggableIndex:yn,newIndex:vn,newDraggableIndex:bn,hideGhostForTarget:Qn,unhideGhostForTarget:Vn,cloneNowHidden:function(){gn=!0},cloneNowShown:function(){gn=!1},dispatchSortableEvent:function(e){ln({sortable:t,name:e,originalEvent:r})}},o))};function ln(e){!function(e){var t=e.sortable,n=e.rootEl,r=e.name,o=e.targetEl,i=e.cloneEl,a=e.toEl,l=e.fromEl,s=e.oldIndex,u=e.newIndex,c=e.oldDraggableIndex,d=e.newDraggableIndex,f=e.originalEvent,h=e.putSortable,p=e.extraEventProperties;if(t=t||n&&n[en]){var g,m=t.options,v="on"+r.charAt(0).toUpperCase()+r.substr(1);!window.CustomEvent||St||Tt?(g=document.createEvent("Event")).initEvent(r,!0,!0):g=new CustomEvent(r,{bubbles:!0,cancelable:!0}),g.to=a||n,g.from=l||n,g.item=o||n,g.clone=i,g.oldIndex=s,g.newIndex=u,g.oldDraggableIndex=c,g.newDraggableIndex=d,g.originalEvent=f,g.pullMode=h?h.lastPutMode:void 0;var y=Et({},p,on.getEventProperties(r,t));for(var b in y)g[b]=y[b];n&&n.dispatchEvent(g),m[v]&&m[v].call(t,g)}}(Et({putSortable:En,cloneEl:pn,targetEl:sn,rootEl:dn,oldIndex:mn,oldDraggableIndex:yn,newIndex:vn,newDraggableIndex:bn},e))}var sn,un,cn,dn,fn,hn,pn,gn,mn,vn,yn,bn,wn,En,In,kn,Sn,Tn,xn,Dn,Pn,_n,Bn,On,Cn,An=!1,Mn=!1,Nn=[],Ln=!1,Rn=!1,Hn=[],Fn=!1,Xn=[],qn="undefined"!=typeof document,Un=Pt,Yn=Tt||St?"cssFloat":"float",jn=qn&&!_t&&!Pt&&"draggable"in document.createElement("div"),Wn=function(){if(qn){if(St)return!1;var e=document.createElement("x");return e.style.cssText="pointer-events:auto","auto"===e.style.pointerEvents}}(),zn=function(e,t){var n=Ft(e),r=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),o=Wt(e,0,t),i=Wt(e,1,t),a=o&&Ft(o),l=i&&Ft(i),s=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+Yt(o).width,u=l&&parseInt(l.marginLeft)+parseInt(l.marginRight)+Yt(i).width;if("flex"===n.display)return"column"===n.flexDirection||"column-reverse"===n.flexDirection?"vertical":"horizontal";if("grid"===n.display)return n.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(o&&a.float&&"none"!==a.float){var c="left"===a.float?"left":"right";return!i||"both"!==l.clear&&l.clear!==c?"horizontal":"vertical"}return o&&("block"===a.display||"flex"===a.display||"table"===a.display||"grid"===a.display||s>=r&&"none"===n[Yn]||i&&"none"===n[Yn]&&s+u>r)?"vertical":"horizontal"},Gn=function(e){function t(e,n){return function(r,o,i,a){var l=r.options.group.name&&o.options.group.name&&r.options.group.name===o.options.group.name;if(null==e&&(n||l))return!0;if(null==e||!1===e)return!1;if(n&&"clone"===e)return e;if("function"==typeof e)return t(e(r,o,i,a),n)(r,o,i,a);var s=(n?r:o).options.group.name;return!0===e||"string"==typeof e&&e===s||e.join&&e.indexOf(s)>-1}}var n={},r=e.group;r&&"object"==yt(r)||(r={name:r}),n.name=r.name,n.checkPull=t(r.pull,!0),n.checkPut=t(r.put),n.revertClone=r.revertClone,e.group=n},Qn=function(){!Wn&&cn&&Ft(cn,"display","none")},Vn=function(){!Wn&&cn&&Ft(cn,"display","")};qn&&document.addEventListener("click",(function(e){if(Mn)return e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.stopImmediatePropagation&&e.stopImmediatePropagation(),Mn=!1,!1}),!0);var Jn=function(e){if(sn){e=e.touches?e.touches[0]:e;var t=(o=e.clientX,i=e.clientY,Nn.some((function(e){if(!zt(e)){var t=Yt(e),n=e[en].options.emptyInsertThreshold,r=o>=t.left-n&&o<=t.right+n,l=i>=t.top-n&&i<=t.bottom+n;return n&&r&&l?a=e:void 0}})),a);if(t){var n={};for(var r in e)e.hasOwnProperty(r)&&(n[r]=e[r]);n.target=n.rootEl=t,n.preventDefault=void 0,n.stopPropagation=void 0,t[en]._onDragOver(n)}}var o,i,a},$n=function(e){sn&&sn.parentNode[en]._isOutsideThisEl(e.target)};function Zn(e,t){if(!e||!e.nodeType||1!==e.nodeType)throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(e));this.el=e,this.options=t=wt({},t),e[en]=this;var n={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(e.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return zn(e,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(e,t){e.setData("Text",t.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:!1!==Zn.supportPointer&&"PointerEvent"in window&&!Dt,emptyInsertThreshold:5};for(var r in on.initializePlugins(this,e,n),n)!(r in t)&&(t[r]=n[r]);for(var o in Gn(t),this)"_"===o.charAt(0)&&"function"==typeof this[o]&&(this[o]=this[o].bind(this));this.nativeDraggable=!t.forceFallback&&jn,this.nativeDraggable&&(this.options.touchStartThreshold=1),t.supportPointer?Ot(e,"pointerdown",this._onTapStart):(Ot(e,"mousedown",this._onTapStart),Ot(e,"touchstart",this._onTapStart)),this.nativeDraggable&&(Ot(e,"dragover",this),Ot(e,"dragenter",this)),Nn.push(this.el),t.store&&t.store.get&&this.sort(t.store.get(this)||[]),wt(this,tn())}function Kn(e,t,n,r,o,i,a,l){var s,u,c=e[en],d=c.options.onMove;return!window.CustomEvent||St||Tt?(s=document.createEvent("Event")).initEvent("move",!0,!0):s=new CustomEvent("move",{bubbles:!0,cancelable:!0}),s.to=t,s.from=e,s.dragged=n,s.draggedRect=r,s.related=o||t,s.relatedRect=i||Yt(t),s.willInsertAfter=l,s.originalEvent=a,e.dispatchEvent(s),d&&(u=d.call(c,s,a)),u}function er(e){e.draggable=!1}function tr(){Fn=!1}function nr(e){for(var t=e.tagName+e.className+e.src+e.href+e.textContent,n=t.length,r=0;n--;)r+=t.charCodeAt(n);return r.toString(36)}function rr(e){return setTimeout(e,0)}function or(e){return clearTimeout(e)}Zn.prototype={constructor:Zn,_isOutsideThisEl:function(e){this.el.contains(e)||e===this.el||(_n=null)},_getDirection:function(e,t){return"function"==typeof this.options.direction?this.options.direction.call(this,e,t,sn):this.options.direction},_onTapStart:function(e){if(e.cancelable){var t=this,n=this.el,r=this.options,o=r.preventOnFilter,i=e.type,a=e.touches&&e.touches[0]||e.pointerType&&"touch"===e.pointerType&&e,l=(a||e).target,s=e.target.shadowRoot&&(e.path&&e.path[0]||e.composedPath&&e.composedPath()[0])||l,u=r.filter;if(function(e){Xn.length=0;var t=e.getElementsByTagName("input"),n=t.length;for(;n--;){var r=t[n];r.checked&&Xn.push(r)}}(n),!sn&&!(/mousedown|pointerdown/.test(i)&&0!==e.button||r.disabled)&&!s.isContentEditable&&(this.nativeDraggable||!Dt||!l||"SELECT"!==l.tagName.toUpperCase())&&!((l=Nt(l,r.draggable,n,!1))&&l.animated||hn===l)){if(mn=Gt(l),yn=Gt(l,r.draggable),"function"==typeof u){if(u.call(this,e,l,this))return ln({sortable:t,rootEl:s,name:"filter",targetEl:l,toEl:n,fromEl:n}),an("filter",t,{evt:e}),void(o&&e.cancelable&&e.preventDefault())}else if(u&&(u=u.split(",").some((function(r){if(r=Nt(s,r.trim(),n,!1))return ln({sortable:t,rootEl:r,name:"filter",targetEl:l,fromEl:n,toEl:n}),an("filter",t,{evt:e}),!0}))))return void(o&&e.cancelable&&e.preventDefault());r.handle&&!Nt(s,r.handle,n,!1)||this._prepareDragStart(e,a,l)}}},_prepareDragStart:function(e,t,n){var r,o=this,i=o.el,a=o.options,l=i.ownerDocument;if(n&&!sn&&n.parentNode===i){var s=Yt(n);if(dn=i,un=(sn=n).parentNode,fn=sn.nextSibling,hn=n,wn=a.group,Zn.dragged=sn,In={target:sn,clientX:(t||e).clientX,clientY:(t||e).clientY},xn=In.clientX-s.left,Dn=In.clientY-s.top,this._lastX=(t||e).clientX,this._lastY=(t||e).clientY,sn.style["will-change"]="all",r=function(){an("delayEnded",o,{evt:e}),Zn.eventCanceled?o._onDrop():(o._disableDelayedDragEvents(),!xt&&o.nativeDraggable&&(sn.draggable=!0),o._triggerDragStart(e,t),ln({sortable:o,name:"choose",originalEvent:e}),Ht(sn,a.chosenClass,!0))},a.ignore.split(",").forEach((function(e){qt(sn,e.trim(),er)})),Ot(l,"dragover",Jn),Ot(l,"mousemove",Jn),Ot(l,"touchmove",Jn),Ot(l,"mouseup",o._onDrop),Ot(l,"touchend",o._onDrop),Ot(l,"touchcancel",o._onDrop),xt&&this.nativeDraggable&&(this.options.touchStartThreshold=4,sn.draggable=!0),an("delayStart",this,{evt:e}),!a.delay||a.delayOnTouchOnly&&!t||this.nativeDraggable&&(Tt||St))r();else{if(Zn.eventCanceled)return void this._onDrop();Ot(l,"mouseup",o._disableDelayedDrag),Ot(l,"touchend",o._disableDelayedDrag),Ot(l,"touchcancel",o._disableDelayedDrag),Ot(l,"mousemove",o._delayedDragTouchMoveHandler),Ot(l,"touchmove",o._delayedDragTouchMoveHandler),a.supportPointer&&Ot(l,"pointermove",o._delayedDragTouchMoveHandler),o._dragStartTimer=setTimeout(r,a.delay)}}},_delayedDragTouchMoveHandler:function(e){var t=e.touches?e.touches[0]:e;Math.max(Math.abs(t.clientX-this._lastX),Math.abs(t.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){sn&&er(sn),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var e=this.el.ownerDocument;Ct(e,"mouseup",this._disableDelayedDrag),Ct(e,"touchend",this._disableDelayedDrag),Ct(e,"touchcancel",this._disableDelayedDrag),Ct(e,"mousemove",this._delayedDragTouchMoveHandler),Ct(e,"touchmove",this._delayedDragTouchMoveHandler),Ct(e,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(e,t){t=t||"touch"==e.pointerType&&e,!this.nativeDraggable||t?this.options.supportPointer?Ot(document,"pointermove",this._onTouchMove):Ot(document,t?"touchmove":"mousemove",this._onTouchMove):(Ot(sn,"dragend",this),Ot(dn,"dragstart",this._onDragStart));try{document.selection?rr((function(){document.selection.empty()})):window.getSelection().removeAllRanges()}catch(e){}},_dragStarted:function(e,t){if(An=!1,dn&&sn){an("dragStarted",this,{evt:t}),this.nativeDraggable&&Ot(document,"dragover",$n);var n=this.options;!e&&Ht(sn,n.dragClass,!1),Ht(sn,n.ghostClass,!0),Zn.active=this,e&&this._appendGhost(),ln({sortable:this,name:"start",originalEvent:t})}else this._nulling()},_emulateDragOver:function(){if(kn){this._lastX=kn.clientX,this._lastY=kn.clientY,Qn();for(var e=document.elementFromPoint(kn.clientX,kn.clientY),t=e;e&&e.shadowRoot&&(e=e.shadowRoot.elementFromPoint(kn.clientX,kn.clientY))!==t;)t=e;if(sn.parentNode[en]._isOutsideThisEl(e),t)do{if(t[en]){if(t[en]._onDragOver({clientX:kn.clientX,clientY:kn.clientY,target:e,rootEl:t})&&!this.options.dragoverBubble)break}e=t}while(t=t.parentNode);Vn()}},_onTouchMove:function(e){if(In){var t=this.options,n=t.fallbackTolerance,r=t.fallbackOffset,o=e.touches?e.touches[0]:e,i=cn&&Xt(cn,!0),a=cn&&i&&i.a,l=cn&&i&&i.d,s=Un&&Cn&&Qt(Cn),u=(o.clientX-In.clientX+r.x)/(a||1)+(s?s[0]-Hn[0]:0)/(a||1),c=(o.clientY-In.clientY+r.y)/(l||1)+(s?s[1]-Hn[1]:0)/(l||1);if(!Zn.active&&!An){if(n&&Math.max(Math.abs(o.clientX-this._lastX),Math.abs(o.clientY-this._lastY))r.right+o||e.clientX<=r.right&&e.clientY>r.bottom&&e.clientX>=r.left:e.clientX>r.right&&e.clientY>r.top||e.clientX<=r.right&&e.clientY>r.bottom+o}(e,o,this)&&!g.animated){if(g===sn)return B(!1);if(g&&i===e.target&&(a=g),a&&(n=Yt(a)),!1!==Kn(dn,i,sn,t,a,n,e,!!a))return _(),i.appendChild(sn),un=i,O(),B(!0)}else if(a.parentNode===i){n=Yt(a);var m,v,y,b=sn.parentNode!==i,w=!function(e,t,n){var r=n?e.left:e.top,o=n?e.right:e.bottom,i=n?e.width:e.height,a=n?t.left:t.top,l=n?t.right:t.bottom,s=n?t.width:t.height;return r===a||o===l||r+i/2===a+s/2}(sn.animated&&sn.toRect||t,a.animated&&a.toRect||n,o),E=o?"top":"left",I=jt(a,"top","top")||jt(sn,"top","top"),k=I?I.scrollTop:void 0;if(_n!==a&&(v=n[E],Ln=!1,Rn=!w&&l.invertSwap||b),0!==(m=function(e,t,n,r,o,i,a,l){var s=r?e.clientY:e.clientX,u=r?n.height:n.width,c=r?n.top:n.left,d=r?n.bottom:n.right,f=!1;if(!a)if(l&&Onc+u*i/2:sd-On)return-Bn}else if(s>c+u*(1-o)/2&&sd-u*i/2))return s>c+u/2?1:-1;return 0}(e,a,n,o,w?1:l.swapThreshold,null==l.invertedSwapThreshold?l.swapThreshold:l.invertedSwapThreshold,Rn,_n===a))){var S=Gt(sn);do{S-=m,y=un.children[S]}while(y&&("none"===Ft(y,"display")||y===cn))}if(0===m||y===a)return B(!1);_n=a,Bn=m;var T=a.nextElementSibling,x=!1,D=Kn(dn,i,sn,t,a,n,e,x=1===m);if(!1!==D)return 1!==D&&-1!==D||(x=1===D),Fn=!0,setTimeout(tr,30),_(),x&&!T?i.appendChild(sn):a.parentNode.insertBefore(sn,x?T:a),I&&Zt(I,0,k-I.scrollTop),un=sn.parentNode,void 0===v||Rn||(On=Math.abs(v-Yt(a)[E])),O(),B(!0)}if(i.contains(sn))return B(!1)}return!1}function P(l,s){an(l,h,Et({evt:e,isOwner:c,axis:o?"vertical":"horizontal",revert:r,dragRect:t,targetRect:n,canSort:d,fromSortable:f,target:a,completed:B,onMove:function(n,r){return Kn(dn,i,sn,t,n,Yt(n),e,r)},changed:O},s))}function _(){P("dragOverAnimationCapture"),h.captureAnimationState(),h!==f&&f.captureAnimationState()}function B(t){return P("dragOverCompleted",{insertion:t}),t&&(c?u._hideClone():u._showClone(h),h!==f&&(Ht(sn,En?En.options.ghostClass:u.options.ghostClass,!1),Ht(sn,l.ghostClass,!0)),En!==h&&h!==Zn.active?En=h:h===Zn.active&&En&&(En=null),f===h&&(h._ignoreWhileAnimating=a),h.animateAll((function(){P("dragOverAnimationComplete"),h._ignoreWhileAnimating=null})),h!==f&&(f.animateAll(),f._ignoreWhileAnimating=null)),(a===sn&&!sn.animated||a===i&&!a.animated)&&(_n=null),l.dragoverBubble||e.rootEl||a===document||(sn.parentNode[en]._isOutsideThisEl(e.target),!t&&Jn(e)),!l.dragoverBubble&&e.stopPropagation&&e.stopPropagation(),p=!0}function O(){vn=Gt(sn),bn=Gt(sn,l.draggable),ln({sortable:h,name:"change",toEl:i,newIndex:vn,newDraggableIndex:bn,originalEvent:e})}},_ignoreWhileAnimating:null,_offMoveEvents:function(){Ct(document,"mousemove",this._onTouchMove),Ct(document,"touchmove",this._onTouchMove),Ct(document,"pointermove",this._onTouchMove),Ct(document,"dragover",Jn),Ct(document,"mousemove",Jn),Ct(document,"touchmove",Jn)},_offUpEvents:function(){var e=this.el.ownerDocument;Ct(e,"mouseup",this._onDrop),Ct(e,"touchend",this._onDrop),Ct(e,"pointerup",this._onDrop),Ct(e,"touchcancel",this._onDrop),Ct(document,"selectstart",this)},_onDrop:function(e){var t=this.el,n=this.options;vn=Gt(sn),bn=Gt(sn,n.draggable),an("drop",this,{evt:e}),un=sn&&sn.parentNode,vn=Gt(sn),bn=Gt(sn,n.draggable),Zn.eventCanceled||(An=!1,Rn=!1,Ln=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),or(this.cloneId),or(this._dragStartId),this.nativeDraggable&&(Ct(document,"drop",this),Ct(t,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),Dt&&Ft(document.body,"user-select",""),Ft(sn,"transform",""),e&&(Pn&&(e.cancelable&&e.preventDefault(),!n.dropBubble&&e.stopPropagation()),cn&&cn.parentNode&&cn.parentNode.removeChild(cn),(dn===un||En&&"clone"!==En.lastPutMode)&&pn&&pn.parentNode&&pn.parentNode.removeChild(pn),sn&&(this.nativeDraggable&&Ct(sn,"dragend",this),er(sn),sn.style["will-change"]="",Pn&&!An&&Ht(sn,En?En.options.ghostClass:this.options.ghostClass,!1),Ht(sn,this.options.chosenClass,!1),ln({sortable:this,name:"unchoose",toEl:un,newIndex:null,newDraggableIndex:null,originalEvent:e}),dn!==un?(vn>=0&&(ln({rootEl:un,name:"add",toEl:un,fromEl:dn,originalEvent:e}),ln({sortable:this,name:"remove",toEl:un,originalEvent:e}),ln({rootEl:un,name:"sort",toEl:un,fromEl:dn,originalEvent:e}),ln({sortable:this,name:"sort",toEl:un,originalEvent:e})),En&&En.save()):vn!==mn&&vn>=0&&(ln({sortable:this,name:"update",toEl:un,originalEvent:e}),ln({sortable:this,name:"sort",toEl:un,originalEvent:e})),Zn.active&&(null!=vn&&-1!==vn||(vn=mn,bn=yn),ln({sortable:this,name:"end",toEl:un,originalEvent:e}),this.save())))),this._nulling()},_nulling:function(){an("nulling",this),dn=sn=un=cn=fn=pn=hn=gn=In=kn=Pn=vn=bn=mn=yn=_n=Bn=En=wn=Zn.dragged=Zn.ghost=Zn.clone=Zn.active=null,Xn.forEach((function(e){e.checked=!0})),Xn.length=Sn=Tn=0},handleEvent:function(e){switch(e.type){case"drop":case"dragend":this._onDrop(e);break;case"dragenter":case"dragover":sn&&(this._onDragOver(e),function(e){e.dataTransfer&&(e.dataTransfer.dropEffect="move");e.cancelable&&e.preventDefault()}(e));break;case"selectstart":e.preventDefault()}},toArray:function(){for(var e,t=[],n=this.el.children,r=0,o=n.length,i=this.options;r