UNPKG

graph-explorer

Version:

Graph Explorer can be used to explore and RDF graphs in SPARQL endpoints or on the web.

2 lines 987 kB
/*! For license information please see graph-explorer-full.min.js.LICENSE.txt */ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.GraphExplorer=t():e.GraphExplorer=t()}(self,(()=>(()=>{var e={93:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Dialog=void 0;var r=n(1635),i=n(6540),o=n(6398),a=n(315),s=n(8051),l=n(926),u="graph-explorer-dialog",c=function(e){function t(t){var n=e.call(this,t)||this;return n.unsubscribeFromTarget=void 0,n.handler=new a.EventObserver,n.updateAll=function(){return n.forceUpdate()},n.onStartDragging=function(e){n.preventSelection();var t=n.props.size;n.startSize={x:n.state.width||t.width,y:n.state.height||t.height}},n.onDragHandleBottom=function(e,t,r){var i=n.calculateHeight(n.startSize.y+r);n.setState({height:i})},n.onDragHandleRight=function(e,t){var r=n.calculateWidth(n.startSize.x+t);n.setState({width:r})},n.onDragHandleBottomRight=function(e,t,r){var i=n.calculateWidth(n.startSize.x+t),o=n.calculateHeight(n.startSize.y+r);n.setState({width:i,height:o})},n.preventSelection=function(){var e=function(){document.body.classList.remove("graph-explorer--unselectable"),document.removeEventListener("mouseup",e)};document.addEventListener("mouseup",e),document.body.classList.add("graph-explorer--unselectable")},n.state={},n}return r.__extends(t,e),t.prototype.componentDidMount=function(){this.listenToTarget(this.props.target),this.focusOn()},t.prototype.componentDidUpdate=function(e){e.target!==this.props.target&&this.listenToTarget(e.target)},t.prototype.componentWillUnmount=function(){this.listenToTarget(void 0)},t.prototype.listenToTarget=function(e){var t=this;if(this.unsubscribeFromTarget&&(this.unsubscribeFromTarget(),this.unsubscribeFromTarget=void 0),e){var n=this.props.view;e instanceof o.Element?this.listenToElement(e):e instanceof o.Link&&this.listenToLink(e),this.handler.listen(n.events,"changeLanguage",this.updateAll),this.unsubscribeFromTarget=function(){t.handler.stopListening()}}},t.prototype.listenToElement=function(e){this.handler.listen(e.events,"changePosition",this.updateAll),this.handler.listen(e.events,"changeSize",this.updateAll)},t.prototype.listenToLink=function(e){var t=this.props.view,n=t.model.getElement(e.sourceId),r=t.model.getElement(e.targetId);this.listenToElement(n),this.listenToElement(r),this.handler.listen(e.events,"changeVertices",this.updateAll),this.handler.listen(e.events,"changeLabelBounds",this.updateAll)},t.prototype.calculatePositionForElement=function(e){var t=this.props,n=t.paperArea,r=t.size,i=(0,s.boundsOf)(e),o=n.paperToScrollablePaneCoords(i.x,i.y).y,a=n.paperToScrollablePaneCoords(i.x+i.width,i.y+i.height);return{x:a.x+40,y:(o+a.y)/2-r.height/2}},t.prototype.calculatePositionForLink=function(e){var t=this.props,n=t.view,r=t.paperArea,i=n.model.getElement(e.sourceId),o=n.model.getElement(e.targetId);if(!i||!o)throw new Error("Source and target are not specified");var a=n.getRouting(e.id),l=e.vertices||[],u=a?a.vertices:l,c=(0,s.computePolyline)(i,o,u),p=(0,s.computePolylineLength)(c),d=(0,s.getPointAlongPolyline)(c,p/2),h=r.paperToScrollablePaneCoords(d.x,d.y),f=h.x;return{y:h.y+20,x:f+20}},t.prototype.calculatePosition=function(){var e=this.props,t=e.target,n=e.paperArea,r=e.offset,i=void 0===r?{x:0,y:0}:r,a=e.calculatePosition;if(a){var s=a(),l=n.paperToScrollablePaneCoords(s.x,s.y),u=l.x,c=l.y;return{x:u+i.x,y:c+i.y}}if(t instanceof o.Element)return this.calculatePositionForElement(t);if(t instanceof o.Link)return this.calculatePositionForLink(t);throw new Error("Unknown target type")},t.prototype.getViewPortScrollablePoints=function(){var e=this.props.paperArea,t=e.getAreaMetrics();return{min:e.clientToScrollablePaneCoords(0,0),max:e.clientToScrollablePaneCoords(t.clientWidth,t.clientHeight)}},t.prototype.getDialogScrollablePoints=function(){var e=this.props.size,t=this.calculatePosition(),n={x:t.x-20,y:t.y-20};return{min:n,max:{x:n.x+e.width+40,y:n.y+e.height+40}}},t.prototype.focusOn=function(){var e=this.props.paperArea,t=this.getViewPortScrollablePoints(),n=t.min,r=t.max,i=this.getDialogScrollablePoints(),o=i.min,a=i.max,s=0;o.x<n.x?s=o.x-n.x:a.x>r.x&&(s=a.x-r.x);var l=0;o.y<n.y?l=o.y-n.y:a.y>r.y&&(l=a.y-r.y);var u={x:n.x+(r.x-n.x)/2+s,y:n.y+(r.y-n.y)/2+l},c=e.scrollablePaneToPaperCoords(u.x,u.y);e.centerTo(c)},t.prototype.calculateHeight=function(e){var t=this.props.size,n=Math.min(t.height,250),r=Math.max(t.height,800);return Math.max(n,Math.min(r,e))},t.prototype.calculateWidth=function(e){var t=this.props.size,n=Math.min(t.width,250),r=Math.max(t.width,800);return Math.max(n,Math.min(r,e))},t.prototype.render=function(){var e=this,t=this.props,n=t.size,r=t.caption,o=this.calculatePosition(),a=o.x,s={top:o.y,left:a,width:this.state.width||n.width,height:this.state.height||n.height};return i.createElement("div",{className:u,style:s},i.createElement("button",{className:"".concat(u,"__close-button"),onClick:function(){return e.props.onClose()}}),r?i.createElement("div",{className:"graph-explorer-dialog__caption"},r):null,this.props.children,i.createElement(l.DraggableHandle,{className:"".concat(u,"__bottom-handle"),onBeginDragHandle:this.onStartDragging,onDragHandle:this.onDragHandleBottom}),i.createElement(l.DraggableHandle,{className:"".concat(u,"__right-handle"),onBeginDragHandle:this.onStartDragging,onDragHandle:this.onDragHandleRight}),i.createElement(l.DraggableHandle,{className:"".concat(u,"__bottom-right-handle"),onBeginDragHandle:this.onStartDragging,onDragHandle:this.onDragHandleBottomRight}))},t.defaultProps={size:{width:300,height:300}},t}(i.Component);t.Dialog=c},132:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});const r="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjxzdmcKICAgeG1sbnM6c3ZnPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIKICAge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LjAxMDggMTAuNTI5NTUsLTQuODQ4NzkgMTAuNTQwMDksLTEwLjgxNDQ0IFYgODYuNTQ2NjQzIFoiCiAgICAgICBpbmtzY2FwZTpjb25uZWN0b3ItY3VydmF0dXJlPSIwIgogICAgICAgc3R5bGU9ImZpbGw6IzBmNTM3NiIKICAgICAgIHNvZGlwb2RpOm5vZGV0eXBlcz0iY2NjY2NjY2NjY2NjYyIgLz4KICA8L2c+Cjwvc3ZnPgo="},143:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EditLinkLabelForm=void 0;var r=n(1635),i=n(6540),o="graph-explorer-edit-form",a=function(e){function t(t){var n=e.call(this,t)||this,r=n.computeLabel();return n.state={label:r},n}return r.__extends(t,e),t.prototype.componentDidUpdate=function(e){if(this.props.link.typeId!==e.link.typeId){var t=this.computeLabel();this.setState({label:t})}},t.prototype.computeLabel=function(){var e=this.props,t=e.view,n=e.link,r=t.model.getLinkType(n.typeId),i=t.createLinkTemplate(r).renderLink(n).label,o=void 0===i?{}:i,a=o.attrs&&o.attrs.text?o.attrs.text.text:void 0;return a&&a.length>0?t.selectLabel(a).value:t.formatLabel(r.label,r.id)},t.prototype.render=function(){var e=this,t=this.props,n=t.onApply,r=t.onCancel,a=this.state.label;return i.createElement("div",{className:o},i.createElement("div",{className:"".concat(o,"__body")},i.createElement("div",{className:"".concat(o,"__form-row")},i.createElement("label",null,"Link Label"),i.createElement("input",{className:"graph-explorer-form-control",value:a,onChange:function(t){return e.setState({label:t.target.value})}}))),i.createElement("div",{className:"".concat(o,"__controls")},i.createElement("button",{className:"graph-explorer-btn graph-explorer-btn-success ".concat(o,"__apply-button"),onClick:function(){return n(a)}},"Apply"),i.createElement("button",{className:"graph-explorer-btn graph-explorer-btn-danger",onClick:function(){return r()}},"Cancel")))},t}(i.Component);t.EditLinkLabelForm=a},251:(e,t)=>{t.read=function(e,t,n,r,i){var o,a,s=8*i-r-1,l=(1<<s)-1,u=l>>1,c=-7,p=n?i-1:0,d=n?-1:1,h=e[t+p];for(p+=d,o=h&(1<<-c)-1,h>>=-c,c+=s;c>0;o=256*o+e[t+p],p+=d,c-=8);for(a=o&(1<<-c)-1,o>>=-c,c+=r;c>0;a=256*a+e[t+p],p+=d,c-=8);if(0===o)o=1-u;else{if(o===l)return a?NaN:1/0*(h?-1:1);a+=Math.pow(2,r),o-=u}return(h?-1:1)*a*Math.pow(2,o-r)},t.write=function(e,t,n,r,i,o){var a,s,l,u=8*o-i-1,c=(1<<u)-1,p=c>>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:o-1,f=r?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=c):(a=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-a))<1&&(a--,l*=2),(t+=a+p>=1?d/l:d*Math.pow(2,1-p))*l>=2&&(a++,l/=2),a+p>=c?(s=0,a=c):a+p>=1?(s=(t*l-1)*Math.pow(2,i),a+=p):(s=t*Math.pow(2,p-1)*Math.pow(2,i),a=0));i>=8;e[n+h]=255&s,h+=f,s/=256,i-=8);for(a=a<<i|s,u+=i;u>0;e[n+h]=255&a,h+=f,a/=256,u-=8);e[n+h-f]|=128*g}},277:(e,t,n)=>{"use strict";const{ArrayIsArray:r,ArrayPrototypeIncludes:i,ArrayPrototypeJoin:o,ArrayPrototypeMap:a,NumberIsInteger:s,NumberIsNaN:l,NumberMAX_SAFE_INTEGER:u,NumberMIN_SAFE_INTEGER:c,NumberParseInt:p,ObjectPrototypeHasOwnProperty:d,RegExpPrototypeExec:h,String:f,StringPrototypeToUpperCase:g,StringPrototypeTrim:A}=n(4134),{hideStackFrames:m,codes:{ERR_SOCKET_BAD_PORT:y,ERR_INVALID_ARG_TYPE:v,ERR_INVALID_ARG_VALUE:b,ERR_OUT_OF_RANGE:_,ERR_UNKNOWN_SIGNAL:C}}=n(6371),{normalizeEncoding:x}=n(7760),{isAsyncFunction:w,isArrayBufferView:E}=n(7760).types,k={},I=/^[0-7]+$/,S=m(((e,t,n=c,r=u)=>{if("number"!=typeof e)throw new v(t,"number",e);if(!s(e))throw new _(t,"an integer",e);if(e<n||e>r)throw new _(t,`>= ${n} && <= ${r}`,e)})),T=m(((e,t,n=-2147483648,r=2147483647)=>{if("number"!=typeof e)throw new v(t,"number",e);if(!s(e))throw new _(t,"an integer",e);if(e<n||e>r)throw new _(t,`>= ${n} && <= ${r}`,e)})),L=m(((e,t,n=!1)=>{if("number"!=typeof e)throw new v(t,"number",e);if(!s(e))throw new _(t,"an integer",e);const r=n?1:0,i=4294967295;if(e<r||e>i)throw new _(t,`>= ${r} && <= ${i}`,e)}));function M(e,t){if("string"!=typeof e)throw new v(t,"string",e)}const N=m(((e,t,n)=>{if(!i(n,e)){const r=o(a(n,(e=>"string"==typeof e?`'${e}'`:f(e))),", ");throw new b(t,e,"must be one of: "+r)}}));function j(e,t){if("boolean"!=typeof e)throw new v(t,"boolean",e)}function D(e,t,n){return null!=e&&d(e,t)?e[t]:n}const O=m(((e,t,n=null)=>{const i=D(n,"allowArray",!1),o=D(n,"allowFunction",!1);if(!D(n,"nullable",!1)&&null===e||!i&&r(e)||"object"!=typeof e&&(!o||"function"!=typeof e))throw new v(t,"Object",e)})),P=m(((e,t)=>{if(null!=e&&"object"!=typeof e&&"function"!=typeof e)throw new v(t,"a dictionary",e)})),B=m(((e,t,n=0)=>{if(!r(e))throw new v(t,"Array",e);if(e.length<n)throw new b(t,e,`must be longer than ${n}`)})),z=m(((e,t="buffer")=>{if(!E(e))throw new v(t,["Buffer","TypedArray","DataView"],e)})),R=m(((e,t)=>{if(void 0!==e&&(null===e||"object"!=typeof e||!("aborted"in e)))throw new v(t,"AbortSignal",e)})),U=m(((e,t)=>{if("function"!=typeof e)throw new v(t,"Function",e)})),F=m(((e,t)=>{if("function"!=typeof e||w(e))throw new v(t,"Function",e)})),G=m(((e,t)=>{if(void 0!==e)throw new v(t,"undefined",e)})),W=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function Y(e,t){if(void 0===e||!h(W,e))throw new b(t,e,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}e.exports={isInt32:function(e){return e===(0|e)},isUint32:function(e){return e===e>>>0},parseFileMode:function(e,t,n){if(void 0===e&&(e=n),"string"==typeof e){if(null===h(I,e))throw new b(t,e,"must be a 32-bit unsigned integer or an octal string");e=p(e,8)}return L(e,t),e},validateArray:B,validateStringArray:function(e,t){B(e,t);for(let n=0;n<e.length;n++)M(e[n],`${t}[${n}]`)},validateBooleanArray:function(e,t){B(e,t);for(let n=0;n<e.length;n++)j(e[n],`${t}[${n}]`)},validateAbortSignalArray:function(e,t){B(e,t);for(let n=0;n<e.length;n++){const r=e[n],i=`${t}[${n}]`;if(null==r)throw new v(i,"AbortSignal",r);R(r,i)}},validateBoolean:j,validateBuffer:z,validateDictionary:P,validateEncoding:function(e,t){const n=x(t),r=e.length;if("hex"===n&&r%2!=0)throw new b("encoding",t,`is invalid for data of length ${r}`)},validateFunction:U,validateInt32:T,validateInteger:S,validateNumber:function(e,t,n=void 0,r){if("number"!=typeof e)throw new v(t,"number",e);if(null!=n&&e<n||null!=r&&e>r||(null!=n||null!=r)&&l(e))throw new _(t,`${null!=n?`>= ${n}`:""}${null!=n&&null!=r?" && ":""}${null!=r?`<= ${r}`:""}`,e)},validateObject:O,validateOneOf:N,validatePlainFunction:F,validatePort:function(e,t="Port",n=!0){if("number"!=typeof e&&"string"!=typeof e||"string"==typeof e&&0===A(e).length||+e!=+e>>>0||e>65535||0===e&&!n)throw new y(t,e,n);return 0|e},validateSignalName:function(e,t="signal"){if(M(e,t),void 0===k[e]){if(void 0!==k[g(e)])throw new C(e+" (signals must use all capital letters)");throw new C(e)}},validateString:M,validateUint32:L,validateUndefined:G,validateUnion:function(e,t,n){if(!i(n,e))throw new v(t,`('${o(n,"|")}')`,e)},validateAbortSignal:R,validateLinkHeaderValue:function(e){if("string"==typeof e)return Y(e,"hints"),e;if(r(e)){const t=e.length;let n="";if(0===t)return n;for(let r=0;r<t;r++){const i=e[r];Y(i,"hints"),n+=i,r!==t-1&&(n+=", ")}return n}throw new b("hints",e,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}}},315:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EventObserver=t.EventSource=void 0;var n=function(){function e(){this.listeners=new Map}return e.prototype.on=function(e,t){var n=this.listeners.get(e);n||(n=[],this.listeners.set(e,n)),n.push(t)},e.prototype.onAny=function(e){var t=this.anyListeners;t||(t=[],this.anyListeners=t),t.push(e)},e.prototype.off=function(e,t){var n=this.listeners.get(e);if(n){var r=n.indexOf(t);r>=0&&n.splice(r,1)}},e.prototype.offAny=function(e){var t=this.anyListeners;if(t){var n=t.indexOf(e);n>=0&&t.splice(n,1)}},e.prototype.trigger=function(e,t){var n,r=this.listeners.get(e);if(r)for(var i=0,o=r;i<o.length;i++)(0,o[i])(t,e);if(this.anyListeners)for(var a=0,s=this.anyListeners;a<s.length;a++)(0,s[a])(((n={})[e]=t,n),e)},e}();t.EventSource=n;var r=function(){function e(){this.unsubscribeByKey=new Map,this.onDispose=[]}return e.prototype.listen=function(e,t,n){e.on(t,n),this.onDispose.push((function(){return e.off(t,n)}))},e.prototype.listenAny=function(e,t){e.onAny(t),this.onDispose.push((function(){return e.offAny(t)}))},e.prototype.listenOnce=function(e,t,n){var r=!1,i=function(o,a){r=!0,e.off(t,i),n(o,a)};e.on(t,i),this.onDispose.push((function(){r||e.off(t,i)}))},e.prototype.stopListening=function(){for(var e=0,t=this.onDispose;e<t.length;e++)(0,t[e])();this.onDispose.length=0,this.unsubscribeByKey.forEach((function(e){for(var t=0,n=e;t<n.length;t++)(0,n[t])()})),this.unsubscribeByKey.clear()},e}();t.EventObserver=r},345:(e,t,n)=>{"use strict";const{StringPrototypeSlice:r,SymbolIterator:i,TypedArrayPrototypeSet:o,Uint8Array:a}=n(4134),{Buffer:s}=n(8287),{inspect:l}=n(7760);e.exports=class{constructor(){this.head=null,this.tail=null,this.length=0}push(e){const t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}unshift(e){const t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}shift(){if(0===this.length)return;const e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}clear(){this.head=this.tail=null,this.length=0}join(e){if(0===this.length)return"";let t=this.head,n=""+t.data;for(;null!==(t=t.next);)n+=e+t.data;return n}concat(e){if(0===this.length)return s.alloc(0);const t=s.allocUnsafe(e>>>0);let n=this.head,r=0;for(;n;)o(t,n.data,r),r+=n.data.length,n=n.next;return t}consume(e,t){const n=this.head.data;if(e<n.length){const t=n.slice(0,e);return this.head.data=n.slice(e),t}return e===n.length?this.shift():t?this._getString(e):this._getBuffer(e)}first(){return this.head.data}*[i](){for(let e=this.head;e;e=e.next)yield e.data}_getString(e){let t="",n=this.head,i=0;do{const o=n.data;if(!(e>o.length)){e===o.length?(t+=o,++i,n.next?this.head=n.next:this.head=this.tail=null):(t+=r(o,0,e),this.head=n,n.data=r(o,e));break}t+=o,e-=o.length,++i}while(null!==(n=n.next));return this.length-=i,t}_getBuffer(e){const t=s.allocUnsafe(e),n=e;let r=this.head,i=0;do{const s=r.data;if(!(e>s.length)){e===s.length?(o(t,s,n-e),++i,r.next?this.head=r.next:this.head=this.tail=null):(o(t,new a(s.buffer,s.byteOffset,e),n-e),this.head=r,r.data=s.slice(e));break}o(t,s,n-e),e-=s.length,++i}while(null!==(r=r.next));return this.length-=i,t}[Symbol.for("nodejs.util.inspect.custom")](e,t){return l(this,{...t,depth:0,customInspect:!1})}}},535:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NonRememberingHistory=t.Command=void 0;var r=n(315);t.Command={create:function(e,t){return{title:e,invoke:t}},effect:function(e,t){var n={title:e,invoke:function(){return t(),r}},r={title:"Skipped effect: "+e,invoke:function(){return n}};return n}};var i=function(){function e(){this.source=new r.EventSource,this.events=this.source,this.undoStack=[],this.redoStack=[],this.storeBatch=function(){},this.discardBatch=function(){}}return e.prototype.reset=function(){this.source.trigger("historyChanged",{hasChanges:!1})},e.prototype.undo=function(){throw new Error("Undo is unsupported")},e.prototype.redo=function(){throw new Error("Redo is unsupported")},e.prototype.execute=function(e){e.invoke(),this.source.trigger("historyChanged",{hasChanges:!0})},e.prototype.registerToUndo=function(e){this.source.trigger("historyChanged",{hasChanges:!0})},e.prototype.startBatch=function(e){return{history:this,store:this.storeBatch,discard:this.discardBatch}},e}();t.NonRememberingHistory=i},543:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>r});const r="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAbCAYAAAAOEM1uAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAZEQAAGREBkIelaAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAGCSURBVFiFzdi9ShxRFAfwn+uiaAoRVBQbbfMEFqIoFja+QCoLLQQr8R0sbdIJgTQiSgT1AcTKzkdIQhpTaOlX0GyK2WJ2c8d1Pt0/XBjOnTnnP+eerxnYxj0aJa9nfEOvlLirgFx8zaQhV8Ng2jfKiVT2amWxKAr1gOwElwXpH8NWXiXtMbKZV2EMHwP6F2P7dR1O8T2PeBW/8EMHp5TpwWGtJewF06JEuWmzu4ueqgnC55juw6ZsHE8B218F8qJsgkS1b0Grh74EbDdwioGqCYbQj6MEkhcYIlxm3opZrGEyh47eJqH22JvDOZbJ5sEJ4Rgqeh1nLTMr6Mv4bBpMZSV4hj9FMknA96wxeC3qCOvyxWAd88L17wobdHkWV0VwxP+e3ksgd6LiOrgtyvhn7DRlo3gM2K68kwziNqb7QTSC9eN3m9136cWvjVuf8FOHaSZPJ8mLfRw0r/8m3RQiuIQPBZEY67CfSCyOsttV0hG/CV3/0VQTTbxVIrW9rv6z8A+8NRQ5z9bcwQAAAABJRU5ErkJggg=="},577:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EditLinkForm=void 0;var r=n(1635),i=n(6540),o=n(6347),a=n(6398),s=n(8432),l=n(7725),u=n(9532),c="graph-explorer-edit-form",p=function(e){function t(t){var n=e.call(this,t)||this;return n.validationCancellation=new s.Cancellation,n.state={linkValue:{value:{link:t.link,direction:a.LinkDirection.out},validated:!0,allowChange:!0}},n}return r.__extends(t,e),t.prototype.componentDidMount=function(){this.validate()},t.prototype.componentDidUpdate=function(e,t){var n=this.state.linkValue;(0,o.sameLink)(n.value.link,t.linkValue.value.link)||this.validate(),n!==t.linkValue&&n.validated&&n.allowChange&&this.props.onChange(n.value.link)},t.prototype.componentWillUnmount=function(){this.validationCancellation.abort()},t.prototype.validate=function(){var e=this,t=this.props,n=t.editor,i=t.link,o=this.state.linkValue.value;this.setState({isValidating:!0}),this.validationCancellation.abort(),this.validationCancellation=new s.Cancellation;var a=this.validationCancellation.signal;(0,u.validateLinkType)(n,o.link,i).then((function(t){a.aborted||e.setState((function(e){var n=e.linkValue;return{linkValue:r.__assign(r.__assign(r.__assign({},n),t),{validated:!0}),isValidating:!1}}))}))},t.prototype.render=function(){var e=this,t=this.props,n=t.editor,r=t.view,o=t.metadataApi,a=t.source,s=t.target,p=this.state,d=p.linkValue,h=p.isValidating,f=!d.error;return i.createElement("div",{className:c},i.createElement("div",{className:"".concat(c,"__body")},i.createElement(u.LinkTypeSelector,{editor:n,view:r,metadataApi:o,linkValue:d,source:a,target:s,onChange:function(t){return e.setState({linkValue:{value:t,error:void 0,validated:!1,allowChange:!1}})}}),h?i.createElement("div",{className:"".concat(c,"__progress")},i.createElement(l.ProgressBar,{state:l.ProgressState.loading,height:10})):null),i.createElement("div",{className:"".concat(c,"__controls")},i.createElement("button",{className:"graph-explorer-btn graph-explorer-btn-success ".concat(c,"__apply-button"),onClick:function(){return e.props.onApply(d.value.link)},disabled:!f||h},"Apply"),i.createElement("button",{className:"graph-explorer-btn graph-explorer-btn-danger",onClick:this.props.onCancel},"Cancel")))},t}(i.Component);t.EditLinkForm=p},602:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AuthoredEntity=void 0;var r=n(1635),i=n(6540),o=n(7344),a=n(8432),s=n(4943),l=n(9413),u=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.queryCancellation=new a.Cancellation,r.onChangeAuthoringState=function(e){var t=e.source,n=e.previous,i=r.props.templateProps.data.id;t.authoringState.elements.get(i)!==n.elements.get(i)&&r.queryAllowedActions()},r.onEdit=function(){var e=r.context.workspace.editor,t=r.props.templateProps.elementId,n=e.model.getElement(t);e.showEditEntityForm(n)},r.onDelete=function(){var e=r.context.workspace.editor,t=r.props.templateProps.data;e.deleteEntity(t.id)},r.state={},r}return r.__extends(t,e),t.prototype.componentDidMount=function(){this.context.workspace.editor.events.on("changeAuthoringState",this.onChangeAuthoringState),this.queryAllowedActions()},t.prototype.componentDidUpdate=function(e){(this.props.templateProps.data!==e.templateProps.data||this.props.templateProps.isExpanded!==e.templateProps.isExpanded)&&this.queryAllowedActions()},t.prototype.componentWillUnmount=function(){this.context.workspace.editor.events.off("changeAuthoringState",this.onChangeAuthoringState),this.queryCancellation.abort()},t.prototype.queryAllowedActions=function(){var e=this.props.templateProps,t=e.isExpanded,n=e.data;if(t){this.queryCancellation.abort(),this.queryCancellation=new a.Cancellation;var r=this.context.workspace.editor;!r.metadataApi||l.AuthoringState.isDeletedElement(r.authoringState,n.id)?this.setState({canEdit:!1,canDelete:!1}):(this.queryCanEdit(n),this.queryCanDelete(n))}},t.prototype.queryCanEdit=function(e){var t=this,n=this.context.workspace.editor,r=this.queryCancellation.signal;this.setState({canEdit:void 0}),a.CancellationToken.mapCancelledToNull(r,n.metadataApi.canEditElement(e,r)).then((function(e){null!==e&&t.setState({canEdit:e})}))},t.prototype.queryCanDelete=function(e){var t=this,n=this.context.workspace.editor,r=this.queryCancellation.signal;this.setState({canDelete:void 0}),a.CancellationToken.mapCancelledToNull(r,n.metadataApi.canDeleteElement(e,r)).then((function(e){null!==e&&t.setState({canDelete:e})}))},t.prototype.render=function(){var e=this.props.children,t=this.context.paperArea.view,n=this.context.workspace.editor,r=this.state,i=r.canEdit,o=r.canDelete,a=this.props.templateProps.iri,s=n.authoringState.elements.get(a);return e({editor:n,view:t,canEdit:i,canDelete:o,editedIri:s&&s.type===l.AuthoringKind.ChangeElement?s.newIri:void 0,onEdit:this.onEdit,onDelete:this.onDelete})},t.contextTypes=r.__assign(r.__assign({},o.PaperAreaContextTypes),s.WorkspaceContextTypes),t}(i.Component);t.AuthoredEntity=u},644:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});const r="data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeD0iMHB4IiB5PSIwcHgiIHdpZHRoPSI0Ny44MjVweCIgaGVpZ2h0PSI0Ny44MjVweCIgdmlld0JveD0iMCAwIDQ3LjgyNSA0Ny44MjUiPgogICAgPHBhdGggZmlsbD0iI2JlYmM3MSIgZD0iTTM2LjQzOSwxMi42NDZjMC02LjkxOS01LjYwOC0xMi41MjctMTIuNTI4LTEyLjUyN1MxMS4zODQsNS43MjcsMTEuMzg0LDEyLjY0NmMwLDkuOTEzLDEyLjUyNywyNC41ODIsMTIuNTI3LDI0LjU4MgogICAgICAgIFMzNi40MzksMjIuNTA4LDM2LjQzOSwxMi42NDZ6IE0xNy43MzMsMTEuODk4YzAtMy40MTMsMi43NjctNi4xNzksNi4xNzktNi4xNzlzNi4xNzksMi43NjYsNi4xNzksNi4xNzkKICAgICAgICBjMCwzLjQxMy0yLjc2Nyw2LjE3OS02LjE3OSw2LjE3OVMxNy43MzMsMTUuMzExLDE3LjczMywxMS44OTh6Ii8+CiAgICA8Y2lyY2xlIGZpbGw9IiNiZWJjNzEiIGN4PSIyMy45MTEiIGN5PSIxMS44OTgiIHI9IjMuMDM4Ii8+CiAgICA8cGF0aCBmaWxsPSIjYmViYzcxIiBkPSJNMzAuOTk0LDMyLjg3Yy0xLjAyMSwxLjQ3Ni0xLjk3OSwyLjc2MS0yLjc3NywzLjc5M2M3LjkxNiwwLjQ3NiwxMy4xMDQsMi4xODUsMTUuMDM0LDMuNDU2CiAgICAgICAgYy0yLjI2MSwxLjQ5MS04Ljk3OSwzLjU4Ny0xOS4zMzgsMy41ODdjLTEwLjM1OCwwLTE3LjA3Ny0yLjA5Ny0xOS4zMzgtMy41ODdjMS45My0xLjI3MSw3LjExNC0yLjk3OSwxNS4wMjItMy40NTUKICAgICAgICBjLTAuOC0xLjAzMi0xLjc1OS0yLjMxNi0yLjc4MS0zLjc5MkM3LjA3NSwzMy44MzEsMCwzNi43MTMsMCw0MC4xMThjMCw0LjE5LDEwLjcwNyw3LjU4OCwyMy45MTMsNy41ODgKICAgICAgICBjMTMuMjA3LDAsMjMuOTEyLTMuMzk2LDIzLjkxMi03LjU4OEM0Ny44MjcsMzYuNzExLDQwLjc0NCwzMy44MjgsMzAuOTk0LDMyLjg3eiIvPgo8L3N2Zz4K"},658:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Navigator=void 0;var r=n(1635),i=n(6540),o=n(7804),a=n(8432),s=n(315),l=n(7587),u="graph-explorer-navigator",c=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.delayedRedraw=new a.Debouncer,r.listener=new s.EventObserver,r.scheduleRedraw=function(){r.state.expanded&&r.delayedRedraw.call(r.draw)},r.draw=function(){var e=r.props,t=e.paperTransform,n=e.width,i=e.height;r.calculateTransform();var o=r.canvas.getContext("2d");o.fillStyle="#EEEEEE",o.clearRect(0,0,n,i),o.fillRect(0,0,n,i);var a=(0,l.paneTopLeft)(t),s=(0,l.totalPaneSize)(t),u={x:a.x+s.x,y:a.y+s.y},c=p(a,0,r.transform),d=p(u,0,r.transform);o.fillStyle="white",o.fillRect(c.x,c.y,d.x-c.x,d.y-c.y),o.save(),r.drawElements(o),r.drawViewport(o),o.restore()},r.onDragViewport=function(e){if(e.preventDefault(),r.isDraggingViewport){var t=(n=r.canvasFromPageCoords(e.pageX,e.pageY),i=r.props.paperTransform,o=r.transform,a={x:o.paneOffset.x+(n.x-o.canvasOffset.x)/o.scale,y:o.paneOffset.y+(n.y-o.canvasOffset.y)/o.scale},(0,l.paperFromPaneCoords)(a,i));r.props.paperArea.centerTo(t)}var n,i,o,a},r.onMouseUp=function(){r.stopDraggingViewport()},r.onWheel=function(e){e.preventDefault();var t=Math.max(-1,Math.min(1,e.deltaY||e.deltaX));r.props.paperArea.zoomBy(.1*-t)},r.onToggleClick=function(){r.setState((function(e){return{expanded:!e.expanded}}),r.scheduleRedraw)},r.state={expanded:r.props.expanded},r}return r.__extends(t,e),t.prototype.componentDidMount=function(){var e=this.props,t=e.view,n=e.paperArea;this.listener.listen(t.events,"changeHighlight",this.scheduleRedraw),this.listener.listen(t.model.events,"changeCells",this.scheduleRedraw),this.listener.listen(t.model.events,"elementEvent",this.scheduleRedraw),this.listener.listen(n.events,"pointerMove",this.scheduleRedraw),this.listener.listen(n.events,"scroll",this.scheduleRedraw)},t.prototype.shouldComponentUpdate=function(e,t){return t!==this.state},t.prototype.componentWillUnmount=function(){this.delayedRedraw.dispose(),this.listener.stopListening(),this.stopDraggingViewport()},t.prototype.drawElements=function(e){var t=this,n=this.props,r=n.view,i=n.paperTransform;r.model.elements.forEach((function(n){var r=n.position,o=n.size;e.fillStyle=t.chooseElementColor(n);var a=d(r,i,t.transform),s=a.x,l=a.y,u=d({x:r.x+o.width,y:r.y+o.height},i,t.transform),c=u.x,p=u.y;e.fillRect(s,l,c-s,p-l)}))},t.prototype.chooseElementColor=function(e){var t=this.props.view;if(t.highlighter&&!t.highlighter(e))return"lightgray";var n=t.getTypeStyle(e.data.types).color,r=n.h,i=n.c,a=n.l;return(0,o.hcl)(r,i,a).toString()},t.prototype.drawViewport=function(e){var t=this.props,n=t.paperArea,r=(t.paperTransform,t.width),i=t.height;e.strokeStyle="#337ab7",e.lineWidth=2;var o=n.getAreaMetrics(),a=o.clientWidth,s=o.clientHeight,l=n.clientToScrollablePaneCoords(0,0),u=n.clientToScrollablePaneCoords(a,s),c=p(l,0,this.transform),d=c.x,h=c.y,f=p(u,0,this.transform),g=f.x,A=f.y;e.strokeRect(d,h,g-d,A-h),e.beginPath(),d<0&&(e.moveTo(0,h),e.lineTo(0,A)),h<0&&(e.moveTo(d,0),e.lineTo(g,0)),g>r&&(e.moveTo(r,h),e.lineTo(r,A)),A>i&&(e.moveTo(d,i),e.lineTo(g,i)),e.lineWidth=4,e.strokeStyle="#a0d2ff",e.setLineDash([5,5]),e.stroke()},t.prototype.calculateTransform=function(){var e=this.props,t=e.paperArea,n=e.paperTransform,r=e.width,i=e.height,o=e.scalePadding,a=t.getContentFittingBox(),s=Math.max(a.width,r/.25)*o,u=Math.max(a.height,i/.25)*o,c=(0,l.paneFromPaperCoords)({x:a.x-s,y:a.y-u},n),p=(0,l.paneFromPaperCoords)({x:a.x+a.width+s,y:a.y+a.height+u},n),d=p.x-c.x,h=p.y-c.y,f=Math.min(r/d,i/h),g={x:(r-d*f)/2,y:(i-h*f)/2};this.transform={scale:f,canvasOffset:g,paneOffset:c}},t.prototype.canvasFromPageCoords=function(e,t){var n=this.canvas.getBoundingClientRect(),r=n.top;return{x:e-n.left-window.pageXOffset,y:t-r-window.pageYOffset}},t.prototype.render=function(){var e=this,t=this.props,n=t.width,r=t.height,o=this.state.expanded;return i.createElement("div",{className:"".concat(u," ").concat(u,"--").concat(o?"expanded":"collapsed"),style:o?{width:n,height:r}:void 0},i.createElement("canvas",{ref:function(t){return e.canvas=t},width:n,height:r,onMouseDown:function(t){e.startDragginViewport(),e.onDragViewport(t)},onWheel:this.onWheel}),i.createElement("button",{className:"".concat(u,"__toggle"),title:o?"Collapse navigator":"Expand navigator",onClick:this.onToggleClick},i.createElement("div",{className:"".concat(u,"__toggle-icon")})))},t.prototype.startDragginViewport=function(){this.isDraggingViewport||(this.isDraggingViewport=!0,document.addEventListener("mousemove",this.onDragViewport),document.addEventListener("mouseup",this.onMouseUp))},t.prototype.stopDraggingViewport=function(){this.isDraggingViewport&&(this.isDraggingViewport=!1,document.removeEventListener("mousemove",this.onDragViewport),document.removeEventListener("mouseup",this.onMouseUp))},t.defaultProps={width:300,height:160,scalePadding:.2,expanded:!0},t}(i.Component);function p(e,t,n){return{x:n.canvasOffset.x+(e.x-n.paneOffset.x)*n.scale,y:n.canvasOffset.y+(e.y-n.paneOffset.y)*n.scale}}function d(e,t,n){return p((0,l.paneFromPaperCoords)(e,t),0,n)}t.Navigator=c},823:(e,t,n)=>{"use strict";const r=globalThis.AbortController||n(5568).AbortController,{codes:{ERR_INVALID_ARG_VALUE:i,ERR_INVALID_ARG_TYPE:o,ERR_MISSING_ARGS:a,ERR_OUT_OF_RANGE:s},AbortError:l}=n(6371),{validateAbortSignal:u,validateInteger:c,validateObject:p}=n(277),d=n(4134).Symbol("kWeak"),h=n(4134).Symbol("kResistStopPropagation"),{finished:f}=n(6238),g=n(7830),{addAbortSignalNoValidate:A}=n(4147),{isWritable:m,isNodeStream:y}=n(6115),{deprecate:v}=n(7760),{ArrayPrototypePush:b,Boolean:_,MathFloor:C,Number:x,NumberIsNaN:w,Promise:E,PromiseReject:k,PromiseResolve:I,PromisePrototypeThen:S,Symbol:T}=n(4134),L=T("kEmpty"),M=T("kEof");function N(e,t){if("function"!=typeof e)throw new o("fn",["Function","AsyncFunction"],e);null!=t&&p(t,"options"),null!=(null==t?void 0:t.signal)&&u(t.signal,"options.signal");let r=1;null!=(null==t?void 0:t.concurrency)&&(r=C(t.concurrency));let i=r-1;return null!=(null==t?void 0:t.highWaterMark)&&(i=C(t.highWaterMark)),c(r,"options.concurrency",1),c(i,"options.highWaterMark",0),i+=r,async function*(){const o=n(7760).AbortSignalAny([null==t?void 0:t.signal].filter(_)),a=this,s=[],u={signal:o};let c,p,d=!1,h=0;function f(){d=!0,g()}function g(){h-=1,A()}function A(){p&&!d&&h<r&&s.length<i&&(p(),p=null)}!async function(){try{for await(let t of a){if(d)return;if(o.aborted)throw new l;try{if(t=e(t,u),t===L)continue;t=I(t)}catch(e){t=k(e)}h+=1,S(t,g,f),s.push(t),c&&(c(),c=null),!d&&(s.length>=i||h>=r)&&await new E((e=>{p=e}))}s.push(M)}catch(e){const t=k(e);S(t,g,f),s.push(t)}finally{d=!0,c&&(c(),c=null)}}();try{for(;;){for(;s.length>0;){const e=await s[0];if(e===M)return;if(o.aborted)throw new l;e!==L&&(yield e),s.shift(),A()}await new E((e=>{c=e}))}}finally{d=!0,p&&(p(),p=null)}}.call(this)}async function j(e,t=void 0){for await(const n of D.call(this,e,t))return!0;return!1}function D(e,t){if("function"!=typeof e)throw new o("fn",["Function","AsyncFunction"],e);return N.call(this,(async function(t,n){return await e(t,n)?t:L}),t)}class O extends a{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}}function P(e){if(e=x(e),w(e))return 0;if(e<0)throw new s("number",">= 0",e);return e}e.exports.streamReturningOperators={asIndexedPairs:v((function(e=void 0){return null!=e&&p(e,"options"),null!=(null==e?void 0:e.signal)&&u(e.signal,"options.signal"),async function*(){let t=0;for await(const r of this){var n;if(null!=e&&null!==(n=e.signal)&&void 0!==n&&n.aborted)throw new l({cause:e.signal.reason});yield[t++,r]}}.call(this)}),"readable.asIndexedPairs will be removed in a future version."),drop:function(e,t=void 0){return null!=t&&p(t,"options"),null!=(null==t?void 0:t.signal)&&u(t.signal,"options.signal"),e=P(e),async function*(){var n;if(null!=t&&null!==(n=t.signal)&&void 0!==n&&n.aborted)throw new l;for await(const n of this){var r;if(null!=t&&null!==(r=t.signal)&&void 0!==r&&r.aborted)throw new l;e--<=0&&(yield n)}}.call(this)},filter:D,flatMap:function(e,t){const n=N.call(this,e,t);return async function*(){for await(const e of n)yield*e}.call(this)},map:N,take:function(e,t=void 0){return null!=t&&p(t,"options"),null!=(null==t?void 0:t.signal)&&u(t.signal,"options.signal"),e=P(e),async function*(){var n;if(null!=t&&null!==(n=t.signal)&&void 0!==n&&n.aborted)throw new l;for await(const n of this){var r;if(null!=t&&null!==(r=t.signal)&&void 0!==r&&r.aborted)throw new l;if(e-- >0&&(yield n),e<=0)return}}.call(this)},compose:function(e,t){if(null!=t&&p(t,"options"),null!=(null==t?void 0:t.signal)&&u(t.signal,"options.signal"),y(e)&&!m(e))throw new i("stream",e,"must be writable");const n=g(this,e);return null!=t&&t.signal&&A(t.signal,n),n}},e.exports.promiseReturningOperators={every:async function(e,t=void 0){if("function"!=typeof e)throw new o("fn",["Function","AsyncFunction"],e);return!await j.call(this,(async(...t)=>!await e(...t)),t)},forEach:async function(e,t){if("function"!=typeof e)throw new o("fn",["Function","AsyncFunction"],e);for await(const n of N.call(this,(async function(t,n){return await e(t,n),L}),t));},reduce:async function(e,t,n){var i;if("function"!=typeof e)throw new o("reducer",["Function","AsyncFunction"],e);null!=n&&p(n,"options"),null!=(null==n?void 0:n.signal)&&u(n.signal,"options.signal");let a=arguments.length>1;if(null!=n&&null!==(i=n.signal)&&void 0!==i&&i.aborted){const e=new l(void 0,{cause:n.signal.reason});throw this.once("error",(()=>{})),await f(this.destroy(e)),e}const s=new r,c=s.signal;if(null!=n&&n.signal){const e={once:!0,[d]:this,[h]:!0};n.signal.addEventListener("abort",(()=>s.abort()),e)}let g=!1;try{for await(const r of this){var A;if(g=!0,null!=n&&null!==(A=n.signal)&&void 0!==A&&A.aborted)throw new l;a?t=await e(t,r,{signal:c}):(t=r,a=!0)}if(!g&&!a)throw new O}finally{s.abort()}return t},toArray:async function(e){null!=e&&p(e,"options"),null!=(null==e?void 0:e.signal)&&u(e.signal,"options.signal");const t=[];for await(const r of this){var n;if(null!=e&&null!==(n=e.signal)&&void 0!==n&&n.aborted)throw new l(void 0,{cause:e.signal.reason});b(t,r)}return t},some:j,find:async function(e,t){for await(const n of D.call(this,e,t))return n}}},843:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});const r="data:image/svg+xml;base64,PHN2Zy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I4LDAuNjcyLTEuNSwxLjUtMS41aDUuOTQ3YzAuODI5LDAsMS41LDAuNjcyLDEuNSwxLjV2MjAuMzQKICAgICAgICBjMCwwLjgyOC0wLjY3MSwxLjUtMS41LDEuNWgtNS45NDdjLTAuODI4LDAtMS41LTAuNjcyLTEuNS0xLjVWOC4wMzd6IE0xOC44OCw4LjAzN2MwLTAuODI4LDAuNjcxLTEuNSwxLjUtMS41aDUuOTQ3CiAgICAgICAgYzAuODI5LDAsMS41LDAuNjcyLDEuNSwxLjV2MjAuMzRjMCwwLjgyOC0wLjY3MSwxLjUtMS41LDEuNUgyMC4zOGMtMC44MjksMC0xLjUtMC42NzItMS41LTEuNVY4LjAzN3ogTTg3LjA2OCw4NC45MDIKICAgICAgICBjMCwwLjgyOC0wLjY3LDEuNS0xLjUsMS41SDExLjkwM2MtMC44MjksMC0xLjUtMC42NzItMS41LTEuNXYtNDBjMC0wLjgyOCwwLjY3MS0xLjUsMS41LTEuNWg3My42NjZjMC44MywwLDEuNSwwLjY3MiwxLjUsMS41CiAgICAgICAgVjg0LjkwMnoiLz4KICA8cmVjdCBmaWxsPSIjYjRiMWZiIiB4PSI2NC41NjgiIHk9IjQ3Ljc1MyIgd2lkdGg9IjE0LjMzNCIgaGVpZ2h0PSIxNC4zMzMiLz4KICA8cmVjdCBmaWxsPSIjYjRiMWZiIiB4PSI2NC41NjgiIHk9IjY3Ljc1NCIgd2lkdGg9IjE0LjMzNCIgaGVpZ2h0PSIxNC4zMzIiLz4KPC9zdmc+Cg=="},847:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SearchResults=void 0;var r=n(1635),i=n(6540),o=n(3789),a=n(8432),s=n(315),l=n(6158),u=function(e){function t(t){var n=e.call(this,t)||this;return n.listener=new s.EventObserver,n.delayedChangeCells=new a.Debouncer,n.startSelection=0,n.endSelection=0,n.onRootMount=function(e){n.root=e},n.renderResultItem=function(e){var t=n.props.useDragAndDrop,r=n.canBeSelected(e);return i.createElement(l.ListElementView,{key:e.id,model:e,view:n.props.view,highlightText:n.props.highlightText,disabled:!r,selected:n.props.selection.has(e.id),onClick:r?n.onItemClick:void 0,onDragStart:t?function(t){var r=n.props.selection,i=[];return r.forEach((function(e){return i.push(e)})),r.has(e.id)||i.push(e.id),(0,l.startDragElements)(t,i)}:void 0})},n.onChangeCells=function(){var e=n.props,t=e.items,r=e.selection;if(0===r.size)t&&t.length>0&&n.forceUpdate();else{for(var i=(0,o.cloneSet)(r),a=0,s=n.props.view.model.elements;a<s.length;a++){var l=s[a];void 0===l.group&&r.has(l.iri)&&i.delete(l.iri)}n.updateSelection(i)}},n.addKeyListener=function(){document.addEventListener("keydown",n.onKeyUp)},n.removeKeyListener=function(){document.removeEventListener("keydown",n.onKeyUp)},n.onKeyUp=function(e){var t=n.props.items,r=38===e.keyCode||38===e.which,i=40===e.keyCode||40===e.which;if(r||i)if(e.shiftKey){r?n.endSelection=n.getNextIndex(n.endSelection,0):i&&(n.endSelection=n.getNextIndex(n.endSelection,1));var o=Math.min(n.startSelection,n.endSelection),a=Math.max(n.startSelection,n.endSelection),s=n.selectRange(o,a);n.updateSelection(s),n.focusOn(n.endSelection)}else{o=Math.min(n.startSelection,n.endSelection),a=Math.max(n.startSelection,n.endSelection),r?n.startSelection=n.getNextIndex(o,0):i&&(n.startSelection=n.getNextIndex(a,1)),n.endSelection=n.startSelection;var l=t[n.startSelection],u=new Set;u.add(l.id),n.updateSelection(u),n.focusOn(n.startSelection)}e.preventDefault()},n.onItemClick=function(e,t){e.preventDefault();var r,i=n.props,a=i.items,s=i.selection,l=i.onSelectionChanged,u=a.indexOf(t);if(e.shiftKey&&-1!==n.startSelection){var c=Math.min(n.startSelection,u),p=Math.max(n.startSelection,u);r=n.selectRange(c,p)}else n.endSelection=n.startSelection=u,e.ctrlKey||e.metaKey?(r=(0,o.cloneSet)(s),s.has(t.id)?r.delete(t.id):r.add(t.id)):(r=new Set).add(t.id);l(r)},n.state={selection:t.selection||{}},n}return r.__extends(t,e),t.prototype.render=function(){var e=this.props.items||[];return i.createElement("ul",{className:"graph-explorer-search-results",ref:this.onRootMount,tabIndex:-1,onFocus:this.addKeyListener,onBlur:this.removeKeyListener},e.map(this.renderResultItem))},t.prototype.componentDidMount=function(){var e=this;this.listener.listen(this.props.view.model.events,"changeCells",(function(){e.delayedChangeCells.call(e.onChangeCells)}))},t.prototype.UNSAFE_componentWillReceiveProps=function(e){this.setState({selection:e.selection||{}})},t.prototype.componentWillUnmount=function(){this.removeKeyListener(),this.listener.stopListening(),this.delayedChangeCells.dispose()},t.prototype.updateSelection=function(e){(0,this.props.onSelectionChanged)(e)},t.prototype.selectRange=function(e,t){for(var n=this.props.items,r=new Set,i=e;i<=t;i++){var o=n[i];this.canBeSelected(o)&&r.add(o.id)}return r},t.prototype.getNextIndex=function(e,t){var n=this.props.items;if(0===n.length)return e;for(var r=0===t?-1:1,i=1;i<n.length;i++){var o=e+i*r;if(o<0&&(o+=n.length),o>=n.length&&(o-=n.length),this.canBeSelected(n[o]))return o}return e},t.prototype.canBeSelected=function(e){var t=this.props.view.model.elements.findIndex((function(t){return t.iri===e.id&&void 0===t.group}))>=0;return!this.props.useDragAndDrop||!t},t.prototype.focusOn=function(e){var t=this.root.parentElement,n=t.getBoundingClientRect(),r=this.root.children.item(e),i=r.getBoundingClientRect(),o=i.top-n.top,a=i.bottom-n.top;o<0?t.scrollTop+=o:a>n.height&&(t.scrollTop+=a-n.height),r.focus()},t.defaultProps={useDragAndDrop:!0},t}(i.Component);t.SearchResults=u},926:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DraggableHandle=void 0;var r=n(1635),i=n(6540),o=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.isHoldingMouse=!1,t.onHandleMouseDown=function(e){e.target!==e.currentTarget||t.isHoldingMouse||0===e.button&&(t.isHoldingMouse=!0,t.originPageX=e.pageX,t.originPageY=e.pageY,document.addEventListener("mousemove",t.onMouseMove),document.addEventListener("mouseup",t.onMouseUp),t.props.onBeginDragHandle(e))},t.onMouseMove=function(e){t.isHoldingMouse&&(e.preventDefault(),t.props.onDragHandle(e,e.pageX-t.originPageX,e.pageY-t.originPageY))},t.onMouseUp=function(e){t.removeListeners(),t.props.onEndDragHandle&&t.props.onEndDragHandle(e)},t}return r.__extends(t,e),t.prototype.render=function(){var e=this.props,t=(e.onBeginDragHandle,e.onDragHandle,e.onEndDragHandle,r.__rest(e,["onBeginDragHandle","onDragHandle","onEndDragHandle"]));return i.createElement("div",r.__assign({},t,{onMouseDown:this.onHandleMouseDown}),this.props.children)},t.prototype.componentWillUnmount=function(){this.removeListeners()},t.prototype.removeListeners=function(){this.isHoldingMouse&&(this.isHoldingMouse=!1,document.removeEventListener("mousemove",this.onMouseMove),document.removeEventListener("mouseup",this.onMouseUp))},t}(i.Component);t.DraggableHandle=o},961:(e,t,n)=>{"use strict";!function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(e){console.error(e)}}(),e.exports=n(2551)},994:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>r});const r="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAA60lEQVQ4T62TzQ2CQBBGv3FtwTI8UQEx8cCBDkw0UoEVbAU2IMaDHSwJBxNDBZwswxZc1ixhCbI/IUGOy7w3s7MzhJkfzeTRC6qqWsZx/JkiHMa2AiHEjohOjLFtkiTvkKQsy5WU8qGUOqdpeichxJ6IrgAWAF6MsY1P0sFPAGsAjVLqSEVRXABkg6xOyQg24TlxzhdRFOUADj6JB77VdZ21PQhJ9H8ppSnb5GhhznnTv4JP0hH6zhasD37mwCMZPkqf2RxagxSQWLBVgbE6JE7YKxg1FqZhrgEL7oKupJM1vun83zJNWSJXzBeWo4O9On9s3QAAAABJRU5ErkJggg=="},1035:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.HaloLink=void 0;var r=n(1635),i=n(6540),o=n(8051),a=n(315),s=n(8432),l=n(1863),u="graph-explorer-halo-link",c=20,p=function(e){function t(t){var n=e.call(this,t)||this;return n.listener=new a.EventObserver,n.targetListener=new a.EventObserver,n.queryDebouncer=new s.Debouncer,n.queryCancellation=new s.Cancellation,n.updateAll=function(){return n.forceUpdate()},n.onSourceMove=function(e){var t=n.props.paperArea.pageToPaperCoords(e.pageX,e.pageY);n.props.onSourceMove(t)},n.onTargetMove=function(e){var t=n.props.paperArea.pageToPaperCoords(e.pageX,e.pageY);n.props.onTargetMove(t)},n.state={},n}return r.__extends(t,e),t.prototype.componentDidMount=function(){var e=this,t=this.props,n=t.target,r=t.editor;this.listener.listen(r.events,"changeAuthoringState",(function(){e.queryAllowedActions()})),this.listenToTarget(n),this.queryAllowedActions()},t.prototype.componentDidUpdate=function(e){e.target!==this.props.target&&(this.listenToTarget(this.props.target),this.queryAllowedActions())},t.prototype.componentWillUnmount=function(){this.listener.stopListening(),this.listenToTarget(void 0),this.queryDebouncer.dispose(),this.queryCancellation.abort()},t.prototype.queryAllowedActions=function(){var e=this;this.queryDebouncer.call((function(){e.queryCancellation.abort(),e.queryCancellation=new s.Cancellation,e.queryCanDelete(e.props.target),e.queryCanEdit(e.props.target)}))},t.prototype.queryCanDelete=function(e){var t=this,n=this.props,r=n.metadataApi,i=n.editor,o=n.view;if(r)if(f(i.authoringState,e))this.setState({canDelete:!1});else{this.setState({canDelete:void 0});var a=o.model.getElement(e.sourceId),l=o.model.getElement(e.targetId),u=this.queryCancellation.signal;s.CancellationToken.mapCancelledToNull(u,r.canDeleteLink(e.data,a.data,l.data,u)).then((function(n){null!==n&&t.props.target.id===e.id&&t.setState({canDelete:n})}))}else this.setState({canDelete:!1})},t.prototype.queryCanEdit=function(e){var t=this,n=this.props,r=n.metadataApi,i=n.editor,o=n.view;if(r)if(d(i.authoringState,e))this.setState({canEdit:!1});else{this.setState({canEdit:void 0});var a=o.model.getElement(e.sourceId),l=o.model.getElement(e.targetId),u=this.queryCancellation.signal;s.CancellationToken.mapCancelledToNull(u,r.canEditLink(e.data,a.data,l.data,u)).then((function(n){null!==n&&t.props.target.id===e.id&&t.setState({canEdit:n})}))}else this.setState({canEdit:!1})},t.prototype.listenToTarget=function(e){var t=this,n=this.props.view;if(this.targetListener.stopListening(),e){var r=n.model.getElement(e.sourceId),i=n.model.getElement(e.targetId),o=function(e){t.targetListener.listen(e.events,"changePosition",t.updateAll),t.targetListener.listen(e.events,"changeSize",t.updateAll)};o(r),o(i),this.targetListener.listen(e.events,"changeVertices",this.updateAll),this.targetListener.listen(e.events,"changeLabelBounds",this.updateAll)}},t.prototype.paperToScrollablePaneCoords=function(e){return this.props.paperArea.paperToScrollablePaneCoords(e.x,e.y)},t.prototype.computePolyline=function(){var e=this.props,t=e.view,n=e.target,r=t.model.getElement(n.sourceId),i=t.model.getElement(n.targetId);if(r&&i){var a=t.getRouting(n.id),s=n.vertices||[],l=a?a.vertices:s;return(0,o.computePolyline)(r,i,l)}},t.prototype.calculateDegree=function(e,t){var n=t.x-e.x,r=t.y-e.y,i=Math.sqrt(n*n+r*r),o={x:n/i,y:r/i};return Math.atan2(o.y,o.x)*(180/Math.PI)},t.prototype.renderSourceButton=function(e){var t=this.props,n=t.editor,r=t.target,a=(0,o.getPointAlongPolyline)(e,0),s=this.paperToScrollablePaneCoords(a),l=s.x,p={top:s.y-10,left:l-10};return i.createElement("button",{className:"".concat(u,"__button"),style:p,disabled:d(n.authoringState,r),onMouseDown:this.onSourceMove},i.createElement("svg",{width:c,height:c},i.createElement("g",{transform:"scale(".concat(c,")")},i.createElement("circle",{r:.5,cx:.5,cy:.5,fill:"#198AD3"}))))},t.prototype.getButtonPosition=function(e,t){var n=(0,o.computePolylineLength)(e),r=(0,o.getPointAlongPolyline)(e,n-25*t),i=this.paperToScrollablePaneCoords(r),a=i.x;return{top:i.y-10,left:a-10}},t.prototype.renderTargetButton=function(e){var t=this.props,n=t.editor,r=t.target,o=this.getButtonPosition(e,0),a=e.length,s=this.calculateDegree(e[a-1],e[a-2]);return i.createElement("button",{className:"".concat(u,"__button"),style:o,disabled:d(n.authoringState,r),onMouseDown:this.onTargetMove},i.createElement("svg",{width:c,height:c,style:{transform:"rotate(".concat(s,"deg)")}},i.createElement("g",{transform:"scale(".concat(c,")")},i.createElement("polygon",{points:"0,0.5 1,1 1,0",fill:"#198AD3"}))))},t.prototype.renderEditButton=function(e){var t=this.state.canEdit,n=this.getButtonPosition(e,1);if(void 0===t)return i.createElement("div",{className:"".concat(u,"__spinner"),style:n},i.createElement(l.HtmlSpinner,{width:20,height:20}));var r=t?"Edit link":"Editing is unavailable for the selected link";return