@hpcc-js/react
Version:
hpcc-js - Viz React
2 lines • 32.9 kB
JavaScript
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@hpcc-js/common")):"function"==typeof define&&define.amd?define(["exports","@hpcc-js/common"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self)["@hpcc-js/react"]={},t["@hpcc-js/common"])}(this,(function(t,e){"use strict";var n,o,i,r,a,l,c,_={},s=[],d=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,h=Array.isArray;function u(t,e){for(var n in e)t[n]=e[n];return t}function f(t){var e=t.parentNode;e&&e.removeChild(t)}function p(t,e,o){var i,r,a,l={};for(a in e)"key"==a?i=e[a]:"ref"==a?r=e[a]:l[a]=e[a];if(arguments.length>2&&(l.children=arguments.length>3?n.call(arguments,2):o),"function"==typeof t&&null!=t.defaultProps)for(a in t.defaultProps)void 0===l[a]&&(l[a]=t.defaultProps[a]);return v(t,l,i,r,null)}function v(t,e,n,r,a){var l={type:t,props:e,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==a?++i:a};return null==a&&null!=o.vnode&&o.vnode(l),l}function g(t){return t.children}function m(t,e){this.props=t,this.context=e}function y(t,e){if(null==e)return t.__?y(t.__,t.__.__k.indexOf(t)+1):null;for(var n;e<t.__k.length;e++)if(null!=(n=t.__k[e])&&null!=n.__e)return n.__e;return"function"==typeof t.type?y(t):null}function x(t){var e,n;if(null!=(t=t.__)&&null!=t.__c){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if(null!=(n=t.__k[e])&&null!=n.__e){t.__e=t.__c.base=n.__e;break}return x(t)}}function k(t){(!t.__d&&(t.__d=!0)&&r.push(t)&&!F.__r++||a!==o.debounceRendering)&&((a=o.debounceRendering)||l)(F)}function F(){var t,e,n,o,i,a,l,_;for(r.sort(c);t=r.shift();)t.__d&&(e=r.length,o=void 0,i=void 0,l=(a=(n=t).__v).__e,(_=n.__P)&&(o=[],(i=u({},a)).__v=a.__v+1,H(_,a,i,n.__n,void 0!==_.ownerSVGElement,null!=a.__h?[l]:null,o,null==l?y(a):l,a.__h),E(o,a),a.__e!=l&&x(a)),r.length>e&&r.sort(c));F.__r=0}function b(t,e,n,o,i,r,a,l,c,d){var u,f,p,m,x,k,F,b=o&&o.__k||s,R=b.length;for(n.__k=[],u=0;u<e.length;u++)if(null!=(m=n.__k[u]=null==(m=e[u])||"boolean"==typeof m||"function"==typeof m?null:"string"==typeof m||"number"==typeof m||"bigint"==typeof m?v(null,m,null,null,m):h(m)?v(g,{children:m},null,null,null):m.__b>0?v(m.type,m.props,m.key,m.ref?m.ref:null,m.__v):m)){if(m.__=n,m.__b=n.__b+1,null===(p=b[u])||p&&m.key==p.key&&m.type===p.type)b[u]=void 0;else for(f=0;f<R;f++){if((p=b[f])&&m.key==p.key&&m.type===p.type){b[f]=void 0;break}p=null}H(t,m,p=p||_,i,r,a,l,c,d),x=m.__e,(f=m.ref)&&p.ref!=f&&(F||(F=[]),p.ref&&F.push(p.ref,null,m),F.push(f,m.__c||x,m)),null!=x?(null==k&&(k=x),"function"==typeof m.type&&m.__k===p.__k?m.__d=c=C(m,c,t):c=w(t,m,p,b,x,c),"function"==typeof n.type&&(n.__d=c)):c&&p.__e==c&&c.parentNode!=t&&(c=y(p))}for(n.__e=k,u=R;u--;)null!=b[u]&&("function"==typeof n.type&&null!=b[u].__e&&b[u].__e==n.__d&&(n.__d=S(o).nextSibling),U(b[u],b[u]));if(F)for(u=0;u<F.length;u++)T(F[u],F[++u],F[++u])}function C(t,e,n){for(var o,i=t.__k,r=0;i&&r<i.length;r++)(o=i[r])&&(o.__=t,e="function"==typeof o.type?C(o,e,n):w(n,o,o,i,o.__e,e));return e}function w(t,e,n,o,i,r){var a,l,c;if(void 0!==e.__d)a=e.__d,e.__d=void 0;else if(null==n||i!=r||null==i.parentNode)t:if(null==r||r.parentNode!==t)t.appendChild(i),a=null;else{for(l=r,c=0;(l=l.nextSibling)&&c<o.length;c+=1)if(l==i)break t;t.insertBefore(i,r),a=r}return void 0!==a?a:i.nextSibling}function S(t){var e,n,o;if(null==t.type||"string"==typeof t.type)return t.__e;if(t.__k)for(e=t.__k.length-1;e>=0;e--)if((n=t.__k[e])&&(o=S(n)))return o;return null}function R(t,e,n){"-"===e[0]?t.setProperty(e,null==n?"":n):t[e]=null==n?"":"number"!=typeof n||d.test(e)?n:n+"px"}function W(t,e,n,o,i){var r;t:if("style"===e)if("string"==typeof n)t.style.cssText=n;else{if("string"==typeof o&&(t.style.cssText=o=""),o)for(e in o)n&&e in n||R(t.style,e,"");if(n)for(e in n)o&&n[e]===o[e]||R(t.style,e,n[e])}else if("o"===e[0]&&"n"===e[1])r=e!==(e=e.replace(/Capture$/,"")),e=e.toLowerCase()in t?e.toLowerCase().slice(2):e.slice(2),t.l||(t.l={}),t.l[e+r]=n,n?o||t.addEventListener(e,r?P:O,r):t.removeEventListener(e,r?P:O,r);else if("dangerouslySetInnerHTML"!==e){if(i)e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!==e&&"height"!==e&&"href"!==e&&"list"!==e&&"form"!==e&&"tabIndex"!==e&&"download"!==e&&"rowSpan"!==e&&"colSpan"!==e&&e in t)try{t[e]=null==n?"":n;break t}catch(t){}"function"==typeof n||(null==n||!1===n&&"-"!==e[4]?t.removeAttribute(e):t.setAttribute(e,n))}}function O(t){return this.l[t.type+!1](o.event?o.event(t):t)}function P(t){return this.l[t.type+!0](o.event?o.event(t):t)}function H(t,e,n,i,r,a,l,c,_){var s,d,f,p,v,y,x,k,F,C,w,S,R,W,O,P=e.type;if(void 0!==e.constructor)return null;null!=n.__h&&(_=n.__h,c=e.__e=n.__e,e.__h=null,a=[c]),(s=o.__b)&&s(e);try{t:if("function"==typeof P){if(k=e.props,F=(s=P.contextType)&&i[s.__c],C=s?F?F.props.value:s.__:i,n.__c?x=(d=e.__c=n.__c).__=d.__E:("prototype"in P&&P.prototype.render?e.__c=d=new P(k,C):(e.__c=d=new m(k,C),d.constructor=P,d.render=N),F&&F.sub(d),d.props=k,d.state||(d.state={}),d.context=C,d.__n=i,f=d.__d=!0,d.__h=[],d._sb=[]),null==d.__s&&(d.__s=d.state),null!=P.getDerivedStateFromProps&&(d.__s==d.state&&(d.__s=u({},d.__s)),u(d.__s,P.getDerivedStateFromProps(k,d.__s))),p=d.props,v=d.state,d.__v=e,f)null==P.getDerivedStateFromProps&&null!=d.componentWillMount&&d.componentWillMount(),null!=d.componentDidMount&&d.__h.push(d.componentDidMount);else{if(null==P.getDerivedStateFromProps&&k!==p&&null!=d.componentWillReceiveProps&&d.componentWillReceiveProps(k,C),!d.__e&&null!=d.shouldComponentUpdate&&!1===d.shouldComponentUpdate(k,d.__s,C)||e.__v===n.__v){for(e.__v!==n.__v&&(d.props=k,d.state=d.__s,d.__d=!1),d.__e=!1,e.__e=n.__e,e.__k=n.__k,e.__k.forEach((function(t){t&&(t.__=e)})),w=0;w<d._sb.length;w++)d.__h.push(d._sb[w]);d._sb=[],d.__h.length&&l.push(d);break t}null!=d.componentWillUpdate&&d.componentWillUpdate(k,d.__s,C),null!=d.componentDidUpdate&&d.__h.push((function(){d.componentDidUpdate(p,v,y)}))}if(d.context=C,d.props=k,d.__P=t,S=o.__r,R=0,"prototype"in P&&P.prototype.render){for(d.state=d.__s,d.__d=!1,S&&S(e),s=d.render(d.props,d.state,d.context),W=0;W<d._sb.length;W++)d.__h.push(d._sb[W]);d._sb=[]}else do{d.__d=!1,S&&S(e),s=d.render(d.props,d.state,d.context),d.state=d.__s}while(d.__d&&++R<25);d.state=d.__s,null!=d.getChildContext&&(i=u(u({},i),d.getChildContext())),f||null==d.getSnapshotBeforeUpdate||(y=d.getSnapshotBeforeUpdate(p,v)),b(t,h(O=null!=s&&s.type===g&&null==s.key?s.props.children:s)?O:[O],e,n,i,r,a,l,c,_),d.base=e.__e,e.__h=null,d.__h.length&&l.push(d),x&&(d.__E=d.__=null),d.__e=!1}else null==a&&e.__v===n.__v?(e.__k=n.__k,e.__e=n.__e):e.__e=D(n.__e,e,n,i,r,a,l,_);(s=o.diffed)&&s(e)}catch(t){e.__v=null,(_||null!=a)&&(e.__e=c,e.__h=!!_,a[a.indexOf(c)]=null),o.__e(t,e,n)}}function E(t,e){o.__c&&o.__c(e,t),t.some((function(e){try{t=e.__h,e.__h=[],t.some((function(t){t.call(e)}))}catch(t){o.__e(t,e.__v)}}))}function D(t,e,o,i,r,a,l,c){var s,d,u,p=o.props,v=e.props,g=e.type,m=0;if("svg"===g&&(r=!0),null!=a)for(;m<a.length;m++)if((s=a[m])&&"setAttribute"in s==!!g&&(g?s.localName===g:3===s.nodeType)){t=s,a[m]=null;break}if(null==t){if(null===g)return document.createTextNode(v);t=r?document.createElementNS("http://www.w3.org/2000/svg",g):document.createElement(g,v.is&&v),a=null,c=!1}if(null===g)p===v||c&&t.data===v||(t.data=v);else{if(a=a&&n.call(t.childNodes),d=(p=o.props||_).dangerouslySetInnerHTML,u=v.dangerouslySetInnerHTML,!c){if(null!=a)for(p={},m=0;m<t.attributes.length;m++)p[t.attributes[m].name]=t.attributes[m].value;(u||d)&&(u&&(d&&u.__html==d.__html||u.__html===t.innerHTML)||(t.innerHTML=u&&u.__html||""))}if(function(t,e,n,o,i){var r;for(r in n)"children"===r||"key"===r||r in e||W(t,r,null,n[r],o);for(r in e)i&&"function"!=typeof e[r]||"children"===r||"key"===r||"value"===r||"checked"===r||n[r]===e[r]||W(t,r,e[r],n[r],o)}(t,v,p,r,c),u)e.__k=[];else if(b(t,h(m=e.props.children)?m:[m],e,o,i,r&&"foreignObject"!==g,a,l,a?a[0]:o.__k&&y(o,0),c),null!=a)for(m=a.length;m--;)null!=a[m]&&f(a[m]);c||("value"in v&&void 0!==(m=v.value)&&(m!==t.value||"progress"===g&&!m||"option"===g&&m!==p.value)&&W(t,"value",m,p.value,!1),"checked"in v&&void 0!==(m=v.checked)&&m!==t.checked&&W(t,"checked",m,p.checked,!1))}return t}function T(t,e,n){try{"function"==typeof t?t(e):t.current=e}catch(t){o.__e(t,n)}}function U(t,e,n){var i,r;if(o.unmount&&o.unmount(t),(i=t.ref)&&(i.current&&i.current!==t.__e||T(i,null,e)),null!=(i=t.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(t){o.__e(t,e)}i.base=i.__P=null,t.__c=void 0}if(i=t.__k)for(r=0;r<i.length;r++)i[r]&&U(i[r],e,n||"function"!=typeof t.type);n||null==t.__e||f(t.__e),t.__=t.__e=t.__d=void 0}function N(t,e,n){return this.constructor(t,n)}function A(t,e,i){var r,a,l;o.__&&o.__(t,e),a=(r="function"==typeof i)?null:i&&i.__k||e.__k,l=[],H(e,t=(!r&&i||e).__k=p(g,null,[t]),a||_,_,void 0!==e.ownerSVGElement,!r&&i?[i]:a?null:e.firstChild?n.call(e.childNodes):null,l,!r&&i?i:a?a.__e:e.firstChild,r),E(l,t)}n=s.slice,o={__e:function(t,e,n,o){for(var i,r,a;e=e.__;)if((i=e.__c)&&!i.__)try{if((r=i.constructor)&&null!=r.getDerivedStateFromError&&(i.setState(r.getDerivedStateFromError(t)),a=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(t,o||{}),a=i.__d),a)return i.__E=i}catch(e){t=e}throw t}},i=0,m.prototype.setState=function(t,e){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=u({},this.state),"function"==typeof t&&(t=t(u({},n),this.props)),t&&u(n,t),null!=t&&this.__v&&(e&&this._sb.push(e),k(this))},m.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),k(this))},m.prototype.render=g,r=[],l="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,c=function(t,e){return t.__v.__b-e.__v.__b},F.__r=0;var V,I,L,z,j=0,M=[],B=[],q=o.__b,G=o.__r,X=o.diffed,Y=o.__c,J=o.unmount;function K(t,e){o.__h&&o.__h(I,t,j||e),j=0;var n=I.__H||(I.__H={__:[],__h:[]});return t>=n.__.length&&n.__.push({__V:B}),n.__[t]}function $(t){return j=1,Q(ct,t)}function Q(t,e,n){var o=K(V++,2);if(o.t=t,!o.__c&&(o.__=[n?n(e):ct(void 0,e),function(t){var e=o.__N?o.__N[0]:o.__[0],n=o.t(e,t);e!==n&&(o.__N=[n,o.__[1]],o.__c.setState({}))}],o.__c=I,!I.u)){var i=function(t,e,n){if(!o.__c.__H)return!0;var i=o.__c.__H.__.filter((function(t){return t.__c}));if(i.every((function(t){return!t.__N})))return!r||r.call(this,t,e,n);var a=!1;return i.forEach((function(t){if(t.__N){var e=t.__[0];t.__=t.__N,t.__N=void 0,e!==t.__[0]&&(a=!0)}})),!(!a&&o.__c.props===t)&&(!r||r.call(this,t,e,n))};I.u=!0;var r=I.shouldComponentUpdate,a=I.componentWillUpdate;I.componentWillUpdate=function(t,e,n){if(this.__e){var o=r;r=void 0,i(t,e,n),r=o}a&&a.call(this,t,e,n)},I.shouldComponentUpdate=i}return o.__N||o.__}function Z(t,e){var n=K(V++,3);!o.__s&<(n.__H,e)&&(n.__=t,n.i=e,I.__H.__h.push(n))}function tt(t,e){var n=K(V++,7);return lt(n.__H,e)?(n.__V=t(),n.i=e,n.__h=t,n.__V):n.__}function et(t,e){return j=8,tt((function(){return t}),e)}function nt(){for(var t;t=M.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(rt),t.__H.__h.forEach(at),t.__H.__h=[]}catch(e){t.__H.__h=[],o.__e(e,t.__v)}}o.__b=function(t){I=null,q&&q(t)},o.__r=function(t){G&&G(t),V=0;var e=(I=t.__c).__H;e&&(L===I?(e.__h=[],I.__h=[],e.__.forEach((function(t){t.__N&&(t.__=t.__N),t.__V=B,t.__N=t.i=void 0}))):(e.__h.forEach(rt),e.__h.forEach(at),e.__h=[],V=0)),L=I},o.diffed=function(t){X&&X(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(1!==M.push(e)&&z===o.requestAnimationFrame||((z=o.requestAnimationFrame)||it)(nt)),e.__H.__.forEach((function(t){t.i&&(t.__H=t.i),t.__V!==B&&(t.__=t.__V),t.i=void 0,t.__V=B}))),L=I=null},o.__c=function(t,e){e.some((function(t){try{t.__h.forEach(rt),t.__h=t.__h.filter((function(t){return!t.__||at(t)}))}catch(n){e.some((function(t){t.__h&&(t.__h=[])})),e=[],o.__e(n,t.__v)}})),Y&&Y(t,e)},o.unmount=function(t){J&&J(t);var e,n=t.__c;n&&n.__H&&(n.__H.__.forEach((function(t){try{rt(t)}catch(t){e=t}})),n.__H=void 0,e&&o.__e(e,n.__v))};var ot="function"==typeof requestAnimationFrame;function it(t){var e,n=function(){clearTimeout(o),ot&&cancelAnimationFrame(e),setTimeout(t)},o=setTimeout(n,100);ot&&(e=requestAnimationFrame(n))}function rt(t){var e=I,n=t.__c;"function"==typeof n&&(t.__c=void 0,n()),I=e}function at(t){var e=I;t.__c=t.__(),I=e}function lt(t,e){return!t||t.length!==e.length||e.some((function(e,n){return e!==t[n]}))}function ct(t,e){return"function"==typeof e?e(t):e}var _t=Object.freeze({__proto__:null,BUILD_VERSION:"2.104.28",Component:m,Fragment:g,PKG_NAME:"@hpcc-js/preact-shim",PKG_VERSION:"2.16.6",createElement:p,h:p,render:A,useCallback:et,useEffect:Z,useMemo:tt,useReducer:Q,useState:$}),st=function(t,e){return st=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},st(t,e)};function dt(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}st(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var ht=function(){return ht=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},ht.apply(this,arguments)};function ut(t,e,n,o){var i,r=arguments.length,a=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var l=t.length-1;l>=0;l--)(i=t[l])&&(a=(r<3?i(a):r>3?i(e,n,a):i(e,n))||a);return r>3&&a&&Object.defineProperty(e,n,a),a}function ft(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}var pt=function(t){var e=t.href,n=t.x,o=t.y,i=void 0===o?0:o,r=t.height,a=void 0===r?12:r;return p("image",{href:e,x:n-a/2,y:i-a/2,width:a,height:a})},vt=function(t){var n=t.x,o=t.y,i=void 0===o?0:o,r=t.height,a=void 0===r?12:r,l=t.fill,c=t.stroke,_=t.fontFamily,s=void 0===_?"FontAwesome":_,d=t.char,h=void 0===d?"":d,u=tt((function(){return"FontAwesome"===s?e.Utility.faChar(h):h}),[h,s]);return p("text",{x:n,y:i,fill:l,stroke:c,"font-family":s,"font-size":"".concat(a,"px"),"dominant-baseline":"middle",style:"text-anchor: middle;alignment-baseline:middle;"},u)},gt=function(t){var e=t.radius,n=void 0===e?32:e,o=t.fill,i=void 0===o?"navy":o,r=t.stroke,a=void 0===r?i:r,l=t.strokeWidth;return p("circle",{r:n,fill:i,stroke:a,"stroke-width":void 0===l?1:l,"shape-rendering":t.shapeRendering})},mt=function(t){var e=t.radius,n=void 0===e?30:e,o=t.cornerRadius,i=void 0===o?0:o,r=t.fill,a=void 0===r?"white":r,l=t.stroke,c=t.strokeWidth;return p("rect",{x:-n,y:-n,rx:i,ry:i,width:2*n,height:2*n,fill:a,stroke:l||a,"stroke-width":void 0===c?1:c,"shape-rendering":t.shapeRendering})},yt=function(t){var e=t.width,n=void 0===e?30:e,o=t.height,i=void 0===o?30:o,r=t.cornerRadius,a=void 0===r?0:r,l=t.fill,c=void 0===l?"white":l,_=t.stroke,s=void 0===_?"black":_,d=t.strokeWidth;return p("rect",{x:-n/2,y:-i/2,rx:a,ry:a,width:n,height:i,fill:c,stroke:s||c,"stroke-width":void 0===d?1:d,"shape-rendering":t.shapeRendering})},xt=function(t){var e=t.shape,n=void 0===e?"circle":e,o=t.height,i=void 0===o?128:o,r=t.width,a=t.fill,l=t.stroke,c=t.strokeWidth,_=void 0===c?1:c,s=t.shapeRendering,d=t.cornerRadius;switch(n){case"square":return p(mt,{radius:i/2,fill:a,stroke:l,strokeWidth:_,shapeRendering:s,cornerRadius:d});case"rectangle":return p(yt,{width:null!=r?r:i,height:i,fill:a,stroke:l,strokeWidth:_,shapeRendering:s,cornerRadius:d});default:return p(gt,{radius:i/2,fill:a,stroke:l,strokeWidth:_,shapeRendering:s})}},kt=function(t){var n=t.shape,o=void 0===n?"circle":n,i=t.width,r=t.height,a=void 0===r?32:r,l=t.fill,c=t.stroke,_=t.strokeWidth,s=void 0===_?0:_,d=t.imageUrl,h=void 0===d?"":d,u=t.imageFontFamily,f=void 0===u?"FontAwesome":u,v=t.imageChar,m=void 0===v?"":v,y=t.imageCharFill,x=void 0===y?e.Palette.textColor(l):y,k=t.padding,F=void 0===k?a/5:k,b=t.xOffset,C=void 0===b?0:b,w=t.yOffset,S=void 0===w?0:w,R=t.cornerRadius,W=t.shapeRendering;return p(g,null,p(xt,{shape:o,width:i,height:a,fill:l,stroke:c,strokeWidth:s,shapeRendering:W,cornerRadius:R}),h?p(pt,{href:h,x:C,y:S,height:a-F}):p(vt,{x:C,y:S,height:a-F,fontFamily:f,char:m,fill:x,"font-weight":400}))},Ft=function(t){var e=t.text,n=t.height,o=void 0===n?12:n,i=t.anchor,r=void 0===i?"middle":i,a=t.baseline,l=void 0===a?"middle":a,c=t.fontFamily,_=void 0===c?"Verdana":c,s=t.fill,d=void 0===s?"black":s;return p("text",{"font-family":_,"font-size":"".concat(o,"px"),"text-anchor":r,"dominant-baseline":l,fill:d},e)},bt=function(t){var n=t.text,o=t.height,i=void 0===o?12:o,r=t.fontFamily,a=void 0===r?"Verdana":r,l=t.fill,c=void 0===l?"black":l,_=t.onSizeUpdate,s=$(0),d=s[0],h=s[1],u=$(0),f=u[0],v=u[1];Z((function(){_&&_({width:d,height:f})}),[d,f,_]);var m=tt((function(){return n.split("\n")}),[n]);h(tt((function(){return e.Utility.textSize(m,a,i)}),[a,i,m]).width),v(m.length*(i+2)-2);var y=-f/2+i/2,x=tt((function(){return m.map((function(t,e){return p("g",{key:e,transform:"translate(0 ".concat(y+e*(i+2),")")},p(Ft,{text:t,height:i,fontFamily:a,fill:c}))}))}),[c,a,i,m,y]);return p(g,null,x)},Ct=function(t){var e=t.text,n=t.height,o=void 0===n?12:n,i=t.fontFamily,r=void 0===i?"Verdana":i,a=t.padding,l=void 0===a?4:a,c=t.fill,_=void 0===c?"whitesmoke":c,s=t.stroke,d=void 0===s?"lightgray":s,h=t.textFill,u=void 0===h?"black":h,f=t.strokeWidth,v=void 0===f?1:f,m=t.cornerRadius,y=void 0===m?0:m,x=t.onSizeUpdate,k=$(0),F=k[0],b=k[1],C=$(0),w=C[0],S=C[1];Z((function(){x&&x({width:F,height:w})}),[F,w,x]);var R=et((function(t){b(t.width),S(t.height)}),[]),W=F+2*l+v,O=w+2*l+v,P=Math.floor(o/10);return p(g,null,p(yt,{width:W,height:O,fill:_,stroke:d,strokeWidth:v,cornerRadius:y}),p("g",{transform:"translate(0 ".concat(P,")")},p(bt,{text:e,fontFamily:r,height:o,fill:u,onSizeUpdate:R})))};function wt(t,e,n,o){A(p(t,e),n,o)}var St=function(t){function n(e){var n=t.call(this)||this;return n._component=e,n._props={},n}return dt(n,t),n.prototype.props=function(t){return arguments.length?(this._props=ht(ht({},this._props),t),this):this._props},n.prototype.prop=function(t,e){return 1===arguments.length?this._props[t]:(this._props[t]=e,this)},n.prototype.update=function(e,n){t.prototype.update.call(this,e,n),wt(this._component,this._props,e)},ut([e.publish({},"object","Properties"),ft("design:type",Object)],n.prototype,"_props",void 0),n}(e.HTMLWidget),Rt=function(t){function n(e){var n=t.call(this)||this;return n._component=e,n._props={},n}return dt(n,t),n.prototype.props=function(t){return arguments.length?(this._props=ht(ht({},this._props),t),this):this._props},n.prototype.prop=function(t,e){return 1===arguments.length?this._props[t]:(this._props[t]=e,this)},n.prototype.update=function(e,n){t.prototype.update.call(this,e,n),wt(this._component,this._props,e)},ut([e.publish({},"object","Properties"),ft("design:type",Object)],n.prototype,"_props",void 0),n}(e.SVGWidget),Wt=function(t){var e=t.x,n=t.y,o=t.annotationIDs,i=void 0===o?[]:o,r=t.stepSize,a=void 0===r?-16:r,l=i.map((function(t,o){return p("g",{key:t,transform:"translate(".concat(e+o*a," ").concat(n,")")},p("use",{href:"#"+t}))}));return p(g,null,l)},Ot=function(t){var n=t.text,o=void 0===n?"":n,i=t.textHeight,r=void 0===i?10:i,a=t.textPadding,l=void 0===a?4:a,c=t.textFill,_=void 0===c?"#287EC4":c,s=t.textboxFill,d=void 0===s?"white":s,h=t.textboxStroke,u=void 0===h?"#CCCCCC":h,f=t.textboxStrokeWidth,v=void 0===f?1:f,g=t.textFontFamily,m=void 0===g?"Verdana":g,y=t.annotationGutter,x=void 0===y?2:y,k=t.annotations,F=void 0===k?[]:k,b=t.cornerRadius,C=void 0===b?3:b,w=t.icon,S=void 0===w?{}:w,R=t.subText,W=void 0===R?{text:""}:R,O=t.showLabel,P=void 0===O||O,H=t.noLabelRadius,E=void 0===H?5:H,D=t.expansionIcon,T=t.scale,U=void 0===T?1:T;S=ht({height:50,imageChar:"?",imageFontFamily:"FontAwesome",imageCharFill:"#555555",fill:"transparent",strokeWidth:0},S),W=ht({text:"",fill:"white",textFill:"#555555"},W),D=D?ht({height:16,shape:"circle",padding:6,imageChar:"?",imageFontFamily:"FontAwesome",imageCharFill:"black",fill:"whitesmoke",stroke:"whitesmoke",strokeWidth:0},D):void 0;var N=0,A=tt((function(){return e.Utility.textSize(o,m,r,!1).width}),[o,m,r]),V=0;""!==o&&(V=A+2*l+2*v);var I=(N+=V+x)-V/2,L=r+2*l+2*v,z=[];F.forEach((function(t,e){var n=t.imageChar,o=(N+=L+x)-L/2;z.push(p("g",{key:e,class:"vertex3-anno","data-click":"annotation","data-click-data":JSON.stringify(t),transform:"translate(".concat(o," ").concat(0,")")},p(kt,ht({},t,{shape:"square",height:L,imageChar:n,imageFontFamily:t.imageFontFamily,cornerRadius:C,strokeWidth:0}))))})),F.length>0&&(N+=x*(F.length-1));var j=p("g",{"data-click":"text",transform:"translate(".concat(I," ").concat(0,")")},P&&""!==o?p(Ct,{text:o,height:r,padding:l,strokeWidth:v,stroke:u,fill:d,textFill:_,fontFamily:m,cornerRadius:C}):p("circle",{r:E,stroke:u,fill:_})),M=S.height||20,B=S.strokeWidth||0,q=0,G=L+2*x;""!==o||z.length>0?q=-M/2-B-L/2-2*x:""!==W.text&&(G=M/2+B+2*x);var X=""===W.text?null:p("g",{"data-click":"subtext",transform:"translate(".concat(0," ").concat(G,")")},p(Ct,ht({fill:W.fill||"#FFFFFF",textFill:W.textFill||_},W,{height:r,padding:l,strokeWidth:0,stroke:u,fontFamily:m,cornerRadius:C})));return p("g",{transform:"scale(".concat(U,")")},p("g",{"data-click":"icon",transform:"translate(".concat(0," ").concat(q,")")},p(kt,ht({},S)),D&&p("g",{"data-click":"expanded-icon","data-click-data":JSON.stringify(D),transform:"translate(".concat((S.height+B)/2-D.height/2," ").concat(-(S.height+B)/2+D.height/2,")")},p(kt,ht({},D)))),p("g",{transform:"translate(".concat(-N/2," ").concat(0,")")},j,z),X)},Pt=function(t){t.categoryID;var n=t.text,o=void 0===n?"":n,i=t.textHeight,r=void 0===i?10:i,a=t.textPadding,l=void 0===a?4:a,c=t.textFill,_=void 0===c?"#287EC4":c,s=t.textboxFill,d=void 0===s?"white":s,h=t.textboxStroke,u=void 0===h?"#CCCCCC":h,f=t.textboxStrokeWidth,v=void 0===f?1:f,g=t.textFontFamily,m=void 0===g?"Verdana":g,y=t.annotationGutter,x=void 0===y?2:y,k=t.annotations,F=void 0===k?[]:k,b=t.iconAnnotations,C=void 0===b?[]:b,w=t.cornerRadius,S=void 0===w?3:w,R=t.icon,W=void 0===R?{}:R,O=t.subText,P=void 0===O?{}:O,H=t.showLabel,E=void 0===H||H,D=t.noLabelRadius,T=void 0===D?5:D,U=t.iconBorderWidth,N=void 0===U?1:U,A=t.iconBorderColor,V=void 0===A?"#333":A,I=t.iconBackgroundColor,L=void 0===I?"#fff":I,z=t.iconFontColor,j=void 0===z?"#000":z,M=t.iconFontSize,B=void 0===M?20:M,q=t.iconFontFamily,G=void 0===q?"FontAwesome":q,X=t.shapeOffsetX,Y=void 0===X?0:X,J=t.shapeOffsetY,K=void 0===J?0:J,$=t.iconOffsetX,Q=void 0===$?0:$,Z=t.iconOffsetY,et=void 0===Z?0:Z,nt=t.iconPadding,ot=void 0===nt?4:nt,it=t.iconText,rt=void 0===it?"?":it,at=t.shapeRendering,lt=void 0===at?"auto":at;W=ht({height:50,imageChar:"?",imageFontFamily:"FontAwesome",imageCharFill:"#555555",fill:"transparent",strokeWidth:0},W),P=ht({text:"",fill:"white",textFill:"#555555"},P);var ct=tt((function(){return e.Utility.textSize(o,m,r,!1).width}),[o,m,r]),_t=0;""!==o&&(_t=ct+2*l+2*v);var st=_t+x,dt=st-_t/2,ut=r+2*x+2*v,ft=F.map((function(t,n){return e.Utility.textSize(t.imageChar,t.imageFontFamily,t.height,!1).width})),pt=[],vt=st;F.forEach((function(t,e){var n,o=t.imageChar,i=null!==(n=t.height)&&void 0!==n?n:ut,r=(vt+=ft[e]+x)-ft[e]/2;pt.push(p("g",{key:e,class:"vertex3-anno","data-click":"annotation","data-click-data":JSON.stringify(t),transform:"translate(".concat(r," ").concat(0,")")},p(kt,ht({},t,{shape:"rectangle",width:ft[e],height:i,imageChar:o,imageFontFamily:t.imageFontFamily,cornerRadius:S,strokeWidth:0}))))})),F.length>0&&(st+=x*(F.length-1));var gt=[];C.forEach((function(t,e){var n,o=t.shapeOffsetX,i=t.shapeOffsetY;gt.push(p("g",{key:e,class:"vertex3-iconAnno","data-click":"icon-annotation","data-click-data":JSON.stringify(t),transform:"translate(".concat(o," ").concat(i,")")},p(kt,ht({},t,{shape:null!==(n=t.shape)&&void 0!==n?n:"square",imageChar:t.imageChar,imageFontFamily:t.imageFontFamily,cornerRadius:S,stroke:t.stroke,strokeWidth:t.strokeWidth}))))}));var mt=p("g",{"data-click":"text",transform:"translate(".concat(dt," ").concat(0,")")},E&&""!==o?p(Ct,{text:o,height:r,padding:l,strokeWidth:v,stroke:u,fill:d,textFill:_,fontFamily:m,cornerRadius:S}):p("circle",{r:T,stroke:u,fill:_})),yt=ut+2*x,xt=""===P.text?null:p("g",{"data-click":"subtext",transform:"translate(".concat(0," ").concat(yt,")")},p(Ct,ht({fill:P.fill||"#FFFFFF",textFill:P.textFill||_},P,{height:r,padding:l,strokeWidth:0,stroke:u,fontFamily:m,cornerRadius:S})));return p("g",null,p("g",{"data-click":"icon",transform:"translate(".concat(Y," ").concat(K,")")},p(kt,ht({},W,{strokeWidth:N,shape:"circle",height:B,fill:L,stroke:V,imageFontFamily:G,imageChar:rt,imageCharFill:j,padding:ot,xOffset:Q,yOffset:et,cornerRadius:S,shapeRendering:lt})),gt),p("g",{transform:"translate(".concat(-st/2," ").concat(0,")")},mt,pt),xt)};t.Annotations=Wt,t.BUILD_VERSION="2.104.28",t.CentroidVertex3=function(t){var e=t.id,n=t.categoryID,o=void 0===n?"":n,i=t.text,r=void 0===i?"":i,a=t.textHeight,l=void 0===a?12:a,c=t.textPadding,_=void 0===c?10:c,s=t.textFill,d=void 0===s?"#287EC4":s,h=t.textboxFill,u=void 0===h?"white":h,f=t.textboxStroke,v=void 0===f?"#CCCCCC":f,g=t.textboxStrokeWidth,m=void 0===g?1:g,y=t.textFontFamily,x=void 0===y?"Verdana":y,k=t.annotationGutter,F=void 0===k?2:k,b=t.annotations,C=void 0===b?[]:b,w=t.cornerRadius,S=t.icon,R=void 0===S?{}:S,W=t.subText,O=void 0===W?{}:W,P=t.expansionIcon,H=t.scale,E=void 0===H?1:H;return R=ht({height:91,padding:40,imageCharFill:"#555555",imageFontFamily:"FontAwesome",fill:"#FFCC33",stroke:"#DFDFDF",imageChar:"?",strokeWidth:4,yOffset:-15},R),O=ht({text:"",fill:"transparent",textFill:"#555555"},O),p(Ot,ht({},{id:e,categoryID:o,text:r,textHeight:l,textPadding:_,textFill:d,textboxFill:u,textboxStroke:v,textboxStrokeWidth:m,textFontFamily:x,annotationGutter:F,annotations:C,cornerRadius:w,icon:R,subText:O,expansionIcon:P,scale:E},{icon:R,subText:O}))},t.CentroidVertex4=function(t){var e=t.id,n=t.categoryID,o=void 0===n?"":n,i=t.text,r=void 0===i?"":i,a=t.textHeight,l=void 0===a?12:a,c=t.textPadding,_=void 0===c?10:c,s=t.textFill,d=void 0===s?"#287EC4":s,h=t.textboxFill,u=void 0===h?"white":h,f=t.textboxStroke,v=void 0===f?"#CCCCCC":f,g=t.textboxStrokeWidth,m=void 0===g?1:g,y=t.textFontFamily,x=void 0===y?"Verdana":y,k=t.annotationGutter,F=void 0===k?2:k,b=t.annotations,C=void 0===b?[]:b,w=t.iconAnnotations,S=void 0===w?[]:w,R=t.cornerRadius,W=t.icon,O=void 0===W?{}:W,P=t.subText,H=void 0===P?{}:P,E=t.showLabel,D=void 0===E||E,T=t.noLabelRadius,U=void 0===T?5:T,N=t.iconBorderWidth,A=void 0===N?1:N,V=t.iconBorderColor,I=void 0===V?"#333":V,L=t.iconBackgroundColor,z=void 0===L?"#fff":L,j=t.iconFontColor,M=void 0===j?"#000":j,B=t.iconFontSize,q=void 0===B?20:B,G=t.iconFontFamily,X=void 0===G?"FontAwesome":G,Y=t.shapeOffsetX,J=void 0===Y?0:Y,K=t.shapeOffsetY,$=void 0===K?0:K,Q=t.iconOffsetX,Z=void 0===Q?0:Q,tt=t.iconOffsetY,et=void 0===tt?0:tt,nt=t.iconPadding,ot=void 0===nt?4:nt,it=t.iconText,rt=void 0===it?"?":it,at=t.shapeRendering,lt=void 0===at?"auto":at;return O=ht({height:91,padding:40,imageCharFill:"#555555",imageFontFamily:"FontAwesome",fill:"#FFCC33",stroke:"#DFDFDF",imageChar:"?",strokeWidth:4,yOffset:-15},O),H=ht({text:"",fill:"transparent",textFill:"#555555"},H),p(Pt,ht({},{id:e,categoryID:o,text:r,textHeight:l,textPadding:_,textFill:d,textboxFill:u,textboxStroke:v,textboxStrokeWidth:m,textFontFamily:x,annotationGutter:F,annotations:C,iconAnnotations:S,cornerRadius:R,icon:O,subText:H,showLabel:D,noLabelRadius:U,iconBorderWidth:A,iconBorderColor:I,iconBackgroundColor:z,iconFontColor:M,iconFontSize:q,iconFontFamily:X,shapeOffsetX:J,shapeOffsetY:$,iconOffsetX:Z,iconOffsetY:et,iconPadding:ot,iconText:rt,shapeRendering:lt},{icon:O,subText:H}))},t.Circle=gt,t.Edge=function(t){var e=t.label,n=t.labelPos,o=t.labelFill,i=void 0===o?"black":o,r=t.labelHeight,a=void 0===r?12:r;return p(g,null,p("path",{d:t.path,stroke:t.stroke,style:{strokeWidth:t.strokeWidth,strokeDasharray:t.strokeDasharray}}),e&&n&&2===n.length?p("g",{transform:"translate(".concat(n[0]," ").concat(n[1],")")},p(bt,{text:e,fill:i,height:a})):void 0)},t.HTMLAdapter=St,t.Icon=kt,t.IconLabelledRect=function(t){var e=t.icon,n=t.iconFontFamily,o=t.text,i=t.height,r=void 0===i?12:i,a=t.width,l=void 0===a?12:a,c=t.fontFamily,_=void 0===c?"Verdana":c,s=t.fontSize,d=void 0===s?10:s,h=t.padding,u=void 0===h?3:h,f=t.fill,v=void 0===f?"whitesmoke":f,m=t.stroke,y=void 0===m?"lightgray":m,x=t.textFill,k=void 0===x?"black":x,F=t.strokeWidth,b=void 0===F?1:F,C=t.cornerRadius,w=void 0===C?0:C;return t.onSizeUpdate,p(g,null,p(yt,{width:l,height:r,fill:v,stroke:y,strokeWidth:b,cornerRadius:w}),p("g",{transform:"translate(".concat(-l/2+u," ").concat(-r/2+u,")")},p(kt,{shape:"square",imageFontFamily:n,imageChar:e,height:r,fill:v,imageCharFill:k})),p("g",{transform:"translate(".concat(-l/2+2*u+r," ").concat(-r/2+u,")")},p(Ft,{text:o,fontFamily:_,height:d,fill:k,anchor:"start",baseline:"hanging"})))},t.Icons=function(t){var e=t.icons,n=(void 0===e?[]:e).map((function(t){return p("g",{key:t.id,id:t.id},p(kt,ht({},t)))}));return p(g,null,n)},t.ImageChar=vt,t.LabelledRect=function(t){var e=t.text,n=t.height,o=void 0===n?12:n,i=t.width,r=void 0===i?12:i,a=t.fontFamily,l=void 0===a?"Verdana":a,c=t.fontSize,_=void 0===c?10:c,s=t.padding,d=void 0===s?3:s,h=t.fill,u=void 0===h?"whitesmoke":h,f=t.stroke,v=void 0===f?"lightgray":f,m=t.textFill,y=void 0===m?"black":m,x=t.strokeWidth,k=void 0===x?1:x,F=t.cornerRadius,b=void 0===F?0:F;return t.onSizeUpdate,p(g,null,p(yt,{width:r,height:o,fill:u,stroke:v,strokeWidth:k,cornerRadius:b}),p("g",{transform:"translate(".concat(-r/2+d," ").concat(-o/2+d,")")},p(Ft,{text:e,fontFamily:l,height:_,fill:y,anchor:"start",baseline:"hanging"})))},t.PKG_NAME="@hpcc-js/react",t.PKG_VERSION="2.53.8",t.React=_t,t.Rectangle=yt,t.SVGAdapter=Rt,t.Shape=xt,t.Square=mt,t.Subgraph=function(t){var n=t.text,o=t.width,i=void 0===o?100:o,r=t.height,a=void 0===r?100:r,l=t.fill,c=void 0===l?"transparent":l,_=t.stroke,s=void 0===_?"black":_,d=t.fontHeight,h=void 0===d?12:d,u=t.fontFamily,f=e.Utility.textSize(n,u,h,!1);return p(g,null,p(yt,{width:i,height:a,fill:c,stroke:s}),p("g",{transform:"translate(".concat((-i+f.width)/2+4," ").concat((-a+f.height)/2+4,")")},p(bt,{height:h,text:n,fontFamily:u})))},t.Text=bt,t.TextBox=Ct,t.TextLine=Ft,t.Vertex=function(t){var e=t.categoryID,n=void 0===e?"":e,o=t.text,i=void 0===o?"":o,r=t.textHeight,a=void 0===r?12:r,l=t.textPadding,c=void 0===l?4:l,_=t.icon,s=void 0===_?{}:_,d=t.annotationsHeight,h=void 0===d?12:d,u=t.annotationIDs,f=void 0===u?[]:u,v=t.textFill,g=t.textboxFill,m=t.textboxStroke,y=t.textFontFamily,x=t.onSizeUpdate,k=t.showLabel,F=void 0===k||k,b=t.scale,C=void 0===b?1:b,w=$(0),S=w[0],R=w[1],W=$(0),O=W[0],P=W[1];Z((function(){x&&x({width:0,height:0})}),[S,O,x]);var H=S;H+=4;var E=-(2*(s=ht({imageChar:"fa-question",height:32,fill:"transparent"},s)).height/6+a+8)/2,D=s.height/3+O/2+c,T=s.height/3+O+c+h/3;F||(E+=(a+8)/2,T-=O+c);var U=et((function(t){R(t.width),P(t.height)}),[]),N=F?p("g",{transform:"translate(0 ".concat(D,")")},p(Ct,{text:i,height:a,padding:c,onSizeUpdate:U,textFill:v,fill:g,stroke:m,fontFamily:y})):void 0;return n?p("g",{transform:"translate(0 ".concat(E,") scale(").concat(C,")")},p("use",{href:"#"+n}),N,p(Wt,{x:H/2,y:T,annotationIDs:f})):p("g",{transform:"translate(0 ".concat(E,") scale(").concat(C,")")},p(kt,ht({},s)),N)},t.Vertex2=function(t){var n=t.categoryID,o=void 0===n?"":n,i=t.text,r=void 0===i?"":i,a=t.textHeight,l=void 0===a?12:a,c=t.textPadding,_=void 0===c?4:c,s=t.icon,d=void 0===s?{}:s,h=t.textFill,u=void 0===h?"black":h,f=t.textboxFill,v=void 0===f?"white":f,m=t.textboxStroke,y=void 0===m?"black":m,x=t.textFontFamily,k=t.annotationsHeight,F=void 0===k?12:k,b=t.annotationIDs,C=void 0===b?[]:b;d=ht({imageChar:"fa-question",imageCharFill:"white",height:32,fill:"black",shape:"square"},d);var w=l+2*_,S=tt((function(){return e.Utility.textSize(r,x,l,!1)}),[r,x,l]).width,R=F,W=w/2,O=-(2*d.height/6+l+8)/2,P=-d.height/2,H=Math.ceil(S/2+_),E=W-d.height/2,D=R/2,T=W;return o?p("g",{transform:"translate(".concat(0," ").concat(O,")")},p("g",{transform:"translate(".concat(P," ").concat(0,")")},p("use",{href:"#"+o})),p("g",{transform:"translate(".concat(H," ").concat(E,")")},p(Ct,{text:r,height:l,padding:_,strokeWidth:1,stroke:y,fill:v,textFill:u,fontFamily:x})),p(Wt,{x:D,y:T,annotationIDs:C,stepSize:R})):p(g,null,p("g",{transform:"translate(".concat(P," ").concat(0,")scale(1.0002)")},p(kt,ht({},d,{shape:"square"}))),p("g",{transform:"translate(".concat(H," ").concat(E,")scale(1.0002)")},p(Ct,{text:r,height:l,padding:_,stroke:y,fill:v})))},t.Vertex3=Ot,t.Vertex4=Pt,t.render=wt,t.svgRender=function(t,e,n,o){A(p("svg",null,p(t,e)),n,o)},Object.defineProperty(t,"__esModule",{value:!0})}));
//# sourceMappingURL=index.min.js.map