No Description

index.js 73KB

12
  1. !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var r=t();for(var n in r)("object"==typeof exports?exports:e)[n]=r[n]}}(window,function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=20)}([function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(){}return e.createRect=function(t,r,n){var i=document.createElementNS("http://www.w3.org/2000/svg","rect");return i.setAttribute("width",t.toString()),i.setAttribute("height",r.toString()),n&&e.setAttributes(i,n),i},e.createLine=function(t,r,n,i,o){var s=document.createElementNS("http://www.w3.org/2000/svg","line");return s.setAttribute("x1",t.toString()),s.setAttribute("y1",r.toString()),s.setAttribute("x2",n.toString()),s.setAttribute("y2",i.toString()),o&&e.setAttributes(s,o),s},e.createPolygon=function(t,r){var n=document.createElementNS("http://www.w3.org/2000/svg","polygon");return n.setAttribute("points",t),r&&e.setAttributes(n,r),n},e.createCircle=function(t,r){var n=document.createElementNS("http://www.w3.org/2000/svg","circle");return n.setAttribute("cx",(t/2).toString()),n.setAttribute("cy",(t/2).toString()),n.setAttribute("r",t.toString()),r&&e.setAttributes(n,r),n},e.createGroup=function(t){var r=document.createElementNS("http://www.w3.org/2000/svg","g");return t&&e.setAttributes(r,t),r},e.setAttributes=function(e,t){for(var r=0,n=t;r<n.length;r++){var i=n[r],o=i[0],s=i[1];e.setAttribute(o,s)}},e.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},e.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},e.createMarker=function(t,r,n,i,o,s,a){var c=document.createElementNS("http://www.w3.org/2000/svg","marker");return e.setAttributes(c,[["id",t],["orient",r],["markerWidth",n.toString()],["markerHeight",i.toString()],["refX",o.toString()],["refY",s.toString()]]),c.appendChild(a),c},e.createText=function(t){var r=document.createElementNS("http://www.w3.org/2000/svg","text");return r.setAttribute("x","0"),r.setAttribute("y","0"),t&&e.setAttributes(r,t),r},e.createTSpan=function(t,r){var n=document.createElementNS("http://www.w3.org/2000/svg","tspan");return n.textContent=t,r&&e.setAttributes(n,r),n},e}();t.SvgHelper=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(7);t.uuid=n},function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(0),s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.setup=function(){e.prototype.setup.call(this),this.markerRect=o.SvgHelper.createRect(this.width,this.height),this.addToRenderVisual(this.markerRect)},t.prototype.resize=function(t,r,n){e.prototype.resize.call(this,t,r,n),this.markerRect.setAttribute("width",this.width.toString()),this.markerRect.setAttribute("height",this.height.toString())},t.createMarker=function(e){var r=new t;return r.page=e,r.setup(),r},t}(r(9).RectangularMarker);t.RectBaseMarker=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(7),i=r(0),o=function(){function e(){var e=this;this.id=n(),this.type="base",this.onChange=function(){},this.defs=[],this.width=200,this.height=50,this.isActive=!0,this.isDragging=!1,this.isResizing=!1,this.previousMouseX=0,this.previousMouseY=0,this.manipulate=function(t){var r=e.visual.getScreenCTM().a,n=(t.screenX-e.previousMouseX)/r,i=(t.screenY-e.previousMouseY)/r;e.isDragging&&(e.onChange({target:"marker",id:e.id,event:"move",data:{dx:n,dy:i}}),e.move(n,i)),e.isResizing&&e.resize(n,i,function(t){e.onChange({target:"marker",id:e.id,event:"resize",data:{dx:n,dy:i,pos:t}})}),e.previousMouseX=t.screenX,e.previousMouseY=t.screenY},this.addToVisual=function(t){e.visual.appendChild(t)},this.addToRenderVisual=function(t){e.renderVisual.appendChild(t)},this.mouseDown=function(t){t.stopPropagation(),e.page&&"mirror"===e.page.mode||(e.select(),e.isDragging=!0,e.previousMouseX=t.screenX,e.previousMouseY=t.screenY)},this.mouseUp=function(t){t.stopPropagation(),e.endManipulation()},this.mouseMove=function(t){t.stopPropagation(),e.manipulate(t)},this.move=function(t,r){var n=e.visual.transform.baseVal.getItem(0);n.setMatrix(n.matrix.translate(t,r)),e.visual.transform.baseVal.replaceItem(n,0)}}return e.prototype.reactToManipulation=function(e,t){var r=t.dx,n=t.dy,i=t.pos;"move"===e&&this.move(r,n),"resize"===e&&this.resizeByEvent(r,n,i)},e.prototype.endManipulation=function(){this.isDragging=!1,this.isResizing=!1},e.prototype.select=function(){this.isActive=!0,this.onSelected&&this.onSelected(this)},e.prototype.deselect=function(){this.isActive=!1,this.endManipulation()},e.prototype.setup=function(){this.visual=i.SvgHelper.createGroup(),this.visual.transform.baseVal.appendItem(i.SvgHelper.createTransform()),this.visual.addEventListener("mousedown",this.mouseDown),this.visual.addEventListener("mouseup",this.mouseUp),this.visual.addEventListener("mousemove",this.mouseMove),this.visual.addEventListener("touchstart",this.onTouch,{passive:!1}),this.visual.addEventListener("touchend",this.onTouch,{passive:!1}),this.visual.addEventListener("touchmove",this.onTouch,{passive:!1}),this.renderVisual=i.SvgHelper.createGroup([["class","render-visual"]]),this.visual.appendChild(this.renderVisual)},e.prototype.resize=function(e,t,r){},e.prototype.resizeByEvent=function(e,t,r){},e.prototype.onTouch=function(e){e.preventDefault();var t=document.createEvent("MouseEvents"),r=e.changedTouches[0],n=null;switch(e.type){case"touchstart":n="mousedown";break;case"touchmove":n="mousemove";break;case"touchend":n="mouseup"}t.initMouseEvent(n,!0,!0,window,0,r.screenX,r.screenY,r.clientX,r.clientY,e.ctrlKey,e.altKey,e.shiftKey,e.metaKey,0,null),e.target.dispatchEvent(t)},e.createMarker=function(t){var r=new e;return r.page=t,r.setup(),r},e}();t.BaseMarker=o},function(e,t,r){"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map(function(t){var r=function(e,t){var r=e[1]||"",n=e[3];if(!n)return r;if(t&&"function"==typeof btoa){var i=(s=n,"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(s))))+" */"),o=n.sources.map(function(e){return"/*# sourceURL="+n.sourceRoot+e+" */"});return[r].concat(o).concat([i]).join("\n")}var s;return[r].join("\n")}(t,e);return t[2]?"@media "+t[2]+"{"+r+"}":r}).join("")},t.i=function(e,r){"string"==typeof e&&(e=[[null,e,""]]);for(var n={},i=0;i<this.length;i++){var o=this[i][0];null!=o&&(n[o]=!0)}for(i=0;i<e.length;i++){var s=e[i];null!=s[0]&&n[s[0]]||(r&&!s[2]?s[2]=r:r&&(s[2]="("+s[2]+") and ("+r+")"),t.push(s))}},t}},function(e,t,r){var n,i,o={},s=(n=function(){return window&&document&&document.all&&!window.atob},function(){return void 0===i&&(i=n.apply(this,arguments)),i}),a=function(e){var t={};return function(e,r){if("function"==typeof e)return e();if(void 0===t[e]){var n=function(e,t){return t?t.querySelector(e):document.querySelector(e)}.call(this,e,r);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}t[e]=n}return t[e]}}(),c=null,l=0,h=[],u=r(41);function d(e,t){for(var r=0;r<e.length;r++){var n=e[r],i=o[n.id];if(i){i.refs++;for(var s=0;s<i.parts.length;s++)i.parts[s](n.parts[s]);for(;s<n.parts.length;s++)i.parts.push(b(n.parts[s],t))}else{var a=[];for(s=0;s<n.parts.length;s++)a.push(b(n.parts[s],t));o[n.id]={id:n.id,refs:1,parts:a}}}}function p(e,t){for(var r=[],n={},i=0;i<e.length;i++){var o=e[i],s=t.base?o[0]+t.base:o[0],a={css:o[1],media:o[2],sourceMap:o[3]};n[s]?n[s].parts.push(a):r.push(n[s]={id:s,parts:[a]})}return r}function f(e,t){var r=a(e.insertInto);if(!r)throw new Error("Couldn't find a style target. This probably means that the value for the 'insertInto' parameter is invalid.");var n=h[h.length-1];if("top"===e.insertAt)n?n.nextSibling?r.insertBefore(t,n.nextSibling):r.appendChild(t):r.insertBefore(t,r.firstChild),h.push(t);else if("bottom"===e.insertAt)r.appendChild(t);else{if("object"!=typeof e.insertAt||!e.insertAt.before)throw new Error("[Style Loader]\n\n Invalid value for parameter 'insertAt' ('options.insertAt') found.\n Must be 'top', 'bottom', or Object.\n (https://github.com/webpack-contrib/style-loader#insertat)\n");var i=a(e.insertAt.before,r);r.insertBefore(t,i)}}function v(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e);var t=h.indexOf(e);t>=0&&h.splice(t,1)}function g(e){var t=document.createElement("style");if(void 0===e.attrs.type&&(e.attrs.type="text/css"),void 0===e.attrs.nonce){var n=function(){0;return r.nc}();n&&(e.attrs.nonce=n)}return m(t,e.attrs),f(e,t),t}function m(e,t){Object.keys(t).forEach(function(r){e.setAttribute(r,t[r])})}function b(e,t){var r,n,i,o;if(t.transform&&e.css){if(!(o="function"==typeof t.transform?t.transform(e.css):t.transform.default(e.css)))return function(){};e.css=o}if(t.singleton){var s=l++;r=c||(c=g(t)),n=x.bind(null,r,s,!1),i=x.bind(null,r,s,!0)}else e.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(r=function(e){var t=document.createElement("link");return void 0===e.attrs.type&&(e.attrs.type="text/css"),e.attrs.rel="stylesheet",m(t,e.attrs),f(e,t),t}(t),n=function(e,t,r){var n=r.css,i=r.sourceMap,o=void 0===t.convertToAbsoluteUrls&&i;(t.convertToAbsoluteUrls||o)&&(n=u(n));i&&(n+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(i))))+" */");var s=new Blob([n],{type:"text/css"}),a=e.href;e.href=URL.createObjectURL(s),a&&URL.revokeObjectURL(a)}.bind(null,r,t),i=function(){v(r),r.href&&URL.revokeObjectURL(r.href)}):(r=g(t),n=function(e,t){var r=t.css,n=t.media;n&&e.setAttribute("media",n);if(e.styleSheet)e.styleSheet.cssText=r;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(r))}}.bind(null,r),i=function(){v(r)});return n(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;n(e=t)}else i()}}e.exports=function(e,t){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");(t=t||{}).attrs="object"==typeof t.attrs?t.attrs:{},t.singleton||"boolean"==typeof t.singleton||(t.singleton=s()),t.insertInto||(t.insertInto="head"),t.insertAt||(t.insertAt="bottom");var r=p(e,t);return d(r,t),function(e){for(var n=[],i=0;i<r.length;i++){var s=r[i];(a=o[s.id]).refs--,n.push(a)}e&&d(p(e,t),t);for(i=0;i<n.length;i++){var a;if(0===(a=n[i]).refs){for(var c=0;c<a.parts.length;c++)a.parts[c]();delete o[a.id]}}}};var y,w=(y=[],function(e,t){return y[e]=t,y.filter(Boolean).join("\n")});function x(e,t,r,n){var i=r?"":n.css;if(e.styleSheet)e.styleSheet.cssText=w(t,i);else{var o=document.createTextNode(i),s=e.childNodes;s[t]&&e.removeChild(s[t]),s.length?e.insertBefore(o,s[t]):e.appendChild(o)}}},function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(21),s=r(24),a=r(35),c=r(37);r(39);var l=function(e){function t(t,r){var n=void 0===r?{}:r,i=n.page,o=n.onChange,l=e.call(this,t)||this;return l.scale=1,l.onComplete=function(){},l.onChange=function(){},l.open=function(e,t){e&&(l.onComplete=e),t&&(l.onCancel=t),l.setTargetRect(),l.initBoard(),l.attachEvents(),l.setStyles(),window.addEventListener("resize",l.adjustUI),"master"===l.page.mode&&l.showUI()},l.hide=function(){l.source.imgSrc&&(l.target.style.display="none"),l.boardHolder.style.visibility="hidden",l.boardHolder.style.zIndex="-1",l.toolbar&&l.toolbar.hide()},l.show=function(){l.source.imgSrc&&(l.target.style.display="block"),l.boardHolder.style.visibility="visible",l.boardHolder.style.zIndex="9999",l.toolbar&&l.toolbar.show()},l.close=function(){l.toolbarUI&&document.body.removeChild(l.toolbarUI),l.boardCanvas&&document.body.removeChild(l.boardHolder)},l.render=function(e,t){l.onComplete=e,t&&(l.onCancel=t),l.selectMarker(null),l.startRender(l.renderFinished)},l.addMarker=function(e,t){var r=(void 0===t?{}:t).id,n=e.createMarker(l.page);if(r&&(n.id=r),n.onSelected=l.selectMarker,n.onChange=l.onChange,n.defs&&n.defs.length>0)for(var i=0,o=n.defs;i<o.length;i++){var s=o[i];s.id&&!l.boardCanvas.getElementById(s.id)&&l.defs.appendChild(s)}l.onChange({target:"marker",parentId:l.page?l.page.id:l.id,event:"add",data:{type:n.type,id:n.id}}),l.markers.push(n),l.selectMarker(n),l.boardCanvas.appendChild(n.visual);var a=n.visual.getBBox(),c=l.width/2/l.scale-a.width/2,h=l.height/2/l.scale-a.height/2,u=n.visual.transform.baseVal.getItem(0);u.setMatrix(u.matrix.translate(c,h)),n.visual.transform.baseVal.replaceItem(u,0)},l.deleteActiveMarker=function(){l.activeMarker&&(l.onChange&&l.onChange({event:"remove",id:l.activeMarker.id,target:"marker",data:{id:l.activeMarker.id}}),l.deleteMarker(l.activeMarker))},l.setTargetRect=function(){var e=l.target.getBoundingClientRect(),t=document.body.parentElement.getBoundingClientRect();l.targetRect={left:e.left-t.left,top:e.top-t.top}},l.startRender=function(e){(new a.Synthetizer).rasterize(l.target,l.boardCanvas,e)},l.attachEvents=function(){l.boardCanvas.addEventListener("mousedown",l.mouseDown),l.boardCanvas.addEventListener("mousemove",l.mouseMove),l.boardCanvas.addEventListener("mouseup",l.mouseUp)},l.mouseDown=function(e){l.activeMarker&&(1&e.buttons)>0&&(l.activeMarker.deselect(),l.activeMarker=null)},l.mouseMove=function(e){l.activeMarker&&(1&e.buttons)>0&&l.activeMarker.manipulate(e)},l.mouseUp=function(e){l.activeMarker&&l.activeMarker.endManipulation()},l.adjustUI=function(e){l.adjustSize(),l.positionUI()},l.adjustSize=function(){l.width=l.target.clientWidth,l.height=l.target.clientHeight;var e=l.target.clientWidth/l.boardHolder.clientWidth;1!==e&&(l.scale*=e,l.boardHolder.style.width=l.width+"px",l.boardHolder.style.height=l.height+"px",l.boardHolder.style.transform="scale("+l.scale+")")},l.positionUI=function(){l.setTargetRect(),l.positionBoard(),l.positionToolbar()},l.positionToolbar=function(){l.toolbarUI.style.left=l.targetRect.left+l.target.offsetWidth-l.toolbarUI.clientWidth+"px",l.toolbarUI.style.top=l.targetRect.top-l.toolbarUI.clientHeight+"px"},l.showUI=function(){l.toolbar=new c.Toolbar(l.toolbars,l.toolbarClick),l.toolbarUI=l.toolbar.getUI(),document.body.appendChild(l.toolbarUI),l.toolbarUI.style.position="absolute",l.positionToolbar()},l.setStyles=function(){var e=document.createElementNS("http://www.w3.org/2000/svg","style");e.innerHTML='\n .rect-marker .render-visual {\n stroke: #ff0000;\n stroke-width: 3;\n fill: transparent;\n }\n .cover-marker .render-visual {\n stroke-width: 0;\n fill: #000000;\n }\n .highlight-marker .render-visual {\n stroke: transparent;\n stroke-width: 0;\n fill: #ffff00;\n fill-opacity: 0.4;\n }\n .line-marker .render-visual {\n stroke: #ff0000;\n stroke-width: 3;\n fill: transparent;\n }\n .arrow-marker .render-visual {\n stroke: #ff0000;\n stroke-width: 3;\n fill: transparent;\n }\n .arrow-marker-tip {\n stroke-width: 0;\n fill: #ff0000;\n }\n .text-marker text {\n fill: #ff0000;\n font-family: -apple-system, BlinkMacSystemFont, "Segoe UI",\n Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji",\n "Segoe UI Emoji", "Segoe UI Symbol";\n }\n .fc-whiteboard-rect-control-box .fc-whiteboard-rect-control-rect {\n stroke: black;\n stroke-width: 1;\n stroke-opacity: 0.5;\n stroke-dasharray: 3, 2;\n fill: transparent;\n }\n .fc-whiteboard-control-grip {\n fill: #cccccc;\n stroke: #333333;\n stroke-width: 2;\n }\n ',l.boardCanvas.appendChild(e)},l.toolbarClick=function(e,t){if(t.markerType)l.addMarker(t.markerType);else switch(t.name){case"delete":l.deleteActiveMarker();break;case"pointer":l.activeMarker&&l.selectMarker(null);break;case"close":l.cancel();break;case"ok":l.complete()}},l.selectMarker=function(e){l.activeMarker&&l.activeMarker!==e&&l.activeMarker.deselect(),l.activeMarker=e},l.deleteMarker=function(e){l.boardCanvas.removeChild(e.visual),l.activeMarker===e&&(l.activeMarker=null),l.markers.splice(l.markers.indexOf(e),1)},l.complete=function(){l.selectMarker(null),l.startRender(l.renderFinishedClose)},l.cancel=function(){l.close(),l.onCancel&&l.onCancel()},l.renderFinished=function(e){l.onComplete(e)},l.renderFinishedClose=function(e){l.close(),l.onComplete(e)},i&&(l.page=i),l.markers=[],l.activeMarker=null,l.toolbars=s.getToolbars(i),o&&(l.onChange=o),l}return i(t,e),Object.defineProperty(t.prototype,"markerMap",{get:function(){var e={};return this.markers.forEach(function(t){e[t.id]=t}),e},enumerable:!0,configurable:!0}),t}(o.Baseboard);t.Drawboard=l},function(e,t,r){var n,i,o=r(22),s=r(23),a=0,c=0;e.exports=function(e,t,r){var l=t&&r||0,h=t||[],u=(e=e||{}).node||n,d=void 0!==e.clockseq?e.clockseq:i;if(null==u||null==d){var p=o();null==u&&(u=n=[1|p[0],p[1],p[2],p[3],p[4],p[5]]),null==d&&(d=i=16383&(p[6]<<8|p[7]))}var f=void 0!==e.msecs?e.msecs:(new Date).getTime(),v=void 0!==e.nsecs?e.nsecs:c+1,g=f-a+(v-c)/1e4;if(g<0&&void 0===e.clockseq&&(d=d+1&16383),(g<0||f>a)&&void 0===e.nsecs&&(v=0),v>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");a=f,c=v,i=d;var m=(1e4*(268435455&(f+=122192928e5))+v)%4294967296;h[l++]=m>>>24&255,h[l++]=m>>>16&255,h[l++]=m>>>8&255,h[l++]=255&m;var b=f/4294967296*1e4&268435455;h[l++]=b>>>8&255,h[l++]=255&b,h[l++]=b>>>24&15|16,h[l++]=b>>>16&255,h[l++]=d>>>8|128,h[l++]=255&d;for(var y=0;y<6;++y)h[l+y]=u[y];return t||s(h)}},function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(2),s=r(0),a=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type="rect",t}return i(t,e),t.prototype.setup=function(){e.prototype.setup.call(this),s.SvgHelper.setAttributes(this.visual,[["class","rect-marker"]])},t.createMarker=function(e){var r=new t;return r.page=e,r.setup(),r},t}(o.RectBaseMarker);t.RectMarker=a},function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(25),s=r(3),a=r(10),c=r(0),l=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.MIN_SIZE=5,t.CB_DISTANCE=10,t.addControlBox=function(){t.controlBox=c.SvgHelper.createGroup([["class","fc-whiteboard-rect-control-box"]]);var e=c.SvgHelper.createTransform();e.setTranslate(-t.CB_DISTANCE/2,-t.CB_DISTANCE/2),t.controlBox.transform.baseVal.appendItem(e),t.addToVisual(t.controlBox),t.controlRect=c.SvgHelper.createRect(t.width+t.CB_DISTANCE,t.height+t.CB_DISTANCE,[["class","fc-whiteboard-rect-control-rect"]]),t.controlBox.appendChild(t.controlRect),t.controlGrips=new o.RectangularMarkerGrips,t.addControlGrips()},t.adjustControlBox=function(){t.controlRect.setAttribute("width",(t.width+t.CB_DISTANCE).toString()),t.controlRect.setAttribute("height",(t.height+t.CB_DISTANCE).toString()),t.positionGrips()},t.addControlGrips=function(){t.controlGrips.topLeft=t.createGrip(),t.controlGrips.topCenter=t.createGrip(),t.controlGrips.topRight=t.createGrip(),t.controlGrips.centerLeft=t.createGrip(),t.controlGrips.centerRight=t.createGrip(),t.controlGrips.bottomLeft=t.createGrip(),t.controlGrips.bottomCenter=t.createGrip(),t.controlGrips.bottomRight=t.createGrip(),t.positionGrips()},t.createGrip=function(){var e=new a.ResizeGrip;return e.visual.transform.baseVal.appendItem(c.SvgHelper.createTransform()),t.controlBox.appendChild(e.visual),e.visual.addEventListener("mousedown",t.gripMouseDown),e.visual.addEventListener("mousemove",t.gripMouseMove),e.visual.addEventListener("mouseup",t.gripMouseUp),e.visual.addEventListener("touchstart",t.onTouch,{passive:!1}),e.visual.addEventListener("touchend",t.onTouch,{passive:!1}),e.visual.addEventListener("touchmove",t.onTouch,{passive:!1}),e},t.positionGrips=function(){var e=t.controlGrips.topLeft.GRIP_SIZE,r=-e/2,n=r,i=(t.width+t.CB_DISTANCE)/2-e/2,o=(t.height+t.CB_DISTANCE)/2-e/2,s=t.height+t.CB_DISTANCE-e/2,a=t.width+t.CB_DISTANCE-e/2;t.positionGrip(t.controlGrips.topLeft.visual,r,n),t.positionGrip(t.controlGrips.topCenter.visual,i,n),t.positionGrip(t.controlGrips.topRight.visual,a,n),t.positionGrip(t.controlGrips.centerLeft.visual,r,o),t.positionGrip(t.controlGrips.centerRight.visual,a,o),t.positionGrip(t.controlGrips.bottomLeft.visual,r,s),t.positionGrip(t.controlGrips.bottomCenter.visual,i,s),t.positionGrip(t.controlGrips.bottomRight.visual,a,s)},t.positionGrip=function(e,t,r){var n=e.transform.baseVal.getItem(0);n.setTranslate(t,r),e.transform.baseVal.replaceItem(n,0)},t.gripMouseDown=function(e){t.isResizing=!0,t.activeGrip=t.controlGrips.findGripByVisual(e.target)||null,t.previousMouseX=e.screenX,t.previousMouseY=e.screenY,e.stopPropagation()},t.gripMouseUp=function(e){t.isResizing=!1,t.activeGrip=null,e.stopPropagation()},t.gripMouseMove=function(e){t.isResizing&&t.manipulate(e)},t}return i(t,e),t.prototype.endManipulation=function(){e.prototype.endManipulation.call(this),this.isResizing=!1,this.activeGrip=null},t.prototype.select=function(){e.prototype.select.call(this),this.controlBox.style.display=""},t.prototype.deselect=function(){e.prototype.deselect.call(this),this.controlBox.style.display="none"},t.prototype.setup=function(){e.prototype.setup.call(this),this.addControlBox(),this.page&&"mirror"===this.page.mode&&(this.controlBox.style.display="none")},t.prototype.resizeByEvent=function(e,t,r){this.activeGrip=this.controlGrips[r],this.resize(e,t)},t.prototype.resize=function(e,t,r){var n=0,i=0;switch(this.activeGrip){case this.controlGrips.topLeft:this.width-=e,this.height-=t,n+=e,i+=t,r&&r("topLeft");break;case this.controlGrips.bottomLeft:this.width-=e,this.height+=t,n+=e,r&&r("bottomLeft");break;case this.controlGrips.topRight:this.width+=e,this.height-=t,i+=t,r&&r("topRight");break;case this.controlGrips.bottomRight:this.width+=e,this.height+=t,r&&r("bottomRight");break;case this.controlGrips.centerLeft:this.width-=e,n+=e,r&&r("centerLeft");break;case this.controlGrips.centerRight:this.width+=e,r&&r("centerRight");break;case this.controlGrips.topCenter:this.height-=t,i+=t,r&&r("topCenter");break;case this.controlGrips.bottomCenter:this.height+=t,r&&r("bottomCenter")}if(this.width<this.MIN_SIZE){var o=this.MIN_SIZE-this.width;this.width=this.MIN_SIZE,0!==n&&(n-=o)}if(this.height<this.MIN_SIZE){o=this.MIN_SIZE-this.height;this.height=this.MIN_SIZE,0!==i&&(i-=o)}if(0!==n||0!==i){var s=this.visual.transform.baseVal.getItem(0);s.setMatrix(s.matrix.translate(n,i)),this.visual.transform.baseVal.replaceItem(s,0)}this.adjustControlBox()},t.prototype.onTouch=function(t){e.prototype.onTouch.call(this,t)},t.createMarker=function(e){var r=new t;return r.page=e,r.setup(),r},t}(s.BaseMarker);t.RectangularMarker=l},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(0),i=function(){return function(){this.GRIP_SIZE=10,this.visual=n.SvgHelper.createCircle(this.GRIP_SIZE,[["class","fc-whiteboard-control-grip"]])}}();t.ResizeGrip=i},function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(0),s=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type="cover",t}return i(t,e),t.prototype.setup=function(){e.prototype.setup.call(this),o.SvgHelper.setAttributes(this.visual,[["class","cover-marker"]])},t.createMarker=function(e){var r=new t;return r.page=e,r.setup(),r},t}(r(2).RectBaseMarker);t.CoverMarker=s},function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(9),s=r(0),a=r(13),c=r(14),l=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type="text",t.MIN_SIZE=50,t.DEFAULT_TEXT="Double-click to edit text",t.text=t.DEFAULT_TEXT,t.inDoubleTap=!1,t.renderText=function(){for(;t.textElement.lastChild;)t.textElement.removeChild(t.textElement.lastChild);for(var e=0,r=t.text.split(/\r\n|[\n\v\f\r\x85\u2028\u2029]/);e<r.length;e++){var n=r[e];""===n.trim()&&(n=" "),t.textElement.appendChild(s.SvgHelper.createTSpan(n,[["x","0"],["dy","1.2em"]]))}setTimeout(t.sizeText,10)},t.sizeText=function(){var e=t.textElement.getBBox(),r=0,n=0,i=1;if(e.width>0&&e.height>0){var o=1*t.width/e.width,s=1*t.height/e.height;i=Math.min(o,s),r=(t.width-e.width*i)/2,n=(t.height-e.height*i)/2}t.textElement.transform.baseVal.getItem(0).setTranslate(r,n),t.textElement.transform.baseVal.getItem(1).setScale(i,i)},t.onDblClick=function(e){t.showEditor()},t.onTap=function(e){t.inDoubleTap?(t.inDoubleTap=!1,t.showEditor()):(t.inDoubleTap=!0,setTimeout(function(){t.inDoubleTap=!1},300))},t.showEditor=function(){t.editor=document.createElement("div"),t.editor.className="fc-whiteboard-text-editor",t.editorTextArea=document.createElement("textarea"),t.text!==t.DEFAULT_TEXT&&(t.editorTextArea.value=t.text),t.editorTextArea.addEventListener("keydown",t.onEditorKeyDown),t.editor.appendChild(t.editorTextArea),document.body.appendChild(t.editor);var e=document.createElement("div");e.className="fc-whiteboard-text-editor-button-bar",t.editor.appendChild(e);var r=document.createElement("div");r.className="fc-whiteboard-text-editor-button",r.innerHTML=a,r.addEventListener("click",t.onEditorOkClick),e.appendChild(r);var n=document.createElement("div");n.className="fc-whiteboard-text-editor-button",n.innerHTML=c,n.addEventListener("click",t.closeEditor),e.appendChild(n)},t.onEditorOkClick=function(e){t.editorTextArea.value.trim()?t.text=t.editorTextArea.value:t.text=t.DEFAULT_TEXT,t.onChange({target:"marker",id:t.id,event:"changeText",data:t.text}),t.renderText(),t.closeEditor()},t.closeEditor=function(){document.body.removeChild(t.editor)},t.onEditorKeyDown=function(e){"Enter"===e.key&&e.ctrlKey&&(e.preventDefault(),t.onEditorOkClick(null))},t}return i(t,e),t.prototype.setText=function(e){this.text=e,this.renderText()},t.prototype.setup=function(){e.prototype.setup.call(this),this.textElement=s.SvgHelper.createText(),this.addToRenderVisual(this.textElement),s.SvgHelper.setAttributes(this.visual,[["class","text-marker"]]),this.textElement.transform.baseVal.appendItem(s.SvgHelper.createTransform()),this.textElement.transform.baseVal.appendItem(s.SvgHelper.createTransform()),this.renderText(),this.visual.addEventListener("dblclick",this.onDblClick),this.visual.addEventListener("touchstart",this.onTap)},t.prototype.resize=function(t,r,n){e.prototype.resize.call(this,t,r,n),this.sizeText()},t.createMarker=function(e){var r=new t;return r.page=e,r.setup(),r},t}(o.RectangularMarker);t.TextMarker=l},function(e,t){e.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z"></path></svg>\x3c!-- Font Awesome Free 5.5.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) --\x3e'},function(e,t){e.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 352 512"><path d="M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z"></path></svg>\x3c!-- Font Awesome Free 5.5.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) --\x3e'},function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(16),s=r(0),a=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type="arrow",t.ARROW_SIZE=6,t}return i(t,e),t.prototype.setup=function(){e.prototype.setup.call(this),s.SvgHelper.setAttributes(this.visual,[["class","arrow-marker"]]);var t=s.SvgHelper.createPolygon("0,0 "+this.ARROW_SIZE+","+this.ARROW_SIZE/2+" 0,"+this.ARROW_SIZE,[["class","arrow-marker-tip"]]);this.defs.push(s.SvgHelper.createMarker("arrow-marker-head","auto",this.ARROW_SIZE,this.ARROW_SIZE,this.ARROW_SIZE-1,this.ARROW_SIZE/2,t)),this.markerLine.setAttribute("marker-end","url(#arrow-marker-head")},t.createMarker=function(e){var r=new t;return r.page=e,r.setup(),r},t}(o.LinearMarker);t.ArrowMarker=a},function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(3),s=r(10),a=r(0),c=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.MIN_LENGTH=20,t.x1=0,t.y1=0,t.x2=t.width,t.y2=0,t.getLineLength=function(e,t,r,n){var i=Math.abs(e-r),o=Math.abs(t-n);return Math.sqrt(Math.pow(i,2)+Math.pow(o,2))},t.addControlBox=function(){t.controlBox=a.SvgHelper.createGroup([["class","fc-whiteboard-line-control-box"]]),t.addToVisual(t.controlBox),t.addControlGrips()},t.adjustControlBox=function(){t.positionGrips()},t.addControlGrips=function(){t.controlGrips={left:t.createGrip(),right:t.createGrip()},t.positionGrips()},t.createGrip=function(){var e=new s.ResizeGrip;return e.visual.transform.baseVal.appendItem(a.SvgHelper.createTransform()),t.controlBox.appendChild(e.visual),e.visual.addEventListener("mousedown",t.gripMouseDown),e.visual.addEventListener("mousemove",t.gripMouseMove),e.visual.addEventListener("mouseup",t.gripMouseUp),e.visual.addEventListener("touchstart",t.onTouch,{passive:!1}),e.visual.addEventListener("touchend",t.onTouch,{passive:!1}),e.visual.addEventListener("touchmove",t.onTouch,{passive:!1}),e},t.positionGrips=function(){var e=t.controlGrips.left.GRIP_SIZE,r=t.x1-e/2,n=t.y1-e/2,i=t.x2-e/2,o=t.y2-e/2;t.positionGrip(t.controlGrips.left.visual,r,n),t.positionGrip(t.controlGrips.right.visual,i,o)},t.positionGrip=function(e,t,r){var n=e.transform.baseVal.getItem(0);n.setTranslate(t,r),e.transform.baseVal.replaceItem(n,0)},t.gripMouseDown=function(e){t.isResizing=!0,t.activeGrip=e.target===t.controlGrips.left.visual?t.controlGrips.left:t.controlGrips.right,t.previousMouseX=e.screenX,t.previousMouseY=e.screenY,e.stopPropagation()},t.gripMouseUp=function(e){t.isResizing=!1,t.activeGrip=null,e.stopPropagation()},t.gripMouseMove=function(e){t.isResizing&&t.resize(e.movementX,e.movementY)},t}return i(t,e),t.prototype.endManipulation=function(){e.prototype.endManipulation.call(this),this.isResizing=!1,this.activeGrip=null},t.prototype.select=function(){e.prototype.select.call(this),this.controlBox.style.display=""},t.prototype.deselect=function(){e.prototype.deselect.call(this),this.controlBox.style.display="none"},t.prototype.setup=function(){e.prototype.setup.call(this),this.markerBgLine=a.SvgHelper.createLine(0,0,this.x2,0,[["stroke","transparent"],["stroke-width","30"]]),this.addToRenderVisual(this.markerBgLine),this.markerLine=a.SvgHelper.createLine(0,0,this.x2,0),this.addToRenderVisual(this.markerLine),this.addControlBox(),this.page&&"mirror"===this.page.mode&&(this.controlBox.style.display="none")},t.prototype.resize=function(e,t,r){this.activeGrip&&(this.activeGrip===this.controlGrips.left&&this.getLineLength(this.x1+e,this.y1+1,this.x2,this.y2)>=this.MIN_LENGTH?(this.x1+=e,this.y1+=t,this.markerBgLine.setAttribute("x1",this.x1.toString()),this.markerBgLine.setAttribute("y1",this.y1.toString()),this.markerLine.setAttribute("x1",this.x1.toString()),this.markerLine.setAttribute("y1",this.y1.toString()),r&&r("left")):this.activeGrip===this.controlGrips.right&&this.getLineLength(this.x1,this.y1,this.x2+e,this.y2+t)>=this.MIN_LENGTH&&(this.x2+=e,this.y2+=t,this.markerBgLine.setAttribute("x2",this.x2.toString()),this.markerBgLine.setAttribute("y2",this.y2.toString()),this.markerLine.setAttribute("x2",this.x2.toString()),this.markerLine.setAttribute("y2",this.y2.toString()),r&&r("right"))),this.adjustControlBox()},t.prototype.resizeByEvent=function(e,t,r){this.activeGrip="left"===r?this.controlGrips.left:this.controlGrips.right,this.resize(e,t)},t.createMarker=function(e){var r=new t;return r.page=e,r.setup(),r},t}(o.BaseMarker);t.LinearMarker=c},function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(0),s=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type="highlight",t}return i(t,e),t.prototype.setup=function(){e.prototype.setup.call(this),o.SvgHelper.setAttributes(this.visual,[["class","highlight-marker"]])},t.createMarker=function(e){var r=new t;return r.page=e,r.setup(),r},t}(r(2).RectBaseMarker);t.HighlightMarker=s},function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(16),s=r(0),a=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type="line",t}return i(t,e),t.prototype.setup=function(){e.prototype.setup.call(this),s.SvgHelper.setAttributes(this.visual,[["class","line-marker"]])},t.createMarker=function(e){var r=new t;return r.page=e,r.setup(),r},t}(o.LinearMarker);t.LineMarker=a},function(e,t,r){"use strict";function n(e,t){e&&(e.className=((e.className||"")+" "+t).trim())}Object.defineProperty(t,"__esModule",{value:!0}),t.createDivWithClassName=function(e,t){var r=document.createElement("div");return t&&t.appendChild(r),e&&n(r,e),r},t.addClassName=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(6);t.Drawboard=n.Drawboard;var i=r(42);t.Whiteboard=i.Whiteboard},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(1),i=r(0),o=function(){return function(e){var t=this;this.id=n.uuid(),this.initBoard=function(){t.boardHolder=document.createElement("div"),t.boardHolder.id="fcw-board-holder-"+t.id,t.boardHolder.style.setProperty("touch-action","none"),t.boardHolder.style.setProperty("-ms-touch-action","none"),document.body.appendChild(t.boardHolder),t.boardCanvas=document.createElementNS("http://www.w3.org/2000/svg","svg"),t.boardCanvas.setAttribute("xmlns","http://www.w3.org/2000/svg"),t.boardCanvas.setAttribute("width",t.width.toString()),t.boardCanvas.setAttribute("height",t.height.toString()),t.boardCanvas.setAttribute("viewBox","0 0 "+t.width.toString()+" "+t.height.toString()),t.boardHolder.style.position="absolute",t.boardHolder.style.width=t.width+"px",t.boardHolder.style.height=t.height+"px",t.boardHolder.style.transformOrigin="top left",t.positionBoard(),t.defs=i.SvgHelper.createDefs(),t.boardCanvas.appendChild(t.defs),t.boardHolder.appendChild(t.boardCanvas)},this.positionBoard=function(){t.boardHolder.style.top=t.targetRect.top+"px",t.boardHolder.style.left=t.targetRect.left+"px"},this.source=e,e.imgEle&&(this.target=e.imgEle,this.width=this.target.clientWidth,this.height=this.target.clientHeight)}}();t.Baseboard=o},function(e,t){var r="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(r){var n=new Uint8Array(16);e.exports=function(){return r(n),n}}else{var i=new Array(16);e.exports=function(){for(var e,t=0;t<16;t++)0==(3&t)&&(e=4294967296*Math.random()),i[t]=e>>>((3&t)<<3)&255;return i}}},function(e,t){for(var r=[],n=0;n<256;++n)r[n]=(n+256).toString(16).substr(1);e.exports=function(e,t){var n=t||0,i=r;return[i[e[n++]],i[e[n++]],i[e[n++]],i[e[n++]],"-",i[e[n++]],i[e[n++]],"-",i[e[n++]],i[e[n++]],"-",i[e[n++]],i[e[n++]],"-",i[e[n++]],i[e[n++]],i[e[n++]],i[e[n++]],i[e[n++]],i[e[n++]]].join("")}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(8),i=r(11),o=r(12),s=r(15),a=r(17),c=r(26),l=r(18),h=r(13),u=r(27),d=r(28),p=r(14);t.highlightMarkerToolbarItem=new c.ToolbarItem({name:"cover-marker",tooltipText:"Cover",icon:r(29),markerType:a.HighlightMarker}),t.arrowMarkerToolbarItem=new c.ToolbarItem({name:"arrow-marker",tooltipText:"Arrow",icon:r(30),markerType:s.ArrowMarker}),t.textMarkerToolbarItem=new c.ToolbarItem({name:"text-marker",tooltipText:"Text",icon:r(31),markerType:o.TextMarker}),t.coverMarkerToolbarItem=new c.ToolbarItem({name:"cover-marker",tooltipText:"Cover",icon:r(32),markerType:i.CoverMarker}),t.rectMarkerToolbarItem=new c.ToolbarItem({name:"rect-marker",tooltipText:"Rectangle",icon:r(33),markerType:n.RectMarker}),t.lineMarkerToolbarItem=new c.ToolbarItem({name:"line-marker",tooltipText:"Line",icon:r(34),markerType:l.LineMarker}),t.getToolbars=function(e){var r=[{icon:d,name:"pointer",tooltipText:"Pointer"},{icon:u,name:"delete",tooltipText:"Delete"},{name:"separator",tooltipText:""},t.rectMarkerToolbarItem,t.coverMarkerToolbarItem,t.highlightMarkerToolbarItem,t.lineMarkerToolbarItem,t.arrowMarkerToolbarItem,t.textMarkerToolbarItem,{name:"separator",tooltipText:""}];return e||r.push.apply(r,[{icon:h,name:"ok",tooltipText:"OK"}]),r.push({icon:p,name:"close",tooltipText:"Close"}),r}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){return function(){var e=this;this.findGripByVisual=function(t){switch(t){case e.topLeft.visual:return e.topLeft;case e.topCenter.visual:return e.topCenter;case e.topRight.visual:return e.topRight;case e.centerLeft.visual:return e.centerLeft;case e.centerRight.visual:return e.centerRight;case e.bottomLeft.visual:return e.bottomLeft;case e.bottomCenter.visual:return e.bottomCenter;case e.bottomRight.visual:return e.bottomRight;default:return e.topLeft}}}}();t.RectangularMarkerGrips=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){return function(e){var t=e.name,r=e.tooltipText,n=e.icon,i=e.markerType;this.name=t,this.tooltipText=r,this.icon=n,this.markerType=i}}();t.ToolbarItem=n},function(e,t){e.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M497.941 273.941c18.745-18.745 18.745-49.137 0-67.882l-160-160c-18.745-18.745-49.136-18.746-67.883 0l-256 256c-18.745 18.745-18.745 49.137 0 67.882l96 96A48.004 48.004 0 0 0 144 480h356c6.627 0 12-5.373 12-12v-40c0-6.627-5.373-12-12-12H355.883l142.058-142.059zm-302.627-62.627l137.373 137.373L265.373 416H150.628l-80-80 124.686-124.686z"></path></svg>\x3c!-- Font Awesome Free 5.5.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) --\x3e'},function(e,t){e.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><path d="M302.189 329.126H196.105l55.831 135.993c3.889 9.428-.555 19.999-9.444 23.999l-49.165 21.427c-9.165 4-19.443-.571-23.332-9.714l-53.053-129.136-86.664 89.138C18.729 472.71 0 463.554 0 447.977V18.299C0 1.899 19.921-6.096 30.277 5.443l284.412 292.542c11.472 11.179 3.007 31.141-12.5 31.141z"></path></svg>\x3c!-- Font Awesome Free 5.5.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) --\x3e'},function(e,t){e.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 544 512"><path d="M0 479.98L99.92 512l35.45-35.45-67.04-67.04L0 479.98zm124.61-240.01a36.592 36.592 0 0 0-10.79 38.1l13.05 42.83-50.93 50.94 96.23 96.23 50.86-50.86 42.74 13.08c13.73 4.2 28.65-.01 38.15-10.78l35.55-41.64-173.34-173.34-41.52 35.44zm403.31-160.7l-63.2-63.2c-20.49-20.49-53.38-21.52-75.12-2.35L190.55 183.68l169.77 169.78L530.27 154.4c19.18-21.74 18.15-54.63-2.35-75.13z"></path></svg>\x3c!-- Font Awesome Free 5.5.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) --\x3e'},function(e,t){e.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path d="M313.941 216H12c-6.627 0-12 5.373-12 12v56c0 6.627 5.373 12 12 12h301.941v46.059c0 21.382 25.851 32.09 40.971 16.971l86.059-86.059c9.373-9.373 9.373-24.569 0-33.941l-86.059-86.059c-15.119-15.119-40.971-4.411-40.971 16.971V216z"></path></svg>\x3c!-- Font Awesome Free 5.5.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) --\x3e'},function(e,t){e.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path d="M152 416h-24.013l26.586-80.782H292.8L319.386 416H296c-8.837 0-16 7.163-16 16v32c0 8.837 7.163 16 16 16h136c8.837 0 16-7.163 16-16v-32c0-8.837-7.163-16-16-16h-26.739L275.495 42.746A16 16 0 0 0 260.382 32h-72.766a16 16 0 0 0-15.113 10.746L42.739 416H16c-8.837 0-16 7.163-16 16v32c0 8.837 7.163 16 16 16h136c8.837 0 16-7.163 16-16v-32c0-8.837-7.163-16-16-16zm64.353-271.778c4.348-15.216 6.61-28.156 7.586-34.644.839 6.521 2.939 19.476 7.727 34.706l41.335 124.006h-98.619l41.971-124.068z"></path></svg>\x3c!-- Font Awesome Free 5.5.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) --\x3e'},function(e,t){e.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path d="M400 32H48C21.5 32 0 53.5 0 80v352c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V80c0-26.5-21.5-48-48-48z"></path></svg>\x3c!-- Font Awesome Free 5.5.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) --\x3e'},function(e,t){e.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path d="M400 32H48C21.5 32 0 53.5 0 80v352c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V80c0-26.5-21.5-48-48-48zm-6 400H54c-3.3 0-6-2.7-6-6V86c0-3.3 2.7-6 6-6h340c3.3 0 6 2.7 6 6v340c0 3.3-2.7 6-6 6z"></path></svg>\x3c!-- Font Awesome Free 5.5.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) --\x3e'},function(e,t){e.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512"><path d="M594.53 508.63L6.18 53.9c-6.97-5.42-8.23-15.47-2.81-22.45L23.01 6.18C28.43-.8 38.49-2.06 45.47 3.37L633.82 458.1c6.97 5.42 8.23 15.47 2.81 22.45l-19.64 25.27c-5.42 6.98-15.48 8.23-22.46 2.81z"></path></svg>\x3c!-- Font Awesome Free 5.5.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) --\x3e'},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(36),i=function(){function e(){}return e.prototype.rasterize=function(e,t,r){if(!n.isHTMLImageElement(e))throw new Error("Error: only support export HTMLImageElement");var i=document.createElement("canvas");i.width=t.width.baseVal.value,i.height=t.height.baseVal.value;var o=t.outerHTML,s=i.getContext("2d");if(!s)throw new Error("Invalid ctx");s.drawImage(e,0,0,i.width,i.height);var a=window.URL,c=new Image(i.width,i.height);c.setAttribute("crossOrigin","anonymous");var l=new Blob([o],{type:"image/svg+xml"}),h=a.createObjectURL(l);c.onload=function(){s.drawImage(c,0,0),a.revokeObjectURL(h),r(i.toDataURL("image/png"))},c.src=h},e}();t.Synthetizer=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isHTMLImageElement=function(e){return"object"==typeof e&&e instanceof HTMLImageElement}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(38),i=r(1),o=function(){function e(e,t){var r=this;this.id=i.uuid(),this.getUI=function(){r.toolbarUI=document.createElement("div"),r.toolbarUI.id="fcw-toolbar-"+r.id,r.toolbarUI.className="fc-whiteboard-toolbar";for(var e=0,t=r.toolbarItems;e<t.length;e++){var i=t[e],o=new n.ToolbarButton(i,r.clickHandler);r.toolbarUI.appendChild(o.getElement())}return r.toolbarUI},this.toolbarItems=e,this.clickHandler=t}return e.prototype.hide=function(){this.toolbarUI.style.visibility="hidden",this.toolbarUI.style.zIndex="-1"},e.prototype.show=function(){this.toolbarUI.style.visibility="visible",this.toolbarUI.style.zIndex="999"},e}();t.Toolbar=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){return function(e,t){var r=this;this.getElement=function(){var e=document.createElement("div");return"separator"!==r.toolbarItem.name?(e.className="fc-whiteboard-toolbar-button",r.clickHandler&&e.addEventListener("click",function(e){r.clickHandler&&r.clickHandler(e,r.toolbarItem)}),r.toolbarItem.icon?(e.title=r.toolbarItem.tooltipText,e.innerHTML=r.toolbarItem.icon):e.innerText=r.toolbarItem.tooltipText):e.className="fc-whiteboard-toolbar-separator",e},this.toolbarItem=e,t&&(this.clickHandler=t)}}();t.ToolbarButton=n},function(e,t,r){var n=r(40);"string"==typeof n&&(n=[[e.i,n,""]]);var i={hmr:!0,transform:void 0,insertInto:void 0};r(5)(n,i);n.locals&&(e.exports=n.locals)},function(e,t,r){(e.exports=r(4)(!1)).push([e.i,".fc-whiteboard-logo {\n display: inline-block;\n margin: 0px;\n padding: 0px;\n fill: #333333;\n}\n.fc-whiteboard-logo a {\n display: grid;\n -ms-flex-align: center;\n align-items: center;\n justify-items: center;\n padding: 3px;\n width: 20px;\n height: 20px;\n}\n.fc-whiteboard-logo a:hover {\n fill: #ff8080;\n}\n.fc-whiteboard-toolbar {\n background-color: #cccccc;\n padding: 0px 5px;\n margin: 0px;\n border-top-left-radius: 10px;\n border-top-right-radius: 10px;\n display: grid;\n grid-template-columns: repeat(20, auto);\n}\n.fc-whiteboard-toolbar-button,\n.fc-whiteboard-toolbar-logo a {\n display: inline-block;\n margin: 2px;\n padding: 3px;\n cursor: pointer;\n width: 20px;\n height: 20px;\n border-radius: 2px;\n border-bottom: transparent solid 1px;\n border-right: transparent solid 1px;\n fill: #333333;\n display: grid;\n -ms-flex-align: center;\n align-items: center;\n justify-items: center;\n}\n.fc-whiteboard-toolbar-separator {\n margin: 5px 5px;\n border: 1px solid #dddddd;\n}\n.fc-whiteboard-toolbar-button:hover,\n.fc-whiteboard-toolbar-logo a:hover {\n background-color: #eeeeee;\n background: -webkit-radial-gradient(#eeeeee, #cccccc);\n background: -o-radial-gradient(#eeeeee, #cccccc);\n background: radial-gradient(#eeeeee, #cccccc);\n fill: #ff8080;\n}\n.fc-whiteboard-toolbar-button svg {\n height: 16px;\n}\n.fc-whiteboard-text-editor {\n position: fixed;\n z-index: 20000;\n left: 0px;\n top: 0px;\n width: 100vw;\n height: 100vh;\n background-color: rgba(0, 0, 0, 0.9);\n display: -ms-flexbox;\n display: flex;\n -ms-flex-direction: column;\n flex-direction: column;\n -ms-flex-align: center;\n align-items: center;\n -ms-flex-pack: center;\n justify-content: center;\n}\n.fc-whiteboard-text-editor textarea {\n width: 50%;\n min-width: 50px;\n max-width: 500px;\n height: 50%;\n min-height: 50px;\n max-height: 500px;\n}\n.fc-whiteboard-text-editor .fc-whiteboard-text-editor-button-bar {\n display: -ms-flexbox;\n display: flex;\n -ms-flex-direction: row;\n flex-direction: row;\n -ms-flex-pack: end;\n justify-content: flex-end;\n width: 50%;\n min-width: 50px;\n max-width: 500px;\n padding-top: 10px;\n}\n.fc-whiteboard-text-editor .fc-whiteboard-text-editor-button {\n display: grid;\n -ms-flex-align: center;\n align-items: center;\n padding: 0px;\n margin-left: 15px;\n width: 20px;\n height: 20px;\n cursor: pointer;\n fill: #888888;\n}\n.fc-whiteboard-text-editor .fc-whiteboard-text-editor-button:hover {\n fill: #ff8080;\n}\n",""])},function(e,t){e.exports=function(e){var t="undefined"!=typeof window&&window.location;if(!t)throw new Error("fixUrls requires window.location");if(!e||"string"!=typeof e)return e;var r=t.protocol+"//"+t.host,n=r+t.pathname.replace(/\/[^\/]*$/,"/");return e.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi,function(e,t){var i,o=t.trim().replace(/^"(.*)"$/,function(e,t){return t}).replace(/^'(.*)'$/,function(e,t){return t});return/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/|\s*$)/i.test(o)?e:(i=0===o.indexOf("//")?o:0===o.indexOf("/")?r+o:n+o.replace(/^\.\//,""),"url("+JSON.stringify(i)+")")})}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(43),i=r(44),o=r(1),s=r(19);r(48);var a=r(50),c=r(51),l="fcw-board",h=function(){return function(){}}();t.SerializableWhiteboard=h;var u=function(){function e(e,t){var r=void 0===t?{}:t,n=r.sources,i=r.eventHub,a=r.mode,c=r.visiblePageIndex;this.id=o.uuid(),this.sources=[],this.mode="master",this.isFullscreen=!1,this.pages=[],this.isInitialized=!1,this.visiblePageIndex=0,e?this.target=e:(this.target=document.createElement("div"),document.body.appendChild(this.target)),this.target.id||(this.target.id=this.id),s.addClassName(this.target,l),n&&(this.sources=n),this.eventHub=i,a&&(this.mode=a),void 0!==c&&(this.visiblePageIndex=c),this.init()}return Object.defineProperty(e.prototype,"activePage",{get:function(){return this.pages[this.visiblePageIndex]},enumerable:!0,configurable:!0}),e.prototype.open=function(){var e=this;this.pages.forEach(function(t,r){t.open(),r!==e.visiblePageIndex&&t.hide()})},e.prototype.close=function(){this.emitInterval&&clearInterval(this.emitInterval)},e.prototype.show=function(){this.activePage&&this.activePage.show()},e.prototype.hide=function(){this.activePage&&this.activePage.hide()},e.prototype.snap=function(){return{id:this.id,sources:this.sources,pageIds:this.pages.map(function(e){return e.id}),visiblePageIndex:this.visiblePageIndex}},e.prototype.init=function(){this.imgsContainer=s.createDivWithClassName(l+"-imgs",this.target),this.pagesContainer=s.createDivWithClassName(l+"-pages",this.target),"master"===this.mode&&(this.initMaster(),this.emitSnapshot()),"mirror"===this.mode&&this.initMirror()},e.prototype.initMaster=function(){var e=this;this.sources.forEach(function(t){var r=new i.WhitePage({imgSrc:t},{mode:e.mode,eventHub:e.eventHub,parentContainer:e.pagesContainer});r.container.style.visibility="hidden",e.pages.push(r)}),this.initSiema();var t=s.createDivWithClassName(l+"-controller",this.target),r=s.createDivWithClassName(l+"-flip-arrow",t);r.innerHTML=a;var n=s.createDivWithClassName(l+"-flip-arrow",t);n.innerHTML=c,n.addEventListener("click",function(){var t=e.visiblePageIndex+1>e.pages.length-1?0:e.visiblePageIndex+1;e.onPageChange(t)}),r.addEventListener("click",function(){var t=e.visiblePageIndex-1<0?e.pages.length-1:e.visiblePageIndex-1;e.onPageChange(t)})},e.prototype.initMirror=function(){var e=this;if(!this.eventHub)throw new Error("Invalid eventHub");this.eventHub.on("sync",function(t){if("whiteboard"===t.target){if("snap"===t.event){if(e.isInitialized)return;e.onSnapshot(t.data)}"changeIndex"===t.event&&t.id===e.id&&e.isInitialized&&e.onPageChange(t.data)}})},e.prototype.initSiema=function(){var e=this;this.sources.forEach(function(t){var r=document.createElement("img");s.addClassName(r,l+"-img"),r.src=t,r.alt="Siema image",e.imgsContainer.appendChild(r)}),this.siema=new n({selector:this.imgsContainer,duration:200,easing:"ease-out",perPage:1,startIndex:0,draggable:!1,multipleDrag:!0,threshold:20,loop:!1,rtl:!1})},e.prototype.onPageChange=function(e){this.siema.goTo(e),this.visiblePageIndex=e,this.pages.forEach(function(t,r){e===r?t.show():t.hide()}),"master"===this.mode&&this.eventHub&&this.eventHub.emit("sync",{event:"changeIndex",id:this.id,target:"whiteboard",data:e})},e.prototype.emitSnapshot=function(){var e=this,t=function(){e.eventHub&&e.eventHub.emit("sync",{event:"snap",id:e.id,target:"whiteboard",data:e.snap()})};this.emitInterval=setInterval(function(){t()},5e3),setTimeout(t,500)},e.prototype.onSnapshot=function(e){var t=this,r=e.id,n=e.sources,o=e.pageIds,s=e.visiblePageIndex;this.isInitialized||(this.id=r,this.sources=n,this.initSiema(),this.sources.forEach(function(e,r){var n=new i.WhitePage({imgSrc:e},{mode:t.mode,eventHub:t.eventHub,parentContainer:t.pagesContainer});n.id=o[r],n.container.style.opacity="hidden",t.pages.push(n),n.open()})),this.isInitialized=!0,this.onPageChange(s)},e}();t.Whiteboard=u},function(e,t,r){"undefined"!=typeof self&&self,e.exports=function(e){function t(n){if(r[n])return r[n].exports;var i=r[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var r={};return t.m=e,t.c=r,t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=0)}([function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n="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},i=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),o=function(){function e(t){var r=this;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.config=e.mergeSettings(t),this.selector="string"==typeof this.config.selector?document.querySelector(this.config.selector):this.config.selector,null===this.selector)throw new Error("Something wrong with your selector 😭");this.resolveSlidesNumber(),this.selectorWidth=this.selector.offsetWidth,this.innerElements=[].slice.call(this.selector.children),this.currentSlide=this.config.loop?this.config.startIndex%this.innerElements.length:Math.max(0,Math.min(this.config.startIndex,this.innerElements.length-this.perPage)),this.transformProperty=e.webkitOrNot(),["resizeHandler","touchstartHandler","touchendHandler","touchmoveHandler","mousedownHandler","mouseupHandler","mouseleaveHandler","mousemoveHandler","clickHandler"].forEach(function(e){r[e]=r[e].bind(r)}),this.init()}return i(e,[{key:"attachEvents",value:function(){window.addEventListener("resize",this.resizeHandler),this.config.draggable&&(this.pointerDown=!1,this.drag={startX:0,endX:0,startY:0,letItGo:null,preventClick:!1},this.selector.addEventListener("touchstart",this.touchstartHandler),this.selector.addEventListener("touchend",this.touchendHandler),this.selector.addEventListener("touchmove",this.touchmoveHandler),this.selector.addEventListener("mousedown",this.mousedownHandler),this.selector.addEventListener("mouseup",this.mouseupHandler),this.selector.addEventListener("mouseleave",this.mouseleaveHandler),this.selector.addEventListener("mousemove",this.mousemoveHandler),this.selector.addEventListener("click",this.clickHandler))}},{key:"detachEvents",value:function(){window.removeEventListener("resize",this.resizeHandler),this.selector.removeEventListener("touchstart",this.touchstartHandler),this.selector.removeEventListener("touchend",this.touchendHandler),this.selector.removeEventListener("touchmove",this.touchmoveHandler),this.selector.removeEventListener("mousedown",this.mousedownHandler),this.selector.removeEventListener("mouseup",this.mouseupHandler),this.selector.removeEventListener("mouseleave",this.mouseleaveHandler),this.selector.removeEventListener("mousemove",this.mousemoveHandler),this.selector.removeEventListener("click",this.clickHandler)}},{key:"init",value:function(){this.attachEvents(),this.selector.style.overflow="hidden",this.selector.style.direction=this.config.rtl?"rtl":"ltr",this.buildSliderFrame(),this.config.onInit.call(this)}},{key:"buildSliderFrame",value:function(){var e=this.selectorWidth/this.perPage,t=this.config.loop?this.innerElements.length+2*this.perPage:this.innerElements.length;this.sliderFrame=document.createElement("div"),this.sliderFrame.style.width=e*t+"px",this.enableTransition(),this.config.draggable&&(this.selector.style.cursor="-webkit-grab");var r=document.createDocumentFragment();if(this.config.loop)for(var n=this.innerElements.length-this.perPage;n<this.innerElements.length;n++){var i=this.buildSliderFrameItem(this.innerElements[n].cloneNode(!0));r.appendChild(i)}for(var o=0;o<this.innerElements.length;o++){var s=this.buildSliderFrameItem(this.innerElements[o]);r.appendChild(s)}if(this.config.loop)for(var a=0;a<this.perPage;a++){var c=this.buildSliderFrameItem(this.innerElements[a].cloneNode(!0));r.appendChild(c)}this.sliderFrame.appendChild(r),this.selector.innerHTML="",this.selector.appendChild(this.sliderFrame),this.slideToCurrent()}},{key:"buildSliderFrameItem",value:function(e){var t=document.createElement("div");return t.style.cssFloat=this.config.rtl?"right":"left",t.style.float=this.config.rtl?"right":"left",t.style.width=(this.config.loop?100/(this.innerElements.length+2*this.perPage):100/this.innerElements.length)+"%",t.appendChild(e),t}},{key:"resolveSlidesNumber",value:function(){if("number"==typeof this.config.perPage)this.perPage=this.config.perPage;else if("object"===n(this.config.perPage))for(var e in this.perPage=1,this.config.perPage)window.innerWidth>=e&&(this.perPage=this.config.perPage[e])}},{key:"prev",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments[1];if(!(this.innerElements.length<=this.perPage)){var r=this.currentSlide;if(this.config.loop)if(this.currentSlide-e<0){this.disableTransition();var n=this.currentSlide+this.innerElements.length,i=this.perPage,o=n+i,s=(this.config.rtl?1:-1)*o*(this.selectorWidth/this.perPage),a=this.config.draggable?this.drag.endX-this.drag.startX:0;this.sliderFrame.style[this.transformProperty]="translate3d("+(s+a)+"px, 0, 0)",this.currentSlide=n-e}else this.currentSlide=this.currentSlide-e;else this.currentSlide=Math.max(this.currentSlide-e,0);r!==this.currentSlide&&(this.slideToCurrent(this.config.loop),this.config.onChange.call(this),t&&t.call(this))}}},{key:"next",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments[1];if(!(this.innerElements.length<=this.perPage)){var r=this.currentSlide;if(this.config.loop)if(this.currentSlide+e>this.innerElements.length-this.perPage){this.disableTransition();var n=this.currentSlide-this.innerElements.length,i=this.perPage,o=n+i,s=(this.config.rtl?1:-1)*o*(this.selectorWidth/this.perPage),a=this.config.draggable?this.drag.endX-this.drag.startX:0;this.sliderFrame.style[this.transformProperty]="translate3d("+(s+a)+"px, 0, 0)",this.currentSlide=n+e}else this.currentSlide=this.currentSlide+e;else this.currentSlide=Math.min(this.currentSlide+e,this.innerElements.length-this.perPage);r!==this.currentSlide&&(this.slideToCurrent(this.config.loop),this.config.onChange.call(this),t&&t.call(this))}}},{key:"disableTransition",value:function(){this.sliderFrame.style.webkitTransition="all 0ms "+this.config.easing,this.sliderFrame.style.transition="all 0ms "+this.config.easing}},{key:"enableTransition",value:function(){this.sliderFrame.style.webkitTransition="all "+this.config.duration+"ms "+this.config.easing,this.sliderFrame.style.transition="all "+this.config.duration+"ms "+this.config.easing}},{key:"goTo",value:function(e,t){if(!(this.innerElements.length<=this.perPage)){var r=this.currentSlide;this.currentSlide=this.config.loop?e%this.innerElements.length:Math.min(Math.max(e,0),this.innerElements.length-this.perPage),r!==this.currentSlide&&(this.slideToCurrent(),this.config.onChange.call(this),t&&t.call(this))}}},{key:"slideToCurrent",value:function(e){var t=this,r=this.config.loop?this.currentSlide+this.perPage:this.currentSlide,n=(this.config.rtl?1:-1)*r*(this.selectorWidth/this.perPage);e?requestAnimationFrame(function(){requestAnimationFrame(function(){t.enableTransition(),t.sliderFrame.style[t.transformProperty]="translate3d("+n+"px, 0, 0)"})}):this.sliderFrame.style[this.transformProperty]="translate3d("+n+"px, 0, 0)"}},{key:"updateAfterDrag",value:function(){var e=(this.config.rtl?-1:1)*(this.drag.endX-this.drag.startX),t=Math.abs(e),r=this.config.multipleDrag?Math.ceil(t/(this.selectorWidth/this.perPage)):1,n=e>0&&this.currentSlide-r<0,i=e<0&&this.currentSlide+r>this.innerElements.length-this.perPage;e>0&&t>this.config.threshold&&this.innerElements.length>this.perPage?this.prev(r):e<0&&t>this.config.threshold&&this.innerElements.length>this.perPage&&this.next(r),this.slideToCurrent(n||i)}},{key:"resizeHandler",value:function(){this.resolveSlidesNumber(),this.currentSlide+this.perPage>this.innerElements.length&&(this.currentSlide=this.innerElements.length<=this.perPage?0:this.innerElements.length-this.perPage),this.selectorWidth=this.selector.offsetWidth,this.buildSliderFrame()}},{key:"clearDrag",value:function(){this.drag={startX:0,endX:0,startY:0,letItGo:null,preventClick:this.drag.preventClick}}},{key:"touchstartHandler",value:function(e){-1!==["TEXTAREA","OPTION","INPUT","SELECT"].indexOf(e.target.nodeName)||(e.stopPropagation(),this.pointerDown=!0,this.drag.startX=e.touches[0].pageX,this.drag.startY=e.touches[0].pageY)}},{key:"touchendHandler",value:function(e){e.stopPropagation(),this.pointerDown=!1,this.enableTransition(),this.drag.endX&&this.updateAfterDrag(),this.clearDrag()}},{key:"touchmoveHandler",value:function(e){if(e.stopPropagation(),null===this.drag.letItGo&&(this.drag.letItGo=Math.abs(this.drag.startY-e.touches[0].pageY)<Math.abs(this.drag.startX-e.touches[0].pageX)),this.pointerDown&&this.drag.letItGo){e.preventDefault(),this.drag.endX=e.touches[0].pageX,this.sliderFrame.style.webkitTransition="all 0ms "+this.config.easing,this.sliderFrame.style.transition="all 0ms "+this.config.easing;var t=this.config.loop?this.currentSlide+this.perPage:this.currentSlide,r=t*(this.selectorWidth/this.perPage),n=this.drag.endX-this.drag.startX,i=this.config.rtl?r+n:r-n;this.sliderFrame.style[this.transformProperty]="translate3d("+(this.config.rtl?1:-1)*i+"px, 0, 0)"}}},{key:"mousedownHandler",value:function(e){-1!==["TEXTAREA","OPTION","INPUT","SELECT"].indexOf(e.target.nodeName)||(e.preventDefault(),e.stopPropagation(),this.pointerDown=!0,this.drag.startX=e.pageX)}},{key:"mouseupHandler",value:function(e){e.stopPropagation(),this.pointerDown=!1,this.selector.style.cursor="-webkit-grab",this.enableTransition(),this.drag.endX&&this.updateAfterDrag(),this.clearDrag()}},{key:"mousemoveHandler",value:function(e){if(e.preventDefault(),this.pointerDown){"A"===e.target.nodeName&&(this.drag.preventClick=!0),this.drag.endX=e.pageX,this.selector.style.cursor="-webkit-grabbing",this.sliderFrame.style.webkitTransition="all 0ms "+this.config.easing,this.sliderFrame.style.transition="all 0ms "+this.config.easing;var t=this.config.loop?this.currentSlide+this.perPage:this.currentSlide,r=t*(this.selectorWidth/this.perPage),n=this.drag.endX-this.drag.startX,i=this.config.rtl?r+n:r-n;this.sliderFrame.style[this.transformProperty]="translate3d("+(this.config.rtl?1:-1)*i+"px, 0, 0)"}}},{key:"mouseleaveHandler",value:function(e){this.pointerDown&&(this.pointerDown=!1,this.selector.style.cursor="-webkit-grab",this.drag.endX=e.pageX,this.drag.preventClick=!1,this.enableTransition(),this.updateAfterDrag(),this.clearDrag())}},{key:"clickHandler",value:function(e){this.drag.preventClick&&e.preventDefault(),this.drag.preventClick=!1}},{key:"remove",value:function(e,t){if(e<0||e>=this.innerElements.length)throw new Error("Item to remove doesn't exist 😭");var r=e<this.currentSlide,n=this.currentSlide+this.perPage-1===e;(r||n)&&this.currentSlide--,this.innerElements.splice(e,1),this.buildSliderFrame(),t&&t.call(this)}},{key:"insert",value:function(e,t,r){if(t<0||t>this.innerElements.length+1)throw new Error("Unable to inset it at this index 😭");if(-1!==this.innerElements.indexOf(e))throw new Error("The same item in a carousel? Really? Nope 😭");var n=t<=this.currentSlide>0&&this.innerElements.length;this.currentSlide=n?this.currentSlide+1:this.currentSlide,this.innerElements.splice(t,0,e),this.buildSliderFrame(),r&&r.call(this)}},{key:"prepend",value:function(e,t){this.insert(e,0),t&&t.call(this)}},{key:"append",value:function(e,t){this.insert(e,this.innerElements.length+1),t&&t.call(this)}},{key:"destroy",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments[1];if(this.detachEvents(),this.selector.style.cursor="auto",e){for(var r=document.createDocumentFragment(),n=0;n<this.innerElements.length;n++)r.appendChild(this.innerElements[n]);this.selector.innerHTML="",this.selector.appendChild(r),this.selector.removeAttribute("style")}t&&t.call(this)}}],[{key:"mergeSettings",value:function(e){var t={selector:".siema",duration:200,easing:"ease-out",perPage:1,startIndex:0,draggable:!0,multipleDrag:!0,threshold:20,loop:!1,rtl:!1,onInit:function(){},onChange:function(){}},r=e;for(var n in r)t[n]=r[n];return t}},{key:"webkitOrNot",value:function(){return"string"==typeof document.documentElement.style.transform?"transform":"WebkitTransform"}}]),e}();t.default=o,e.exports=t.default}])},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(6),i=r(1),o=r(45);r(46);var s=r(19),a=function(){function e(e,t){var r=void 0===t?{}:t,n=r.mode,o=r.eventHub,s=r.parentContainer;this.id=i.uuid(),this.mode="master",n&&(this.mode=n),this.eventHub=o,this.parentContainer=s,this.initSource(e),"master"===this.mode&&this.initMaster(),"mirror"===this.mode&&this.initMirror()}return e.prototype.open=function(){this.drawboard.open()},e.prototype.hide=function(){this.drawboard.hide()},e.prototype.show=function(){this.drawboard.show()},e.prototype.close=function(){this.drawboard.close()},e.prototype.initSource=function(e){if("string"==typeof e.imgSrc&&!this.parentContainer)throw new Error("Invalid source, If you set image url, you must also set parentContainer");this.source=e,e.imgEle&&(this.target=e.imgEle),"string"==typeof e.imgSrc&&(this.container=s.createDivWithClassName("fcw-page",this.parentContainer),this.container.id=this.id,this.target=document.createElement("img"),this.target.src=e.imgSrc,this.target.alt="Siema image",this.container.appendChild(this.target))},e.prototype.initMaster=function(){var e=this;this.eventHub?this.drawboard=new n.Drawboard({imgEle:this.target},{page:this,onChange:function(t){return e.eventHub.emit("sync",t)}}):this.drawboard=new n.Drawboard({imgEle:this.target},{page:this})},e.prototype.initMirror=function(){var e=this;if(!this.eventHub)throw new Error("Invalid eventHub");this.drawboard=new n.Drawboard({imgEle:this.target},{page:this}),this.eventHub.on("sync",function(t){try{"page"===t.target&&t.id===e.id&&e.onPageSync(),"marker"===t.target&&e.onMarkerSync(t)}catch(e){console.warn(e)}})},e.prototype.onPageSync=function(){},e.prototype.onMarkerSync=function(e){if("add"===e.event&&e.parentId===this.id){var t=e.data;(r=this.drawboard.markerMap[t.id])||this.drawboard.addMarker(o.getMarkerByType(t.type),{id:t.id})}if(e.id){if("remove"===e.event){t=e.data;(r=this.drawboard.markerMap[t.id])&&this.drawboard.deleteMarker(r)}var r;if("move"===e.event||"resize"===e.event)(r=this.drawboard.markerMap[e.id])&&r.reactToManipulation(e.event,e.data);if("changeText"===e.event)(r=this.drawboard.markerMap[e.id])&&r.setText(e.data)}},e}();t.WhitePage=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(17),i=r(12),o=r(15),s=r(3),a=r(11),c=r(18),l=r(8);t.getMarkerByType=function(e){switch(e){case"arrow":return o.ArrowMarker;case"base":return s.BaseMarker;case"cover":return a.CoverMarker;case"highlight":return n.HighlightMarker;case"line":return c.LineMarker;case"rect":return l.RectMarker;case"text":return i.TextMarker;default:return s.BaseMarker}}},function(e,t,r){var n=r(47);"string"==typeof n&&(n=[[e.i,n,""]]);var i={hmr:!0,transform:void 0,insertInto:void 0};r(5)(n,i);n.locals&&(e.exports=n.locals)},function(e,t,r){(e.exports=r(4)(!1)).push([e.i,".fcw-page img {\n width: 100%;\n height: 100%;\n}\n",""])},function(e,t,r){var n=r(49);"string"==typeof n&&(n=[[e.i,n,""]]);var i={hmr:!0,transform:void 0,insertInto:void 0};r(5)(n,i);n.locals&&(e.exports=n.locals)},function(e,t,r){(e.exports=r(4)(!1)).push([e.i,".fcw-board-imgs,\n.fcw-board-pages,\n.fcw-board .fcw-page {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n}\n.fcw-board-img {\n width: 100%;\n height: 100%;\n}\n.fcw-board-flip-arrow {\n height: 20px;\n width: 20px;\n cursor: pointer;\n}\n.fcw-board-controller {\n position: absolute;\n display: -ms-flexbox;\n display: flex;\n width: 50px;\n height: 30px;\n -ms-flex-pack: justify;\n justify-content: space-between;\n -ms-flex-align: center;\n align-items: center;\n top: -30px;\n background-color: #cccccc;\n padding: 0px 5px;\n margin: 0px;\n border-top-left-radius: 10px;\n border-top-right-radius: 10px;\n}\n",""])},function(e,t){e.exports='<svg t="1553418887330" class="icon" style viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2264" xmlns:xlink="http://www.w3.org/1999/xlink"><defs><style type="text/css"></style></defs><path d="M787.797333 90.197333a42.581333 42.581333 0 0 0-44.074666 2.688l-554.666667 384a42.794667 42.794667 0 0 0 0 70.186667l554.666667 384A42.666667 42.666667 0 0 0 810.666667 896V128a42.666667 42.666667 0 0 0-22.869334-37.802667zM725.333333 814.549333L288.298667 512 725.333333 209.450667v605.098666z" p-id="2265"></path></svg>'},function(e,t){e.exports='<svg t="1553418900235" class="icon" style viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2709" xmlns:xlink="http://www.w3.org/1999/xlink"><defs><style type="text/css"></style></defs><path d="M236.202667 933.802667a42.837333 42.837333 0 0 0 44.074666-2.730667l554.666667-384a42.666667 42.666667 0 0 0 0-70.144l-554.666667-384A42.581333 42.581333 0 0 0 213.333333 128v768a42.666667 42.666667 0 0 0 22.869334 37.802667zM298.666667 209.450667L735.701333 512 298.666667 814.549333V209.450667z" p-id="2710"></path></svg>'}])});
  2. //# sourceMappingURL=index.js.map