Sin descripción

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537
  1. (function webpackUniversalModuleDefinition(root, factory) {
  2. if(typeof exports === 'object' && typeof module === 'object')
  3. module.exports = factory();
  4. else if(typeof define === 'function' && define.amd)
  5. define([], factory);
  6. else {
  7. var a = factory();
  8. for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
  9. }
  10. })(window, function() {
  11. return /******/ (function(modules) { // webpackBootstrap
  12. /******/ // The module cache
  13. /******/ var installedModules = {};
  14. /******/
  15. /******/ // The require function
  16. /******/ function __webpack_require__(moduleId) {
  17. /******/
  18. /******/ // Check if module is in cache
  19. /******/ if(installedModules[moduleId]) {
  20. /******/ return installedModules[moduleId].exports;
  21. /******/ }
  22. /******/ // Create a new module (and put it into the cache)
  23. /******/ var module = installedModules[moduleId] = {
  24. /******/ i: moduleId,
  25. /******/ l: false,
  26. /******/ exports: {}
  27. /******/ };
  28. /******/
  29. /******/ // Execute the module function
  30. /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  31. /******/
  32. /******/ // Flag the module as loaded
  33. /******/ module.l = true;
  34. /******/
  35. /******/ // Return the exports of the module
  36. /******/ return module.exports;
  37. /******/ }
  38. /******/
  39. /******/
  40. /******/ // expose the modules object (__webpack_modules__)
  41. /******/ __webpack_require__.m = modules;
  42. /******/
  43. /******/ // expose the module cache
  44. /******/ __webpack_require__.c = installedModules;
  45. /******/
  46. /******/ // define getter function for harmony exports
  47. /******/ __webpack_require__.d = function(exports, name, getter) {
  48. /******/ if(!__webpack_require__.o(exports, name)) {
  49. /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
  50. /******/ }
  51. /******/ };
  52. /******/
  53. /******/ // define __esModule on exports
  54. /******/ __webpack_require__.r = function(exports) {
  55. /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
  56. /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
  57. /******/ }
  58. /******/ Object.defineProperty(exports, '__esModule', { value: true });
  59. /******/ };
  60. /******/
  61. /******/ // create a fake namespace object
  62. /******/ // mode & 1: value is a module id, require it
  63. /******/ // mode & 2: merge all properties of value into the ns
  64. /******/ // mode & 4: return value when already ns object
  65. /******/ // mode & 8|1: behave like require
  66. /******/ __webpack_require__.t = function(value, mode) {
  67. /******/ if(mode & 1) value = __webpack_require__(value);
  68. /******/ if(mode & 8) return value;
  69. /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
  70. /******/ var ns = Object.create(null);
  71. /******/ __webpack_require__.r(ns);
  72. /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
  73. /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
  74. /******/ return ns;
  75. /******/ };
  76. /******/
  77. /******/ // getDefaultExport function for compatibility with non-harmony modules
  78. /******/ __webpack_require__.n = function(module) {
  79. /******/ var getter = module && module.__esModule ?
  80. /******/ function getDefault() { return module['default']; } :
  81. /******/ function getModuleExports() { return module; };
  82. /******/ __webpack_require__.d(getter, 'a', getter);
  83. /******/ return getter;
  84. /******/ };
  85. /******/
  86. /******/ // Object.prototype.hasOwnProperty.call
  87. /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
  88. /******/
  89. /******/ // __webpack_public_path__
  90. /******/ __webpack_require__.p = "";
  91. /******/
  92. /******/
  93. /******/ // Load entry module and return exports
  94. /******/ return __webpack_require__(__webpack_require__.s = "./src/index.ts");
  95. /******/ })
  96. /************************************************************************/
  97. /******/ ({
  98. /***/ "./node_modules/css-loader/dist/cjs.js?!./node_modules/postcss-loader/src/index.js!./node_modules/less-loader/dist/cjs.js?!./src/board/Drawboard/index.less":
  99. /*!*****************************************************************************************************************************************************************************!*\
  100. !*** ./node_modules/css-loader/dist/cjs.js??ref--11-1!./node_modules/postcss-loader/src!./node_modules/less-loader/dist/cjs.js??ref--11-3!./src/board/Drawboard/index.less ***!
  101. \*****************************************************************************************************************************************************************************/
  102. /*! no static exports found */
  103. /***/ (function(module, exports, __webpack_require__) {
  104. exports = module.exports = __webpack_require__(/*! ../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js")(false);
  105. // Module
  106. exports.push([module.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", ""]);
  107. /***/ }),
  108. /***/ "./node_modules/css-loader/dist/cjs.js?!./node_modules/postcss-loader/src/index.js!./node_modules/less-loader/dist/cjs.js?!./src/board/WhitePage/index.less":
  109. /*!*****************************************************************************************************************************************************************************!*\
  110. !*** ./node_modules/css-loader/dist/cjs.js??ref--11-1!./node_modules/postcss-loader/src!./node_modules/less-loader/dist/cjs.js??ref--11-3!./src/board/WhitePage/index.less ***!
  111. \*****************************************************************************************************************************************************************************/
  112. /*! no static exports found */
  113. /***/ (function(module, exports, __webpack_require__) {
  114. exports = module.exports = __webpack_require__(/*! ../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js")(false);
  115. // Module
  116. exports.push([module.i, ".fcw-page img {\n width: 100%;\n height: 100%;\n}\n", ""]);
  117. /***/ }),
  118. /***/ "./node_modules/css-loader/dist/cjs.js?!./node_modules/postcss-loader/src/index.js!./node_modules/less-loader/dist/cjs.js?!./src/board/Whiteboard/index.less":
  119. /*!******************************************************************************************************************************************************************************!*\
  120. !*** ./node_modules/css-loader/dist/cjs.js??ref--11-1!./node_modules/postcss-loader/src!./node_modules/less-loader/dist/cjs.js??ref--11-3!./src/board/Whiteboard/index.less ***!
  121. \******************************************************************************************************************************************************************************/
  122. /*! no static exports found */
  123. /***/ (function(module, exports, __webpack_require__) {
  124. exports = module.exports = __webpack_require__(/*! ../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js")(false);
  125. // Module
  126. exports.push([module.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", ""]);
  127. /***/ }),
  128. /***/ "./node_modules/css-loader/dist/runtime/api.js":
  129. /*!*****************************************************!*\
  130. !*** ./node_modules/css-loader/dist/runtime/api.js ***!
  131. \*****************************************************/
  132. /*! no static exports found */
  133. /***/ (function(module, exports, __webpack_require__) {
  134. "use strict";
  135. /*
  136. MIT License http://www.opensource.org/licenses/mit-license.php
  137. Author Tobias Koppers @sokra
  138. */
  139. // css base code, injected by the css-loader
  140. module.exports = function (useSourceMap) {
  141. var list = []; // return the list of modules as css string
  142. list.toString = function toString() {
  143. return this.map(function (item) {
  144. var content = cssWithMappingToString(item, useSourceMap);
  145. if (item[2]) {
  146. return '@media ' + item[2] + '{' + content + '}';
  147. } else {
  148. return content;
  149. }
  150. }).join('');
  151. }; // import a list of modules into the list
  152. list.i = function (modules, mediaQuery) {
  153. if (typeof modules === 'string') {
  154. modules = [[null, modules, '']];
  155. }
  156. var alreadyImportedModules = {};
  157. for (var i = 0; i < this.length; i++) {
  158. var id = this[i][0];
  159. if (id != null) {
  160. alreadyImportedModules[id] = true;
  161. }
  162. }
  163. for (i = 0; i < modules.length; i++) {
  164. var item = modules[i]; // skip already imported module
  165. // this implementation is not 100% perfect for weird media query combinations
  166. // when a module is imported multiple times with different media queries.
  167. // I hope this will never occur (Hey this way we have smaller bundles)
  168. if (item[0] == null || !alreadyImportedModules[item[0]]) {
  169. if (mediaQuery && !item[2]) {
  170. item[2] = mediaQuery;
  171. } else if (mediaQuery) {
  172. item[2] = '(' + item[2] + ') and (' + mediaQuery + ')';
  173. }
  174. list.push(item);
  175. }
  176. }
  177. };
  178. return list;
  179. };
  180. function cssWithMappingToString(item, useSourceMap) {
  181. var content = item[1] || '';
  182. var cssMapping = item[3];
  183. if (!cssMapping) {
  184. return content;
  185. }
  186. if (useSourceMap && typeof btoa === 'function') {
  187. var sourceMapping = toComment(cssMapping);
  188. var sourceURLs = cssMapping.sources.map(function (source) {
  189. return '/*# sourceURL=' + cssMapping.sourceRoot + source + ' */';
  190. });
  191. return [content].concat(sourceURLs).concat([sourceMapping]).join('\n');
  192. }
  193. return [content].join('\n');
  194. } // Adapted from convert-source-map (MIT)
  195. function toComment(sourceMap) {
  196. // eslint-disable-next-line no-undef
  197. var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));
  198. var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;
  199. return '/*# ' + data + ' */';
  200. }
  201. /***/ }),
  202. /***/ "./node_modules/siema/dist/siema.min.js":
  203. /*!**********************************************!*\
  204. !*** ./node_modules/siema/dist/siema.min.js ***!
  205. \**********************************************/
  206. /*! no static exports found */
  207. /***/ (function(module, exports, __webpack_require__) {
  208. !function(e,t){ true?module.exports=t():undefined}("undefined"!=typeof self?self:this,function(){return function(e){function t(r){if(i[r])return i[r].exports;var n=i[r]={i:r,l:!1,exports:{}};return e[r].call(n.exports,n,n.exports,t),n.l=!0,n.exports}var i={};return t.m=e,t.c=i,t.d=function(e,i,r){t.o(e,i)||Object.defineProperty(e,i,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var i=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(i,"a",i),i},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=0)}([function(e,t,i){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}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},s=function(){function e(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,i,r){return i&&e(t.prototype,i),r&&e(t,r),t}}(),l=function(){function e(t){var i=this;if(r(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){i[e]=i[e].bind(i)}),this.init()}return s(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 i=document.createDocumentFragment();if(this.config.loop)for(var r=this.innerElements.length-this.perPage;r<this.innerElements.length;r++){var n=this.buildSliderFrameItem(this.innerElements[r].cloneNode(!0));i.appendChild(n)}for(var s=0;s<this.innerElements.length;s++){var l=this.buildSliderFrameItem(this.innerElements[s]);i.appendChild(l)}if(this.config.loop)for(var o=0;o<this.perPage;o++){var a=this.buildSliderFrameItem(this.innerElements[o].cloneNode(!0));i.appendChild(a)}this.sliderFrame.appendChild(i),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)){this.perPage=1;for(var e in 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 i=this.currentSlide;if(this.config.loop){if(this.currentSlide-e<0){this.disableTransition();var r=this.currentSlide+this.innerElements.length,n=this.perPage,s=r+n,l=(this.config.rtl?1:-1)*s*(this.selectorWidth/this.perPage),o=this.config.draggable?this.drag.endX-this.drag.startX:0;this.sliderFrame.style[this.transformProperty]="translate3d("+(l+o)+"px, 0, 0)",this.currentSlide=r-e}else this.currentSlide=this.currentSlide-e}else this.currentSlide=Math.max(this.currentSlide-e,0);i!==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 i=this.currentSlide;if(this.config.loop){if(this.currentSlide+e>this.innerElements.length-this.perPage){this.disableTransition();var r=this.currentSlide-this.innerElements.length,n=this.perPage,s=r+n,l=(this.config.rtl?1:-1)*s*(this.selectorWidth/this.perPage),o=this.config.draggable?this.drag.endX-this.drag.startX:0;this.sliderFrame.style[this.transformProperty]="translate3d("+(l+o)+"px, 0, 0)",this.currentSlide=r+e}else this.currentSlide=this.currentSlide+e}else this.currentSlide=Math.min(this.currentSlide+e,this.innerElements.length-this.perPage);i!==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 i=this.currentSlide;this.currentSlide=this.config.loop?e%this.innerElements.length:Math.min(Math.max(e,0),this.innerElements.length-this.perPage),i!==this.currentSlide&&(this.slideToCurrent(),this.config.onChange.call(this),t&&t.call(this))}}},{key:"slideToCurrent",value:function(e){var t=this,i=this.config.loop?this.currentSlide+this.perPage:this.currentSlide,r=(this.config.rtl?1:-1)*i*(this.selectorWidth/this.perPage);e?requestAnimationFrame(function(){requestAnimationFrame(function(){t.enableTransition(),t.sliderFrame.style[t.transformProperty]="translate3d("+r+"px, 0, 0)"})}):this.sliderFrame.style[this.transformProperty]="translate3d("+r+"px, 0, 0)"}},{key:"updateAfterDrag",value:function(){var e=(this.config.rtl?-1:1)*(this.drag.endX-this.drag.startX),t=Math.abs(e),i=this.config.multipleDrag?Math.ceil(t/(this.selectorWidth/this.perPage)):1,r=e>0&&this.currentSlide-i<0,n=e<0&&this.currentSlide+i>this.innerElements.length-this.perPage;e>0&&t>this.config.threshold&&this.innerElements.length>this.perPage?this.prev(i):e<0&&t>this.config.threshold&&this.innerElements.length>this.perPage&&this.next(i),this.slideToCurrent(r||n)}},{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,i=t*(this.selectorWidth/this.perPage),r=this.drag.endX-this.drag.startX,n=this.config.rtl?i+r:i-r;this.sliderFrame.style[this.transformProperty]="translate3d("+(this.config.rtl?1:-1)*n+"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,i=t*(this.selectorWidth/this.perPage),r=this.drag.endX-this.drag.startX,n=this.config.rtl?i+r:i-r;this.sliderFrame.style[this.transformProperty]="translate3d("+(this.config.rtl?1:-1)*n+"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 i=e<this.currentSlide,r=this.currentSlide+this.perPage-1===e;(i||r)&&this.currentSlide--,this.innerElements.splice(e,1),this.buildSliderFrame(),t&&t.call(this)}},{key:"insert",value:function(e,t,i){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 r=t<=this.currentSlide>0&&this.innerElements.length;this.currentSlide=r?this.currentSlide+1:this.currentSlide,this.innerElements.splice(t,0,e),this.buildSliderFrame(),i&&i.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 i=document.createDocumentFragment(),r=0;r<this.innerElements.length;r++)i.appendChild(this.innerElements[r]);this.selector.innerHTML="",this.selector.appendChild(i),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(){}},i=e;for(var r in i)t[r]=i[r];return t}},{key:"webkitOrNot",value:function(){return"string"==typeof document.documentElement.style.transform?"transform":"WebkitTransform"}}]),e}();t.default=l,e.exports=t.default}])});
  209. /***/ }),
  210. /***/ "./node_modules/style-loader/lib/addStyles.js":
  211. /*!****************************************************!*\
  212. !*** ./node_modules/style-loader/lib/addStyles.js ***!
  213. \****************************************************/
  214. /*! no static exports found */
  215. /***/ (function(module, exports, __webpack_require__) {
  216. /*
  217. MIT License http://www.opensource.org/licenses/mit-license.php
  218. Author Tobias Koppers @sokra
  219. */
  220. var stylesInDom = {};
  221. var memoize = function (fn) {
  222. var memo;
  223. return function () {
  224. if (typeof memo === "undefined") memo = fn.apply(this, arguments);
  225. return memo;
  226. };
  227. };
  228. var isOldIE = memoize(function () {
  229. // Test for IE <= 9 as proposed by Browserhacks
  230. // @see http://browserhacks.com/#hack-e71d8692f65334173fee715c222cb805
  231. // Tests for existence of standard globals is to allow style-loader
  232. // to operate correctly into non-standard environments
  233. // @see https://github.com/webpack-contrib/style-loader/issues/177
  234. return window && document && document.all && !window.atob;
  235. });
  236. var getTarget = function (target, parent) {
  237. if (parent){
  238. return parent.querySelector(target);
  239. }
  240. return document.querySelector(target);
  241. };
  242. var getElement = (function (fn) {
  243. var memo = {};
  244. return function(target, parent) {
  245. // If passing function in options, then use it for resolve "head" element.
  246. // Useful for Shadow Root style i.e
  247. // {
  248. // insertInto: function () { return document.querySelector("#foo").shadowRoot }
  249. // }
  250. if (typeof target === 'function') {
  251. return target();
  252. }
  253. if (typeof memo[target] === "undefined") {
  254. var styleTarget = getTarget.call(this, target, parent);
  255. // Special case to return head of iframe instead of iframe itself
  256. if (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) {
  257. try {
  258. // This will throw an exception if access to iframe is blocked
  259. // due to cross-origin restrictions
  260. styleTarget = styleTarget.contentDocument.head;
  261. } catch(e) {
  262. styleTarget = null;
  263. }
  264. }
  265. memo[target] = styleTarget;
  266. }
  267. return memo[target]
  268. };
  269. })();
  270. var singleton = null;
  271. var singletonCounter = 0;
  272. var stylesInsertedAtTop = [];
  273. var fixUrls = __webpack_require__(/*! ./urls */ "./node_modules/style-loader/lib/urls.js");
  274. module.exports = function(list, options) {
  275. if (typeof DEBUG !== "undefined" && DEBUG) {
  276. if (typeof document !== "object") throw new Error("The style-loader cannot be used in a non-browser environment");
  277. }
  278. options = options || {};
  279. options.attrs = typeof options.attrs === "object" ? options.attrs : {};
  280. // Force single-tag solution on IE6-9, which has a hard limit on the # of <style>
  281. // tags it will allow on a page
  282. if (!options.singleton && typeof options.singleton !== "boolean") options.singleton = isOldIE();
  283. // By default, add <style> tags to the <head> element
  284. if (!options.insertInto) options.insertInto = "head";
  285. // By default, add <style> tags to the bottom of the target
  286. if (!options.insertAt) options.insertAt = "bottom";
  287. var styles = listToStyles(list, options);
  288. addStylesToDom(styles, options);
  289. return function update (newList) {
  290. var mayRemove = [];
  291. for (var i = 0; i < styles.length; i++) {
  292. var item = styles[i];
  293. var domStyle = stylesInDom[item.id];
  294. domStyle.refs--;
  295. mayRemove.push(domStyle);
  296. }
  297. if(newList) {
  298. var newStyles = listToStyles(newList, options);
  299. addStylesToDom(newStyles, options);
  300. }
  301. for (var i = 0; i < mayRemove.length; i++) {
  302. var domStyle = mayRemove[i];
  303. if(domStyle.refs === 0) {
  304. for (var j = 0; j < domStyle.parts.length; j++) domStyle.parts[j]();
  305. delete stylesInDom[domStyle.id];
  306. }
  307. }
  308. };
  309. };
  310. function addStylesToDom (styles, options) {
  311. for (var i = 0; i < styles.length; i++) {
  312. var item = styles[i];
  313. var domStyle = stylesInDom[item.id];
  314. if(domStyle) {
  315. domStyle.refs++;
  316. for(var j = 0; j < domStyle.parts.length; j++) {
  317. domStyle.parts[j](item.parts[j]);
  318. }
  319. for(; j < item.parts.length; j++) {
  320. domStyle.parts.push(addStyle(item.parts[j], options));
  321. }
  322. } else {
  323. var parts = [];
  324. for(var j = 0; j < item.parts.length; j++) {
  325. parts.push(addStyle(item.parts[j], options));
  326. }
  327. stylesInDom[item.id] = {id: item.id, refs: 1, parts: parts};
  328. }
  329. }
  330. }
  331. function listToStyles (list, options) {
  332. var styles = [];
  333. var newStyles = {};
  334. for (var i = 0; i < list.length; i++) {
  335. var item = list[i];
  336. var id = options.base ? item[0] + options.base : item[0];
  337. var css = item[1];
  338. var media = item[2];
  339. var sourceMap = item[3];
  340. var part = {css: css, media: media, sourceMap: sourceMap};
  341. if(!newStyles[id]) styles.push(newStyles[id] = {id: id, parts: [part]});
  342. else newStyles[id].parts.push(part);
  343. }
  344. return styles;
  345. }
  346. function insertStyleElement (options, style) {
  347. var target = getElement(options.insertInto)
  348. if (!target) {
  349. throw new Error("Couldn't find a style target. This probably means that the value for the 'insertInto' parameter is invalid.");
  350. }
  351. var lastStyleElementInsertedAtTop = stylesInsertedAtTop[stylesInsertedAtTop.length - 1];
  352. if (options.insertAt === "top") {
  353. if (!lastStyleElementInsertedAtTop) {
  354. target.insertBefore(style, target.firstChild);
  355. } else if (lastStyleElementInsertedAtTop.nextSibling) {
  356. target.insertBefore(style, lastStyleElementInsertedAtTop.nextSibling);
  357. } else {
  358. target.appendChild(style);
  359. }
  360. stylesInsertedAtTop.push(style);
  361. } else if (options.insertAt === "bottom") {
  362. target.appendChild(style);
  363. } else if (typeof options.insertAt === "object" && options.insertAt.before) {
  364. var nextSibling = getElement(options.insertAt.before, target);
  365. target.insertBefore(style, nextSibling);
  366. } else {
  367. 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");
  368. }
  369. }
  370. function removeStyleElement (style) {
  371. if (style.parentNode === null) return false;
  372. style.parentNode.removeChild(style);
  373. var idx = stylesInsertedAtTop.indexOf(style);
  374. if(idx >= 0) {
  375. stylesInsertedAtTop.splice(idx, 1);
  376. }
  377. }
  378. function createStyleElement (options) {
  379. var style = document.createElement("style");
  380. if(options.attrs.type === undefined) {
  381. options.attrs.type = "text/css";
  382. }
  383. if(options.attrs.nonce === undefined) {
  384. var nonce = getNonce();
  385. if (nonce) {
  386. options.attrs.nonce = nonce;
  387. }
  388. }
  389. addAttrs(style, options.attrs);
  390. insertStyleElement(options, style);
  391. return style;
  392. }
  393. function createLinkElement (options) {
  394. var link = document.createElement("link");
  395. if(options.attrs.type === undefined) {
  396. options.attrs.type = "text/css";
  397. }
  398. options.attrs.rel = "stylesheet";
  399. addAttrs(link, options.attrs);
  400. insertStyleElement(options, link);
  401. return link;
  402. }
  403. function addAttrs (el, attrs) {
  404. Object.keys(attrs).forEach(function (key) {
  405. el.setAttribute(key, attrs[key]);
  406. });
  407. }
  408. function getNonce() {
  409. if (false) {}
  410. return __webpack_require__.nc;
  411. }
  412. function addStyle (obj, options) {
  413. var style, update, remove, result;
  414. // If a transform function was defined, run it on the css
  415. if (options.transform && obj.css) {
  416. result = typeof options.transform === 'function'
  417. ? options.transform(obj.css)
  418. : options.transform.default(obj.css);
  419. if (result) {
  420. // If transform returns a value, use that instead of the original css.
  421. // This allows running runtime transformations on the css.
  422. obj.css = result;
  423. } else {
  424. // If the transform function returns a falsy value, don't add this css.
  425. // This allows conditional loading of css
  426. return function() {
  427. // noop
  428. };
  429. }
  430. }
  431. if (options.singleton) {
  432. var styleIndex = singletonCounter++;
  433. style = singleton || (singleton = createStyleElement(options));
  434. update = applyToSingletonTag.bind(null, style, styleIndex, false);
  435. remove = applyToSingletonTag.bind(null, style, styleIndex, true);
  436. } else if (
  437. obj.sourceMap &&
  438. typeof URL === "function" &&
  439. typeof URL.createObjectURL === "function" &&
  440. typeof URL.revokeObjectURL === "function" &&
  441. typeof Blob === "function" &&
  442. typeof btoa === "function"
  443. ) {
  444. style = createLinkElement(options);
  445. update = updateLink.bind(null, style, options);
  446. remove = function () {
  447. removeStyleElement(style);
  448. if(style.href) URL.revokeObjectURL(style.href);
  449. };
  450. } else {
  451. style = createStyleElement(options);
  452. update = applyToTag.bind(null, style);
  453. remove = function () {
  454. removeStyleElement(style);
  455. };
  456. }
  457. update(obj);
  458. return function updateStyle (newObj) {
  459. if (newObj) {
  460. if (
  461. newObj.css === obj.css &&
  462. newObj.media === obj.media &&
  463. newObj.sourceMap === obj.sourceMap
  464. ) {
  465. return;
  466. }
  467. update(obj = newObj);
  468. } else {
  469. remove();
  470. }
  471. };
  472. }
  473. var replaceText = (function () {
  474. var textStore = [];
  475. return function (index, replacement) {
  476. textStore[index] = replacement;
  477. return textStore.filter(Boolean).join('\n');
  478. };
  479. })();
  480. function applyToSingletonTag (style, index, remove, obj) {
  481. var css = remove ? "" : obj.css;
  482. if (style.styleSheet) {
  483. style.styleSheet.cssText = replaceText(index, css);
  484. } else {
  485. var cssNode = document.createTextNode(css);
  486. var childNodes = style.childNodes;
  487. if (childNodes[index]) style.removeChild(childNodes[index]);
  488. if (childNodes.length) {
  489. style.insertBefore(cssNode, childNodes[index]);
  490. } else {
  491. style.appendChild(cssNode);
  492. }
  493. }
  494. }
  495. function applyToTag (style, obj) {
  496. var css = obj.css;
  497. var media = obj.media;
  498. if(media) {
  499. style.setAttribute("media", media)
  500. }
  501. if(style.styleSheet) {
  502. style.styleSheet.cssText = css;
  503. } else {
  504. while(style.firstChild) {
  505. style.removeChild(style.firstChild);
  506. }
  507. style.appendChild(document.createTextNode(css));
  508. }
  509. }
  510. function updateLink (link, options, obj) {
  511. var css = obj.css;
  512. var sourceMap = obj.sourceMap;
  513. /*
  514. If convertToAbsoluteUrls isn't defined, but sourcemaps are enabled
  515. and there is no publicPath defined then lets turn convertToAbsoluteUrls
  516. on by default. Otherwise default to the convertToAbsoluteUrls option
  517. directly
  518. */
  519. var autoFixUrls = options.convertToAbsoluteUrls === undefined && sourceMap;
  520. if (options.convertToAbsoluteUrls || autoFixUrls) {
  521. css = fixUrls(css);
  522. }
  523. if (sourceMap) {
  524. // http://stackoverflow.com/a/26603875
  525. css += "\n/*# sourceMappingURL=data:application/json;base64," + btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))) + " */";
  526. }
  527. var blob = new Blob([css], { type: "text/css" });
  528. var oldSrc = link.href;
  529. link.href = URL.createObjectURL(blob);
  530. if(oldSrc) URL.revokeObjectURL(oldSrc);
  531. }
  532. /***/ }),
  533. /***/ "./node_modules/style-loader/lib/urls.js":
  534. /*!***********************************************!*\
  535. !*** ./node_modules/style-loader/lib/urls.js ***!
  536. \***********************************************/
  537. /*! no static exports found */
  538. /***/ (function(module, exports) {
  539. /**
  540. * When source maps are enabled, `style-loader` uses a link element with a data-uri to
  541. * embed the css on the page. This breaks all relative urls because now they are relative to a
  542. * bundle instead of the current page.
  543. *
  544. * One solution is to only use full urls, but that may be impossible.
  545. *
  546. * Instead, this function "fixes" the relative urls to be absolute according to the current page location.
  547. *
  548. * A rudimentary test suite is located at `test/fixUrls.js` and can be run via the `npm test` command.
  549. *
  550. */
  551. module.exports = function (css) {
  552. // get current location
  553. var location = typeof window !== "undefined" && window.location;
  554. if (!location) {
  555. throw new Error("fixUrls requires window.location");
  556. }
  557. // blank or null?
  558. if (!css || typeof css !== "string") {
  559. return css;
  560. }
  561. var baseUrl = location.protocol + "//" + location.host;
  562. var currentDir = baseUrl + location.pathname.replace(/\/[^\/]*$/, "/");
  563. // convert each url(...)
  564. /*
  565. This regular expression is just a way to recursively match brackets within
  566. a string.
  567. /url\s*\( = Match on the word "url" with any whitespace after it and then a parens
  568. ( = Start a capturing group
  569. (?: = Start a non-capturing group
  570. [^)(] = Match anything that isn't a parentheses
  571. | = OR
  572. \( = Match a start parentheses
  573. (?: = Start another non-capturing groups
  574. [^)(]+ = Match anything that isn't a parentheses
  575. | = OR
  576. \( = Match a start parentheses
  577. [^)(]* = Match anything that isn't a parentheses
  578. \) = Match a end parentheses
  579. ) = End Group
  580. *\) = Match anything and then a close parens
  581. ) = Close non-capturing group
  582. * = Match anything
  583. ) = Close capturing group
  584. \) = Match a close parens
  585. /gi = Get all matches, not the first. Be case insensitive.
  586. */
  587. var fixedCss = css.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi, function(fullMatch, origUrl) {
  588. // strip quotes (if they exist)
  589. var unquotedOrigUrl = origUrl
  590. .trim()
  591. .replace(/^"(.*)"$/, function(o, $1){ return $1; })
  592. .replace(/^'(.*)'$/, function(o, $1){ return $1; });
  593. // already a full url? no change
  594. if (/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/|\s*$)/i.test(unquotedOrigUrl)) {
  595. return fullMatch;
  596. }
  597. // convert the url to a full url
  598. var newUrl;
  599. if (unquotedOrigUrl.indexOf("//") === 0) {
  600. //TODO: should we add protocol?
  601. newUrl = unquotedOrigUrl;
  602. } else if (unquotedOrigUrl.indexOf("/") === 0) {
  603. // path should be relative to the base url
  604. newUrl = baseUrl + unquotedOrigUrl; // already starts with '/'
  605. } else {
  606. // path should be relative to current directory
  607. newUrl = currentDir + unquotedOrigUrl.replace(/^\.\//, ""); // Strip leading './'
  608. }
  609. // send back the fixed url(...)
  610. return "url(" + JSON.stringify(newUrl) + ")";
  611. });
  612. // send back the fixed css
  613. return fixedCss;
  614. };
  615. /***/ }),
  616. /***/ "./node_modules/uuid/lib/bytesToUuid.js":
  617. /*!**********************************************!*\
  618. !*** ./node_modules/uuid/lib/bytesToUuid.js ***!
  619. \**********************************************/
  620. /*! no static exports found */
  621. /***/ (function(module, exports) {
  622. /**
  623. * Convert array of 16 byte values to UUID string format of the form:
  624. * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
  625. */
  626. var byteToHex = [];
  627. for (var i = 0; i < 256; ++i) {
  628. byteToHex[i] = (i + 0x100).toString(16).substr(1);
  629. }
  630. function bytesToUuid(buf, offset) {
  631. var i = offset || 0;
  632. var bth = byteToHex;
  633. // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4
  634. return ([bth[buf[i++]], bth[buf[i++]],
  635. bth[buf[i++]], bth[buf[i++]], '-',
  636. bth[buf[i++]], bth[buf[i++]], '-',
  637. bth[buf[i++]], bth[buf[i++]], '-',
  638. bth[buf[i++]], bth[buf[i++]], '-',
  639. bth[buf[i++]], bth[buf[i++]],
  640. bth[buf[i++]], bth[buf[i++]],
  641. bth[buf[i++]], bth[buf[i++]]]).join('');
  642. }
  643. module.exports = bytesToUuid;
  644. /***/ }),
  645. /***/ "./node_modules/uuid/lib/rng-browser.js":
  646. /*!**********************************************!*\
  647. !*** ./node_modules/uuid/lib/rng-browser.js ***!
  648. \**********************************************/
  649. /*! no static exports found */
  650. /***/ (function(module, exports) {
  651. // Unique ID creation requires a high quality random # generator. In the
  652. // browser this is a little complicated due to unknown quality of Math.random()
  653. // and inconsistent support for the `crypto` API. We do the best we can via
  654. // feature-detection
  655. // getRandomValues needs to be invoked in a context where "this" is a Crypto
  656. // implementation. Also, find the complete implementation of crypto on IE11.
  657. var getRandomValues = (typeof(crypto) != 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto)) ||
  658. (typeof(msCrypto) != 'undefined' && typeof window.msCrypto.getRandomValues == 'function' && msCrypto.getRandomValues.bind(msCrypto));
  659. if (getRandomValues) {
  660. // WHATWG crypto RNG - http://wiki.whatwg.org/wiki/Crypto
  661. var rnds8 = new Uint8Array(16); // eslint-disable-line no-undef
  662. module.exports = function whatwgRNG() {
  663. getRandomValues(rnds8);
  664. return rnds8;
  665. };
  666. } else {
  667. // Math.random()-based (RNG)
  668. //
  669. // If all else fails, use Math.random(). It's fast, but is of unspecified
  670. // quality.
  671. var rnds = new Array(16);
  672. module.exports = function mathRNG() {
  673. for (var i = 0, r; i < 16; i++) {
  674. if ((i & 0x03) === 0) r = Math.random() * 0x100000000;
  675. rnds[i] = r >>> ((i & 0x03) << 3) & 0xff;
  676. }
  677. return rnds;
  678. };
  679. }
  680. /***/ }),
  681. /***/ "./node_modules/uuid/v1.js":
  682. /*!*********************************!*\
  683. !*** ./node_modules/uuid/v1.js ***!
  684. \*********************************/
  685. /*! no static exports found */
  686. /***/ (function(module, exports, __webpack_require__) {
  687. var rng = __webpack_require__(/*! ./lib/rng */ "./node_modules/uuid/lib/rng-browser.js");
  688. var bytesToUuid = __webpack_require__(/*! ./lib/bytesToUuid */ "./node_modules/uuid/lib/bytesToUuid.js");
  689. // **`v1()` - Generate time-based UUID**
  690. //
  691. // Inspired by https://github.com/LiosK/UUID.js
  692. // and http://docs.python.org/library/uuid.html
  693. var _nodeId;
  694. var _clockseq;
  695. // Previous uuid creation time
  696. var _lastMSecs = 0;
  697. var _lastNSecs = 0;
  698. // See https://github.com/broofa/node-uuid for API details
  699. function v1(options, buf, offset) {
  700. var i = buf && offset || 0;
  701. var b = buf || [];
  702. options = options || {};
  703. var node = options.node || _nodeId;
  704. var clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq;
  705. // node and clockseq need to be initialized to random values if they're not
  706. // specified. We do this lazily to minimize issues related to insufficient
  707. // system entropy. See #189
  708. if (node == null || clockseq == null) {
  709. var seedBytes = rng();
  710. if (node == null) {
  711. // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)
  712. node = _nodeId = [
  713. seedBytes[0] | 0x01,
  714. seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]
  715. ];
  716. }
  717. if (clockseq == null) {
  718. // Per 4.2.2, randomize (14 bit) clockseq
  719. clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff;
  720. }
  721. }
  722. // UUID timestamps are 100 nano-second units since the Gregorian epoch,
  723. // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so
  724. // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'
  725. // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.
  726. var msecs = options.msecs !== undefined ? options.msecs : new Date().getTime();
  727. // Per 4.2.1.2, use count of uuid's generated during the current clock
  728. // cycle to simulate higher resolution clock
  729. var nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1;
  730. // Time since last uuid creation (in msecs)
  731. var dt = (msecs - _lastMSecs) + (nsecs - _lastNSecs)/10000;
  732. // Per 4.2.1.2, Bump clockseq on clock regression
  733. if (dt < 0 && options.clockseq === undefined) {
  734. clockseq = clockseq + 1 & 0x3fff;
  735. }
  736. // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new
  737. // time interval
  738. if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) {
  739. nsecs = 0;
  740. }
  741. // Per 4.2.1.2 Throw error if too many uuids are requested
  742. if (nsecs >= 10000) {
  743. throw new Error('uuid.v1(): Can\'t create more than 10M uuids/sec');
  744. }
  745. _lastMSecs = msecs;
  746. _lastNSecs = nsecs;
  747. _clockseq = clockseq;
  748. // Per 4.1.4 - Convert from unix epoch to Gregorian epoch
  749. msecs += 12219292800000;
  750. // `time_low`
  751. var tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;
  752. b[i++] = tl >>> 24 & 0xff;
  753. b[i++] = tl >>> 16 & 0xff;
  754. b[i++] = tl >>> 8 & 0xff;
  755. b[i++] = tl & 0xff;
  756. // `time_mid`
  757. var tmh = (msecs / 0x100000000 * 10000) & 0xfffffff;
  758. b[i++] = tmh >>> 8 & 0xff;
  759. b[i++] = tmh & 0xff;
  760. // `time_high_and_version`
  761. b[i++] = tmh >>> 24 & 0xf | 0x10; // include version
  762. b[i++] = tmh >>> 16 & 0xff;
  763. // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)
  764. b[i++] = clockseq >>> 8 | 0x80;
  765. // `clock_seq_low`
  766. b[i++] = clockseq & 0xff;
  767. // `node`
  768. for (var n = 0; n < 6; ++n) {
  769. b[i + n] = node[n];
  770. }
  771. return buf ? buf : bytesToUuid(b);
  772. }
  773. module.exports = v1;
  774. /***/ }),
  775. /***/ "./src/assets/arrow.svg":
  776. /*!******************************!*\
  777. !*** ./src/assets/arrow.svg ***!
  778. \******************************/
  779. /*! no static exports found */
  780. /***/ (function(module, exports) {
  781. module.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><!-- 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) -->"
  782. /***/ }),
  783. /***/ "./src/assets/bx-left-arrow.svg":
  784. /*!**************************************!*\
  785. !*** ./src/assets/bx-left-arrow.svg ***!
  786. \**************************************/
  787. /*! no static exports found */
  788. /***/ (function(module, exports) {
  789. module.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>"
  790. /***/ }),
  791. /***/ "./src/assets/bx-right-arrow.svg":
  792. /*!***************************************!*\
  793. !*** ./src/assets/bx-right-arrow.svg ***!
  794. \***************************************/
  795. /*! no static exports found */
  796. /***/ (function(module, exports) {
  797. module.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>"
  798. /***/ }),
  799. /***/ "./src/assets/check.svg":
  800. /*!******************************!*\
  801. !*** ./src/assets/check.svg ***!
  802. \******************************/
  803. /*! no static exports found */
  804. /***/ (function(module, exports) {
  805. module.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><!-- 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) -->"
  806. /***/ }),
  807. /***/ "./src/assets/cover.svg":
  808. /*!******************************!*\
  809. !*** ./src/assets/cover.svg ***!
  810. \******************************/
  811. /*! no static exports found */
  812. /***/ (function(module, exports) {
  813. module.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><!-- 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) -->"
  814. /***/ }),
  815. /***/ "./src/assets/eraser.svg":
  816. /*!*******************************!*\
  817. !*** ./src/assets/eraser.svg ***!
  818. \*******************************/
  819. /*! no static exports found */
  820. /***/ (function(module, exports) {
  821. module.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><!-- 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) -->"
  822. /***/ }),
  823. /***/ "./src/assets/highlight.svg":
  824. /*!**********************************!*\
  825. !*** ./src/assets/highlight.svg ***!
  826. \**********************************/
  827. /*! no static exports found */
  828. /***/ (function(module, exports) {
  829. module.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><!-- 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) -->"
  830. /***/ }),
  831. /***/ "./src/assets/line.svg":
  832. /*!*****************************!*\
  833. !*** ./src/assets/line.svg ***!
  834. \*****************************/
  835. /*! no static exports found */
  836. /***/ (function(module, exports) {
  837. module.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><!-- 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) -->"
  838. /***/ }),
  839. /***/ "./src/assets/mouse-pointer.svg":
  840. /*!**************************************!*\
  841. !*** ./src/assets/mouse-pointer.svg ***!
  842. \**************************************/
  843. /*! no static exports found */
  844. /***/ (function(module, exports) {
  845. module.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><!-- 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) -->"
  846. /***/ }),
  847. /***/ "./src/assets/rect.svg":
  848. /*!*****************************!*\
  849. !*** ./src/assets/rect.svg ***!
  850. \*****************************/
  851. /*! no static exports found */
  852. /***/ (function(module, exports) {
  853. module.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><!-- 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) -->"
  854. /***/ }),
  855. /***/ "./src/assets/text.svg":
  856. /*!*****************************!*\
  857. !*** ./src/assets/text.svg ***!
  858. \*****************************/
  859. /*! no static exports found */
  860. /***/ (function(module, exports) {
  861. module.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><!-- 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) -->"
  862. /***/ }),
  863. /***/ "./src/assets/times.svg":
  864. /*!******************************!*\
  865. !*** ./src/assets/times.svg ***!
  866. \******************************/
  867. /*! no static exports found */
  868. /***/ (function(module, exports) {
  869. module.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><!-- 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) -->"
  870. /***/ }),
  871. /***/ "./src/board/Baseboard/index.ts":
  872. /*!**************************************!*\
  873. !*** ./src/board/Baseboard/index.ts ***!
  874. \**************************************/
  875. /*! no static exports found */
  876. /***/ (function(module, exports, __webpack_require__) {
  877. "use strict";
  878. Object.defineProperty(exports, "__esModule", { value: true });
  879. var uuid_1 = __webpack_require__(/*! ./../../utils/uuid */ "./src/utils/uuid.ts");
  880. var index_1 = __webpack_require__(/*! ./../../renderer/SvgHelper/index */ "./src/renderer/SvgHelper/index.ts");
  881. var Baseboard = function () {
  882. function Baseboard(source) {
  883. var _this = this;
  884. this.id = uuid_1.uuid();
  885. this.initBoard = function () {
  886. _this.boardHolder = document.createElement('div');
  887. _this.boardHolder.id = "fcw-board-holder-" + _this.id;
  888. _this.boardHolder.style.setProperty('touch-action', 'none');
  889. _this.boardHolder.style.setProperty('-ms-touch-action', 'none');
  890. document.body.appendChild(_this.boardHolder);
  891. _this.boardCanvas = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
  892. _this.boardCanvas.setAttribute('xmlns', 'http://www.w3.org/2000/svg');
  893. _this.boardCanvas.setAttribute('width', _this.width.toString());
  894. _this.boardCanvas.setAttribute('height', _this.height.toString());
  895. _this.boardCanvas.setAttribute('viewBox', '0 0 ' + _this.width.toString() + ' ' + _this.height.toString());
  896. _this.boardHolder.style.position = 'absolute';
  897. _this.boardHolder.style.width = _this.width + "px";
  898. _this.boardHolder.style.height = _this.height + "px";
  899. _this.boardHolder.style.transformOrigin = 'top left';
  900. _this.positionBoard();
  901. _this.defs = index_1.SvgHelper.createDefs();
  902. _this.boardCanvas.appendChild(_this.defs);
  903. _this.boardHolder.appendChild(_this.boardCanvas);
  904. };
  905. this.positionBoard = function () {
  906. _this.boardHolder.style.top = _this.targetRect.top + 'px';
  907. _this.boardHolder.style.left = _this.targetRect.left + 'px';
  908. };
  909. this.source = source;
  910. if (source.imgEle) {
  911. this.target = source.imgEle;
  912. this.width = this.target.clientWidth;
  913. this.height = this.target.clientHeight;
  914. }
  915. }
  916. return Baseboard;
  917. }();
  918. exports.Baseboard = Baseboard;
  919. /***/ }),
  920. /***/ "./src/board/Drawboard/index.less":
  921. /*!****************************************!*\
  922. !*** ./src/board/Drawboard/index.less ***!
  923. \****************************************/
  924. /*! no static exports found */
  925. /***/ (function(module, exports, __webpack_require__) {
  926. var content = __webpack_require__(/*! !../../../node_modules/css-loader/dist/cjs.js??ref--11-1!../../../node_modules/postcss-loader/src!../../../node_modules/less-loader/dist/cjs.js??ref--11-3!./index.less */ "./node_modules/css-loader/dist/cjs.js?!./node_modules/postcss-loader/src/index.js!./node_modules/less-loader/dist/cjs.js?!./src/board/Drawboard/index.less");
  927. if(typeof content === 'string') content = [[module.i, content, '']];
  928. var transform;
  929. var insertInto;
  930. var options = {"hmr":true}
  931. options.transform = transform
  932. options.insertInto = undefined;
  933. var update = __webpack_require__(/*! ../../../node_modules/style-loader/lib/addStyles.js */ "./node_modules/style-loader/lib/addStyles.js")(content, options);
  934. if(content.locals) module.exports = content.locals;
  935. if(false) {}
  936. /***/ }),
  937. /***/ "./src/board/Drawboard/index.ts":
  938. /*!**************************************!*\
  939. !*** ./src/board/Drawboard/index.ts ***!
  940. \**************************************/
  941. /*! no static exports found */
  942. /***/ (function(module, exports, __webpack_require__) {
  943. "use strict";
  944. var __extends = this && this.__extends || function () {
  945. var extendStatics = function (d, b) {
  946. extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (d, b) {
  947. d.__proto__ = b;
  948. } || function (d, b) {
  949. for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
  950. };
  951. return extendStatics(d, b);
  952. };
  953. return function (d, b) {
  954. extendStatics(d, b);
  955. function __() {
  956. this.constructor = d;
  957. }
  958. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  959. };
  960. }();
  961. Object.defineProperty(exports, "__esModule", { value: true });
  962. var index_1 = __webpack_require__(/*! ./../Baseboard/index */ "./src/board/Baseboard/index.ts");
  963. var toolbar_items_1 = __webpack_require__(/*! ./../../toolbar/toolbar-items */ "./src/toolbar/toolbar-items.ts");
  964. var Synthetizer_1 = __webpack_require__(/*! ../../renderer/Synthetizer */ "./src/renderer/Synthetizer/index.ts");
  965. var Toolbar_1 = __webpack_require__(/*! ../../toolbar/Toolbar */ "./src/toolbar/Toolbar.ts");
  966. __webpack_require__(/*! ./index.less */ "./src/board/Drawboard/index.less");
  967. var Drawboard = function (_super) {
  968. __extends(Drawboard, _super);
  969. function Drawboard(source, _a) {
  970. var _b = _a === void 0 ? {} : _a,
  971. page = _b.page,
  972. onChange = _b.onChange;
  973. var _this = _super.call(this, source) || this;
  974. _this.scale = 1.0;
  975. _this.onComplete = function () {};
  976. _this.onChange = function () {};
  977. _this.open = function (onComplete, onCancel) {
  978. if (onComplete) {
  979. _this.onComplete = onComplete;
  980. }
  981. if (onCancel) {
  982. _this.onCancel = onCancel;
  983. }
  984. _this.setTargetRect();
  985. _this.initBoard();
  986. _this.attachEvents();
  987. _this.setStyles();
  988. window.addEventListener('resize', _this.adjustUI);
  989. if (_this.page.mode === 'master') {
  990. _this.showUI();
  991. }
  992. };
  993. _this.hide = function () {
  994. if (_this.source.imgSrc) {
  995. _this.target.style.display = 'none';
  996. }
  997. _this.boardHolder.style.visibility = 'hidden';
  998. _this.boardHolder.style.zIndex = '-1';
  999. if (_this.toolbar) {
  1000. _this.toolbar.hide();
  1001. }
  1002. };
  1003. _this.show = function () {
  1004. if (_this.source.imgSrc) {
  1005. _this.target.style.display = 'block';
  1006. }
  1007. _this.boardHolder.style.visibility = 'visible';
  1008. _this.boardHolder.style.zIndex = '9999';
  1009. if (_this.toolbar) {
  1010. _this.toolbar.show();
  1011. }
  1012. };
  1013. _this.close = function () {
  1014. if (_this.toolbarUI) {
  1015. document.body.removeChild(_this.toolbarUI);
  1016. }
  1017. if (_this.boardCanvas) {
  1018. document.body.removeChild(_this.boardHolder);
  1019. }
  1020. };
  1021. _this.render = function (onComplete, onCancel) {
  1022. _this.onComplete = onComplete;
  1023. if (onCancel) {
  1024. _this.onCancel = onCancel;
  1025. }
  1026. _this.selectMarker(null);
  1027. _this.startRender(_this.renderFinished);
  1028. };
  1029. _this.addMarker = function (markerType, _a) {
  1030. var id = (_a === void 0 ? {} : _a).id;
  1031. var marker = markerType.createMarker(_this.page);
  1032. if (id) {
  1033. marker.id = id;
  1034. }
  1035. marker.onSelected = _this.selectMarker;
  1036. marker.onChange = _this.onChange;
  1037. if (marker.defs && marker.defs.length > 0) {
  1038. for (var _i = 0, _b = marker.defs; _i < _b.length; _i++) {
  1039. var d = _b[_i];
  1040. if (d.id && !_this.boardCanvas.getElementById(d.id)) {
  1041. _this.defs.appendChild(d);
  1042. }
  1043. }
  1044. }
  1045. _this.onChange({
  1046. target: 'marker',
  1047. parentId: _this.page ? _this.page.id : _this.id,
  1048. event: 'add',
  1049. data: { type: marker.type, id: marker.id }
  1050. });
  1051. _this.markers.push(marker);
  1052. _this.selectMarker(marker);
  1053. _this.boardCanvas.appendChild(marker.visual);
  1054. var bbox = marker.visual.getBBox();
  1055. var x = _this.width / 2 / _this.scale - bbox.width / 2;
  1056. var y = _this.height / 2 / _this.scale - bbox.height / 2;
  1057. var translate = marker.visual.transform.baseVal.getItem(0);
  1058. translate.setMatrix(translate.matrix.translate(x, y));
  1059. marker.visual.transform.baseVal.replaceItem(translate, 0);
  1060. };
  1061. _this.deleteActiveMarker = function () {
  1062. if (_this.activeMarker) {
  1063. if (_this.onChange) {
  1064. _this.onChange({
  1065. event: 'remove',
  1066. id: _this.activeMarker.id,
  1067. target: 'marker',
  1068. data: { id: _this.activeMarker.id }
  1069. });
  1070. }
  1071. _this.deleteMarker(_this.activeMarker);
  1072. }
  1073. };
  1074. _this.setTargetRect = function () {
  1075. var targetRect = _this.target.getBoundingClientRect();
  1076. var bodyRect = document.body.parentElement.getBoundingClientRect();
  1077. _this.targetRect = {
  1078. left: targetRect.left - bodyRect.left,
  1079. top: targetRect.top - bodyRect.top
  1080. };
  1081. };
  1082. _this.startRender = function (done) {
  1083. var renderer = new Synthetizer_1.Synthetizer();
  1084. renderer.rasterize(_this.target, _this.boardCanvas, done);
  1085. };
  1086. _this.attachEvents = function () {
  1087. _this.boardCanvas.addEventListener('mousedown', _this.mouseDown);
  1088. _this.boardCanvas.addEventListener('mousemove', _this.mouseMove);
  1089. _this.boardCanvas.addEventListener('mouseup', _this.mouseUp);
  1090. };
  1091. _this.mouseDown = function (ev) {
  1092. if (_this.activeMarker && (ev.buttons & 1) > 0) {
  1093. _this.activeMarker.deselect();
  1094. _this.activeMarker = null;
  1095. }
  1096. };
  1097. _this.mouseMove = function (ev) {
  1098. if (_this.activeMarker && (ev.buttons & 1) > 0) {
  1099. _this.activeMarker.manipulate(ev);
  1100. }
  1101. };
  1102. _this.mouseUp = function (ev) {
  1103. if (_this.activeMarker) {
  1104. _this.activeMarker.endManipulation();
  1105. }
  1106. };
  1107. _this.adjustUI = function (ev) {
  1108. _this.adjustSize();
  1109. _this.positionUI();
  1110. };
  1111. _this.adjustSize = function () {
  1112. _this.width = _this.target.clientWidth;
  1113. _this.height = _this.target.clientHeight;
  1114. var scale = _this.target.clientWidth / _this.boardHolder.clientWidth;
  1115. if (scale !== 1.0) {
  1116. _this.scale *= scale;
  1117. _this.boardHolder.style.width = _this.width + "px";
  1118. _this.boardHolder.style.height = _this.height + "px";
  1119. _this.boardHolder.style.transform = "scale(" + _this.scale + ")";
  1120. }
  1121. };
  1122. _this.positionUI = function () {
  1123. _this.setTargetRect();
  1124. _this.positionBoard();
  1125. _this.positionToolbar();
  1126. };
  1127. _this.positionToolbar = function () {
  1128. _this.toolbarUI.style.left = _this.targetRect.left + _this.target.offsetWidth - _this.toolbarUI.clientWidth + "px";
  1129. _this.toolbarUI.style.top = _this.targetRect.top - _this.toolbarUI.clientHeight + "px";
  1130. };
  1131. _this.showUI = function () {
  1132. _this.toolbar = new Toolbar_1.Toolbar(_this.toolbars, _this.toolbarClick);
  1133. _this.toolbarUI = _this.toolbar.getUI();
  1134. document.body.appendChild(_this.toolbarUI);
  1135. _this.toolbarUI.style.position = 'absolute';
  1136. _this.positionToolbar();
  1137. };
  1138. _this.setStyles = function () {
  1139. var editorStyleSheet = document.createElementNS('http://www.w3.org/2000/svg', 'style');
  1140. editorStyleSheet.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 ";
  1141. _this.boardCanvas.appendChild(editorStyleSheet);
  1142. };
  1143. _this.toolbarClick = function (ev, toolbarItem) {
  1144. if (toolbarItem.markerType) {
  1145. _this.addMarker(toolbarItem.markerType);
  1146. } else {
  1147. switch (toolbarItem.name) {
  1148. case 'delete':
  1149. {
  1150. _this.deleteActiveMarker();
  1151. break;
  1152. }
  1153. case 'pointer':
  1154. {
  1155. if (_this.activeMarker) {
  1156. _this.selectMarker(null);
  1157. }
  1158. break;
  1159. }
  1160. case 'close':
  1161. {
  1162. _this.cancel();
  1163. break;
  1164. }
  1165. case 'ok':
  1166. {
  1167. _this.complete();
  1168. break;
  1169. }
  1170. default:
  1171. break;
  1172. }
  1173. }
  1174. };
  1175. _this.selectMarker = function (marker) {
  1176. if (_this.activeMarker && _this.activeMarker !== marker) {
  1177. _this.activeMarker.deselect();
  1178. }
  1179. _this.activeMarker = marker;
  1180. };
  1181. _this.deleteMarker = function (marker) {
  1182. _this.boardCanvas.removeChild(marker.visual);
  1183. if (_this.activeMarker === marker) {
  1184. _this.activeMarker = null;
  1185. }
  1186. _this.markers.splice(_this.markers.indexOf(marker), 1);
  1187. };
  1188. _this.complete = function () {
  1189. _this.selectMarker(null);
  1190. _this.startRender(_this.renderFinishedClose);
  1191. };
  1192. _this.cancel = function () {
  1193. _this.close();
  1194. if (_this.onCancel) {
  1195. _this.onCancel();
  1196. }
  1197. };
  1198. _this.renderFinished = function (dataUrl) {
  1199. _this.onComplete(dataUrl);
  1200. };
  1201. _this.renderFinishedClose = function (dataUrl) {
  1202. _this.close();
  1203. _this.onComplete(dataUrl);
  1204. };
  1205. if (page) {
  1206. _this.page = page;
  1207. }
  1208. _this.markers = [];
  1209. _this.activeMarker = null;
  1210. _this.toolbars = toolbar_items_1.getToolbars(page);
  1211. if (onChange) {
  1212. _this.onChange = onChange;
  1213. }
  1214. return _this;
  1215. }
  1216. Object.defineProperty(Drawboard.prototype, "markerMap", {
  1217. get: function () {
  1218. var map = {};
  1219. this.markers.forEach(function (marker) {
  1220. map[marker.id] = marker;
  1221. });
  1222. return map;
  1223. },
  1224. enumerable: true,
  1225. configurable: true
  1226. });
  1227. return Drawboard;
  1228. }(index_1.Baseboard);
  1229. exports.Drawboard = Drawboard;
  1230. /***/ }),
  1231. /***/ "./src/board/WhitePage/index.less":
  1232. /*!****************************************!*\
  1233. !*** ./src/board/WhitePage/index.less ***!
  1234. \****************************************/
  1235. /*! no static exports found */
  1236. /***/ (function(module, exports, __webpack_require__) {
  1237. var content = __webpack_require__(/*! !../../../node_modules/css-loader/dist/cjs.js??ref--11-1!../../../node_modules/postcss-loader/src!../../../node_modules/less-loader/dist/cjs.js??ref--11-3!./index.less */ "./node_modules/css-loader/dist/cjs.js?!./node_modules/postcss-loader/src/index.js!./node_modules/less-loader/dist/cjs.js?!./src/board/WhitePage/index.less");
  1238. if(typeof content === 'string') content = [[module.i, content, '']];
  1239. var transform;
  1240. var insertInto;
  1241. var options = {"hmr":true}
  1242. options.transform = transform
  1243. options.insertInto = undefined;
  1244. var update = __webpack_require__(/*! ../../../node_modules/style-loader/lib/addStyles.js */ "./node_modules/style-loader/lib/addStyles.js")(content, options);
  1245. if(content.locals) module.exports = content.locals;
  1246. if(false) {}
  1247. /***/ }),
  1248. /***/ "./src/board/WhitePage/index.ts":
  1249. /*!**************************************!*\
  1250. !*** ./src/board/WhitePage/index.ts ***!
  1251. \**************************************/
  1252. /*! no static exports found */
  1253. /***/ (function(module, exports, __webpack_require__) {
  1254. "use strict";
  1255. Object.defineProperty(exports, "__esModule", { value: true });
  1256. var index_1 = __webpack_require__(/*! ./../Drawboard/index */ "./src/board/Drawboard/index.ts");
  1257. var uuid_1 = __webpack_require__(/*! ./../../utils/uuid */ "./src/utils/uuid.ts");
  1258. var types_1 = __webpack_require__(/*! ../../markers/types */ "./src/markers/types.ts");
  1259. __webpack_require__(/*! ./index.less */ "./src/board/WhitePage/index.less");
  1260. var dom_1 = __webpack_require__(/*! ../../utils/dom */ "./src/utils/dom.ts");
  1261. var prefix = 'fcw-page';
  1262. var WhitePage = function () {
  1263. function WhitePage(source, _a) {
  1264. var _b = _a === void 0 ? {} : _a,
  1265. mode = _b.mode,
  1266. eventHub = _b.eventHub,
  1267. parentContainer = _b.parentContainer;
  1268. this.id = uuid_1.uuid();
  1269. this.mode = 'master';
  1270. if (mode) {
  1271. this.mode = mode;
  1272. }
  1273. this.eventHub = eventHub;
  1274. this.parentContainer = parentContainer;
  1275. this.initSource(source);
  1276. if (this.mode === 'master') {
  1277. this.initMaster();
  1278. }
  1279. if (this.mode === 'mirror') {
  1280. this.initMirror();
  1281. }
  1282. }
  1283. WhitePage.prototype.open = function () {
  1284. this.drawboard.open();
  1285. };
  1286. WhitePage.prototype.hide = function () {
  1287. this.drawboard.hide();
  1288. };
  1289. WhitePage.prototype.show = function () {
  1290. this.drawboard.show();
  1291. };
  1292. WhitePage.prototype.close = function () {
  1293. this.drawboard.close();
  1294. };
  1295. WhitePage.prototype.initSource = function (source) {
  1296. if (typeof source.imgSrc === 'string' && !this.parentContainer) {
  1297. throw new Error('Invalid source, If you set image url, you must also set parentContainer');
  1298. }
  1299. this.source = source;
  1300. if (source.imgEle) {
  1301. this.target = source.imgEle;
  1302. }
  1303. if (typeof source.imgSrc === 'string') {
  1304. this.container = dom_1.createDivWithClassName(prefix, this.parentContainer);
  1305. this.container.id = this.id;
  1306. this.target = document.createElement('img');
  1307. this.target.src = source.imgSrc;
  1308. this.target.alt = 'Siema image';
  1309. this.container.appendChild(this.target);
  1310. }
  1311. };
  1312. WhitePage.prototype.initMaster = function () {
  1313. var _this = this;
  1314. if (this.eventHub) {
  1315. this.drawboard = new index_1.Drawboard({ imgEle: this.target }, {
  1316. page: this,
  1317. onChange: function (ev) {
  1318. return _this.eventHub.emit('sync', ev);
  1319. }
  1320. });
  1321. } else {
  1322. this.drawboard = new index_1.Drawboard({ imgEle: this.target }, { page: this });
  1323. }
  1324. };
  1325. WhitePage.prototype.initMirror = function () {
  1326. var _this = this;
  1327. if (!this.eventHub) {
  1328. throw new Error('Invalid eventHub');
  1329. }
  1330. this.drawboard = new index_1.Drawboard({ imgEle: this.target }, { page: this });
  1331. this.eventHub.on('sync', function (ev) {
  1332. try {
  1333. if (ev.target === 'page' && ev.id === _this.id) {
  1334. _this.onPageSync();
  1335. }
  1336. if (ev.target === 'marker') {
  1337. _this.onMarkerSync(ev);
  1338. }
  1339. } catch (e) {
  1340. console.warn(e);
  1341. }
  1342. });
  1343. };
  1344. WhitePage.prototype.onPageSync = function () {};
  1345. WhitePage.prototype.onMarkerSync = function (ev) {
  1346. if (ev.event === 'add' && ev.parentId === this.id) {
  1347. var data = ev.data;
  1348. var marker = this.drawboard.markerMap[data.id];
  1349. if (!marker) {
  1350. this.drawboard.addMarker(types_1.getMarkerByType(data.type), { id: data.id });
  1351. }
  1352. }
  1353. if (!ev.id) {
  1354. return;
  1355. }
  1356. if (ev.event === 'remove') {
  1357. var data = ev.data;
  1358. var marker = this.drawboard.markerMap[data.id];
  1359. if (marker) {
  1360. this.drawboard.deleteMarker(marker);
  1361. }
  1362. }
  1363. if (ev.event === 'move' || ev.event === 'resize') {
  1364. var marker = this.drawboard.markerMap[ev.id];
  1365. if (marker) {
  1366. marker.reactToManipulation(ev.event, ev.data);
  1367. }
  1368. }
  1369. if (ev.event === 'changeText') {
  1370. var marker = this.drawboard.markerMap[ev.id];
  1371. if (marker) {
  1372. marker.setText(ev.data);
  1373. }
  1374. }
  1375. };
  1376. return WhitePage;
  1377. }();
  1378. exports.WhitePage = WhitePage;
  1379. /***/ }),
  1380. /***/ "./src/board/Whiteboard/index.less":
  1381. /*!*****************************************!*\
  1382. !*** ./src/board/Whiteboard/index.less ***!
  1383. \*****************************************/
  1384. /*! no static exports found */
  1385. /***/ (function(module, exports, __webpack_require__) {
  1386. var content = __webpack_require__(/*! !../../../node_modules/css-loader/dist/cjs.js??ref--11-1!../../../node_modules/postcss-loader/src!../../../node_modules/less-loader/dist/cjs.js??ref--11-3!./index.less */ "./node_modules/css-loader/dist/cjs.js?!./node_modules/postcss-loader/src/index.js!./node_modules/less-loader/dist/cjs.js?!./src/board/Whiteboard/index.less");
  1387. if(typeof content === 'string') content = [[module.i, content, '']];
  1388. var transform;
  1389. var insertInto;
  1390. var options = {"hmr":true}
  1391. options.transform = transform
  1392. options.insertInto = undefined;
  1393. var update = __webpack_require__(/*! ../../../node_modules/style-loader/lib/addStyles.js */ "./node_modules/style-loader/lib/addStyles.js")(content, options);
  1394. if(content.locals) module.exports = content.locals;
  1395. if(false) {}
  1396. /***/ }),
  1397. /***/ "./src/board/Whiteboard/index.ts":
  1398. /*!***************************************!*\
  1399. !*** ./src/board/Whiteboard/index.ts ***!
  1400. \***************************************/
  1401. /*! no static exports found */
  1402. /***/ (function(module, exports, __webpack_require__) {
  1403. "use strict";
  1404. Object.defineProperty(exports, "__esModule", { value: true });
  1405. var Siema = __webpack_require__(/*! siema */ "./node_modules/siema/dist/siema.min.js");
  1406. var index_1 = __webpack_require__(/*! ../WhitePage/index */ "./src/board/WhitePage/index.ts");
  1407. var uuid_1 = __webpack_require__(/*! ../../utils/uuid */ "./src/utils/uuid.ts");
  1408. var dom_1 = __webpack_require__(/*! ../../utils/dom */ "./src/utils/dom.ts");
  1409. __webpack_require__(/*! ./index.less */ "./src/board/Whiteboard/index.less");
  1410. var LeftArrowIcon = __webpack_require__(/*! ../../assets/bx-left-arrow.svg */ "./src/assets/bx-left-arrow.svg");
  1411. var RightArrowIcon = __webpack_require__(/*! ../../assets/bx-right-arrow.svg */ "./src/assets/bx-right-arrow.svg");
  1412. var prefix = 'fcw-board';
  1413. var SerializableWhiteboard = function () {
  1414. function SerializableWhiteboard() {}
  1415. return SerializableWhiteboard;
  1416. }();
  1417. exports.SerializableWhiteboard = SerializableWhiteboard;
  1418. var Whiteboard = function () {
  1419. function Whiteboard(target, _a) {
  1420. var _b = _a === void 0 ? {} : _a,
  1421. sources = _b.sources,
  1422. eventHub = _b.eventHub,
  1423. mode = _b.mode,
  1424. visiblePageIndex = _b.visiblePageIndex;
  1425. this.id = uuid_1.uuid();
  1426. this.sources = [];
  1427. this.mode = 'master';
  1428. this.isFullscreen = false;
  1429. this.pages = [];
  1430. this.isInitialized = false;
  1431. this.isSyncing = false;
  1432. this.visiblePageIndex = 0;
  1433. if (target) {
  1434. this.target = target;
  1435. } else {
  1436. this.target = document.createElement('div');
  1437. document.body.appendChild(this.target);
  1438. }
  1439. if (!this.target.id) {
  1440. this.target.id = this.id;
  1441. }
  1442. dom_1.addClassName(this.target, prefix);
  1443. if (sources) {
  1444. this.sources = sources;
  1445. }
  1446. this.eventHub = eventHub;
  1447. if (mode) {
  1448. this.mode = mode;
  1449. }
  1450. if (typeof visiblePageIndex !== 'undefined') {
  1451. this.visiblePageIndex = visiblePageIndex;
  1452. }
  1453. this.init();
  1454. }
  1455. Object.defineProperty(Whiteboard.prototype, "activePage", {
  1456. get: function () {
  1457. return this.pages[this.visiblePageIndex];
  1458. },
  1459. enumerable: true,
  1460. configurable: true
  1461. });
  1462. Whiteboard.prototype.open = function () {
  1463. var _this = this;
  1464. this.pages.forEach(function (page, i) {
  1465. page.open();
  1466. if (i !== _this.visiblePageIndex) {
  1467. page.hide();
  1468. }
  1469. });
  1470. };
  1471. Whiteboard.prototype.close = function () {
  1472. if (this.emitInterval) {
  1473. clearInterval(this.emitInterval);
  1474. }
  1475. };
  1476. Whiteboard.prototype.show = function () {
  1477. if (this.activePage) {
  1478. this.activePage.show();
  1479. }
  1480. };
  1481. Whiteboard.prototype.hide = function () {
  1482. if (this.activePage) {
  1483. this.activePage.hide();
  1484. }
  1485. };
  1486. Whiteboard.prototype.snap = function () {
  1487. return {
  1488. id: this.id,
  1489. sources: this.sources,
  1490. pageIds: this.pages.map(function (page) {
  1491. return page.id;
  1492. }),
  1493. visiblePageIndex: this.visiblePageIndex
  1494. };
  1495. };
  1496. Whiteboard.prototype.init = function () {
  1497. this.imgsContainer = dom_1.createDivWithClassName(prefix + "-imgs", this.target);
  1498. this.pagesContainer = dom_1.createDivWithClassName(prefix + "-pages", this.target);
  1499. if (this.mode === 'master') {
  1500. this.initMaster();
  1501. this.emitSnapshot();
  1502. }
  1503. if (this.mode === 'mirror') {
  1504. this.initMirror();
  1505. }
  1506. };
  1507. Whiteboard.prototype.initMaster = function () {
  1508. var _this = this;
  1509. this.sources.forEach(function (source) {
  1510. var page = new index_1.WhitePage({ imgSrc: source }, {
  1511. mode: _this.mode,
  1512. eventHub: _this.eventHub,
  1513. parentContainer: _this.pagesContainer
  1514. });
  1515. page.container.style.visibility = 'hidden';
  1516. _this.pages.push(page);
  1517. });
  1518. this.initSiema();
  1519. var controller = dom_1.createDivWithClassName(prefix + "-controller", this.target);
  1520. var prevEle = dom_1.createDivWithClassName(prefix + "-flip-arrow", controller);
  1521. prevEle.innerHTML = LeftArrowIcon;
  1522. var nextEle = dom_1.createDivWithClassName(prefix + "-flip-arrow", controller);
  1523. nextEle.innerHTML = RightArrowIcon;
  1524. nextEle.addEventListener('click', function () {
  1525. var nextPageIndex = _this.visiblePageIndex + 1 > _this.pages.length - 1 ? 0 : _this.visiblePageIndex + 1;
  1526. _this.onPageChange(nextPageIndex);
  1527. });
  1528. prevEle.addEventListener('click', function () {
  1529. var nextPageIndex = _this.visiblePageIndex - 1 < 0 ? _this.pages.length - 1 : _this.visiblePageIndex - 1;
  1530. _this.onPageChange(nextPageIndex);
  1531. });
  1532. };
  1533. Whiteboard.prototype.initMirror = function () {
  1534. var _this = this;
  1535. if (!this.eventHub) {
  1536. throw new Error('Invalid eventHub');
  1537. }
  1538. this.eventHub.on('sync', function (ev) {
  1539. if (ev.target !== 'whiteboard') {
  1540. return;
  1541. }
  1542. if (ev.event === 'snap') {
  1543. if (_this.isInitialized) {
  1544. return;
  1545. }
  1546. _this.onSnapshot(ev.data);
  1547. }
  1548. if (ev.event === 'changeIndex' && ev.id === _this.id) {
  1549. if (_this.isInitialized) {
  1550. _this.onPageChange(ev.data);
  1551. }
  1552. }
  1553. });
  1554. };
  1555. Whiteboard.prototype.initSiema = function () {
  1556. var _this = this;
  1557. this.sources.forEach(function (source) {
  1558. var imgEle = document.createElement('img');
  1559. dom_1.addClassName(imgEle, prefix + "-img");
  1560. imgEle.src = source;
  1561. imgEle.alt = 'Siema image';
  1562. _this.imgsContainer.appendChild(imgEle);
  1563. });
  1564. this.siema = new Siema({
  1565. selector: this.imgsContainer,
  1566. duration: 200,
  1567. easing: 'ease-out',
  1568. perPage: 1,
  1569. startIndex: 0,
  1570. draggable: false,
  1571. multipleDrag: true,
  1572. threshold: 20,
  1573. loop: false,
  1574. rtl: false
  1575. });
  1576. };
  1577. Whiteboard.prototype.onPageChange = function (nextPageIndex) {
  1578. this.siema.goTo(nextPageIndex);
  1579. this.visiblePageIndex = nextPageIndex;
  1580. this.pages.forEach(function (page, i) {
  1581. if (nextPageIndex === i) {
  1582. page.show();
  1583. } else {
  1584. page.hide();
  1585. }
  1586. });
  1587. if (this.mode === 'master' && this.eventHub) {
  1588. this.eventHub.emit('sync', {
  1589. event: 'changeIndex',
  1590. id: this.id,
  1591. target: 'whiteboard',
  1592. data: nextPageIndex
  1593. });
  1594. }
  1595. };
  1596. Whiteboard.prototype.emitSnapshot = function () {
  1597. var _this = this;
  1598. var innerFunc = function () {
  1599. if (_this.eventHub) {
  1600. _this.eventHub.emit('sync', {
  1601. event: 'snap',
  1602. id: _this.id,
  1603. target: 'whiteboard',
  1604. data: _this.snap()
  1605. });
  1606. }
  1607. };
  1608. this.emitInterval = setInterval(function () {
  1609. innerFunc();
  1610. }, 5 * 1000);
  1611. setTimeout(innerFunc, 500);
  1612. };
  1613. Whiteboard.prototype.onSnapshot = function (snap) {
  1614. var _this = this;
  1615. var id = snap.id,
  1616. sources = snap.sources,
  1617. pageIds = snap.pageIds,
  1618. visiblePageIndex = snap.visiblePageIndex;
  1619. if (!this.isInitialized && !this.isSyncing) {
  1620. this.id = id;
  1621. this.sources = sources;
  1622. this.isSyncing = true;
  1623. this.sources.forEach(function (source, i) {
  1624. var page = new index_1.WhitePage({ imgSrc: source }, {
  1625. mode: _this.mode,
  1626. eventHub: _this.eventHub,
  1627. parentContainer: _this.pagesContainer
  1628. });
  1629. page.id = pageIds[i];
  1630. page.container.style.visibility = 'hidden';
  1631. _this.pages.push(page);
  1632. page.open();
  1633. });
  1634. this.initSiema();
  1635. }
  1636. this.isInitialized = true;
  1637. this.isSyncing = false;
  1638. this.onPageChange(visiblePageIndex);
  1639. };
  1640. return Whiteboard;
  1641. }();
  1642. exports.Whiteboard = Whiteboard;
  1643. /***/ }),
  1644. /***/ "./src/index.ts":
  1645. /*!**********************!*\
  1646. !*** ./src/index.ts ***!
  1647. \**********************/
  1648. /*! no static exports found */
  1649. /***/ (function(module, exports, __webpack_require__) {
  1650. "use strict";
  1651. Object.defineProperty(exports, "__esModule", { value: true });
  1652. var Drawboard_1 = __webpack_require__(/*! ./board/Drawboard */ "./src/board/Drawboard/index.ts");
  1653. exports.Drawboard = Drawboard_1.Drawboard;
  1654. var Whiteboard_1 = __webpack_require__(/*! ./board/Whiteboard */ "./src/board/Whiteboard/index.ts");
  1655. exports.Whiteboard = Whiteboard_1.Whiteboard;
  1656. /***/ }),
  1657. /***/ "./src/markers/ArrowMarker/index.ts":
  1658. /*!******************************************!*\
  1659. !*** ./src/markers/ArrowMarker/index.ts ***!
  1660. \******************************************/
  1661. /*! no static exports found */
  1662. /***/ (function(module, exports, __webpack_require__) {
  1663. "use strict";
  1664. var __extends = this && this.__extends || function () {
  1665. var extendStatics = function (d, b) {
  1666. extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (d, b) {
  1667. d.__proto__ = b;
  1668. } || function (d, b) {
  1669. for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
  1670. };
  1671. return extendStatics(d, b);
  1672. };
  1673. return function (d, b) {
  1674. extendStatics(d, b);
  1675. function __() {
  1676. this.constructor = d;
  1677. }
  1678. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  1679. };
  1680. }();
  1681. Object.defineProperty(exports, "__esModule", { value: true });
  1682. var LinearMarker_1 = __webpack_require__(/*! ../LinearMarker */ "./src/markers/LinearMarker/index.ts");
  1683. var SvgHelper_1 = __webpack_require__(/*! ../../renderer/SvgHelper */ "./src/renderer/SvgHelper/index.ts");
  1684. var ArrowMarker = function (_super) {
  1685. __extends(ArrowMarker, _super);
  1686. function ArrowMarker() {
  1687. var _this = _super !== null && _super.apply(this, arguments) || this;
  1688. _this.type = 'arrow';
  1689. _this.ARROW_SIZE = 6;
  1690. return _this;
  1691. }
  1692. ArrowMarker.prototype.setup = function () {
  1693. _super.prototype.setup.call(this);
  1694. SvgHelper_1.SvgHelper.setAttributes(this.visual, [['class', 'arrow-marker']]);
  1695. var tip = SvgHelper_1.SvgHelper.createPolygon("0,0 " + this.ARROW_SIZE + "," + this.ARROW_SIZE / 2 + " 0," + this.ARROW_SIZE, [['class', 'arrow-marker-tip']]);
  1696. this.defs.push(SvgHelper_1.SvgHelper.createMarker('arrow-marker-head', 'auto', this.ARROW_SIZE, this.ARROW_SIZE, this.ARROW_SIZE - 1, this.ARROW_SIZE / 2, tip));
  1697. this.markerLine.setAttribute('marker-end', 'url(#arrow-marker-head');
  1698. };
  1699. ArrowMarker.createMarker = function (page) {
  1700. var marker = new ArrowMarker();
  1701. marker.page = page;
  1702. marker.setup();
  1703. return marker;
  1704. };
  1705. return ArrowMarker;
  1706. }(LinearMarker_1.LinearMarker);
  1707. exports.ArrowMarker = ArrowMarker;
  1708. /***/ }),
  1709. /***/ "./src/markers/BaseMarker/ResizeGrip.ts":
  1710. /*!**********************************************!*\
  1711. !*** ./src/markers/BaseMarker/ResizeGrip.ts ***!
  1712. \**********************************************/
  1713. /*! no static exports found */
  1714. /***/ (function(module, exports, __webpack_require__) {
  1715. "use strict";
  1716. Object.defineProperty(exports, "__esModule", { value: true });
  1717. var SvgHelper_1 = __webpack_require__(/*! ../../renderer/SvgHelper */ "./src/renderer/SvgHelper/index.ts");
  1718. var ResizeGrip = function () {
  1719. function ResizeGrip() {
  1720. this.GRIP_SIZE = 10;
  1721. this.visual = SvgHelper_1.SvgHelper.createCircle(this.GRIP_SIZE, [['class', 'fc-whiteboard-control-grip']]);
  1722. }
  1723. return ResizeGrip;
  1724. }();
  1725. exports.ResizeGrip = ResizeGrip;
  1726. /***/ }),
  1727. /***/ "./src/markers/BaseMarker/index.ts":
  1728. /*!*****************************************!*\
  1729. !*** ./src/markers/BaseMarker/index.ts ***!
  1730. \*****************************************/
  1731. /*! no static exports found */
  1732. /***/ (function(module, exports, __webpack_require__) {
  1733. "use strict";
  1734. Object.defineProperty(exports, "__esModule", { value: true });
  1735. var uuid = __webpack_require__(/*! uuid/v1 */ "./node_modules/uuid/v1.js");
  1736. var SvgHelper_1 = __webpack_require__(/*! ../../renderer/SvgHelper */ "./src/renderer/SvgHelper/index.ts");
  1737. var BaseMarker = function () {
  1738. function BaseMarker() {
  1739. var _this = this;
  1740. this.id = uuid();
  1741. this.type = 'base';
  1742. this.onChange = function () {};
  1743. this.defs = [];
  1744. this.width = 200;
  1745. this.height = 50;
  1746. this.isActive = true;
  1747. this.isDragging = false;
  1748. this.isResizing = false;
  1749. this.previousMouseX = 0;
  1750. this.previousMouseY = 0;
  1751. this.manipulate = function (ev) {
  1752. var scale = _this.visual.getScreenCTM().a;
  1753. var dx = (ev.screenX - _this.previousMouseX) / scale;
  1754. var dy = (ev.screenY - _this.previousMouseY) / scale;
  1755. if (_this.isDragging) {
  1756. _this.onChange({ target: 'marker', id: _this.id, event: 'move', data: { dx: dx, dy: dy } });
  1757. _this.move(dx, dy);
  1758. }
  1759. if (_this.isResizing) {
  1760. _this.resize(dx, dy, function (pos) {
  1761. _this.onChange({ target: 'marker', id: _this.id, event: 'resize', data: { dx: dx, dy: dy, pos: pos } });
  1762. });
  1763. }
  1764. _this.previousMouseX = ev.screenX;
  1765. _this.previousMouseY = ev.screenY;
  1766. };
  1767. this.addToVisual = function (el) {
  1768. _this.visual.appendChild(el);
  1769. };
  1770. this.addToRenderVisual = function (el) {
  1771. _this.renderVisual.appendChild(el);
  1772. };
  1773. this.mouseDown = function (ev) {
  1774. ev.stopPropagation();
  1775. if (_this.page && _this.page.mode === 'mirror') {
  1776. return;
  1777. }
  1778. _this.select();
  1779. _this.isDragging = true;
  1780. _this.previousMouseX = ev.screenX;
  1781. _this.previousMouseY = ev.screenY;
  1782. };
  1783. this.mouseUp = function (ev) {
  1784. ev.stopPropagation();
  1785. _this.endManipulation();
  1786. };
  1787. this.mouseMove = function (ev) {
  1788. ev.stopPropagation();
  1789. _this.manipulate(ev);
  1790. };
  1791. this.move = function (dx, dy) {
  1792. var translate = _this.visual.transform.baseVal.getItem(0);
  1793. translate.setMatrix(translate.matrix.translate(dx, dy));
  1794. _this.visual.transform.baseVal.replaceItem(translate, 0);
  1795. };
  1796. }
  1797. BaseMarker.prototype.reactToManipulation = function (type, _a) {
  1798. var dx = _a.dx,
  1799. dy = _a.dy,
  1800. pos = _a.pos;
  1801. if (type === 'move') {
  1802. this.move(dx, dy);
  1803. }
  1804. if (type === 'resize') {
  1805. this.resizeByEvent(dx, dy, pos);
  1806. }
  1807. };
  1808. BaseMarker.prototype.endManipulation = function () {
  1809. this.isDragging = false;
  1810. this.isResizing = false;
  1811. };
  1812. BaseMarker.prototype.select = function () {
  1813. this.isActive = true;
  1814. if (this.onSelected) {
  1815. this.onSelected(this);
  1816. }
  1817. return;
  1818. };
  1819. BaseMarker.prototype.deselect = function () {
  1820. this.isActive = false;
  1821. this.endManipulation();
  1822. return;
  1823. };
  1824. BaseMarker.prototype.setup = function () {
  1825. this.visual = SvgHelper_1.SvgHelper.createGroup();
  1826. this.visual.transform.baseVal.appendItem(SvgHelper_1.SvgHelper.createTransform());
  1827. this.visual.addEventListener('mousedown', this.mouseDown);
  1828. this.visual.addEventListener('mouseup', this.mouseUp);
  1829. this.visual.addEventListener('mousemove', this.mouseMove);
  1830. this.visual.addEventListener('touchstart', this.onTouch, { passive: false });
  1831. this.visual.addEventListener('touchend', this.onTouch, { passive: false });
  1832. this.visual.addEventListener('touchmove', this.onTouch, { passive: false });
  1833. this.renderVisual = SvgHelper_1.SvgHelper.createGroup([['class', 'render-visual']]);
  1834. this.visual.appendChild(this.renderVisual);
  1835. };
  1836. BaseMarker.prototype.resize = function (x, y, cb) {
  1837. return;
  1838. };
  1839. BaseMarker.prototype.resizeByEvent = function (x, y, pos) {
  1840. return;
  1841. };
  1842. BaseMarker.prototype.onTouch = function (ev) {
  1843. ev.preventDefault();
  1844. var newEvt = document.createEvent('MouseEvents');
  1845. var touch = ev.changedTouches[0];
  1846. var type = null;
  1847. switch (ev.type) {
  1848. case 'touchstart':
  1849. type = 'mousedown';
  1850. break;
  1851. case 'touchmove':
  1852. type = 'mousemove';
  1853. break;
  1854. case 'touchend':
  1855. type = 'mouseup';
  1856. break;
  1857. default:
  1858. break;
  1859. }
  1860. newEvt.initMouseEvent(type, true, true, window, 0, touch.screenX, touch.screenY, touch.clientX, touch.clientY, ev.ctrlKey, ev.altKey, ev.shiftKey, ev.metaKey, 0, null);
  1861. ev.target.dispatchEvent(newEvt);
  1862. };
  1863. BaseMarker.createMarker = function (page) {
  1864. var marker = new BaseMarker();
  1865. marker.page = page;
  1866. marker.setup();
  1867. return marker;
  1868. };
  1869. return BaseMarker;
  1870. }();
  1871. exports.BaseMarker = BaseMarker;
  1872. /***/ }),
  1873. /***/ "./src/markers/CoverMarker/index.ts":
  1874. /*!******************************************!*\
  1875. !*** ./src/markers/CoverMarker/index.ts ***!
  1876. \******************************************/
  1877. /*! no static exports found */
  1878. /***/ (function(module, exports, __webpack_require__) {
  1879. "use strict";
  1880. var __extends = this && this.__extends || function () {
  1881. var extendStatics = function (d, b) {
  1882. extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (d, b) {
  1883. d.__proto__ = b;
  1884. } || function (d, b) {
  1885. for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
  1886. };
  1887. return extendStatics(d, b);
  1888. };
  1889. return function (d, b) {
  1890. extendStatics(d, b);
  1891. function __() {
  1892. this.constructor = d;
  1893. }
  1894. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  1895. };
  1896. }();
  1897. Object.defineProperty(exports, "__esModule", { value: true });
  1898. var SvgHelper_1 = __webpack_require__(/*! ../../renderer/SvgHelper */ "./src/renderer/SvgHelper/index.ts");
  1899. var RectBaseMarker_1 = __webpack_require__(/*! ../RectMarker/RectBaseMarker */ "./src/markers/RectMarker/RectBaseMarker.ts");
  1900. var CoverMarker = function (_super) {
  1901. __extends(CoverMarker, _super);
  1902. function CoverMarker() {
  1903. var _this = _super !== null && _super.apply(this, arguments) || this;
  1904. _this.type = 'cover';
  1905. return _this;
  1906. }
  1907. CoverMarker.prototype.setup = function () {
  1908. _super.prototype.setup.call(this);
  1909. SvgHelper_1.SvgHelper.setAttributes(this.visual, [['class', 'cover-marker']]);
  1910. };
  1911. CoverMarker.createMarker = function (page) {
  1912. var marker = new CoverMarker();
  1913. marker.page = page;
  1914. marker.setup();
  1915. return marker;
  1916. };
  1917. return CoverMarker;
  1918. }(RectBaseMarker_1.RectBaseMarker);
  1919. exports.CoverMarker = CoverMarker;
  1920. /***/ }),
  1921. /***/ "./src/markers/HighlightMarker/index.ts":
  1922. /*!**********************************************!*\
  1923. !*** ./src/markers/HighlightMarker/index.ts ***!
  1924. \**********************************************/
  1925. /*! no static exports found */
  1926. /***/ (function(module, exports, __webpack_require__) {
  1927. "use strict";
  1928. var __extends = this && this.__extends || function () {
  1929. var extendStatics = function (d, b) {
  1930. extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (d, b) {
  1931. d.__proto__ = b;
  1932. } || function (d, b) {
  1933. for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
  1934. };
  1935. return extendStatics(d, b);
  1936. };
  1937. return function (d, b) {
  1938. extendStatics(d, b);
  1939. function __() {
  1940. this.constructor = d;
  1941. }
  1942. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  1943. };
  1944. }();
  1945. Object.defineProperty(exports, "__esModule", { value: true });
  1946. var SvgHelper_1 = __webpack_require__(/*! ../../renderer/SvgHelper */ "./src/renderer/SvgHelper/index.ts");
  1947. var RectBaseMarker_1 = __webpack_require__(/*! ../RectMarker/RectBaseMarker */ "./src/markers/RectMarker/RectBaseMarker.ts");
  1948. var HighlightMarker = function (_super) {
  1949. __extends(HighlightMarker, _super);
  1950. function HighlightMarker() {
  1951. var _this = _super !== null && _super.apply(this, arguments) || this;
  1952. _this.type = 'highlight';
  1953. return _this;
  1954. }
  1955. HighlightMarker.prototype.setup = function () {
  1956. _super.prototype.setup.call(this);
  1957. SvgHelper_1.SvgHelper.setAttributes(this.visual, [['class', 'highlight-marker']]);
  1958. };
  1959. HighlightMarker.createMarker = function (page) {
  1960. var marker = new HighlightMarker();
  1961. marker.page = page;
  1962. marker.setup();
  1963. return marker;
  1964. };
  1965. return HighlightMarker;
  1966. }(RectBaseMarker_1.RectBaseMarker);
  1967. exports.HighlightMarker = HighlightMarker;
  1968. /***/ }),
  1969. /***/ "./src/markers/LineMarker/index.ts":
  1970. /*!*****************************************!*\
  1971. !*** ./src/markers/LineMarker/index.ts ***!
  1972. \*****************************************/
  1973. /*! no static exports found */
  1974. /***/ (function(module, exports, __webpack_require__) {
  1975. "use strict";
  1976. var __extends = this && this.__extends || function () {
  1977. var extendStatics = function (d, b) {
  1978. extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (d, b) {
  1979. d.__proto__ = b;
  1980. } || function (d, b) {
  1981. for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
  1982. };
  1983. return extendStatics(d, b);
  1984. };
  1985. return function (d, b) {
  1986. extendStatics(d, b);
  1987. function __() {
  1988. this.constructor = d;
  1989. }
  1990. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  1991. };
  1992. }();
  1993. Object.defineProperty(exports, "__esModule", { value: true });
  1994. var LinearMarker_1 = __webpack_require__(/*! ../LinearMarker */ "./src/markers/LinearMarker/index.ts");
  1995. var index_1 = __webpack_require__(/*! ./../../renderer/SvgHelper/index */ "./src/renderer/SvgHelper/index.ts");
  1996. var LineMarker = function (_super) {
  1997. __extends(LineMarker, _super);
  1998. function LineMarker() {
  1999. var _this = _super !== null && _super.apply(this, arguments) || this;
  2000. _this.type = 'line';
  2001. return _this;
  2002. }
  2003. LineMarker.prototype.setup = function () {
  2004. _super.prototype.setup.call(this);
  2005. index_1.SvgHelper.setAttributes(this.visual, [['class', 'line-marker']]);
  2006. };
  2007. LineMarker.createMarker = function (page) {
  2008. var marker = new LineMarker();
  2009. marker.page = page;
  2010. marker.setup();
  2011. return marker;
  2012. };
  2013. return LineMarker;
  2014. }(LinearMarker_1.LinearMarker);
  2015. exports.LineMarker = LineMarker;
  2016. /***/ }),
  2017. /***/ "./src/markers/LinearMarker/index.ts":
  2018. /*!*******************************************!*\
  2019. !*** ./src/markers/LinearMarker/index.ts ***!
  2020. \*******************************************/
  2021. /*! no static exports found */
  2022. /***/ (function(module, exports, __webpack_require__) {
  2023. "use strict";
  2024. var __extends = this && this.__extends || function () {
  2025. var extendStatics = function (d, b) {
  2026. extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (d, b) {
  2027. d.__proto__ = b;
  2028. } || function (d, b) {
  2029. for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
  2030. };
  2031. return extendStatics(d, b);
  2032. };
  2033. return function (d, b) {
  2034. extendStatics(d, b);
  2035. function __() {
  2036. this.constructor = d;
  2037. }
  2038. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  2039. };
  2040. }();
  2041. Object.defineProperty(exports, "__esModule", { value: true });
  2042. var BaseMarker_1 = __webpack_require__(/*! ../BaseMarker */ "./src/markers/BaseMarker/index.ts");
  2043. var ResizeGrip_1 = __webpack_require__(/*! ../BaseMarker/ResizeGrip */ "./src/markers/BaseMarker/ResizeGrip.ts");
  2044. var SvgHelper_1 = __webpack_require__(/*! ../../renderer/SvgHelper */ "./src/renderer/SvgHelper/index.ts");
  2045. var LinearMarker = function (_super) {
  2046. __extends(LinearMarker, _super);
  2047. function LinearMarker() {
  2048. var _this = _super !== null && _super.apply(this, arguments) || this;
  2049. _this.MIN_LENGTH = 20;
  2050. _this.x1 = 0;
  2051. _this.y1 = 0;
  2052. _this.x2 = _this.width;
  2053. _this.y2 = 0;
  2054. _this.getLineLength = function (x1, y1, x2, y2) {
  2055. var dx = Math.abs(x1 - x2);
  2056. var dy = Math.abs(y1 - y2);
  2057. return Math.sqrt(Math.pow(dx, 2) + Math.pow(dy, 2));
  2058. };
  2059. _this.addControlBox = function () {
  2060. _this.controlBox = SvgHelper_1.SvgHelper.createGroup([['class', 'fc-whiteboard-line-control-box']]);
  2061. _this.addToVisual(_this.controlBox);
  2062. _this.addControlGrips();
  2063. };
  2064. _this.adjustControlBox = function () {
  2065. _this.positionGrips();
  2066. };
  2067. _this.addControlGrips = function () {
  2068. _this.controlGrips = {
  2069. left: _this.createGrip(),
  2070. right: _this.createGrip()
  2071. };
  2072. _this.positionGrips();
  2073. };
  2074. _this.createGrip = function () {
  2075. var grip = new ResizeGrip_1.ResizeGrip();
  2076. grip.visual.transform.baseVal.appendItem(SvgHelper_1.SvgHelper.createTransform());
  2077. _this.controlBox.appendChild(grip.visual);
  2078. grip.visual.addEventListener('mousedown', _this.gripMouseDown);
  2079. grip.visual.addEventListener('mousemove', _this.gripMouseMove);
  2080. grip.visual.addEventListener('mouseup', _this.gripMouseUp);
  2081. grip.visual.addEventListener('touchstart', _this.onTouch, { passive: false });
  2082. grip.visual.addEventListener('touchend', _this.onTouch, { passive: false });
  2083. grip.visual.addEventListener('touchmove', _this.onTouch, { passive: false });
  2084. return grip;
  2085. };
  2086. _this.positionGrips = function () {
  2087. var gripSize = _this.controlGrips.left.GRIP_SIZE;
  2088. var x1 = _this.x1 - gripSize / 2;
  2089. var y1 = _this.y1 - gripSize / 2;
  2090. var x2 = _this.x2 - gripSize / 2;
  2091. var y2 = _this.y2 - gripSize / 2;
  2092. _this.positionGrip(_this.controlGrips.left.visual, x1, y1);
  2093. _this.positionGrip(_this.controlGrips.right.visual, x2, y2);
  2094. };
  2095. _this.positionGrip = function (grip, x, y) {
  2096. var translate = grip.transform.baseVal.getItem(0);
  2097. translate.setTranslate(x, y);
  2098. grip.transform.baseVal.replaceItem(translate, 0);
  2099. };
  2100. _this.gripMouseDown = function (ev) {
  2101. _this.isResizing = true;
  2102. _this.activeGrip = ev.target === _this.controlGrips.left.visual ? _this.controlGrips.left : _this.controlGrips.right;
  2103. _this.previousMouseX = ev.screenX;
  2104. _this.previousMouseY = ev.screenY;
  2105. ev.stopPropagation();
  2106. };
  2107. _this.gripMouseUp = function (ev) {
  2108. _this.isResizing = false;
  2109. _this.activeGrip = null;
  2110. ev.stopPropagation();
  2111. };
  2112. _this.gripMouseMove = function (ev) {
  2113. if (_this.isResizing) {
  2114. _this.resize(ev.movementX, ev.movementY);
  2115. }
  2116. };
  2117. return _this;
  2118. }
  2119. LinearMarker.prototype.endManipulation = function () {
  2120. _super.prototype.endManipulation.call(this);
  2121. this.isResizing = false;
  2122. this.activeGrip = null;
  2123. };
  2124. LinearMarker.prototype.select = function () {
  2125. _super.prototype.select.call(this);
  2126. this.controlBox.style.display = '';
  2127. };
  2128. LinearMarker.prototype.deselect = function () {
  2129. _super.prototype.deselect.call(this);
  2130. this.controlBox.style.display = 'none';
  2131. };
  2132. LinearMarker.prototype.setup = function () {
  2133. _super.prototype.setup.call(this);
  2134. this.markerBgLine = SvgHelper_1.SvgHelper.createLine(0, 0, this.x2, 0, [['stroke', 'transparent'], ['stroke-width', '30']]);
  2135. this.addToRenderVisual(this.markerBgLine);
  2136. this.markerLine = SvgHelper_1.SvgHelper.createLine(0, 0, this.x2, 0);
  2137. this.addToRenderVisual(this.markerLine);
  2138. this.addControlBox();
  2139. if (this.page && this.page.mode === 'mirror') {
  2140. this.controlBox.style.display = 'none';
  2141. }
  2142. };
  2143. LinearMarker.prototype.resize = function (x, y, onPosition) {
  2144. if (this.activeGrip) {
  2145. if (this.activeGrip === this.controlGrips.left && this.getLineLength(this.x1 + x, this.y1 + 1, this.x2, this.y2) >= this.MIN_LENGTH) {
  2146. this.x1 += x;
  2147. this.y1 += y;
  2148. this.markerBgLine.setAttribute('x1', this.x1.toString());
  2149. this.markerBgLine.setAttribute('y1', this.y1.toString());
  2150. this.markerLine.setAttribute('x1', this.x1.toString());
  2151. this.markerLine.setAttribute('y1', this.y1.toString());
  2152. if (onPosition) {
  2153. onPosition('left');
  2154. }
  2155. } else if (this.activeGrip === this.controlGrips.right && this.getLineLength(this.x1, this.y1, this.x2 + x, this.y2 + y) >= this.MIN_LENGTH) {
  2156. this.x2 += x;
  2157. this.y2 += y;
  2158. this.markerBgLine.setAttribute('x2', this.x2.toString());
  2159. this.markerBgLine.setAttribute('y2', this.y2.toString());
  2160. this.markerLine.setAttribute('x2', this.x2.toString());
  2161. this.markerLine.setAttribute('y2', this.y2.toString());
  2162. if (onPosition) {
  2163. onPosition('right');
  2164. }
  2165. }
  2166. }
  2167. this.adjustControlBox();
  2168. };
  2169. LinearMarker.prototype.resizeByEvent = function (x, y, pos) {
  2170. if (pos === 'left') {
  2171. this.activeGrip = this.controlGrips.left;
  2172. } else {
  2173. this.activeGrip = this.controlGrips.right;
  2174. }
  2175. this.resize(x, y);
  2176. };
  2177. LinearMarker.createMarker = function (page) {
  2178. var marker = new LinearMarker();
  2179. marker.page = page;
  2180. marker.setup();
  2181. return marker;
  2182. };
  2183. return LinearMarker;
  2184. }(BaseMarker_1.BaseMarker);
  2185. exports.LinearMarker = LinearMarker;
  2186. /***/ }),
  2187. /***/ "./src/markers/RectMarker/RectBaseMarker.ts":
  2188. /*!**************************************************!*\
  2189. !*** ./src/markers/RectMarker/RectBaseMarker.ts ***!
  2190. \**************************************************/
  2191. /*! no static exports found */
  2192. /***/ (function(module, exports, __webpack_require__) {
  2193. "use strict";
  2194. var __extends = this && this.__extends || function () {
  2195. var extendStatics = function (d, b) {
  2196. extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (d, b) {
  2197. d.__proto__ = b;
  2198. } || function (d, b) {
  2199. for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
  2200. };
  2201. return extendStatics(d, b);
  2202. };
  2203. return function (d, b) {
  2204. extendStatics(d, b);
  2205. function __() {
  2206. this.constructor = d;
  2207. }
  2208. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  2209. };
  2210. }();
  2211. Object.defineProperty(exports, "__esModule", { value: true });
  2212. var SvgHelper_1 = __webpack_require__(/*! ../../renderer/SvgHelper */ "./src/renderer/SvgHelper/index.ts");
  2213. var RectangularMarker_1 = __webpack_require__(/*! ../RectangularMarker */ "./src/markers/RectangularMarker/index.ts");
  2214. var RectBaseMarker = function (_super) {
  2215. __extends(RectBaseMarker, _super);
  2216. function RectBaseMarker() {
  2217. return _super !== null && _super.apply(this, arguments) || this;
  2218. }
  2219. RectBaseMarker.prototype.setup = function () {
  2220. _super.prototype.setup.call(this);
  2221. this.markerRect = SvgHelper_1.SvgHelper.createRect(this.width, this.height);
  2222. this.addToRenderVisual(this.markerRect);
  2223. };
  2224. RectBaseMarker.prototype.resize = function (x, y, onPosition) {
  2225. _super.prototype.resize.call(this, x, y, onPosition);
  2226. this.markerRect.setAttribute('width', this.width.toString());
  2227. this.markerRect.setAttribute('height', this.height.toString());
  2228. };
  2229. RectBaseMarker.createMarker = function (page) {
  2230. var marker = new RectBaseMarker();
  2231. marker.page = page;
  2232. marker.setup();
  2233. return marker;
  2234. };
  2235. return RectBaseMarker;
  2236. }(RectangularMarker_1.RectangularMarker);
  2237. exports.RectBaseMarker = RectBaseMarker;
  2238. /***/ }),
  2239. /***/ "./src/markers/RectMarker/index.ts":
  2240. /*!*****************************************!*\
  2241. !*** ./src/markers/RectMarker/index.ts ***!
  2242. \*****************************************/
  2243. /*! no static exports found */
  2244. /***/ (function(module, exports, __webpack_require__) {
  2245. "use strict";
  2246. var __extends = this && this.__extends || function () {
  2247. var extendStatics = function (d, b) {
  2248. extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (d, b) {
  2249. d.__proto__ = b;
  2250. } || function (d, b) {
  2251. for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
  2252. };
  2253. return extendStatics(d, b);
  2254. };
  2255. return function (d, b) {
  2256. extendStatics(d, b);
  2257. function __() {
  2258. this.constructor = d;
  2259. }
  2260. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  2261. };
  2262. }();
  2263. Object.defineProperty(exports, "__esModule", { value: true });
  2264. var RectBaseMarker_1 = __webpack_require__(/*! ./RectBaseMarker */ "./src/markers/RectMarker/RectBaseMarker.ts");
  2265. var SvgHelper_1 = __webpack_require__(/*! ../../renderer/SvgHelper */ "./src/renderer/SvgHelper/index.ts");
  2266. var RectMarker = function (_super) {
  2267. __extends(RectMarker, _super);
  2268. function RectMarker() {
  2269. var _this = _super !== null && _super.apply(this, arguments) || this;
  2270. _this.type = 'rect';
  2271. return _this;
  2272. }
  2273. RectMarker.prototype.setup = function () {
  2274. _super.prototype.setup.call(this);
  2275. SvgHelper_1.SvgHelper.setAttributes(this.visual, [['class', 'rect-marker']]);
  2276. };
  2277. RectMarker.createMarker = function (page) {
  2278. var marker = new RectMarker();
  2279. marker.page = page;
  2280. marker.setup();
  2281. return marker;
  2282. };
  2283. return RectMarker;
  2284. }(RectBaseMarker_1.RectBaseMarker);
  2285. exports.RectMarker = RectMarker;
  2286. /***/ }),
  2287. /***/ "./src/markers/RectangularMarker/RectangularMarkerGrips.ts":
  2288. /*!*****************************************************************!*\
  2289. !*** ./src/markers/RectangularMarker/RectangularMarkerGrips.ts ***!
  2290. \*****************************************************************/
  2291. /*! no static exports found */
  2292. /***/ (function(module, exports, __webpack_require__) {
  2293. "use strict";
  2294. Object.defineProperty(exports, "__esModule", { value: true });
  2295. var RectangularMarkerGrips = function () {
  2296. function RectangularMarkerGrips() {
  2297. var _this = this;
  2298. this.findGripByVisual = function (gripVisual) {
  2299. switch (gripVisual) {
  2300. case _this.topLeft.visual:
  2301. return _this.topLeft;
  2302. case _this.topCenter.visual:
  2303. return _this.topCenter;
  2304. case _this.topRight.visual:
  2305. return _this.topRight;
  2306. case _this.centerLeft.visual:
  2307. return _this.centerLeft;
  2308. case _this.centerRight.visual:
  2309. return _this.centerRight;
  2310. case _this.bottomLeft.visual:
  2311. return _this.bottomLeft;
  2312. case _this.bottomCenter.visual:
  2313. return _this.bottomCenter;
  2314. case _this.bottomRight.visual:
  2315. return _this.bottomRight;
  2316. default:
  2317. return _this.topLeft;
  2318. }
  2319. };
  2320. }
  2321. return RectangularMarkerGrips;
  2322. }();
  2323. exports.RectangularMarkerGrips = RectangularMarkerGrips;
  2324. /***/ }),
  2325. /***/ "./src/markers/RectangularMarker/index.ts":
  2326. /*!************************************************!*\
  2327. !*** ./src/markers/RectangularMarker/index.ts ***!
  2328. \************************************************/
  2329. /*! no static exports found */
  2330. /***/ (function(module, exports, __webpack_require__) {
  2331. "use strict";
  2332. var __extends = this && this.__extends || function () {
  2333. var extendStatics = function (d, b) {
  2334. extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (d, b) {
  2335. d.__proto__ = b;
  2336. } || function (d, b) {
  2337. for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
  2338. };
  2339. return extendStatics(d, b);
  2340. };
  2341. return function (d, b) {
  2342. extendStatics(d, b);
  2343. function __() {
  2344. this.constructor = d;
  2345. }
  2346. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  2347. };
  2348. }();
  2349. Object.defineProperty(exports, "__esModule", { value: true });
  2350. var RectangularMarkerGrips_1 = __webpack_require__(/*! ./RectangularMarkerGrips */ "./src/markers/RectangularMarker/RectangularMarkerGrips.ts");
  2351. var BaseMarker_1 = __webpack_require__(/*! ../BaseMarker */ "./src/markers/BaseMarker/index.ts");
  2352. var ResizeGrip_1 = __webpack_require__(/*! ../BaseMarker/ResizeGrip */ "./src/markers/BaseMarker/ResizeGrip.ts");
  2353. var SvgHelper_1 = __webpack_require__(/*! ../../renderer/SvgHelper */ "./src/renderer/SvgHelper/index.ts");
  2354. var RectangularMarker = function (_super) {
  2355. __extends(RectangularMarker, _super);
  2356. function RectangularMarker() {
  2357. var _this = _super !== null && _super.apply(this, arguments) || this;
  2358. _this.MIN_SIZE = 5;
  2359. _this.CB_DISTANCE = 10;
  2360. _this.addControlBox = function () {
  2361. _this.controlBox = SvgHelper_1.SvgHelper.createGroup([['class', 'fc-whiteboard-rect-control-box']]);
  2362. var translate = SvgHelper_1.SvgHelper.createTransform();
  2363. translate.setTranslate(-_this.CB_DISTANCE / 2, -_this.CB_DISTANCE / 2);
  2364. _this.controlBox.transform.baseVal.appendItem(translate);
  2365. _this.addToVisual(_this.controlBox);
  2366. _this.controlRect = SvgHelper_1.SvgHelper.createRect(_this.width + _this.CB_DISTANCE, _this.height + _this.CB_DISTANCE, [['class', 'fc-whiteboard-rect-control-rect']]);
  2367. _this.controlBox.appendChild(_this.controlRect);
  2368. _this.controlGrips = new RectangularMarkerGrips_1.RectangularMarkerGrips();
  2369. _this.addControlGrips();
  2370. };
  2371. _this.adjustControlBox = function () {
  2372. _this.controlRect.setAttribute('width', (_this.width + _this.CB_DISTANCE).toString());
  2373. _this.controlRect.setAttribute('height', (_this.height + _this.CB_DISTANCE).toString());
  2374. _this.positionGrips();
  2375. };
  2376. _this.addControlGrips = function () {
  2377. _this.controlGrips.topLeft = _this.createGrip();
  2378. _this.controlGrips.topCenter = _this.createGrip();
  2379. _this.controlGrips.topRight = _this.createGrip();
  2380. _this.controlGrips.centerLeft = _this.createGrip();
  2381. _this.controlGrips.centerRight = _this.createGrip();
  2382. _this.controlGrips.bottomLeft = _this.createGrip();
  2383. _this.controlGrips.bottomCenter = _this.createGrip();
  2384. _this.controlGrips.bottomRight = _this.createGrip();
  2385. _this.positionGrips();
  2386. };
  2387. _this.createGrip = function () {
  2388. var grip = new ResizeGrip_1.ResizeGrip();
  2389. grip.visual.transform.baseVal.appendItem(SvgHelper_1.SvgHelper.createTransform());
  2390. _this.controlBox.appendChild(grip.visual);
  2391. grip.visual.addEventListener('mousedown', _this.gripMouseDown);
  2392. grip.visual.addEventListener('mousemove', _this.gripMouseMove);
  2393. grip.visual.addEventListener('mouseup', _this.gripMouseUp);
  2394. grip.visual.addEventListener('touchstart', _this.onTouch, { passive: false });
  2395. grip.visual.addEventListener('touchend', _this.onTouch, { passive: false });
  2396. grip.visual.addEventListener('touchmove', _this.onTouch, { passive: false });
  2397. return grip;
  2398. };
  2399. _this.positionGrips = function () {
  2400. var gripSize = _this.controlGrips.topLeft.GRIP_SIZE;
  2401. var left = -gripSize / 2;
  2402. var top = left;
  2403. var cx = (_this.width + _this.CB_DISTANCE) / 2 - gripSize / 2;
  2404. var cy = (_this.height + _this.CB_DISTANCE) / 2 - gripSize / 2;
  2405. var bottom = _this.height + _this.CB_DISTANCE - gripSize / 2;
  2406. var right = _this.width + _this.CB_DISTANCE - gripSize / 2;
  2407. _this.positionGrip(_this.controlGrips.topLeft.visual, left, top);
  2408. _this.positionGrip(_this.controlGrips.topCenter.visual, cx, top);
  2409. _this.positionGrip(_this.controlGrips.topRight.visual, right, top);
  2410. _this.positionGrip(_this.controlGrips.centerLeft.visual, left, cy);
  2411. _this.positionGrip(_this.controlGrips.centerRight.visual, right, cy);
  2412. _this.positionGrip(_this.controlGrips.bottomLeft.visual, left, bottom);
  2413. _this.positionGrip(_this.controlGrips.bottomCenter.visual, cx, bottom);
  2414. _this.positionGrip(_this.controlGrips.bottomRight.visual, right, bottom);
  2415. };
  2416. _this.positionGrip = function (grip, x, y) {
  2417. var translate = grip.transform.baseVal.getItem(0);
  2418. translate.setTranslate(x, y);
  2419. grip.transform.baseVal.replaceItem(translate, 0);
  2420. };
  2421. _this.gripMouseDown = function (ev) {
  2422. _this.isResizing = true;
  2423. _this.activeGrip = _this.controlGrips.findGripByVisual(ev.target) || null;
  2424. _this.previousMouseX = ev.screenX;
  2425. _this.previousMouseY = ev.screenY;
  2426. ev.stopPropagation();
  2427. };
  2428. _this.gripMouseUp = function (ev) {
  2429. _this.isResizing = false;
  2430. _this.activeGrip = null;
  2431. ev.stopPropagation();
  2432. };
  2433. _this.gripMouseMove = function (ev) {
  2434. if (_this.isResizing) {
  2435. _this.manipulate(ev);
  2436. }
  2437. };
  2438. return _this;
  2439. }
  2440. RectangularMarker.prototype.endManipulation = function () {
  2441. _super.prototype.endManipulation.call(this);
  2442. this.isResizing = false;
  2443. this.activeGrip = null;
  2444. };
  2445. RectangularMarker.prototype.select = function () {
  2446. _super.prototype.select.call(this);
  2447. this.controlBox.style.display = '';
  2448. };
  2449. RectangularMarker.prototype.deselect = function () {
  2450. _super.prototype.deselect.call(this);
  2451. this.controlBox.style.display = 'none';
  2452. };
  2453. RectangularMarker.prototype.setup = function () {
  2454. _super.prototype.setup.call(this);
  2455. this.addControlBox();
  2456. if (this.page && this.page.mode === 'mirror') {
  2457. this.controlBox.style.display = 'none';
  2458. }
  2459. };
  2460. RectangularMarker.prototype.resizeByEvent = function (x, y, pos) {
  2461. this.activeGrip = this.controlGrips[pos];
  2462. this.resize(x, y);
  2463. };
  2464. RectangularMarker.prototype.resize = function (x, y, onPosition) {
  2465. var translateX = 0;
  2466. var translateY = 0;
  2467. switch (this.activeGrip) {
  2468. case this.controlGrips.topLeft:
  2469. this.width -= x;
  2470. this.height -= y;
  2471. translateX += x;
  2472. translateY += y;
  2473. if (onPosition) {
  2474. onPosition('topLeft');
  2475. }
  2476. break;
  2477. case this.controlGrips.bottomLeft:
  2478. this.width -= x;
  2479. this.height += y;
  2480. translateX += x;
  2481. if (onPosition) {
  2482. onPosition('bottomLeft');
  2483. }
  2484. break;
  2485. case this.controlGrips.topRight:
  2486. this.width += x;
  2487. this.height -= y;
  2488. translateY += y;
  2489. if (onPosition) {
  2490. onPosition('topRight');
  2491. }
  2492. break;
  2493. case this.controlGrips.bottomRight:
  2494. this.width += x;
  2495. this.height += y;
  2496. if (onPosition) {
  2497. onPosition('bottomRight');
  2498. }
  2499. break;
  2500. case this.controlGrips.centerLeft:
  2501. this.width -= x;
  2502. translateX += x;
  2503. if (onPosition) {
  2504. onPosition('centerLeft');
  2505. }
  2506. break;
  2507. case this.controlGrips.centerRight:
  2508. this.width += x;
  2509. if (onPosition) {
  2510. onPosition('centerRight');
  2511. }
  2512. break;
  2513. case this.controlGrips.topCenter:
  2514. this.height -= y;
  2515. translateY += y;
  2516. if (onPosition) {
  2517. onPosition('topCenter');
  2518. }
  2519. break;
  2520. case this.controlGrips.bottomCenter:
  2521. this.height += y;
  2522. if (onPosition) {
  2523. onPosition('bottomCenter');
  2524. }
  2525. break;
  2526. default:
  2527. break;
  2528. }
  2529. if (this.width < this.MIN_SIZE) {
  2530. var offset = this.MIN_SIZE - this.width;
  2531. this.width = this.MIN_SIZE;
  2532. if (translateX !== 0) {
  2533. translateX -= offset;
  2534. }
  2535. }
  2536. if (this.height < this.MIN_SIZE) {
  2537. var offset = this.MIN_SIZE - this.height;
  2538. this.height = this.MIN_SIZE;
  2539. if (translateY !== 0) {
  2540. translateY -= offset;
  2541. }
  2542. }
  2543. if (translateX !== 0 || translateY !== 0) {
  2544. var translate = this.visual.transform.baseVal.getItem(0);
  2545. translate.setMatrix(translate.matrix.translate(translateX, translateY));
  2546. this.visual.transform.baseVal.replaceItem(translate, 0);
  2547. }
  2548. this.adjustControlBox();
  2549. };
  2550. RectangularMarker.prototype.onTouch = function (ev) {
  2551. _super.prototype.onTouch.call(this, ev);
  2552. };
  2553. RectangularMarker.createMarker = function (page) {
  2554. var marker = new RectangularMarker();
  2555. marker.page = page;
  2556. marker.setup();
  2557. return marker;
  2558. };
  2559. return RectangularMarker;
  2560. }(BaseMarker_1.BaseMarker);
  2561. exports.RectangularMarker = RectangularMarker;
  2562. /***/ }),
  2563. /***/ "./src/markers/TextMarker/index.ts":
  2564. /*!*****************************************!*\
  2565. !*** ./src/markers/TextMarker/index.ts ***!
  2566. \*****************************************/
  2567. /*! no static exports found */
  2568. /***/ (function(module, exports, __webpack_require__) {
  2569. "use strict";
  2570. var __extends = this && this.__extends || function () {
  2571. var extendStatics = function (d, b) {
  2572. extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (d, b) {
  2573. d.__proto__ = b;
  2574. } || function (d, b) {
  2575. for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
  2576. };
  2577. return extendStatics(d, b);
  2578. };
  2579. return function (d, b) {
  2580. extendStatics(d, b);
  2581. function __() {
  2582. this.constructor = d;
  2583. }
  2584. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  2585. };
  2586. }();
  2587. Object.defineProperty(exports, "__esModule", { value: true });
  2588. var RectangularMarker_1 = __webpack_require__(/*! ../RectangularMarker */ "./src/markers/RectangularMarker/index.ts");
  2589. var SvgHelper_1 = __webpack_require__(/*! ../../renderer/SvgHelper */ "./src/renderer/SvgHelper/index.ts");
  2590. var OkIcon = __webpack_require__(/*! ../../assets/check.svg */ "./src/assets/check.svg");
  2591. var CancelIcon = __webpack_require__(/*! ../../assets/times.svg */ "./src/assets/times.svg");
  2592. var TextMarker = function (_super) {
  2593. __extends(TextMarker, _super);
  2594. function TextMarker() {
  2595. var _this = _super !== null && _super.apply(this, arguments) || this;
  2596. _this.type = 'text';
  2597. _this.MIN_SIZE = 50;
  2598. _this.DEFAULT_TEXT = 'Double-click to edit text';
  2599. _this.text = _this.DEFAULT_TEXT;
  2600. _this.inDoubleTap = false;
  2601. _this.renderText = function () {
  2602. var LINE_SIZE = '1.2em';
  2603. while (_this.textElement.lastChild) {
  2604. _this.textElement.removeChild(_this.textElement.lastChild);
  2605. }
  2606. var lines = _this.text.split(/\r\n|[\n\v\f\r\x85\u2028\u2029]/);
  2607. for (var _i = 0, lines_1 = lines; _i < lines_1.length; _i++) {
  2608. var line = lines_1[_i];
  2609. if (line.trim() === '') {
  2610. line = ' ';
  2611. }
  2612. _this.textElement.appendChild(SvgHelper_1.SvgHelper.createTSpan(line, [['x', '0'], ['dy', LINE_SIZE]]));
  2613. }
  2614. setTimeout(_this.sizeText, 10);
  2615. };
  2616. _this.sizeText = function () {
  2617. var textSize = _this.textElement.getBBox();
  2618. var x = 0;
  2619. var y = 0;
  2620. var scale = 1.0;
  2621. if (textSize.width > 0 && textSize.height > 0) {
  2622. var xScale = _this.width * 1.0 / textSize.width;
  2623. var yScale = _this.height * 1.0 / textSize.height;
  2624. scale = Math.min(xScale, yScale);
  2625. x = (_this.width - textSize.width * scale) / 2;
  2626. y = (_this.height - textSize.height * scale) / 2;
  2627. }
  2628. _this.textElement.transform.baseVal.getItem(0).setTranslate(x, y);
  2629. _this.textElement.transform.baseVal.getItem(1).setScale(scale, scale);
  2630. };
  2631. _this.onDblClick = function (ev) {
  2632. _this.showEditor();
  2633. };
  2634. _this.onTap = function (ev) {
  2635. if (_this.inDoubleTap) {
  2636. _this.inDoubleTap = false;
  2637. _this.showEditor();
  2638. } else {
  2639. _this.inDoubleTap = true;
  2640. setTimeout(function () {
  2641. _this.inDoubleTap = false;
  2642. }, 300);
  2643. }
  2644. };
  2645. _this.showEditor = function () {
  2646. _this.editor = document.createElement('div');
  2647. _this.editor.className = 'fc-whiteboard-text-editor';
  2648. _this.editorTextArea = document.createElement('textarea');
  2649. if (_this.text !== _this.DEFAULT_TEXT) {
  2650. _this.editorTextArea.value = _this.text;
  2651. }
  2652. _this.editorTextArea.addEventListener('keydown', _this.onEditorKeyDown);
  2653. _this.editor.appendChild(_this.editorTextArea);
  2654. document.body.appendChild(_this.editor);
  2655. var buttons = document.createElement('div');
  2656. buttons.className = 'fc-whiteboard-text-editor-button-bar';
  2657. _this.editor.appendChild(buttons);
  2658. var okButton = document.createElement('div');
  2659. okButton.className = 'fc-whiteboard-text-editor-button';
  2660. okButton.innerHTML = OkIcon;
  2661. okButton.addEventListener('click', _this.onEditorOkClick);
  2662. buttons.appendChild(okButton);
  2663. var cancelButton = document.createElement('div');
  2664. cancelButton.className = 'fc-whiteboard-text-editor-button';
  2665. cancelButton.innerHTML = CancelIcon;
  2666. cancelButton.addEventListener('click', _this.closeEditor);
  2667. buttons.appendChild(cancelButton);
  2668. };
  2669. _this.onEditorOkClick = function (ev) {
  2670. if (_this.editorTextArea.value.trim()) {
  2671. _this.text = _this.editorTextArea.value;
  2672. } else {
  2673. _this.text = _this.DEFAULT_TEXT;
  2674. }
  2675. _this.onChange({ target: 'marker', id: _this.id, event: 'changeText', data: _this.text });
  2676. _this.renderText();
  2677. _this.closeEditor();
  2678. };
  2679. _this.closeEditor = function () {
  2680. document.body.removeChild(_this.editor);
  2681. };
  2682. _this.onEditorKeyDown = function (ev) {
  2683. if (ev.key === 'Enter' && ev.ctrlKey) {
  2684. ev.preventDefault();
  2685. _this.onEditorOkClick(null);
  2686. }
  2687. };
  2688. return _this;
  2689. }
  2690. TextMarker.prototype.setText = function (text) {
  2691. this.text = text;
  2692. this.renderText();
  2693. };
  2694. TextMarker.prototype.setup = function () {
  2695. _super.prototype.setup.call(this);
  2696. this.textElement = SvgHelper_1.SvgHelper.createText();
  2697. this.addToRenderVisual(this.textElement);
  2698. SvgHelper_1.SvgHelper.setAttributes(this.visual, [['class', 'text-marker']]);
  2699. this.textElement.transform.baseVal.appendItem(SvgHelper_1.SvgHelper.createTransform());
  2700. this.textElement.transform.baseVal.appendItem(SvgHelper_1.SvgHelper.createTransform());
  2701. this.renderText();
  2702. this.visual.addEventListener('dblclick', this.onDblClick);
  2703. this.visual.addEventListener('touchstart', this.onTap);
  2704. };
  2705. TextMarker.prototype.resize = function (x, y, onPosition) {
  2706. _super.prototype.resize.call(this, x, y, onPosition);
  2707. this.sizeText();
  2708. };
  2709. TextMarker.createMarker = function (page) {
  2710. var marker = new TextMarker();
  2711. marker.page = page;
  2712. marker.setup();
  2713. return marker;
  2714. };
  2715. return TextMarker;
  2716. }(RectangularMarker_1.RectangularMarker);
  2717. exports.TextMarker = TextMarker;
  2718. /***/ }),
  2719. /***/ "./src/markers/types.ts":
  2720. /*!******************************!*\
  2721. !*** ./src/markers/types.ts ***!
  2722. \******************************/
  2723. /*! no static exports found */
  2724. /***/ (function(module, exports, __webpack_require__) {
  2725. "use strict";
  2726. Object.defineProperty(exports, "__esModule", { value: true });
  2727. var index_1 = __webpack_require__(/*! ./HighlightMarker/index */ "./src/markers/HighlightMarker/index.ts");
  2728. var index_2 = __webpack_require__(/*! ./TextMarker/index */ "./src/markers/TextMarker/index.ts");
  2729. var index_3 = __webpack_require__(/*! ./ArrowMarker/index */ "./src/markers/ArrowMarker/index.ts");
  2730. var index_4 = __webpack_require__(/*! ./BaseMarker/index */ "./src/markers/BaseMarker/index.ts");
  2731. var CoverMarker_1 = __webpack_require__(/*! ./CoverMarker */ "./src/markers/CoverMarker/index.ts");
  2732. var LineMarker_1 = __webpack_require__(/*! ./LineMarker */ "./src/markers/LineMarker/index.ts");
  2733. var RectMarker_1 = __webpack_require__(/*! ./RectMarker */ "./src/markers/RectMarker/index.ts");
  2734. function getMarkerByType(type) {
  2735. switch (type) {
  2736. case 'arrow':
  2737. return index_3.ArrowMarker;
  2738. case 'base':
  2739. return index_4.BaseMarker;
  2740. case 'cover':
  2741. return CoverMarker_1.CoverMarker;
  2742. case 'highlight':
  2743. return index_1.HighlightMarker;
  2744. case 'line':
  2745. return LineMarker_1.LineMarker;
  2746. case 'rect':
  2747. return RectMarker_1.RectMarker;
  2748. case 'text':
  2749. return index_2.TextMarker;
  2750. default:
  2751. return index_4.BaseMarker;
  2752. }
  2753. }
  2754. exports.getMarkerByType = getMarkerByType;
  2755. /***/ }),
  2756. /***/ "./src/renderer/SvgHelper/index.ts":
  2757. /*!*****************************************!*\
  2758. !*** ./src/renderer/SvgHelper/index.ts ***!
  2759. \*****************************************/
  2760. /*! no static exports found */
  2761. /***/ (function(module, exports, __webpack_require__) {
  2762. "use strict";
  2763. Object.defineProperty(exports, "__esModule", { value: true });
  2764. var SvgHelper = function () {
  2765. function SvgHelper() {}
  2766. SvgHelper.createRect = function (width, height, attributes) {
  2767. var rect = document.createElementNS('http://www.w3.org/2000/svg', 'rect');
  2768. rect.setAttribute('width', width.toString());
  2769. rect.setAttribute('height', height.toString());
  2770. if (attributes) {
  2771. SvgHelper.setAttributes(rect, attributes);
  2772. }
  2773. return rect;
  2774. };
  2775. SvgHelper.createLine = function (x1, y1, x2, y2, attributes) {
  2776. var line = document.createElementNS('http://www.w3.org/2000/svg', 'line');
  2777. line.setAttribute('x1', x1.toString());
  2778. line.setAttribute('y1', y1.toString());
  2779. line.setAttribute('x2', x2.toString());
  2780. line.setAttribute('y2', y2.toString());
  2781. if (attributes) {
  2782. SvgHelper.setAttributes(line, attributes);
  2783. }
  2784. return line;
  2785. };
  2786. SvgHelper.createPolygon = function (points, attributes) {
  2787. var polygon = document.createElementNS('http://www.w3.org/2000/svg', 'polygon');
  2788. polygon.setAttribute('points', points);
  2789. if (attributes) {
  2790. SvgHelper.setAttributes(polygon, attributes);
  2791. }
  2792. return polygon;
  2793. };
  2794. SvgHelper.createCircle = function (radius, attributes) {
  2795. var circle = document.createElementNS('http://www.w3.org/2000/svg', 'circle');
  2796. circle.setAttribute('cx', (radius / 2).toString());
  2797. circle.setAttribute('cy', (radius / 2).toString());
  2798. circle.setAttribute('r', radius.toString());
  2799. if (attributes) {
  2800. SvgHelper.setAttributes(circle, attributes);
  2801. }
  2802. return circle;
  2803. };
  2804. SvgHelper.createGroup = function (attributes) {
  2805. var g = document.createElementNS('http://www.w3.org/2000/svg', 'g');
  2806. if (attributes) {
  2807. SvgHelper.setAttributes(g, attributes);
  2808. }
  2809. return g;
  2810. };
  2811. SvgHelper.setAttributes = function (el, attributes) {
  2812. for (var _i = 0, attributes_1 = attributes; _i < attributes_1.length; _i++) {
  2813. var _a = attributes_1[_i],
  2814. attr = _a[0],
  2815. value = _a[1];
  2816. el.setAttribute(attr, value);
  2817. }
  2818. };
  2819. SvgHelper.createTransform = function () {
  2820. var svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
  2821. return svg.createSVGTransform();
  2822. };
  2823. SvgHelper.createDefs = function () {
  2824. var defs = document.createElementNS('http://www.w3.org/2000/svg', 'defs');
  2825. return defs;
  2826. };
  2827. SvgHelper.createMarker = function (id, orient, markerWidth, markerHeight, refX, refY, markerElement) {
  2828. var marker = document.createElementNS('http://www.w3.org/2000/svg', 'marker');
  2829. SvgHelper.setAttributes(marker, [['id', id], ['orient', orient], ['markerWidth', markerWidth.toString()], ['markerHeight', markerHeight.toString()], ['refX', refX.toString()], ['refY', refY.toString()]]);
  2830. marker.appendChild(markerElement);
  2831. return marker;
  2832. };
  2833. SvgHelper.createText = function (attributes) {
  2834. var text = document.createElementNS('http://www.w3.org/2000/svg', 'text');
  2835. text.setAttribute('x', '0');
  2836. text.setAttribute('y', '0');
  2837. if (attributes) {
  2838. SvgHelper.setAttributes(text, attributes);
  2839. }
  2840. return text;
  2841. };
  2842. SvgHelper.createTSpan = function (text, attributes) {
  2843. var tspan = document.createElementNS('http://www.w3.org/2000/svg', 'tspan');
  2844. tspan.textContent = text;
  2845. if (attributes) {
  2846. SvgHelper.setAttributes(tspan, attributes);
  2847. }
  2848. return tspan;
  2849. };
  2850. return SvgHelper;
  2851. }();
  2852. exports.SvgHelper = SvgHelper;
  2853. /***/ }),
  2854. /***/ "./src/renderer/Synthetizer/index.ts":
  2855. /*!*******************************************!*\
  2856. !*** ./src/renderer/Synthetizer/index.ts ***!
  2857. \*******************************************/
  2858. /*! no static exports found */
  2859. /***/ (function(module, exports, __webpack_require__) {
  2860. "use strict";
  2861. Object.defineProperty(exports, "__esModule", { value: true });
  2862. var validator_1 = __webpack_require__(/*! ../../utils/validator */ "./src/utils/validator.ts");
  2863. var Synthetizer = function () {
  2864. function Synthetizer() {}
  2865. Synthetizer.prototype.rasterize = function (target, markerImage, done) {
  2866. if (!validator_1.isHTMLImageElement(target)) {
  2867. throw new Error('Error: only support export HTMLImageElement');
  2868. }
  2869. var canvas = document.createElement('canvas');
  2870. canvas.width = markerImage.width.baseVal.value;
  2871. canvas.height = markerImage.height.baseVal.value;
  2872. var data = markerImage.outerHTML;
  2873. var ctx = canvas.getContext('2d');
  2874. if (!ctx) {
  2875. throw new Error('Invalid ctx');
  2876. }
  2877. ctx.drawImage(target, 0, 0, canvas.width, canvas.height);
  2878. var DOMURL = window.URL;
  2879. var img = new Image(canvas.width, canvas.height);
  2880. img.setAttribute('crossOrigin', 'anonymous');
  2881. var blob = new Blob([data], { type: 'image/svg+xml' });
  2882. var url = DOMURL.createObjectURL(blob);
  2883. img.onload = function () {
  2884. ctx.drawImage(img, 0, 0);
  2885. DOMURL.revokeObjectURL(url);
  2886. done(canvas.toDataURL('image/png'));
  2887. };
  2888. img.src = url;
  2889. };
  2890. return Synthetizer;
  2891. }();
  2892. exports.Synthetizer = Synthetizer;
  2893. /***/ }),
  2894. /***/ "./src/toolbar/Toolbar.ts":
  2895. /*!********************************!*\
  2896. !*** ./src/toolbar/Toolbar.ts ***!
  2897. \********************************/
  2898. /*! no static exports found */
  2899. /***/ (function(module, exports, __webpack_require__) {
  2900. "use strict";
  2901. Object.defineProperty(exports, "__esModule", { value: true });
  2902. var ToolbarButton_1 = __webpack_require__(/*! ./ToolbarButton */ "./src/toolbar/ToolbarButton.ts");
  2903. var uuid_1 = __webpack_require__(/*! ../utils/uuid */ "./src/utils/uuid.ts");
  2904. var Toolbar = function () {
  2905. function Toolbar(toolbarItems, clickHandler) {
  2906. var _this = this;
  2907. this.id = uuid_1.uuid();
  2908. this.getUI = function () {
  2909. _this.toolbarUI = document.createElement('div');
  2910. _this.toolbarUI.id = "fcw-toolbar-" + _this.id;
  2911. _this.toolbarUI.className = 'fc-whiteboard-toolbar';
  2912. for (var _i = 0, _a = _this.toolbarItems; _i < _a.length; _i++) {
  2913. var toolbarItem = _a[_i];
  2914. var toolbarButton = new ToolbarButton_1.ToolbarButton(toolbarItem, _this.clickHandler);
  2915. _this.toolbarUI.appendChild(toolbarButton.getElement());
  2916. }
  2917. return _this.toolbarUI;
  2918. };
  2919. this.toolbarItems = toolbarItems;
  2920. this.clickHandler = clickHandler;
  2921. }
  2922. Toolbar.prototype.hide = function () {
  2923. this.toolbarUI.style.visibility = 'hidden';
  2924. this.toolbarUI.style.zIndex = '-1';
  2925. };
  2926. Toolbar.prototype.show = function () {
  2927. this.toolbarUI.style.visibility = 'visible';
  2928. this.toolbarUI.style.zIndex = '999';
  2929. };
  2930. return Toolbar;
  2931. }();
  2932. exports.Toolbar = Toolbar;
  2933. /***/ }),
  2934. /***/ "./src/toolbar/ToolbarButton.ts":
  2935. /*!**************************************!*\
  2936. !*** ./src/toolbar/ToolbarButton.ts ***!
  2937. \**************************************/
  2938. /*! no static exports found */
  2939. /***/ (function(module, exports, __webpack_require__) {
  2940. "use strict";
  2941. Object.defineProperty(exports, "__esModule", { value: true });
  2942. var ToolbarButton = function () {
  2943. function ToolbarButton(toolbarItem, clickHandler) {
  2944. var _this = this;
  2945. this.getElement = function () {
  2946. var div = document.createElement('div');
  2947. if (_this.toolbarItem.name !== 'separator') {
  2948. div.className = 'fc-whiteboard-toolbar-button';
  2949. if (_this.clickHandler) {
  2950. div.addEventListener('click', function (ev) {
  2951. if (_this.clickHandler) {
  2952. _this.clickHandler(ev, _this.toolbarItem);
  2953. }
  2954. });
  2955. }
  2956. if (_this.toolbarItem.icon) {
  2957. div.title = _this.toolbarItem.tooltipText;
  2958. div.innerHTML = _this.toolbarItem.icon;
  2959. } else {
  2960. div.innerText = _this.toolbarItem.tooltipText;
  2961. }
  2962. } else {
  2963. div.className = 'fc-whiteboard-toolbar-separator';
  2964. }
  2965. return div;
  2966. };
  2967. this.toolbarItem = toolbarItem;
  2968. if (clickHandler) {
  2969. this.clickHandler = clickHandler;
  2970. }
  2971. }
  2972. return ToolbarButton;
  2973. }();
  2974. exports.ToolbarButton = ToolbarButton;
  2975. /***/ }),
  2976. /***/ "./src/toolbar/ToolbarItem.ts":
  2977. /*!************************************!*\
  2978. !*** ./src/toolbar/ToolbarItem.ts ***!
  2979. \************************************/
  2980. /*! no static exports found */
  2981. /***/ (function(module, exports, __webpack_require__) {
  2982. "use strict";
  2983. Object.defineProperty(exports, "__esModule", { value: true });
  2984. var ToolbarItem = function () {
  2985. function ToolbarItem(_a) {
  2986. var name = _a.name,
  2987. tooltipText = _a.tooltipText,
  2988. icon = _a.icon,
  2989. markerType = _a.markerType;
  2990. this.name = name;
  2991. this.tooltipText = tooltipText;
  2992. this.icon = icon;
  2993. this.markerType = markerType;
  2994. }
  2995. return ToolbarItem;
  2996. }();
  2997. exports.ToolbarItem = ToolbarItem;
  2998. /***/ }),
  2999. /***/ "./src/toolbar/toolbar-items.ts":
  3000. /*!**************************************!*\
  3001. !*** ./src/toolbar/toolbar-items.ts ***!
  3002. \**************************************/
  3003. /*! no static exports found */
  3004. /***/ (function(module, exports, __webpack_require__) {
  3005. "use strict";
  3006. Object.defineProperty(exports, "__esModule", { value: true });
  3007. var index_1 = __webpack_require__(/*! ./../markers/RectMarker/index */ "./src/markers/RectMarker/index.ts");
  3008. var index_2 = __webpack_require__(/*! ./../markers/CoverMarker/index */ "./src/markers/CoverMarker/index.ts");
  3009. var index_3 = __webpack_require__(/*! ./../markers/TextMarker/index */ "./src/markers/TextMarker/index.ts");
  3010. var index_4 = __webpack_require__(/*! ./../markers/ArrowMarker/index */ "./src/markers/ArrowMarker/index.ts");
  3011. var index_5 = __webpack_require__(/*! ./../markers/HighlightMarker/index */ "./src/markers/HighlightMarker/index.ts");
  3012. var ToolbarItem_1 = __webpack_require__(/*! ./ToolbarItem */ "./src/toolbar/ToolbarItem.ts");
  3013. var LineMarker_1 = __webpack_require__(/*! ../markers/LineMarker */ "./src/markers/LineMarker/index.ts");
  3014. var OkIcon = __webpack_require__(/*! ../assets/check.svg */ "./src/assets/check.svg");
  3015. var DeleteIcon = __webpack_require__(/*! ../assets/eraser.svg */ "./src/assets/eraser.svg");
  3016. var PointerIcon = __webpack_require__(/*! ../assets/mouse-pointer.svg */ "./src/assets/mouse-pointer.svg");
  3017. var CloseIcon = __webpack_require__(/*! ../assets/times.svg */ "./src/assets/times.svg");
  3018. exports.highlightMarkerToolbarItem = new ToolbarItem_1.ToolbarItem({
  3019. name: 'cover-marker',
  3020. tooltipText: 'Cover',
  3021. icon: __webpack_require__(/*! ../assets/highlight.svg */ "./src/assets/highlight.svg"),
  3022. markerType: index_5.HighlightMarker
  3023. });
  3024. exports.arrowMarkerToolbarItem = new ToolbarItem_1.ToolbarItem({
  3025. name: 'arrow-marker',
  3026. tooltipText: 'Arrow',
  3027. icon: __webpack_require__(/*! ../assets/arrow.svg */ "./src/assets/arrow.svg"),
  3028. markerType: index_4.ArrowMarker
  3029. });
  3030. exports.textMarkerToolbarItem = new ToolbarItem_1.ToolbarItem({
  3031. name: 'text-marker',
  3032. tooltipText: 'Text',
  3033. icon: __webpack_require__(/*! ../assets/text.svg */ "./src/assets/text.svg"),
  3034. markerType: index_3.TextMarker
  3035. });
  3036. exports.coverMarkerToolbarItem = new ToolbarItem_1.ToolbarItem({
  3037. name: 'cover-marker',
  3038. tooltipText: 'Cover',
  3039. icon: __webpack_require__(/*! ../assets/cover.svg */ "./src/assets/cover.svg"),
  3040. markerType: index_2.CoverMarker
  3041. });
  3042. exports.rectMarkerToolbarItem = new ToolbarItem_1.ToolbarItem({
  3043. name: 'rect-marker',
  3044. tooltipText: 'Rectangle',
  3045. icon: __webpack_require__(/*! ../assets/rect.svg */ "./src/assets/rect.svg"),
  3046. markerType: index_1.RectMarker
  3047. });
  3048. exports.lineMarkerToolbarItem = new ToolbarItem_1.ToolbarItem({
  3049. name: 'line-marker',
  3050. tooltipText: 'Line',
  3051. icon: __webpack_require__(/*! ../assets/line.svg */ "./src/assets/line.svg"),
  3052. markerType: LineMarker_1.LineMarker
  3053. });
  3054. function getToolbars(page) {
  3055. var toolbars = [{
  3056. icon: PointerIcon,
  3057. name: 'pointer',
  3058. tooltipText: 'Pointer'
  3059. }, {
  3060. icon: DeleteIcon,
  3061. name: 'delete',
  3062. tooltipText: 'Delete'
  3063. }, {
  3064. name: 'separator',
  3065. tooltipText: ''
  3066. }, exports.rectMarkerToolbarItem, exports.coverMarkerToolbarItem, exports.highlightMarkerToolbarItem, exports.lineMarkerToolbarItem, exports.arrowMarkerToolbarItem, exports.textMarkerToolbarItem, {
  3067. name: 'separator',
  3068. tooltipText: ''
  3069. }];
  3070. if (!page) {
  3071. toolbars.push.apply(toolbars, [{
  3072. icon: OkIcon,
  3073. name: 'ok',
  3074. tooltipText: 'OK'
  3075. }]);
  3076. }
  3077. toolbars.push({
  3078. icon: CloseIcon,
  3079. name: 'close',
  3080. tooltipText: 'Close'
  3081. });
  3082. return toolbars;
  3083. }
  3084. exports.getToolbars = getToolbars;
  3085. /***/ }),
  3086. /***/ "./src/utils/dom.ts":
  3087. /*!**************************!*\
  3088. !*** ./src/utils/dom.ts ***!
  3089. \**************************/
  3090. /*! no static exports found */
  3091. /***/ (function(module, exports, __webpack_require__) {
  3092. "use strict";
  3093. Object.defineProperty(exports, "__esModule", { value: true });
  3094. function createDivWithClassName(className, parent) {
  3095. var ele = document.createElement('div');
  3096. if (parent) {
  3097. parent.appendChild(ele);
  3098. }
  3099. if (className) {
  3100. addClassName(ele, className);
  3101. }
  3102. return ele;
  3103. }
  3104. exports.createDivWithClassName = createDivWithClassName;
  3105. function addClassName(ele, className) {
  3106. if (!ele) {
  3107. return;
  3108. }
  3109. ele.className = ((ele.className || '') + " " + className).trim();
  3110. }
  3111. exports.addClassName = addClassName;
  3112. /***/ }),
  3113. /***/ "./src/utils/uuid.ts":
  3114. /*!***************************!*\
  3115. !*** ./src/utils/uuid.ts ***!
  3116. \***************************/
  3117. /*! no static exports found */
  3118. /***/ (function(module, exports, __webpack_require__) {
  3119. "use strict";
  3120. Object.defineProperty(exports, "__esModule", { value: true });
  3121. var uuidV1 = __webpack_require__(/*! uuid/v1 */ "./node_modules/uuid/v1.js");
  3122. exports.uuid = uuidV1;
  3123. /***/ }),
  3124. /***/ "./src/utils/validator.ts":
  3125. /*!********************************!*\
  3126. !*** ./src/utils/validator.ts ***!
  3127. \********************************/
  3128. /*! no static exports found */
  3129. /***/ (function(module, exports, __webpack_require__) {
  3130. "use strict";
  3131. Object.defineProperty(exports, "__esModule", { value: true });
  3132. function isHTMLImageElement(ele) {
  3133. if (typeof ele === 'object' && ele instanceof HTMLImageElement) {
  3134. return true;
  3135. }
  3136. return false;
  3137. }
  3138. exports.isHTMLImageElement = isHTMLImageElement;
  3139. /***/ })
  3140. /******/ });
  3141. });
  3142. //# sourceMappingURL=index.js.map