!function o(a,c,d){function s(t,e){if(!c[t]){if(!a[t]){var n="function"==typeof require&&require;if(!e&&n)return n(t,!0);if(u)return u(t,!0);var i=new Error("Cannot find module '"+t+"'");throw i.code="MODULE_NOT_FOUND",i}var r=c[t]={exports:{}};a[t][0].call(r.exports,function(e){return s(a[t][1][e]||e)},r,r.exports,o,a,c,d)}return c[t].exports}for(var u="function"==typeof require&&require,e=0;e
"+t+"
"}else t=b.options.itemHandleOptions.customHandler.replace("%s",t);return t}arguments[0]&&"object"==typeof arguments[0]&&(this.options=function(e,t){var n;for(n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}(t,arguments[0])),this.__getCanMove=function(e){return b.options.itemHandleOptions.enabled?b.options.itemHandleOptions.handleClass?e.classList.contains(b.options.itemHandleOptions.handleClass):e.classList.contains("item_handle"):!!b.options.dragItems},this.init=function(){!function(){b.element=document.querySelector(b.options.element);var e=document.createElement("div");e.classList.add("kanban-container"),b.container=e,b.addBoards(b.options.boards,!0),b.element.appendChild(b.container)}(),window.innerWidth>b.options.responsive&&(b.drakeBoard=b.dragula([b.container],{moves:function(e,t,n,i){return!!b.options.dragBoards&&(n.classList.contains("kanban-board-header")||n.classList.contains("kanban-title-board"))},accepts:function(e,t,n,i){return t.classList.contains("kanban-container")},revertOnSpill:!0,direction:"horizontal"}).on("drag",function(e,t){e.classList.add("is-moving"),b.options.dragBoard(e,t),"function"==typeof e.dragfn&&e.dragfn(e,t)}).on("dragend",function(e){!function(){for(var e=1,t=0;tb.options.responsive)var n=(100-2*e.length)/e.length;else n=100-2*e.length;else n=b.options.widthBoard;var i=b.options.addItemButton,r=b.options.buttonContent;for(var o in e){var a=e[o];t||b.options.boards.push(a),b.options.responsivePercentage||(""===b.container.style.width?b.container.style.width=parseInt(n)+2*parseInt(b.options.gutter)+"px":b.container.style.width=parseInt(b.container.style.width)+parseInt(n)+2*parseInt(b.options.gutter)+"px");var c=document.createElement("div");c.dataset.id=a.id,c.dataset.order=b.container.childNodes.length+1,c.classList.add("kanban-board"),b.options.responsivePercentage?c.style.width=n+"%":c.style.width=n,c.style.marginLeft=b.options.gutter,c.style.marginRight=b.options.gutter;var d=document.createElement("header");if(""!==a.class&&void 0!==a.class)var s=a.class.split(",");else s=[];if(d.classList.add("kanban-board-header"),s.map(function(e){d.classList.add(e)}),d.innerHTML='
'+a.title+"
",i){var u=document.createElement("BUTTON"),l=document.createTextNode(r);u.setAttribute("class","kanban-title-button btn btn-default btn-xs"),u.appendChild(l),d.appendChild(u),w(u,a.id)}var f=document.createElement("main");if(f.classList.add("kanban-drag"),""!==a.bodyClass&&void 0!==a.bodyClass)var p=a.bodyClass.split(",");else p=[];for(var v in p.map(function(e){f.classList.add(e)}),b.boardContainer.push(f),a.item){var m=a.item[v],h=document.createElement("div");h.classList.add("kanban-item"),m.id&&(h.dataset.eid=m.id),m.class&&Array.isArray(m.class)&&m.class.forEach(function(e){h.classList.add(e)}),h.innerHTML=T(m.title),h.clickfn=m.click,h.dragfn=m.drag,h.dragendfn=m.dragend,h.dropfn=m.drop,E(h,m),y(h),b.options.itemHandleOptions.enabled&&(h.style.cursor="default"),f.appendChild(h)}var g=document.createElement("footer");c.appendChild(d),c.appendChild(f),c.appendChild(g),b.container.appendChild(c)}return b},this.findBoard=function(e){return b.element.querySelector('[data-id="'+e+'"]')},this.getParentBoardID=function(e){return"string"==typeof e&&(e=b.element.querySelector('[data-eid="'+e+'"]')),null===e?null:e.parentNode.parentNode.dataset.id},this.moveElement=function(e,t,n){if(e!==this.getParentBoardID(t))return this.removeElement(t),this.addElement(e,n)},this.replaceElement=function(e,t){var n=e;return"string"==typeof n&&(n=b.element.querySelector('[data-eid="'+e+'"]')),n.innerHTML=t.title,n.clickfn=t.click,n.dragfn=t.drag,n.dragendfn=t.dragend,n.dropfn=t.drop,E(n,t),b},this.findElement=function(e){return b.element.querySelector('[data-eid="'+e+'"]')},this.getBoardElements=function(e){return b.element.querySelector('[data-id="'+e+'"] .kanban-drag').childNodes},this.removeElement=function(e){return"string"==typeof e&&(e=b.element.querySelector('[data-eid="'+e+'"]')),null!==e&&e.remove(),b},this.removeBoard=function(e){var t=null;"string"==typeof e&&(t=b.element.querySelector('[data-id="'+e+'"]')),null!==t&&t.remove();for(var n=0;ne.left+$(e)/2);return n(a>e.top+G(e)/2)}():function(){var e,t,n,i=r.children.length;for(e=0;eo)return t;if(!c&&n.top+n.height/2>a)return t}return null}();function n(e){return e?Z(t):t}}}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./classes":8,"contra/emitter":4,crossvent:5}],10:[function(e,t,n){var i,r,o=t.exports={};function a(){throw new Error("setTimeout has not been defined")}function c(){throw new Error("clearTimeout has not been defined")}function d(t){if(i===setTimeout)return setTimeout(t,0);if((i===a||!i)&&setTimeout)return i=setTimeout,setTimeout(t,0);try{return i(t,0)}catch(e){try{return i.call(null,t,0)}catch(e){return i.call(this,t,0)}}}!function(){try{i="function"==typeof setTimeout?setTimeout:a}catch(e){i=a}try{r="function"==typeof clearTimeout?clearTimeout:c}catch(e){r=c}}();var s,u=[],l=!1,f=-1;function p(){l&&s&&(l=!1,s.length?u=s.concat(u):f=-1,u.length&&v())}function v(){if(!l){var e=d(p);l=!0;for(var t=u.length;t;){for(s=u,u=[];++f