function _AwaitValue(t){this.wrapped=t}function _AsyncGenerator(t){var e,r;function resume(e,r){try{var n=t[e](r),o=n.value,a=o instanceof _AwaitValue;Promise.resolve(a?o.wrapped:o).then((function(t){a?resume("return"===e?"return":"next",t):settle(n.done?"return":"normal",t)}),(function(t){resume("throw",t)}))}catch(t){settle("throw",t)}}function settle(t,n){switch(t){case"return":e.resolve({value:n,done:!0});break;case"throw":e.reject(n);break;default:e.resolve({value:n,done:!1})}(e=e.next)?resume(e.key,e.arg):r=null}this._invoke=function send(t,n){return new Promise((function(o,a){var i={key:t,arg:n,resolve:o,reject:a,next:null};r?r=r.next=i:(e=r=i,resume(t,n))}))},"function"!=typeof t.return&&(this.return=void 0)}function asyncGeneratorStep(t,e,r,n,o,a,i){try{var s=t[a](i),c=s.value}catch(t){return void r(t)}s.done?e(c):Promise.resolve(c).then(n,o)}"function"==typeof Symbol&&Symbol.asyncIterator&&(_AsyncGenerator.prototype[Symbol.asyncIterator]=function(){return this}),_AsyncGenerator.prototype.next=function(t){return this._invoke("next",t)},_AsyncGenerator.prototype.throw=function(t){return this._invoke("throw",t)},_AsyncGenerator.prototype.return=function(t){return this._invoke("return",t)}; /** * @file ext-connector.js * * @license MIT * * @copyright 2010 Alexis Deveria * */ var t={name:"connector",init:function init(t){var e=this;return function _asyncToGenerator(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var a=t.apply(e,r);function _next(t){asyncGeneratorStep(a,n,o,_next,_throw,"next",t)}function _throw(t){asyncGeneratorStep(a,n,o,_next,_throw,"throw",t)}_next(void 0)}))}}(regeneratorRuntime.mark((function _callee(){var r,n,o,a,i,s,c,u,l,d,f,h,g,m,v,_,p,b,y,x,k,w,A,S,B,E,I,N,G,M;return regeneratorRuntime.wrap((function _callee$(C){for(;;)switch(C.prev=C.next){case 0:return G=function _init(){a(b).find("*").each((function(){var t=this.getAttributeNS(p,"connector");if(t){this.setAttribute("class",l.substr(1));var e=t.split(" "),r=n.getStrokedBBox([o(e[0])]),i=n.getStrokedBBox([o(e[1])]);a(this).data("c_start",e[0]).data("c_end",e[1]).data("start_bb",r).data("end_bb",i),n.getEditorNS(!0)}}))},N=function _updateConnectors(t){if(I(t),x.length)for(var e=x.length;e--;){var r=x[e],o=r.connector,a=r.elem,i=r.is_start?"start":"end",s=n.getStrokedBBox([a]);s.x=r.start_x,s.y=r.start_y,d(o,i+"_bb",s),d(o,i+"_off");var c=r.is_start?"end":"start",u=d(o,c+"_bb"),l=u.x+u.width/2,f=u.y+u.height/2,h=w(l,f,s,A(i,o));B(o,r.is_start?0:"end",h.x,h.y,!0);var g=w(h.x,h.y,d(o,c+"_bb"),A(c,o));if(B(o,r.is_start?"end":0,g.x,g.y,!0),navigator.userAgent.includes("AppleWebKit")){for(var m=o.points,v=m.numberOfItems,_=[],p=0;p0&&void 0!==arguments[0]?arguments[0]:k,e=a(b).find(l);x=[],e.each((function(){var e;function add(){t.includes(this)&&(e=!0)}var r=[];["start","end"].forEach((function(t,e){var o=d(this,"c_"+t);null==o?(o=document.getElementById(this.attributes["se:connector"].value.split(" ")[e]),d(this,"c_"+t,o.id),d(this,t+"_bb",n.getStrokedBBox([o]))):o=document.getElementById(o),r.push(o)}),this);for(var o=0;o<2;o++){var i=r[o];if(e=!1,a(i).parents().each(add),i&&i.parentNode){if(t.includes(i)||e){var s=n.getStrokedBBox([i]);x.push({elem:i,connector:this,is_start:0===o,start_x:s.x,start_y:s.y})}}else a(this).remove()}}))},E=function _updateLine(t,e){for(var r=x.length;r--;){var n=x[r],o=n.connector,a=n.is_start?"start":"end",i=d(o,a+"_bb");i.x=n.start_x+t,i.y=n.start_y+e,d(o,a+"_bb",i);var s=n.is_start?"end":"start",c=d(o,s+"_bb"),u=c.x+c.width/2,l=c.y+c.height/2,f=w(u,l,i,A(a,o));B(o,n.is_start?0:"end",f.x,f.y,!0);var h=w(f.x,f.y,d(o,s+"_bb"),A(s,o));B(o,n.is_start?"end":0,h.x,h.y,!0)}},B=function _setPoint(t,e,r,n,o){var a=t.points,s=i.createSVGPoint();s.x=r,s.y=n,"end"===e&&(e=a.numberOfItems-1);try{a.replaceItem(s,e)}catch(o){for(var c=t.getAttribute("points").split(" "),u=0;u').appendTo("head")),e.text(t?"#tool_clone, #tool_topath, #tool_angle, #xy_panel { display: none !important; }":""),a("#connector_panel").toggle(t)},A=function _getOffset(t,e){var r=e.getAttribute("marker-"+t),n=5*e.getAttribute("stroke-width");return r?n:0},w=function _getBBintersect(t,e,r,n){n&&(n-=0,(r=a.extend({},r)).width+=n,r.height+=n,r.x-=n/2,r.y-=n/2);var o,i=r.x+r.width/2,s=r.y+r.height/2,c=t-i,u=e-s;return{x:i+c*(o=Math.abs(u/c)