@daoyi/nmtl-ui 1.1.43-beta.92 → 1.1.43-beta.93
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/SNA.js +1 -1
- package/package.json +1 -1
package/lib/components/SNA.js
CHANGED
|
@@ -37,4 +37,4 @@ var r=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,i=Object.pr
|
|
|
37
37
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
38
38
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
39
39
|
* SOFTWARE.
|
|
40
|
-
*/var Tn=kn&&window.Promise?function(e){var t=!1;return function(){t||(t=!0,window.Promise.resolve().then((function(){t=!1,e()})))}}:function(e){var t=!1;return function(){t||(t=!0,setTimeout((function(){t=!1,e()}),Sn))}};function _n(e){return e&&"[object Function]"==={}.toString.call(e)}function On(e,t){if(1!==e.nodeType)return[];var n=e.ownerDocument.defaultView.getComputedStyle(e,null);return t?n[t]:n}function Cn(e){return"HTML"===e.nodeName?e:e.parentNode||e.host}function Nn(e){if(!e)return document.body;switch(e.nodeName){case"HTML":case"BODY":return e.ownerDocument.body;case"#document":return e.body}var t=On(e),n=t.overflow,r=t.overflowX,o=t.overflowY;return/(auto|scroll|overlay)/.test(n+o+r)?e:Nn(Cn(e))}function Mn(e){return e&&e.referenceNode?e.referenceNode:e}var Pn=kn&&!(!window.MSInputMethodContext||!document.documentMode),zn=kn&&/MSIE 10/.test(navigator.userAgent);function An(e){return 11===e?Pn:10===e?zn:Pn||zn}function jn(e){if(!e)return document.documentElement;for(var t=An(10)?document.body:null,n=e.offsetParent||null;n===t&&e.nextElementSibling;)n=(e=e.nextElementSibling).offsetParent;var r=n&&n.nodeName;return r&&"BODY"!==r&&"HTML"!==r?-1!==["TH","TD","TABLE"].indexOf(n.nodeName)&&"static"===On(n,"position")?jn(n):n:e?e.ownerDocument.documentElement:document.documentElement}function Rn(e){return null!==e.parentNode?Rn(e.parentNode):e}function Dn(e,t){if(!(e&&e.nodeType&&t&&t.nodeType))return document.documentElement;var n=e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING,r=n?e:t,o=n?t:e,i=document.createRange();i.setStart(r,0),i.setEnd(o,0);var a,l,s=i.commonAncestorContainer;if(e!==s&&t!==s||r.contains(o))return"BODY"===(l=(a=s).nodeName)||"HTML"!==l&&jn(a.firstElementChild)!==a?jn(s):s;var u=Rn(e);return u.host?Dn(u.host,t):Dn(e,Rn(t).host)}function Fn(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"top",n="top"===t?"scrollTop":"scrollLeft",r=e.nodeName;if("BODY"===r||"HTML"===r){var o=e.ownerDocument.documentElement,i=e.ownerDocument.scrollingElement||o;return i[n]}return e[n]}function Ln(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=Fn(t,"top"),o=Fn(t,"left"),i=n?-1:1;return e.top+=r*i,e.bottom+=r*i,e.left+=o*i,e.right+=o*i,e}function In(e,t){var n="x"===t?"Left":"Top",r="Left"===n?"Right":"Bottom";return parseFloat(e["border"+n+"Width"])+parseFloat(e["border"+r+"Width"])}function Bn(e,t,n,r){return Math.max(t["offset"+e],t["scroll"+e],n["client"+e],n["offset"+e],n["scroll"+e],An(10)?parseInt(n["offset"+e])+parseInt(r["margin"+("Height"===e?"Top":"Left")])+parseInt(r["margin"+("Height"===e?"Bottom":"Right")]):0)}function Hn(e){var t=e.body,n=e.documentElement,r=An(10)&&getComputedStyle(n);return{height:Bn("Height",t,n,r),width:Bn("Width",t,n,r)}}var Un=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},Wn=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),qn=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},$n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};function Vn(e){return $n({},e,{right:e.left+e.width,bottom:e.top+e.height})}function Gn(e){var t={};try{if(An(10)){t=e.getBoundingClientRect();var n=Fn(e,"top"),r=Fn(e,"left");t.top+=n,t.left+=r,t.bottom+=n,t.right+=r}else t=e.getBoundingClientRect()}catch(e){}var o={left:t.left,top:t.top,width:t.right-t.left,height:t.bottom-t.top},i="HTML"===e.nodeName?Hn(e.ownerDocument):{},a=i.width||e.clientWidth||o.width,l=i.height||e.clientHeight||o.height,s=e.offsetWidth-a,u=e.offsetHeight-l;if(s||u){var c=On(e);s-=In(c,"x"),u-=In(c,"y"),o.width-=s,o.height-=u}return Vn(o)}function Yn(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=An(10),o="HTML"===t.nodeName,i=Gn(e),a=Gn(t),l=Nn(e),s=On(t),u=parseFloat(s.borderTopWidth),c=parseFloat(s.borderLeftWidth);n&&o&&(a.top=Math.max(a.top,0),a.left=Math.max(a.left,0));var f=Vn({top:i.top-a.top-u,left:i.left-a.left-c,width:i.width,height:i.height});if(f.marginTop=0,f.marginLeft=0,!r&&o){var p=parseFloat(s.marginTop),d=parseFloat(s.marginLeft);f.top-=u-p,f.bottom-=u-p,f.left-=c-d,f.right-=c-d,f.marginTop=p,f.marginLeft=d}return(r&&!n?t.contains(l):t===l&&"BODY"!==l.nodeName)&&(f=Ln(f,t)),f}function Xn(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=e.ownerDocument.documentElement,r=Yn(e,n),o=Math.max(n.clientWidth,window.innerWidth||0),i=Math.max(n.clientHeight,window.innerHeight||0),a=t?0:Fn(n),l=t?0:Fn(n,"left"),s={top:a-r.top+r.marginTop,left:l-r.left+r.marginLeft,width:o,height:i};return Vn(s)}function Kn(e){var t=e.nodeName;if("BODY"===t||"HTML"===t)return!1;if("fixed"===On(e,"position"))return!0;var n=Cn(e);return!!n&&Kn(n)}function Jn(e){if(!e||!e.parentElement||An())return document.documentElement;for(var t=e.parentElement;t&&"none"===On(t,"transform");)t=t.parentElement;return t||document.documentElement}function Qn(e,t,n,r){var o=arguments.length>4&&void 0!==arguments[4]&&arguments[4],i={top:0,left:0},a=o?Jn(e):Dn(e,Mn(t));if("viewport"===r)i=Xn(a,o);else{var l=void 0;"scrollParent"===r?"BODY"===(l=Nn(Cn(t))).nodeName&&(l=e.ownerDocument.documentElement):l="window"===r?e.ownerDocument.documentElement:r;var s=Yn(l,a,o);if("HTML"!==l.nodeName||Kn(a))i=s;else{var u=Hn(e.ownerDocument),c=u.height,f=u.width;i.top+=s.top-s.marginTop,i.bottom=c+s.top,i.left+=s.left-s.marginLeft,i.right=f+s.left}}var p="number"==typeof(n=n||0);return i.left+=p?n:n.left||0,i.top+=p?n:n.top||0,i.right-=p?n:n.right||0,i.bottom-=p?n:n.bottom||0,i}function Zn(e){return e.width*e.height}function er(e,t,n,r,o){var i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;if(-1===e.indexOf("auto"))return e;var a=Qn(n,r,i,o),l={top:{width:a.width,height:t.top-a.top},right:{width:a.right-t.right,height:a.height},bottom:{width:a.width,height:a.bottom-t.bottom},left:{width:t.left-a.left,height:a.height}},s=Object.keys(l).map((function(e){return $n({key:e},l[e],{area:Zn(l[e])})})).sort((function(e,t){return t.area-e.area})),u=s.filter((function(e){var t=e.width,r=e.height;return t>=n.clientWidth&&r>=n.clientHeight})),c=u.length>0?u[0].key:s[0].key,f=e.split("-")[1];return c+(f?"-"+f:"")}function tr(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,o=r?Jn(t):Dn(t,Mn(n));return Yn(n,o,r)}function nr(e){var t=e.ownerDocument.defaultView.getComputedStyle(e),n=parseFloat(t.marginTop||0)+parseFloat(t.marginBottom||0),r=parseFloat(t.marginLeft||0)+parseFloat(t.marginRight||0);return{width:e.offsetWidth+r,height:e.offsetHeight+n}}function rr(e){var t={left:"right",right:"left",bottom:"top",top:"bottom"};return e.replace(/left|right|bottom|top/g,(function(e){return t[e]}))}function or(e,t,n){n=n.split("-")[0];var r=nr(e),o={width:r.width,height:r.height},i=-1!==["right","left"].indexOf(n),a=i?"top":"left",l=i?"left":"top",s=i?"height":"width",u=i?"width":"height";return o[a]=t[a]+t[s]/2-r[s]/2,o[l]=n===l?t[l]-r[u]:t[rr(l)],o}function ir(e,t){return Array.prototype.find?e.find(t):e.filter(t)[0]}function ar(e,t,n){return(void 0===n?e:e.slice(0,function(e,t,n){if(Array.prototype.findIndex)return e.findIndex((function(e){return e[t]===n}));var r=ir(e,(function(e){return e[t]===n}));return e.indexOf(r)}(e,"name",n))).forEach((function(e){e.function&&console.warn("`modifier.function` is deprecated, use `modifier.fn`!");var n=e.function||e.fn;e.enabled&&_n(n)&&(t.offsets.popper=Vn(t.offsets.popper),t.offsets.reference=Vn(t.offsets.reference),t=n(t,e))})),t}function lr(){if(!this.state.isDestroyed){var e={instance:this,styles:{},arrowStyles:{},attributes:{},flipped:!1,offsets:{}};e.offsets.reference=tr(this.state,this.popper,this.reference,this.options.positionFixed),e.placement=er(this.options.placement,e.offsets.reference,this.popper,this.reference,this.options.modifiers.flip.boundariesElement,this.options.modifiers.flip.padding),e.originalPlacement=e.placement,e.positionFixed=this.options.positionFixed,e.offsets.popper=or(this.popper,e.offsets.reference,e.placement),e.offsets.popper.position=this.options.positionFixed?"fixed":"absolute",e=ar(this.modifiers,e),this.state.isCreated?this.options.onUpdate(e):(this.state.isCreated=!0,this.options.onCreate(e))}}function sr(e,t){return e.some((function(e){var n=e.name;return e.enabled&&n===t}))}function ur(e){for(var t=[!1,"ms","Webkit","Moz","O"],n=e.charAt(0).toUpperCase()+e.slice(1),r=0;r<t.length;r++){var o=t[r],i=o?""+o+n:e;if(void 0!==document.body.style[i])return i}return null}function cr(){return this.state.isDestroyed=!0,sr(this.modifiers,"applyStyle")&&(this.popper.removeAttribute("x-placement"),this.popper.style.position="",this.popper.style.top="",this.popper.style.left="",this.popper.style.right="",this.popper.style.bottom="",this.popper.style.willChange="",this.popper.style[ur("transform")]=""),this.disableEventListeners(),this.options.removeOnDestroy&&this.popper.parentNode.removeChild(this.popper),this}function fr(e){var t=e.ownerDocument;return t?t.defaultView:window}function pr(e,t,n,r){var o="BODY"===e.nodeName,i=o?e.ownerDocument.defaultView:e;i.addEventListener(t,n,{passive:!0}),o||pr(Nn(i.parentNode),t,n,r),r.push(i)}function dr(e,t,n,r){n.updateBound=r,fr(e).addEventListener("resize",n.updateBound,{passive:!0});var o=Nn(e);return pr(o,"scroll",n.updateBound,n.scrollParents),n.scrollElement=o,n.eventsEnabled=!0,n}function hr(){this.state.eventsEnabled||(this.state=dr(this.reference,this.options,this.state,this.scheduleUpdate))}function mr(){var e,t;this.state.eventsEnabled&&(cancelAnimationFrame(this.scheduleUpdate),this.state=(e=this.reference,t=this.state,fr(e).removeEventListener("resize",t.updateBound),t.scrollParents.forEach((function(e){e.removeEventListener("scroll",t.updateBound)})),t.updateBound=null,t.scrollParents=[],t.scrollElement=null,t.eventsEnabled=!1,t))}function vr(e){return""!==e&&!isNaN(parseFloat(e))&&isFinite(e)}function gr(e,t){Object.keys(t).forEach((function(n){var r="";-1!==["width","height","top","right","bottom","left"].indexOf(n)&&vr(t[n])&&(r="px"),e.style[n]=t[n]+r}))}var yr=kn&&/Firefox/i.test(navigator.userAgent);function br(e,t,n){var r=ir(e,(function(e){return e.name===t})),o=!!r&&e.some((function(e){return e.name===n&&e.enabled&&e.order<r.order}));if(!o){var i="`"+t+"`",a="`"+n+"`";console.warn(a+" modifier is required by "+i+" modifier in order to work, be sure to include it before "+i+"!")}return o}var wr=["auto-start","auto","auto-end","top-start","top","top-end","right-start","right","right-end","bottom-end","bottom","bottom-start","left-end","left","left-start"],xr=wr.slice(3);function Er(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=xr.indexOf(e),r=xr.slice(n+1).concat(xr.slice(0,n));return t?r.reverse():r}var kr="flip",Sr="clockwise",Tr="counterclockwise";function _r(e,t,n,r){var o=[0,0],i=-1!==["right","left"].indexOf(r),a=e.split(/(\+|\-)/).map((function(e){return e.trim()})),l=a.indexOf(ir(a,(function(e){return-1!==e.search(/,|\s/)})));a[l]&&-1===a[l].indexOf(",")&&console.warn("Offsets separated by white space(s) are deprecated, use a comma (,) instead.");var s=/\s*,\s*|\s+/,u=-1!==l?[a.slice(0,l).concat([a[l].split(s)[0]]),[a[l].split(s)[1]].concat(a.slice(l+1))]:[a];return u=u.map((function(e,r){var o=(1===r?!i:i)?"height":"width",a=!1;return e.reduce((function(e,t){return""===e[e.length-1]&&-1!==["+","-"].indexOf(t)?(e[e.length-1]=t,a=!0,e):a?(e[e.length-1]+=t,a=!1,e):e.concat(t)}),[]).map((function(e){return function(e,t,n,r){var o=e.match(/((?:\-|\+)?\d*\.?\d*)(.*)/),i=+o[1],a=o[2];if(!i)return e;if(0===a.indexOf("%")){return Vn("%p"===a?n:r)[t]/100*i}if("vh"===a||"vw"===a)return("vh"===a?Math.max(document.documentElement.clientHeight,window.innerHeight||0):Math.max(document.documentElement.clientWidth,window.innerWidth||0))/100*i;return i}(e,o,t,n)}))})),u.forEach((function(e,t){e.forEach((function(n,r){vr(n)&&(o[t]+=n*("-"===e[r-1]?-1:1))}))})),o}var Or={shift:{order:100,enabled:!0,fn:function(e){var t=e.placement,n=t.split("-")[0],r=t.split("-")[1];if(r){var o=e.offsets,i=o.reference,a=o.popper,l=-1!==["bottom","top"].indexOf(n),s=l?"left":"top",u=l?"width":"height",c={start:qn({},s,i[s]),end:qn({},s,i[s]+i[u]-a[u])};e.offsets.popper=$n({},a,c[r])}return e}},offset:{order:200,enabled:!0,fn:function(e,t){var n=t.offset,r=e.placement,o=e.offsets,i=o.popper,a=o.reference,l=r.split("-")[0],s=void 0;return s=vr(+n)?[+n,0]:_r(n,i,a,l),"left"===l?(i.top+=s[0],i.left-=s[1]):"right"===l?(i.top+=s[0],i.left+=s[1]):"top"===l?(i.left+=s[0],i.top-=s[1]):"bottom"===l&&(i.left+=s[0],i.top+=s[1]),e.popper=i,e},offset:0},preventOverflow:{order:300,enabled:!0,fn:function(e,t){var n=t.boundariesElement||jn(e.instance.popper);e.instance.reference===n&&(n=jn(n));var r=ur("transform"),o=e.instance.popper.style,i=o.top,a=o.left,l=o[r];o.top="",o.left="",o[r]="";var s=Qn(e.instance.popper,e.instance.reference,t.padding,n,e.positionFixed);o.top=i,o.left=a,o[r]=l,t.boundaries=s;var u=t.priority,c=e.offsets.popper,f={primary:function(e){var n=c[e];return c[e]<s[e]&&!t.escapeWithReference&&(n=Math.max(c[e],s[e])),qn({},e,n)},secondary:function(e){var n="right"===e?"left":"top",r=c[n];return c[e]>s[e]&&!t.escapeWithReference&&(r=Math.min(c[n],s[e]-("right"===e?c.width:c.height))),qn({},n,r)}};return u.forEach((function(e){var t=-1!==["left","top"].indexOf(e)?"primary":"secondary";c=$n({},c,f[t](e))})),e.offsets.popper=c,e},priority:["left","right","top","bottom"],padding:5,boundariesElement:"scrollParent"},keepTogether:{order:400,enabled:!0,fn:function(e){var t=e.offsets,n=t.popper,r=t.reference,o=e.placement.split("-")[0],i=Math.floor,a=-1!==["top","bottom"].indexOf(o),l=a?"right":"bottom",s=a?"left":"top",u=a?"width":"height";return n[l]<i(r[s])&&(e.offsets.popper[s]=i(r[s])-n[u]),n[s]>i(r[l])&&(e.offsets.popper[s]=i(r[l])),e}},arrow:{order:500,enabled:!0,fn:function(e,t){var n;if(!br(e.instance.modifiers,"arrow","keepTogether"))return e;var r=t.element;if("string"==typeof r){if(!(r=e.instance.popper.querySelector(r)))return e}else if(!e.instance.popper.contains(r))return console.warn("WARNING: `arrow.element` must be child of its popper element!"),e;var o=e.placement.split("-")[0],i=e.offsets,a=i.popper,l=i.reference,s=-1!==["left","right"].indexOf(o),u=s?"height":"width",c=s?"Top":"Left",f=c.toLowerCase(),p=s?"left":"top",d=s?"bottom":"right",h=nr(r)[u];l[d]-h<a[f]&&(e.offsets.popper[f]-=a[f]-(l[d]-h)),l[f]+h>a[d]&&(e.offsets.popper[f]+=l[f]+h-a[d]),e.offsets.popper=Vn(e.offsets.popper);var m=l[f]+l[u]/2-h/2,v=On(e.instance.popper),g=parseFloat(v["margin"+c]),y=parseFloat(v["border"+c+"Width"]),b=m-e.offsets.popper[f]-g-y;return b=Math.max(Math.min(a[u]-h,b),0),e.arrowElement=r,e.offsets.arrow=(qn(n={},f,Math.round(b)),qn(n,p,""),n),e},element:"[x-arrow]"},flip:{order:600,enabled:!0,fn:function(e,t){if(sr(e.instance.modifiers,"inner"))return e;if(e.flipped&&e.placement===e.originalPlacement)return e;var n=Qn(e.instance.popper,e.instance.reference,t.padding,t.boundariesElement,e.positionFixed),r=e.placement.split("-")[0],o=rr(r),i=e.placement.split("-")[1]||"",a=[];switch(t.behavior){case kr:a=[r,o];break;case Sr:a=Er(r);break;case Tr:a=Er(r,!0);break;default:a=t.behavior}return a.forEach((function(l,s){if(r!==l||a.length===s+1)return e;r=e.placement.split("-")[0],o=rr(r);var u=e.offsets.popper,c=e.offsets.reference,f=Math.floor,p="left"===r&&f(u.right)>f(c.left)||"right"===r&&f(u.left)<f(c.right)||"top"===r&&f(u.bottom)>f(c.top)||"bottom"===r&&f(u.top)<f(c.bottom),d=f(u.left)<f(n.left),h=f(u.right)>f(n.right),m=f(u.top)<f(n.top),v=f(u.bottom)>f(n.bottom),g="left"===r&&d||"right"===r&&h||"top"===r&&m||"bottom"===r&&v,y=-1!==["top","bottom"].indexOf(r),b=!!t.flipVariations&&(y&&"start"===i&&d||y&&"end"===i&&h||!y&&"start"===i&&m||!y&&"end"===i&&v),w=!!t.flipVariationsByContent&&(y&&"start"===i&&h||y&&"end"===i&&d||!y&&"start"===i&&v||!y&&"end"===i&&m),x=b||w;(p||g||x)&&(e.flipped=!0,(p||g)&&(r=a[s+1]),x&&(i=function(e){return"end"===e?"start":"start"===e?"end":e}(i)),e.placement=r+(i?"-"+i:""),e.offsets.popper=$n({},e.offsets.popper,or(e.instance.popper,e.offsets.reference,e.placement)),e=ar(e.instance.modifiers,e,"flip"))})),e},behavior:"flip",padding:5,boundariesElement:"viewport",flipVariations:!1,flipVariationsByContent:!1},inner:{order:700,enabled:!1,fn:function(e){var t=e.placement,n=t.split("-")[0],r=e.offsets,o=r.popper,i=r.reference,a=-1!==["left","right"].indexOf(n),l=-1===["top","left"].indexOf(n);return o[a?"left":"top"]=i[n]-(l?o[a?"width":"height"]:0),e.placement=rr(t),e.offsets.popper=Vn(o),e}},hide:{order:800,enabled:!0,fn:function(e){if(!br(e.instance.modifiers,"hide","preventOverflow"))return e;var t=e.offsets.reference,n=ir(e.instance.modifiers,(function(e){return"preventOverflow"===e.name})).boundaries;if(t.bottom<n.top||t.left>n.right||t.top>n.bottom||t.right<n.left){if(!0===e.hide)return e;e.hide=!0,e.attributes["x-out-of-boundaries"]=""}else{if(!1===e.hide)return e;e.hide=!1,e.attributes["x-out-of-boundaries"]=!1}return e}},computeStyle:{order:850,enabled:!0,fn:function(e,t){var n=t.x,r=t.y,o=e.offsets.popper,i=ir(e.instance.modifiers,(function(e){return"applyStyle"===e.name})).gpuAcceleration;void 0!==i&&console.warn("WARNING: `gpuAcceleration` option moved to `computeStyle` modifier and will not be supported in future versions of Popper.js!");var a=void 0!==i?i:t.gpuAcceleration,l=jn(e.instance.popper),s=Gn(l),u={position:o.position},c=function(e,t){var n=e.offsets,r=n.popper,o=n.reference,i=Math.round,a=Math.floor,l=function(e){return e},s=i(o.width),u=i(r.width),c=-1!==["left","right"].indexOf(e.placement),f=-1!==e.placement.indexOf("-"),p=t?c||f||s%2==u%2?i:a:l,d=t?i:l;return{left:p(s%2==1&&u%2==1&&!f&&t?r.left-1:r.left),top:d(r.top),bottom:d(r.bottom),right:p(r.right)}}(e,window.devicePixelRatio<2||!yr),f="bottom"===n?"top":"bottom",p="right"===r?"left":"right",d=ur("transform"),h=void 0,m=void 0;if(m="bottom"===f?"HTML"===l.nodeName?-l.clientHeight+c.bottom:-s.height+c.bottom:c.top,h="right"===p?"HTML"===l.nodeName?-l.clientWidth+c.right:-s.width+c.right:c.left,a&&d)u[d]="translate3d("+h+"px, "+m+"px, 0)",u[f]=0,u[p]=0,u.willChange="transform";else{var v="bottom"===f?-1:1,g="right"===p?-1:1;u[f]=m*v,u[p]=h*g,u.willChange=f+", "+p}var y={"x-placement":e.placement};return e.attributes=$n({},y,e.attributes),e.styles=$n({},u,e.styles),e.arrowStyles=$n({},e.offsets.arrow,e.arrowStyles),e},gpuAcceleration:!0,x:"bottom",y:"right"},applyStyle:{order:900,enabled:!0,fn:function(e){var t,n;return gr(e.instance.popper,e.styles),t=e.instance.popper,n=e.attributes,Object.keys(n).forEach((function(e){!1!==n[e]?t.setAttribute(e,n[e]):t.removeAttribute(e)})),e.arrowElement&&Object.keys(e.arrowStyles).length&&gr(e.arrowElement,e.arrowStyles),e},onLoad:function(e,t,n,r,o){var i=tr(o,t,e,n.positionFixed),a=er(n.placement,i,t,e,n.modifiers.flip.boundariesElement,n.modifiers.flip.padding);return t.setAttribute("x-placement",a),gr(t,{position:n.positionFixed?"fixed":"absolute"}),n},gpuAcceleration:void 0}},Cr={placement:"bottom",positionFixed:!1,eventsEnabled:!0,removeOnDestroy:!1,onCreate:function(){},onUpdate:function(){},modifiers:Or},Nr=function(){function e(t,n){var r=this,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Un(this,e),this.scheduleUpdate=function(){return requestAnimationFrame(r.update)},this.update=Tn(this.update.bind(this)),this.options=$n({},e.Defaults,o),this.state={isDestroyed:!1,isCreated:!1,scrollParents:[]},this.reference=t&&t.jquery?t[0]:t,this.popper=n&&n.jquery?n[0]:n,this.options.modifiers={},Object.keys($n({},e.Defaults.modifiers,o.modifiers)).forEach((function(t){r.options.modifiers[t]=$n({},e.Defaults.modifiers[t]||{},o.modifiers?o.modifiers[t]:{})})),this.modifiers=Object.keys(this.options.modifiers).map((function(e){return $n({name:e},r.options.modifiers[e])})).sort((function(e,t){return e.order-t.order})),this.modifiers.forEach((function(e){e.enabled&&_n(e.onLoad)&&e.onLoad(r.reference,r.popper,r.options,e,r.state)})),this.update();var i=this.options.eventsEnabled;i&&this.enableEventListeners(),this.state.eventsEnabled=i}return Wn(e,[{key:"update",value:function(){return lr.call(this)}},{key:"destroy",value:function(){return cr.call(this)}},{key:"enableEventListeners",value:function(){return hr.call(this)}},{key:"disableEventListeners",value:function(){return mr.call(this)}}]),e}();Nr.Utils=("undefined"!=typeof window?window:global).PopperUtils,Nr.placements=wr,Nr.Defaults=Cr;var Mr=Nr;var Pr="undefined"!=typeof window?e.useLayoutEffect:e.useEffect,zr=e.forwardRef((function(t,n){var r=t.children,o=t.container,i=t.disablePortal,a=void 0!==i&&i,l=t.onRendered,s=e.useState(null),u=s[0],c=s[1],f=D(e.isValidElement(r)?r.ref:null,n);return Pr((function(){a||c(function(e){return e="function"==typeof e?e():e,ee.findDOMNode(e)}(o)||document.body)}),[o,a]),Pr((function(){if(u&&!a)return B(n,u),function(){B(n,null)}}),[n,u,a]),Pr((function(){l&&(u||a)&&l()}),[l,u,a]),a?e.isValidElement(r)?e.cloneElement(r,{ref:f}):r:u?ee.createPortal(r,u):u}));function Ar(e){return"function"==typeof e?e():e}var jr="undefined"!=typeof window?e.useLayoutEffect:e.useEffect,Rr={},Dr=e.forwardRef((function(t,n){var r=t.anchorEl,o=t.children,i=t.container,a=t.disablePortal,l=void 0!==a&&a,s=t.keepMounted,u=void 0!==s&&s,c=t.modifiers,f=t.open,p=t.placement,d=void 0===p?"bottom":p,h=t.popperOptions,m=void 0===h?Rr:h,v=t.popperRef,g=t.style,y=t.transition,b=void 0!==y&&y,w=j(t,["anchorEl","children","container","disablePortal","keepMounted","modifiers","open","placement","popperOptions","popperRef","style","transition"]),x=e.useRef(null),E=D(x,n),k=e.useRef(null),S=D(k,v),T=e.useRef(S);jr((function(){T.current=S}),[S]),e.useImperativeHandle(v,(function(){return k.current}),[]);var _=e.useState(!0),O=_[0],C=_[1],N=function(e,t){if("ltr"===(t&&t.direction||"ltr"))return e;switch(e){case"bottom-end":return"bottom-start";case"bottom-start":return"bottom-end";case"top-end":return"top-start";case"top-start":return"top-end";default:return e}}(d,ne()),P=e.useState(N),z=P[0],A=P[1];e.useEffect((function(){k.current&&k.current.update()}));var R=e.useCallback((function(){if(x.current&&r&&f){k.current&&(k.current.destroy(),T.current(null));var e=function(e){A(e.placement)};Ar(r);var t=new Mr(Ar(r),x.current,M({placement:N},m,{modifiers:M({},l?{}:{preventOverflow:{boundariesElement:"window"}},c,m.modifiers),onCreate:H(e,m.onCreate),onUpdate:H(e,m.onUpdate)}));T.current(t)}}),[r,l,c,f,N,m]),F=e.useCallback((function(e){B(E,e),R()}),[E,R]),L=function(){k.current&&(k.current.destroy(),T.current(null))};if(e.useEffect((function(){return function(){L()}}),[]),e.useEffect((function(){f||b||L()}),[f,b]),!u&&!f&&(!b||O))return null;var I={placement:z};return b&&(I.TransitionProps={in:f,onEnter:function(){C(!1)},onExited:function(){C(!0),L()}}),e.createElement(zr,{disablePortal:l,container:i},e.createElement("div",M({ref:F,role:"tooltip"},w,{style:M({position:"fixed",top:0,left:0,display:f||!u||b?null:"none"},g)}),"function"==typeof o?o(I):o))})),Fr=Dr;function Lr(e){return Math.round(1e5*e)/1e5}var Ir=!1,Br=null,Hr=e.forwardRef((function(t,n){var r=t.arrow,o=void 0!==r&&r,i=t.children,a=t.classes,l=t.disableFocusListener,s=void 0!==l&&l,u=t.disableHoverListener,c=void 0!==u&&u,f=t.disableTouchListener,p=void 0!==f&&f,d=t.enterDelay,h=void 0===d?100:d,m=t.enterNextDelay,v=void 0===m?0:m,g=t.enterTouchDelay,y=void 0===g?700:g,b=t.id,w=t.interactive,x=void 0!==w&&w,E=t.leaveDelay,k=void 0===E?0:E,S=t.leaveTouchDelay,T=void 0===S?1500:S,_=t.onClose,O=t.onOpen,C=t.open,N=t.placement,z=void 0===N?"bottom":N,A=t.PopperComponent,F=void 0===A?Fr:A,I=t.PopperProps,H=t.title,$=t.TransitionComponent,V=void 0===$?En:$,G=t.TransitionProps,Y=j(t,["arrow","children","classes","disableFocusListener","disableHoverListener","disableTouchListener","enterDelay","enterNextDelay","enterTouchDelay","id","interactive","leaveDelay","leaveTouchDelay","onClose","onOpen","open","placement","PopperComponent","PopperProps","title","TransitionComponent","TransitionProps"]),X=gn(),K=e.useState(),J=K[0],Q=K[1],Z=e.useState(null),te=Z[0],ne=Z[1],re=e.useRef(!1),oe=e.useRef(),ie=e.useRef(),le=e.useRef(),se=e.useRef(),ue=ae(U({controlled:C,default:!1,name:"Tooltip",state:"open"}),2),ce=ue[0],fe=ue[1],pe=ce,de=W(b);e.useEffect((function(){return function(){clearTimeout(oe.current),clearTimeout(ie.current),clearTimeout(le.current),clearTimeout(se.current)}}),[]);var he=function(e){clearTimeout(Br),Ir=!0,fe(!0),O&&O(e)},me=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return function(t){var n=i.props;"mouseover"===t.type&&n.onMouseOver&&e&&n.onMouseOver(t),re.current&&"touchstart"!==t.type||(J&&J.removeAttribute("title"),clearTimeout(ie.current),clearTimeout(le.current),h||Ir&&v?(t.persist(),ie.current=setTimeout((function(){he(t)}),Ir?v:h)):he(t))}},ve=R(),ge=ve.isFocusVisible,ye=ve.onBlurVisible,be=ve.ref,we=e.useState(!1),xe=we[0],Ee=we[1],ke=function(){xe&&(Ee(!1),ye())},Se=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return function(t){J||Q(t.currentTarget),ge(t)&&(Ee(!0),me()(t));var n=i.props;n.onFocus&&e&&n.onFocus(t)}},Te=function(e){clearTimeout(Br),Br=setTimeout((function(){Ir=!1}),800+k),fe(!1),_&&_(e),clearTimeout(oe.current),oe.current=setTimeout((function(){re.current=!1}),X.transitions.duration.shortest)},_e=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return function(t){var n=i.props;"blur"===t.type&&(n.onBlur&&e&&n.onBlur(t),ke()),"mouseleave"===t.type&&n.onMouseLeave&&t.currentTarget===J&&n.onMouseLeave(t),clearTimeout(ie.current),clearTimeout(le.current),t.persist(),le.current=setTimeout((function(){Te(t)}),k)}},Oe=function(e){re.current=!0;var t=i.props;t.onTouchStart&&t.onTouchStart(e)},Ce=D(Q,n),Ne=D(be,Ce),Me=e.useCallback((function(e){B(Ne,ee.findDOMNode(e))}),[Ne]),Pe=D(i.ref,Me);""===H&&(pe=!1);var ze=M({"aria-describedby":pe?de:null,title:!pe&&!c&&"string"==typeof H?H:null},Y,i.props,{className:P(Y.className,i.props.className),onTouchStart:Oe,ref:Pe}),Ae={};p||(ze.onTouchStart=function(e){Oe(e),clearTimeout(le.current),clearTimeout(oe.current),clearTimeout(se.current),e.persist(),se.current=setTimeout((function(){me()(e)}),y)},ze.onTouchEnd=function(e){i.props.onTouchEnd&&i.props.onTouchEnd(e),clearTimeout(se.current),clearTimeout(le.current),e.persist(),le.current=setTimeout((function(){Te(e)}),T)}),c||(ze.onMouseOver=me(),ze.onMouseLeave=_e(),x&&(Ae.onMouseOver=me(!1),Ae.onMouseLeave=_e(!1))),s||(ze.onFocus=Se(),ze.onBlur=_e(),x&&(Ae.onFocus=Se(!1),Ae.onBlur=_e(!1)));var je=e.useMemo((function(){return q({popperOptions:{modifiers:{arrow:{enabled:Boolean(te),element:te}}}},I)}),[te,I]);return e.createElement(e.Fragment,null,e.cloneElement(i,ze),e.createElement(F,M({className:P(a.popper,x&&a.popperInteractive,o&&a.popperArrow),placement:z,anchorEl:J,open:!!J&&pe,id:ze["aria-describedby"],transition:!0},Ae,je),(function(t){var n=t.placement,r=t.TransitionProps;return e.createElement(V,M({timeout:X.transitions.duration.shorter},r,G),e.createElement("div",{className:P(a.tooltip,a["tooltipPlacement".concat(L(n.split("-")[0]))],re.current&&a.touch,o&&a.tooltipArrow)},H,o?e.createElement("span",{className:a.arrow,ref:ne}):null))})))})),Ur=A((function(e){return{popper:{zIndex:e.zIndex.tooltip,pointerEvents:"none"},popperInteractive:{pointerEvents:"auto"},popperArrow:{'&[x-placement*="bottom"] $arrow':{top:0,left:0,marginTop:"-0.71em",marginLeft:4,marginRight:4,"&::before":{transformOrigin:"0 100%"}},'&[x-placement*="top"] $arrow':{bottom:0,left:0,marginBottom:"-0.71em",marginLeft:4,marginRight:4,"&::before":{transformOrigin:"100% 0"}},'&[x-placement*="right"] $arrow':{left:0,marginLeft:"-0.71em",height:"1em",width:"0.71em",marginTop:4,marginBottom:4,"&::before":{transformOrigin:"100% 100%"}},'&[x-placement*="left"] $arrow':{right:0,marginRight:"-0.71em",height:"1em",width:"0.71em",marginTop:4,marginBottom:4,"&::before":{transformOrigin:"0 0"}}},tooltip:{backgroundColor:F(e.palette.grey[700],.9),borderRadius:e.shape.borderRadius,color:e.palette.common.white,fontFamily:e.typography.fontFamily,padding:"4px 8px",fontSize:e.typography.pxToRem(10),lineHeight:"".concat(Lr(1.4),"em"),maxWidth:300,wordWrap:"break-word",fontWeight:e.typography.fontWeightMedium},tooltipArrow:{position:"relative",margin:"0"},arrow:{overflow:"hidden",position:"absolute",width:"1em",height:"0.71em",boxSizing:"border-box",color:F(e.palette.grey[700],.9),"&::before":{content:'""',margin:"auto",display:"block",width:"100%",height:"100%",backgroundColor:"currentColor",transform:"rotate(45deg)"}},touch:{padding:"8px 16px",fontSize:e.typography.pxToRem(14),lineHeight:"".concat(Lr(16/14),"em"),fontWeight:e.typography.fontWeightRegular},tooltipPlacementLeft:$({transformOrigin:"right center",margin:"0 24px "},e.breakpoints.up("sm"),{margin:"0 14px"}),tooltipPlacementRight:$({transformOrigin:"left center",margin:"0 24px"},e.breakpoints.up("sm"),{margin:"0 14px"}),tooltipPlacementTop:$({transformOrigin:"center bottom",margin:"24px 0"},e.breakpoints.up("sm"),{margin:"14px 0"}),tooltipPlacementBottom:$({transformOrigin:"center top",margin:"24px 0"},e.breakpoints.up("sm"),{margin:"14px 0"})}}),{name:"MuiTooltip",flip:!1})(Hr);const Wr=()=>t.createElement("div",{id:"resetBtn"},t.createElement(Ur,{title:"回到原來位置與大小"},t.createElement(hn,null,t.createElement(vn,null))));Wr.propTypes={};Z(".SNA {\n overflow: hidden;\n object-fit: contain;\n position: relative;\n font-size: 0.75rem;\n width: 100%; }\n .SNA--smallSize .node {\n padding-top: 8px;\n font-size: 0.75rem;\n width: 3rem;\n height: 3rem;\n overflow: hidden;\n white-space: pre-wrap;\n text-overflow: ellipsis;\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical; }\n .SNA .node {\n background-color: #4a4e69;\n border-radius: 50%;\n color: #fff;\n font-size: 20px;\n font-weight: 500;\n height: 54px;\n width: 54px;\n padding-top: 15px;\n position: absolute;\n text-align: center;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n cursor: grab; }\n .SNA .links line {\n stroke: #c7bfb4;\n stroke-width: 2; }\n .SNA .mainNode {\n fill: #4e3a16; }\n .SNA .person {\n fill: #867b3a; }\n .SNA .publication {\n fill: #825c0d; }\n .SNA .article {\n fill: #afafaf; }\n .SNA .keyword {\n fill: #fcfae8; }\n .SNA .org {\n fill: #000000; }\n .SNA #resetBtn {\n float: right; }\n\n@media only screen and (max-width: 484px) {\n .SNA {\n margin-left: 0px; }\n .SNA .node {\n background-color: #4a4e69;\n border-radius: 50%;\n color: #fff;\n font-size: 1px;\n font-weight: 500;\n height: 44px;\n width: 44px;\n padding-top: 12px;\n position: absolute;\n text-align: center;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n cursor: grab; } }\n\n@media only screen and (max-width: 484px) {\n .SNA {\n margin-left: 0px; } }\n");var qr=function(e){var l,s=e.className,u=e.intl,c=e.exclude,f=e.distance,p=e.SNAData,d=e.handleClickNodeGoto,h=e.DownloadExcel,_=e.width,O=e.height,C=e.fontColor,N=e.backgroundColor,M=e.iconColor;if(!p||0===p.nodes.length)return t.createElement("div",{className:"noData"},u?u.formatMessage({id:"common.noData"}):"暫無資料");var P=function(){var e=r(!1),t=e[0],l=e[1],s=o(null);i((function(){var e=function(){l(ot.fullscreenElement===s.current)};return ot.addEventListener("fullscreenchange",e),function(){return ot.removeEventListener("fullscreenchange",e)}}),[]);var u=a((function(){return ot.fullscreenElement?ot.exitFullscreen().then((function(){return ot.requestFullscreen(s.current)})):s.current?ot.requestFullscreen(s.current):void 0}),[]),c=a((function(){return ot.fullscreenElement===s.current?ot.exitFullscreen():Promise.resolve()}),[]);return n((function(){return{active:t,enter:u,exit:c,node:s}}),[t,u,c])}(),z=n((function(){return P.active?screen.width:screen.width>1050?_:screen.width-80}),[P.active,screen.width]),A=n((function(){return P.active?screen.height:screen.width>1050?O:screen.height-300}),[P.active,screen.width]),j=function(e){return function(){var e,t,n,r,o=ge,i=ye,a=be,l=we,s={},u=y("start","drag","end"),c=0,f=0;function p(e){e.on("mousedown.drag",d).filter(l).on("touchstart.drag",w).on("touchmove.drag",x).on("touchend.drag touchcancel.drag",E).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function d(){if(!r&&o.apply(this,arguments)){var a=k("mouse",i.apply(this,arguments),ue,this,arguments);a&&(g(v.view).on("mousemove.drag",h,!0).on("mouseup.drag",m,!0),de(v.view),fe(),n=!1,e=v.clientX,t=v.clientY,a("start"))}}function h(){if(pe(),!n){var r=v.clientX-e,o=v.clientY-t;n=r*r+o*o>f}s.mouse("drag")}function m(){g(v.view).on("mousemove.drag mouseup.drag",null),he(v.view,n),pe(),s.mouse("end")}function w(){if(o.apply(this,arguments)){var e,t,n=v.changedTouches,r=i.apply(this,arguments),a=n.length;for(e=0;e<a;++e)(t=k(n[e].identifier,r,ce,this,arguments))&&(fe(),t("start"))}}function x(){var e,t,n=v.changedTouches,r=n.length;for(e=0;e<r;++e)(t=s[n[e].identifier])&&(pe(),t("drag"))}function E(){var e,t,n=v.changedTouches,o=n.length;for(r&&clearTimeout(r),r=setTimeout((function(){r=null}),500),e=0;e<o;++e)(t=s[n[e].identifier])&&(fe(),t("end"))}function k(e,t,n,r,o){var i,l,f,d=n(t,e),h=u.copy();if(b(new ve(p,"beforestart",i,e,c,d[0],d[1],0,0,h),(function(){return null!=(v.subject=i=a.apply(r,o))&&(l=i.x-d[0]||0,f=i.y-d[1]||0,!0)})))return function a(u){var m,v=d;switch(u){case"start":s[e]=a,m=c++;break;case"end":delete s[e],--c;case"drag":d=n(t,e),m=c}b(new ve(p,u,i,e,m,d[0]+l,d[1]+f,d[0]-v[0],d[1]-v[1],h),h.apply,h,[u,r,o])}}return p.filter=function(e){return arguments.length?(o="function"==typeof e?e:me(!!e),p):o},p.container=function(e){return arguments.length?(i="function"==typeof e?e:me(e),p):i},p.subject=function(e){return arguments.length?(a="function"==typeof e?e:me(e),p):a},p.touchable=function(e){return arguments.length?(l="function"==typeof e?e:me(!!e),p):l},p.on=function(){var e=u.on.apply(u,arguments);return e===u?p:e},p.clickDistance=function(e){return arguments.length?(f=(e=+e)*e,p):Math.sqrt(f)},p}().on("start",(function(t){v.active||e.alphaTarget(.3).restart(),t.fx=t.x,t.fy=t.y})).on("drag",(function(e){e.fx=v.x>z-10||v.x<20?e.x:v.x,e.fy=v.y>A-10||v.y<20?e.y:v.y}))},R=function(e,t,n){var r=function(e,t,n){var r=.5*(t.x+e.x),o=.5*(t.y+e.y),i=t.x-e.x,a=t.y-e.y,l=Math.pow(Math.pow(i,2)+Math.pow(a,2),.5);return{qx:r-a*n/l,qy:o+i*n/l}}(e,t,n),o=r.qx,i=r.qy;return isNaN(o)?"M".concat(e.x,", ").concat(e.y," Q0 0 ").concat(t.x," ").concat(t.y):"M".concat(e.x,", ").concat(e.y," Q").concat(o," ").concat(i," ").concat(t.x," ").concat(t.y)},D=function(e){var t=8.5,n="-0 -".concat(t," ").concat(17," ").concat(17),r="M 0,-".concat(6.800000000000001," L ").concat(13.600000000000001," ,0 L 0,").concat(6.800000000000001),o=T(He),i=e.links.map((function(e){return Object.create(e)})),a=e.nodes.map((function(e){return Object.create(e)})),s=function(e){var t,n=1,r=.001,o=1-Math.pow(r,1/300),i=0,a=.6,l=w(),s=x(c),u=y("tick","end");function c(){f(),u.call("tick",t),n<r&&(s.stop(),u.call("end",t))}function f(r){var s,u,c=e.length;void 0===r&&(r=1);for(var f=0;f<r;++f)for(n+=(i-n)*o,l.each((function(e){e(n)})),s=0;s<c;++s)null==(u=e[s]).fx?u.x+=u.vx*=a:(u.x=u.fx,u.vx=0),null==u.fy?u.y+=u.vy*=a:(u.y=u.fy,u.vy=0);return t}function p(){for(var t,n=0,r=e.length;n<r;++n){if((t=e[n]).index=n,null!=t.fx&&(t.x=t.fx),null!=t.fy&&(t.y=t.fy),isNaN(t.x)||isNaN(t.y)){var o=10*Math.sqrt(n),i=n*Be;t.x=o*Math.cos(i),t.y=o*Math.sin(i)}(isNaN(t.vx)||isNaN(t.vy))&&(t.vx=t.vy=0)}}function d(t){return t.initialize&&t.initialize(e),t}return null==e&&(e=[]),p(),t={tick:f,restart:function(){return s.restart(c),t},stop:function(){return s.stop(),t},nodes:function(n){return arguments.length?(e=n,p(),l.each(d),t):e},alpha:function(e){return arguments.length?(n=+e,t):n},alphaMin:function(e){return arguments.length?(r=+e,t):r},alphaDecay:function(e){return arguments.length?(o=+e,t):+o},alphaTarget:function(e){return arguments.length?(i=+e,t):i},velocityDecay:function(e){return arguments.length?(a=1-e,t):1-a},force:function(e,n){return arguments.length>1?(null==n?l.remove(e):l.set(e,d(n)),t):l.get(e)},find:function(t,n,r){var o,i,a,l,s,u=0,c=e.length;for(null==r?r=1/0:r*=r,u=0;u<c;++u)(a=(o=t-(l=e[u]).x)*o+(i=n-l.y)*i)<r&&(s=l,r=a);return s},on:function(e,n){return arguments.length>1?(u.on(e,n),t):u.on(e)}}}(a).force("link",function(e){var t,n,r,o,i,a=De,l=function(e){return 1/Math.min(o[e.source.index],o[e.target.index])},s=Se(30),u=1;function c(r){for(var o=0,a=e.length;o<u;++o)for(var l,s,c,f,p,d,h,m=0;m<a;++m)s=(l=e[m]).source,f=(c=l.target).x+c.vx-s.x-s.vx||Te(),p=c.y+c.vy-s.y-s.vy||Te(),f*=d=((d=Math.sqrt(f*f+p*p))-n[m])/d*r*t[m],p*=d,c.vx-=f*(h=i[m]),c.vy-=p*h,s.vx+=f*(h=1-h),s.vy+=p*h}function f(){if(r){var l,s,u=r.length,c=e.length,f=w(r,a);for(l=0,o=new Array(u);l<c;++l)(s=e[l]).index=l,"object"!=typeof s.source&&(s.source=Fe(f,s.source)),"object"!=typeof s.target&&(s.target=Fe(f,s.target)),o[s.source.index]=(o[s.source.index]||0)+1,o[s.target.index]=(o[s.target.index]||0)+1;for(l=0,i=new Array(c);l<c;++l)s=e[l],i[l]=o[s.source.index]/(o[s.source.index]+o[s.target.index]);t=new Array(c),p(),n=new Array(c),d()}}function p(){if(r)for(var n=0,o=e.length;n<o;++n)t[n]=+l(e[n],n,e)}function d(){if(r)for(var t=0,o=e.length;t<o;++t)n[t]=+s(e[t],t,e)}return null==e&&(e=[]),c.initialize=function(e){r=e,f()},c.links=function(t){return arguments.length?(e=t,f(),c):e},c.id=function(e){return arguments.length?(a=e,c):a},c.iterations=function(e){return arguments.length?(u=+e,c):u},c.strength=function(e){return arguments.length?(l="function"==typeof e?e:Se(+e),p(),c):l},c.distance=function(e){return arguments.length?(s="function"==typeof e?e:Se(+e),d(),c):s},c}(i).id((function(e){return e.index})).distance(50)).force("charge",function(){var e,t,n,r,o=Se(-30),i=1,a=1/0,l=.81;function s(r){var o,i=e.length,a=Me(e,Le,Ie).visitAfter(c);for(n=r,o=0;o<i;++o)t=e[o],a.visit(f)}function u(){if(e){var t,n,i=e.length;for(r=new Array(i),t=0;t<i;++t)n=e[t],r[n.index]=+o(n,t,e)}}function c(e){var t,n,o,i,a,l=0,s=0;if(e.length){for(o=i=a=0;a<4;++a)(t=e[a])&&(n=Math.abs(t.value))&&(l+=t.value,s+=n,o+=n*t.x,i+=n*t.y);e.x=o/s,e.y=i/s}else{(t=e).x=t.data.x,t.y=t.data.y;do{l+=r[t.data.index]}while(t=t.next)}e.value=l}function f(e,o,s,u){if(!e.value)return!0;var c=e.x-t.x,f=e.y-t.y,p=u-o,d=c*c+f*f;if(p*p/l<d)return d<a&&(0===c&&(d+=(c=Te())*c),0===f&&(d+=(f=Te())*f),d<i&&(d=Math.sqrt(i*d)),t.vx+=c*e.value*n/d,t.vy+=f*e.value*n/d),!0;if(!(e.length||d>=a)){(e.data!==t||e.next)&&(0===c&&(d+=(c=Te())*c),0===f&&(d+=(f=Te())*f),d<i&&(d=Math.sqrt(i*d)));do{e.data!==t&&(p=r[e.data.index]*n/d,t.vx+=c*p,t.vy+=f*p)}while(e=e.next)}}return s.initialize=function(t){e=t,u()},s.strength=function(e){return arguments.length?(o="function"==typeof e?e:Se(+e),u(),s):o},s.distanceMin=function(e){return arguments.length?(i=e*e,s):Math.sqrt(i)},s.distanceMax=function(e){return arguments.length?(a=e*e,s):Math.sqrt(a)},s.theta=function(e){return arguments.length?(l=e*e,s):Math.sqrt(l)},s}().strength(-100)).force("center",function(e,t){var n;function r(){var r,o,i=n.length,a=0,l=0;for(r=0;r<i;++r)a+=(o=n[r]).x,l+=o.y;for(a=a/i-e,l=l/i-t,r=0;r<i;++r)(o=n[r]).x-=a,o.y-=l}return null==e&&(e=0),null==t&&(t=0),r.initialize=function(e){n=e},r.x=function(t){return arguments.length?(e=+t,r):e},r.y=function(e){return arguments.length?(t=+e,r):t},r}(z/2,A/2)).force("collide",function(e){var t,n,r=1,o=1;function i(){for(var e,i,l,s,u,c,f,p=t.length,d=0;d<o;++d)for(i=Me(t,je,Re).visitAfter(a),e=0;e<p;++e)l=t[e],c=n[l.index],f=c*c,s=l.x+l.vx,u=l.y+l.vy,i.visit(h);function h(e,t,n,o,i){var a=e.data,p=e.r,d=c+p;if(!a)return t>s+d||o<s-d||n>u+d||i<u-d;if(a.index>l.index){var h=s-a.x-a.vx,m=u-a.y-a.vy,v=h*h+m*m;v<d*d&&(0===h&&(v+=(h=Te())*h),0===m&&(v+=(m=Te())*m),v=(d-(v=Math.sqrt(v)))/v*r,l.vx+=(h*=v)*(d=(p*=p)/(f+p)),l.vy+=(m*=v)*d,a.vx-=h*(d=1-d),a.vy-=m*d)}}}function a(e){if(e.data)return e.r=n[e.data.index];for(var t=e.r=0;t<4;++t)e[t]&&e[t].r>e.r&&(e.r=e[t].r)}function l(){if(t){var r,o,i=t.length;for(n=new Array(i),r=0;r<i;++r)o=t[r],n[o.index]=+e(o,r,t)}}return"function"!=typeof e&&(e=Se(null==e?1:+e)),i.initialize=function(e){t=e,l()},i.iterations=function(e){return arguments.length?(o=+e,i):o},i.strength=function(e){return arguments.length?(r=+e,i):r},i.radius=function(t){return arguments.length?(e="function"==typeof t?t:Se(+t),l(),i):e},i}().radius((function(){return 13.5})).strength(.1).iterations(.1)).force("x",function(e){var t,n,r,o=Se(.1);function i(e){for(var o,i=0,a=t.length;i<a;++i)(o=t[i]).vx+=(r[i]-o.x)*n[i]*e}function a(){if(t){var i,a=t.length;for(n=new Array(a),r=new Array(a),i=0;i<a;++i)n[i]=isNaN(r[i]=+e(t[i],i,t))?0:+o(t[i],i,t)}}return"function"!=typeof e&&(e=Se(null==e?0:+e)),i.initialize=function(e){t=e,a()},i.strength=function(e){return arguments.length?(o="function"==typeof e?e:Se(+e),a(),i):o},i.x=function(t){return arguments.length?(e="function"==typeof t?t:Se(+t),a(),i):e},i}(z/2)).force("y",function(e){var t,n,r,o=Se(.1);function i(e){for(var o,i=0,a=t.length;i<a;++i)(o=t[i]).vy+=(r[i]-o.y)*n[i]*e}function a(){if(t){var i,a=t.length;for(n=new Array(a),r=new Array(a),i=0;i<a;++i)n[i]=isNaN(r[i]=+e(t[i],i,t))?0:+o(t[i],i,t)}}return"function"!=typeof e&&(e=Se(null==e?0:+e)),i.initialize=function(e){t=e,a()},i.strength=function(e){return arguments.length?(o="function"==typeof e?e:Se(+e),a(),i):o},i.y=function(t){return arguments.length?(e="function"==typeof t?t:Se(+t),a(),i):e},i}(A/2)).force("radial",function(e,t,n){var r,o,i,a=Se(.1);function l(e){for(var a=0,l=r.length;a<l;++a){var s=r[a],u=s.x-t||1e-6,c=s.y-n||1e-6,f=Math.sqrt(u*u+c*c),p=(i[a]-f)*o[a]*e/f;s.vx+=u*p,s.vy+=c*p}}function s(){if(r){var t,n=r.length;for(o=new Array(n),i=new Array(n),t=0;t<n;++t)i[t]=+e(r[t],t,r),o[t]=isNaN(i[t])?0:+a(r[t],t,r)}}return"function"!=typeof e&&(e=Se(+e)),null==t&&(t=0),null==n&&(n=0),l.initialize=function(e){r=e,s()},l.strength=function(e){return arguments.length?(a="function"==typeof e?e:Se(+e),s(),l):a},l.radius=function(t){return arguments.length?(e="function"==typeof t?t:Se(+t),s(),l):e},l.x=function(e){return arguments.length?(t=+e,l):t},l.y=function(e){return arguments.length?(n=+e,l):n},l}(100,z/1.5,A/1.5)),c=g(".chart").append("svg").attr("viewBox",[0,0,z,A]).style("background-color",N);c.append("defs").append("marker").attr("id","arrowhead").attr("viewBox",n).attr("refX",23.8).attr("refY",0).attr("orient","auto").attr("markerWidth",15.3).attr("markerHeight",15.3).attr("xoverflow","visible").append("svg:path").attr("d",r).attr("fill","#999").style("stroke","none"),l=c.append("g");var f=function(){var e,t,n=Ve,r=Ge,o=Je,i=Xe,a=Ke,l=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],u=250,c=ke,f=y("start","zoom","end"),p=500,d=0;function h(e){e.property("__zoom",Ye).on("wheel.zoom",C).on("mousedown.zoom",N).on("dblclick.zoom",M).filter(a).on("touchstart.zoom",P).on("touchmove.zoom",z).on("touchend.zoom touchcancel.zoom",A).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function m(e,t){return(t=Math.max(l[0],Math.min(l[1],t)))===e.k?e:new E(t,e.x,e.y)}function w(e,t,n){var r=t[0]-n[0]*e.k,o=t[1]-n[1]*e.k;return r===e.x&&o===e.y?e:new E(e.k,r,o)}function x(e){return[(+e[0][0]+ +e[1][0])/2,(+e[0][1]+ +e[1][1])/2]}function T(e,t,n){e.on("start.zoom",(function(){_(this,arguments).start()})).on("interrupt.zoom end.zoom",(function(){_(this,arguments).end()})).tween("zoom",(function(){var e=this,o=arguments,i=_(e,o),a=r.apply(e,o),l=null==n?x(a):"function"==typeof n?n.apply(e,o):n,s=Math.max(a[1][0]-a[0][0],a[1][1]-a[0][1]),u=e.__zoom,f="function"==typeof t?t.apply(e,o):t,p=c(u.invert(l).concat(s/u.k),f.invert(l).concat(s/f.k));return function(e){if(1===e)e=f;else{var t=p(e),n=s/t[2];e=new E(n,l[0]-t[0]*n,l[1]-t[1]*n)}i.zoom(null,e)}}))}function _(e,t,n){return!n&&e.__zooming||new O(e,t)}function O(e,t){this.that=e,this.args=t,this.active=0,this.extent=r.apply(e,t),this.taps=0}function C(){if(n.apply(this,arguments)){var e=_(this,arguments),t=this.__zoom,r=Math.max(l[0],Math.min(l[1],t.k*Math.pow(2,i.apply(this,arguments)))),a=ue(this);if(e.wheel)e.mouse[0][0]===a[0]&&e.mouse[0][1]===a[1]||(e.mouse[1]=t.invert(e.mouse[0]=a)),clearTimeout(e.wheel);else{if(t.k===r)return;e.mouse=[a,t.invert(a)],S(this),e.start()}$e(),e.wheel=setTimeout(u,150),e.zoom("mouse",o(w(m(t,r),e.mouse[0],e.mouse[1]),e.extent,s))}function u(){e.wheel=null,e.end()}}function N(){if(!t&&n.apply(this,arguments)){var e=_(this,arguments,!0),r=g(v.view).on("mousemove.zoom",u,!0).on("mouseup.zoom",c,!0),i=ue(this),a=v.clientX,l=v.clientY;de(v.view),qe(),e.mouse=[i,this.__zoom.invert(i)],S(this),e.start()}function u(){if($e(),!e.moved){var t=v.clientX-a,n=v.clientY-l;e.moved=t*t+n*n>d}e.zoom("mouse",o(w(e.that.__zoom,e.mouse[0]=ue(e.that),e.mouse[1]),e.extent,s))}function c(){r.on("mousemove.zoom mouseup.zoom",null),he(v.view,e.moved),$e(),e.end()}}function M(){if(n.apply(this,arguments)){var e=this.__zoom,t=ue(this),i=e.invert(t),a=e.k*(v.shiftKey?.5:2),l=o(w(m(e,a),t,i),r.apply(this,arguments),s);$e(),u>0?g(this).transition().duration(u).call(T,l,t):g(this).call(h.transform,l)}}function P(){if(n.apply(this,arguments)){var t,r,o,i,a=v.touches,l=a.length,s=_(this,arguments,v.changedTouches.length===l);for(qe(),r=0;r<l;++r)i=[i=ce(this,a,(o=a[r]).identifier),this.__zoom.invert(i),o.identifier],s.touch0?s.touch1||s.touch0[2]===i[2]||(s.touch1=i,s.taps=0):(s.touch0=i,t=!0,s.taps=1+!!e);e&&(e=clearTimeout(e)),t&&(s.taps<2&&(e=setTimeout((function(){e=null}),p)),S(this),s.start())}}function z(){if(this.__zooming){var t,n,r,i,a=_(this,arguments),l=v.changedTouches,u=l.length;for($e(),e&&(e=clearTimeout(e)),a.taps=0,t=0;t<u;++t)r=ce(this,l,(n=l[t]).identifier),a.touch0&&a.touch0[2]===n.identifier?a.touch0[0]=r:a.touch1&&a.touch1[2]===n.identifier&&(a.touch1[0]=r);if(n=a.that.__zoom,a.touch1){var c=a.touch0[0],f=a.touch0[1],p=a.touch1[0],d=a.touch1[1],h=(h=p[0]-c[0])*h+(h=p[1]-c[1])*h,g=(g=d[0]-f[0])*g+(g=d[1]-f[1])*g;n=m(n,Math.sqrt(h/g)),r=[(c[0]+p[0])/2,(c[1]+p[1])/2],i=[(f[0]+d[0])/2,(f[1]+d[1])/2]}else{if(!a.touch0)return;r=a.touch0[0],i=a.touch0[1]}a.zoom("touch",o(w(n,r,i),a.extent,s))}}function A(){if(this.__zooming){var e,n,r=_(this,arguments),o=v.changedTouches,i=o.length;for(qe(),t&&clearTimeout(t),t=setTimeout((function(){t=null}),p),e=0;e<i;++e)n=o[e],r.touch0&&r.touch0[2]===n.identifier?delete r.touch0:r.touch1&&r.touch1[2]===n.identifier&&delete r.touch1;if(r.touch1&&!r.touch0&&(r.touch0=r.touch1,delete r.touch1),r.touch0)r.touch0[1]=this.__zoom.invert(r.touch0[0]);else if(r.end(),2===r.taps){var a=g(this).on("dblclick.zoom");a&&a.apply(this,arguments)}}}return h.transform=function(e,t,n){var r=e.selection?e.selection():e;r.property("__zoom",Ye),e!==r?T(e,t,n):r.interrupt().each((function(){_(this,arguments).start().zoom(null,"function"==typeof t?t.apply(this,arguments):t).end()}))},h.scaleBy=function(e,t,n){h.scaleTo(e,(function(){return this.__zoom.k*("function"==typeof t?t.apply(this,arguments):t)}),n)},h.scaleTo=function(e,t,n){h.transform(e,(function(){var e=r.apply(this,arguments),i=this.__zoom,a=null==n?x(e):"function"==typeof n?n.apply(this,arguments):n,l=i.invert(a),u="function"==typeof t?t.apply(this,arguments):t;return o(w(m(i,u),a,l),e,s)}),n)},h.translateBy=function(e,t,n){h.transform(e,(function(){return o(this.__zoom.translate("function"==typeof t?t.apply(this,arguments):t,"function"==typeof n?n.apply(this,arguments):n),r.apply(this,arguments),s)}))},h.translateTo=function(e,t,n,i){h.transform(e,(function(){var e=r.apply(this,arguments),a=this.__zoom,l=null==i?x(e):"function"==typeof i?i.apply(this,arguments):i;return o(k.translate(l[0],l[1]).scale(a.k).translate("function"==typeof t?-t.apply(this,arguments):-t,"function"==typeof n?-n.apply(this,arguments):-n),e,s)}),i)},O.prototype={start:function(){return 1==++this.active&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(e,t){return this.mouse&&"mouse"!==e&&(this.mouse[1]=t.invert(this.mouse[0])),this.touch0&&"touch"!==e&&(this.touch0[1]=t.invert(this.touch0[0])),this.touch1&&"touch"!==e&&(this.touch1[1]=t.invert(this.touch1[0])),this.that.__zoom=t,this.emit("zoom"),this},end:function(){return 0==--this.active&&(delete this.that.__zooming,this.emit("end")),this},emit:function(e){b(new We(h,e,this.that.__zoom),f.apply,f,[e,this.that,this.args])}},h.wheelDelta=function(e){return arguments.length?(i="function"==typeof e?e:Ue(+e),h):i},h.filter=function(e){return arguments.length?(n="function"==typeof e?e:Ue(!!e),h):n},h.touchable=function(e){return arguments.length?(a="function"==typeof e?e:Ue(!!e),h):a},h.extent=function(e){return arguments.length?(r="function"==typeof e?e:Ue([[+e[0][0],+e[0][1]],[+e[1][0],+e[1][1]]]),h):r},h.scaleExtent=function(e){return arguments.length?(l[0]=+e[0],l[1]=+e[1],h):[l[0],l[1]]},h.translateExtent=function(e){return arguments.length?(s[0][0]=+e[0][0],s[1][0]=+e[1][0],s[0][1]=+e[0][1],s[1][1]=+e[1][1],h):[[s[0][0],s[0][1]],[s[1][0],s[1][1]]]},h.constrain=function(e){return arguments.length?(o=e,h):o},h.duration=function(e){return arguments.length?(u=+e,h):u},h.interpolate=function(e){return arguments.length?(c=e,h):c},h.on=function(){var e=f.on.apply(f,arguments);return e===f?h:e},h.clickDistance=function(e){return arguments.length?(d=(e=+e)*e,h):Math.sqrt(d)},h}().scaleExtent([.5,20]).extent([[0,0],[z,A]]).on("zoom",(function(){l.attr("transform",v.transform)}));f(c),g("#resetBtn").on("click",(function(){c.transition().duration(750).call(f.transform,k)}));var p=l.append("g").attr("stroke","#999").attr("stroke-opacity",.6).selectAll("line").data(i).join("path").attr("fill","none").attr("stroke-dasharray",(function(e){return"protege"===e.ontology?"2,5,3":""})).attr("key",(function(e){return e.type})),h=l.append("g").attr("stroke","#fff").attr("stroke-width",1.5).selectAll("circle").data(a).join("circle").attr("r",(function(e){return"mainNode"===e.type?13.5:t})).attr("fill",(function(e){return o(e.type)})).attr("key",(function(e){return e.type})).attr("class",(function(e){return"node node-".concat(e.id," ").concat(e.type&&"organization"===e.type?"org":"person"===e.type?"person":"publication"===e.type?"publication":"mainNode"===e.type?"mainNode":"article"===e.type?"article":"keyword"===e.type?"keyword":"event"===e.type?"event":"")})).on("click",(function(e){return e.hasClick?d({name:e.name,id:e.id,type:e.type}):null})).call(j(s));h.append("title").text((function(e){return"".concat(e.name,"-").concat(function(e){switch(e){case"mainNode":return u?u.formatMessage({id:"SNA.search.center"}):"主要搜尋中心";case"organization":return u?u.formatMessage({id:"SNA.organization"}):"組織";case"person":return u?u.formatMessage({id:"SNA.author"}):"作家";case"publication":return u?u.formatMessage({id:"SNA.publication"}):"作家";case"article":return u?u.formatMessage({id:"SNA.article"}):"單篇作品";case"keyword":return u?u.formatMessage({id:"SNA.keyword"}):"關鍵字";case"event":return u?u.formatMessage({id:"SNA.event"}):"事件";default:return""}}(e.type))}));var m=l.append("g").selectAll("text").data(a).join("text").attr("fill",C).attr("text-anchor","middle").attr("key",(function(e){return e.type})).style("color","#fff").style("font-size","14px").text((function(e){return e.name})),_=l.selectAll(".edgepath").data(i).enter().append("path").attr("class","edgepath").attr("fill-opacity",0).attr("stroke-opacity",0).attr("id",(function(e,t){return"edgepath".concat(t)})).style("pointer-events","none");l.selectAll(".edgelabel").data(i).enter().append("text").style("pointer-events","none").attr("class","edgelabel").attr("font-size","10px").attr("fill","#aaa").attr("visibility","visible").attr("key",(function(e){return e.type})).attr("id",(function(e,t){return"edgelabel".concat(t)})).append("textPath").attr("xlink:href",(function(e,t){return"#edgepath".concat(t)})).style("text-anchor","middle").style("pointer-events","none").attr("startOffset","50%").text((function(e){return e.property})),s.on("tick",(function(){a.forEach((function(e){e.x>=z-20&&(e.x=z-20),e.y>=A-20&&(e.y=A-20),e.x<=20&&(e.x=20),e.y<=20&&(e.y=20)})),p.attr("d",(function(e){return R(e.source,e.target,30)})),h.attr("cx",(function(e){return e.x})).attr("cy",(function(e){return e.y})),m.attr("x",(function(e){return e.x})).attr("y",(function(e){return e.y-t})),_.attr("d",(function(e){return R(e.source,e.target,30)}))}))};return i((function(){if(p&&p.nodes&&p.nodes.length>0){var e=document.getElementById("network-graph");e&&e.childNodes[0]&&e.removeChild(e.childNodes[0]),D(p)}}),[p,P.active]),t.createElement("div",{className:m("SNA",{"SNA--smallSize":f<200},s),style:{contentWidth:z,contentHeight:A,backgroundColor:N}},t.createElement(Vt,{intl:u,data:p,iconColor:M,domToImageId:"network-graph",fullScreenHandle:P,exclude:c,DownloadExcel:h}),t.createElement(Wr,null),t.createElement(it,{handle:P},t.createElement("div",{className:"chart",id:"network-graph"},P.active&&t.createElement("div",{className:"fullscreenExit",style:{backgroundColor:N}},t.createElement(lt,{fontSize:"large",style:{color:M},onClick:P.exit,title:u?u.formatMessage({id:"knowledge.writersAndWorksSNA.fullscreenExit"}):"離開全螢幕"})))))};qr.defaultProps={className:void 0,intl:void 0,width:1050,height:600,distance:400,SNAData:null,fontColor:"#000000",backgroundColor:"#FFFFFF",iconColor:"#825c0d",exclude:["downloadXls","downloadTsv"],handleClickNodeGoto:null,DownloadExcel:void 0},qr.propTypes={className:p.string,intl:p.objectOf(p.any),width:p.number,height:p.number,distance:p.number,SNAData:p.objectOf(p.any),fontColor:p.string,backgroundColor:p.string,iconColor:p.string,exclude:p.arrayOf(p.string),handleClickNodeGoto:p.func,DownloadExcel:p.oneOfType([p.node,p.func])};export{qr as default};
|
|
40
|
+
*/var Tn=kn&&window.Promise?function(e){var t=!1;return function(){t||(t=!0,window.Promise.resolve().then((function(){t=!1,e()})))}}:function(e){var t=!1;return function(){t||(t=!0,setTimeout((function(){t=!1,e()}),Sn))}};function _n(e){return e&&"[object Function]"==={}.toString.call(e)}function On(e,t){if(1!==e.nodeType)return[];var n=e.ownerDocument.defaultView.getComputedStyle(e,null);return t?n[t]:n}function Cn(e){return"HTML"===e.nodeName?e:e.parentNode||e.host}function Nn(e){if(!e)return document.body;switch(e.nodeName){case"HTML":case"BODY":return e.ownerDocument.body;case"#document":return e.body}var t=On(e),n=t.overflow,r=t.overflowX,o=t.overflowY;return/(auto|scroll|overlay)/.test(n+o+r)?e:Nn(Cn(e))}function Mn(e){return e&&e.referenceNode?e.referenceNode:e}var Pn=kn&&!(!window.MSInputMethodContext||!document.documentMode),zn=kn&&/MSIE 10/.test(navigator.userAgent);function An(e){return 11===e?Pn:10===e?zn:Pn||zn}function jn(e){if(!e)return document.documentElement;for(var t=An(10)?document.body:null,n=e.offsetParent||null;n===t&&e.nextElementSibling;)n=(e=e.nextElementSibling).offsetParent;var r=n&&n.nodeName;return r&&"BODY"!==r&&"HTML"!==r?-1!==["TH","TD","TABLE"].indexOf(n.nodeName)&&"static"===On(n,"position")?jn(n):n:e?e.ownerDocument.documentElement:document.documentElement}function Rn(e){return null!==e.parentNode?Rn(e.parentNode):e}function Dn(e,t){if(!(e&&e.nodeType&&t&&t.nodeType))return document.documentElement;var n=e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING,r=n?e:t,o=n?t:e,i=document.createRange();i.setStart(r,0),i.setEnd(o,0);var a,l,s=i.commonAncestorContainer;if(e!==s&&t!==s||r.contains(o))return"BODY"===(l=(a=s).nodeName)||"HTML"!==l&&jn(a.firstElementChild)!==a?jn(s):s;var u=Rn(e);return u.host?Dn(u.host,t):Dn(e,Rn(t).host)}function Fn(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"top",n="top"===t?"scrollTop":"scrollLeft",r=e.nodeName;if("BODY"===r||"HTML"===r){var o=e.ownerDocument.documentElement,i=e.ownerDocument.scrollingElement||o;return i[n]}return e[n]}function Ln(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=Fn(t,"top"),o=Fn(t,"left"),i=n?-1:1;return e.top+=r*i,e.bottom+=r*i,e.left+=o*i,e.right+=o*i,e}function In(e,t){var n="x"===t?"Left":"Top",r="Left"===n?"Right":"Bottom";return parseFloat(e["border"+n+"Width"])+parseFloat(e["border"+r+"Width"])}function Bn(e,t,n,r){return Math.max(t["offset"+e],t["scroll"+e],n["client"+e],n["offset"+e],n["scroll"+e],An(10)?parseInt(n["offset"+e])+parseInt(r["margin"+("Height"===e?"Top":"Left")])+parseInt(r["margin"+("Height"===e?"Bottom":"Right")]):0)}function Hn(e){var t=e.body,n=e.documentElement,r=An(10)&&getComputedStyle(n);return{height:Bn("Height",t,n,r),width:Bn("Width",t,n,r)}}var Un=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},Wn=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),qn=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},$n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};function Vn(e){return $n({},e,{right:e.left+e.width,bottom:e.top+e.height})}function Gn(e){var t={};try{if(An(10)){t=e.getBoundingClientRect();var n=Fn(e,"top"),r=Fn(e,"left");t.top+=n,t.left+=r,t.bottom+=n,t.right+=r}else t=e.getBoundingClientRect()}catch(e){}var o={left:t.left,top:t.top,width:t.right-t.left,height:t.bottom-t.top},i="HTML"===e.nodeName?Hn(e.ownerDocument):{},a=i.width||e.clientWidth||o.width,l=i.height||e.clientHeight||o.height,s=e.offsetWidth-a,u=e.offsetHeight-l;if(s||u){var c=On(e);s-=In(c,"x"),u-=In(c,"y"),o.width-=s,o.height-=u}return Vn(o)}function Yn(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=An(10),o="HTML"===t.nodeName,i=Gn(e),a=Gn(t),l=Nn(e),s=On(t),u=parseFloat(s.borderTopWidth),c=parseFloat(s.borderLeftWidth);n&&o&&(a.top=Math.max(a.top,0),a.left=Math.max(a.left,0));var f=Vn({top:i.top-a.top-u,left:i.left-a.left-c,width:i.width,height:i.height});if(f.marginTop=0,f.marginLeft=0,!r&&o){var p=parseFloat(s.marginTop),d=parseFloat(s.marginLeft);f.top-=u-p,f.bottom-=u-p,f.left-=c-d,f.right-=c-d,f.marginTop=p,f.marginLeft=d}return(r&&!n?t.contains(l):t===l&&"BODY"!==l.nodeName)&&(f=Ln(f,t)),f}function Xn(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=e.ownerDocument.documentElement,r=Yn(e,n),o=Math.max(n.clientWidth,window.innerWidth||0),i=Math.max(n.clientHeight,window.innerHeight||0),a=t?0:Fn(n),l=t?0:Fn(n,"left"),s={top:a-r.top+r.marginTop,left:l-r.left+r.marginLeft,width:o,height:i};return Vn(s)}function Kn(e){var t=e.nodeName;if("BODY"===t||"HTML"===t)return!1;if("fixed"===On(e,"position"))return!0;var n=Cn(e);return!!n&&Kn(n)}function Jn(e){if(!e||!e.parentElement||An())return document.documentElement;for(var t=e.parentElement;t&&"none"===On(t,"transform");)t=t.parentElement;return t||document.documentElement}function Qn(e,t,n,r){var o=arguments.length>4&&void 0!==arguments[4]&&arguments[4],i={top:0,left:0},a=o?Jn(e):Dn(e,Mn(t));if("viewport"===r)i=Xn(a,o);else{var l=void 0;"scrollParent"===r?"BODY"===(l=Nn(Cn(t))).nodeName&&(l=e.ownerDocument.documentElement):l="window"===r?e.ownerDocument.documentElement:r;var s=Yn(l,a,o);if("HTML"!==l.nodeName||Kn(a))i=s;else{var u=Hn(e.ownerDocument),c=u.height,f=u.width;i.top+=s.top-s.marginTop,i.bottom=c+s.top,i.left+=s.left-s.marginLeft,i.right=f+s.left}}var p="number"==typeof(n=n||0);return i.left+=p?n:n.left||0,i.top+=p?n:n.top||0,i.right-=p?n:n.right||0,i.bottom-=p?n:n.bottom||0,i}function Zn(e){return e.width*e.height}function er(e,t,n,r,o){var i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;if(-1===e.indexOf("auto"))return e;var a=Qn(n,r,i,o),l={top:{width:a.width,height:t.top-a.top},right:{width:a.right-t.right,height:a.height},bottom:{width:a.width,height:a.bottom-t.bottom},left:{width:t.left-a.left,height:a.height}},s=Object.keys(l).map((function(e){return $n({key:e},l[e],{area:Zn(l[e])})})).sort((function(e,t){return t.area-e.area})),u=s.filter((function(e){var t=e.width,r=e.height;return t>=n.clientWidth&&r>=n.clientHeight})),c=u.length>0?u[0].key:s[0].key,f=e.split("-")[1];return c+(f?"-"+f:"")}function tr(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,o=r?Jn(t):Dn(t,Mn(n));return Yn(n,o,r)}function nr(e){var t=e.ownerDocument.defaultView.getComputedStyle(e),n=parseFloat(t.marginTop||0)+parseFloat(t.marginBottom||0),r=parseFloat(t.marginLeft||0)+parseFloat(t.marginRight||0);return{width:e.offsetWidth+r,height:e.offsetHeight+n}}function rr(e){var t={left:"right",right:"left",bottom:"top",top:"bottom"};return e.replace(/left|right|bottom|top/g,(function(e){return t[e]}))}function or(e,t,n){n=n.split("-")[0];var r=nr(e),o={width:r.width,height:r.height},i=-1!==["right","left"].indexOf(n),a=i?"top":"left",l=i?"left":"top",s=i?"height":"width",u=i?"width":"height";return o[a]=t[a]+t[s]/2-r[s]/2,o[l]=n===l?t[l]-r[u]:t[rr(l)],o}function ir(e,t){return Array.prototype.find?e.find(t):e.filter(t)[0]}function ar(e,t,n){return(void 0===n?e:e.slice(0,function(e,t,n){if(Array.prototype.findIndex)return e.findIndex((function(e){return e[t]===n}));var r=ir(e,(function(e){return e[t]===n}));return e.indexOf(r)}(e,"name",n))).forEach((function(e){e.function&&console.warn("`modifier.function` is deprecated, use `modifier.fn`!");var n=e.function||e.fn;e.enabled&&_n(n)&&(t.offsets.popper=Vn(t.offsets.popper),t.offsets.reference=Vn(t.offsets.reference),t=n(t,e))})),t}function lr(){if(!this.state.isDestroyed){var e={instance:this,styles:{},arrowStyles:{},attributes:{},flipped:!1,offsets:{}};e.offsets.reference=tr(this.state,this.popper,this.reference,this.options.positionFixed),e.placement=er(this.options.placement,e.offsets.reference,this.popper,this.reference,this.options.modifiers.flip.boundariesElement,this.options.modifiers.flip.padding),e.originalPlacement=e.placement,e.positionFixed=this.options.positionFixed,e.offsets.popper=or(this.popper,e.offsets.reference,e.placement),e.offsets.popper.position=this.options.positionFixed?"fixed":"absolute",e=ar(this.modifiers,e),this.state.isCreated?this.options.onUpdate(e):(this.state.isCreated=!0,this.options.onCreate(e))}}function sr(e,t){return e.some((function(e){var n=e.name;return e.enabled&&n===t}))}function ur(e){for(var t=[!1,"ms","Webkit","Moz","O"],n=e.charAt(0).toUpperCase()+e.slice(1),r=0;r<t.length;r++){var o=t[r],i=o?""+o+n:e;if(void 0!==document.body.style[i])return i}return null}function cr(){return this.state.isDestroyed=!0,sr(this.modifiers,"applyStyle")&&(this.popper.removeAttribute("x-placement"),this.popper.style.position="",this.popper.style.top="",this.popper.style.left="",this.popper.style.right="",this.popper.style.bottom="",this.popper.style.willChange="",this.popper.style[ur("transform")]=""),this.disableEventListeners(),this.options.removeOnDestroy&&this.popper.parentNode.removeChild(this.popper),this}function fr(e){var t=e.ownerDocument;return t?t.defaultView:window}function pr(e,t,n,r){var o="BODY"===e.nodeName,i=o?e.ownerDocument.defaultView:e;i.addEventListener(t,n,{passive:!0}),o||pr(Nn(i.parentNode),t,n,r),r.push(i)}function dr(e,t,n,r){n.updateBound=r,fr(e).addEventListener("resize",n.updateBound,{passive:!0});var o=Nn(e);return pr(o,"scroll",n.updateBound,n.scrollParents),n.scrollElement=o,n.eventsEnabled=!0,n}function hr(){this.state.eventsEnabled||(this.state=dr(this.reference,this.options,this.state,this.scheduleUpdate))}function mr(){var e,t;this.state.eventsEnabled&&(cancelAnimationFrame(this.scheduleUpdate),this.state=(e=this.reference,t=this.state,fr(e).removeEventListener("resize",t.updateBound),t.scrollParents.forEach((function(e){e.removeEventListener("scroll",t.updateBound)})),t.updateBound=null,t.scrollParents=[],t.scrollElement=null,t.eventsEnabled=!1,t))}function vr(e){return""!==e&&!isNaN(parseFloat(e))&&isFinite(e)}function gr(e,t){Object.keys(t).forEach((function(n){var r="";-1!==["width","height","top","right","bottom","left"].indexOf(n)&&vr(t[n])&&(r="px"),e.style[n]=t[n]+r}))}var yr=kn&&/Firefox/i.test(navigator.userAgent);function br(e,t,n){var r=ir(e,(function(e){return e.name===t})),o=!!r&&e.some((function(e){return e.name===n&&e.enabled&&e.order<r.order}));if(!o){var i="`"+t+"`",a="`"+n+"`";console.warn(a+" modifier is required by "+i+" modifier in order to work, be sure to include it before "+i+"!")}return o}var wr=["auto-start","auto","auto-end","top-start","top","top-end","right-start","right","right-end","bottom-end","bottom","bottom-start","left-end","left","left-start"],xr=wr.slice(3);function Er(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=xr.indexOf(e),r=xr.slice(n+1).concat(xr.slice(0,n));return t?r.reverse():r}var kr="flip",Sr="clockwise",Tr="counterclockwise";function _r(e,t,n,r){var o=[0,0],i=-1!==["right","left"].indexOf(r),a=e.split(/(\+|\-)/).map((function(e){return e.trim()})),l=a.indexOf(ir(a,(function(e){return-1!==e.search(/,|\s/)})));a[l]&&-1===a[l].indexOf(",")&&console.warn("Offsets separated by white space(s) are deprecated, use a comma (,) instead.");var s=/\s*,\s*|\s+/,u=-1!==l?[a.slice(0,l).concat([a[l].split(s)[0]]),[a[l].split(s)[1]].concat(a.slice(l+1))]:[a];return u=u.map((function(e,r){var o=(1===r?!i:i)?"height":"width",a=!1;return e.reduce((function(e,t){return""===e[e.length-1]&&-1!==["+","-"].indexOf(t)?(e[e.length-1]=t,a=!0,e):a?(e[e.length-1]+=t,a=!1,e):e.concat(t)}),[]).map((function(e){return function(e,t,n,r){var o=e.match(/((?:\-|\+)?\d*\.?\d*)(.*)/),i=+o[1],a=o[2];if(!i)return e;if(0===a.indexOf("%")){return Vn("%p"===a?n:r)[t]/100*i}if("vh"===a||"vw"===a)return("vh"===a?Math.max(document.documentElement.clientHeight,window.innerHeight||0):Math.max(document.documentElement.clientWidth,window.innerWidth||0))/100*i;return i}(e,o,t,n)}))})),u.forEach((function(e,t){e.forEach((function(n,r){vr(n)&&(o[t]+=n*("-"===e[r-1]?-1:1))}))})),o}var Or={shift:{order:100,enabled:!0,fn:function(e){var t=e.placement,n=t.split("-")[0],r=t.split("-")[1];if(r){var o=e.offsets,i=o.reference,a=o.popper,l=-1!==["bottom","top"].indexOf(n),s=l?"left":"top",u=l?"width":"height",c={start:qn({},s,i[s]),end:qn({},s,i[s]+i[u]-a[u])};e.offsets.popper=$n({},a,c[r])}return e}},offset:{order:200,enabled:!0,fn:function(e,t){var n=t.offset,r=e.placement,o=e.offsets,i=o.popper,a=o.reference,l=r.split("-")[0],s=void 0;return s=vr(+n)?[+n,0]:_r(n,i,a,l),"left"===l?(i.top+=s[0],i.left-=s[1]):"right"===l?(i.top+=s[0],i.left+=s[1]):"top"===l?(i.left+=s[0],i.top-=s[1]):"bottom"===l&&(i.left+=s[0],i.top+=s[1]),e.popper=i,e},offset:0},preventOverflow:{order:300,enabled:!0,fn:function(e,t){var n=t.boundariesElement||jn(e.instance.popper);e.instance.reference===n&&(n=jn(n));var r=ur("transform"),o=e.instance.popper.style,i=o.top,a=o.left,l=o[r];o.top="",o.left="",o[r]="";var s=Qn(e.instance.popper,e.instance.reference,t.padding,n,e.positionFixed);o.top=i,o.left=a,o[r]=l,t.boundaries=s;var u=t.priority,c=e.offsets.popper,f={primary:function(e){var n=c[e];return c[e]<s[e]&&!t.escapeWithReference&&(n=Math.max(c[e],s[e])),qn({},e,n)},secondary:function(e){var n="right"===e?"left":"top",r=c[n];return c[e]>s[e]&&!t.escapeWithReference&&(r=Math.min(c[n],s[e]-("right"===e?c.width:c.height))),qn({},n,r)}};return u.forEach((function(e){var t=-1!==["left","top"].indexOf(e)?"primary":"secondary";c=$n({},c,f[t](e))})),e.offsets.popper=c,e},priority:["left","right","top","bottom"],padding:5,boundariesElement:"scrollParent"},keepTogether:{order:400,enabled:!0,fn:function(e){var t=e.offsets,n=t.popper,r=t.reference,o=e.placement.split("-")[0],i=Math.floor,a=-1!==["top","bottom"].indexOf(o),l=a?"right":"bottom",s=a?"left":"top",u=a?"width":"height";return n[l]<i(r[s])&&(e.offsets.popper[s]=i(r[s])-n[u]),n[s]>i(r[l])&&(e.offsets.popper[s]=i(r[l])),e}},arrow:{order:500,enabled:!0,fn:function(e,t){var n;if(!br(e.instance.modifiers,"arrow","keepTogether"))return e;var r=t.element;if("string"==typeof r){if(!(r=e.instance.popper.querySelector(r)))return e}else if(!e.instance.popper.contains(r))return console.warn("WARNING: `arrow.element` must be child of its popper element!"),e;var o=e.placement.split("-")[0],i=e.offsets,a=i.popper,l=i.reference,s=-1!==["left","right"].indexOf(o),u=s?"height":"width",c=s?"Top":"Left",f=c.toLowerCase(),p=s?"left":"top",d=s?"bottom":"right",h=nr(r)[u];l[d]-h<a[f]&&(e.offsets.popper[f]-=a[f]-(l[d]-h)),l[f]+h>a[d]&&(e.offsets.popper[f]+=l[f]+h-a[d]),e.offsets.popper=Vn(e.offsets.popper);var m=l[f]+l[u]/2-h/2,v=On(e.instance.popper),g=parseFloat(v["margin"+c]),y=parseFloat(v["border"+c+"Width"]),b=m-e.offsets.popper[f]-g-y;return b=Math.max(Math.min(a[u]-h,b),0),e.arrowElement=r,e.offsets.arrow=(qn(n={},f,Math.round(b)),qn(n,p,""),n),e},element:"[x-arrow]"},flip:{order:600,enabled:!0,fn:function(e,t){if(sr(e.instance.modifiers,"inner"))return e;if(e.flipped&&e.placement===e.originalPlacement)return e;var n=Qn(e.instance.popper,e.instance.reference,t.padding,t.boundariesElement,e.positionFixed),r=e.placement.split("-")[0],o=rr(r),i=e.placement.split("-")[1]||"",a=[];switch(t.behavior){case kr:a=[r,o];break;case Sr:a=Er(r);break;case Tr:a=Er(r,!0);break;default:a=t.behavior}return a.forEach((function(l,s){if(r!==l||a.length===s+1)return e;r=e.placement.split("-")[0],o=rr(r);var u=e.offsets.popper,c=e.offsets.reference,f=Math.floor,p="left"===r&&f(u.right)>f(c.left)||"right"===r&&f(u.left)<f(c.right)||"top"===r&&f(u.bottom)>f(c.top)||"bottom"===r&&f(u.top)<f(c.bottom),d=f(u.left)<f(n.left),h=f(u.right)>f(n.right),m=f(u.top)<f(n.top),v=f(u.bottom)>f(n.bottom),g="left"===r&&d||"right"===r&&h||"top"===r&&m||"bottom"===r&&v,y=-1!==["top","bottom"].indexOf(r),b=!!t.flipVariations&&(y&&"start"===i&&d||y&&"end"===i&&h||!y&&"start"===i&&m||!y&&"end"===i&&v),w=!!t.flipVariationsByContent&&(y&&"start"===i&&h||y&&"end"===i&&d||!y&&"start"===i&&v||!y&&"end"===i&&m),x=b||w;(p||g||x)&&(e.flipped=!0,(p||g)&&(r=a[s+1]),x&&(i=function(e){return"end"===e?"start":"start"===e?"end":e}(i)),e.placement=r+(i?"-"+i:""),e.offsets.popper=$n({},e.offsets.popper,or(e.instance.popper,e.offsets.reference,e.placement)),e=ar(e.instance.modifiers,e,"flip"))})),e},behavior:"flip",padding:5,boundariesElement:"viewport",flipVariations:!1,flipVariationsByContent:!1},inner:{order:700,enabled:!1,fn:function(e){var t=e.placement,n=t.split("-")[0],r=e.offsets,o=r.popper,i=r.reference,a=-1!==["left","right"].indexOf(n),l=-1===["top","left"].indexOf(n);return o[a?"left":"top"]=i[n]-(l?o[a?"width":"height"]:0),e.placement=rr(t),e.offsets.popper=Vn(o),e}},hide:{order:800,enabled:!0,fn:function(e){if(!br(e.instance.modifiers,"hide","preventOverflow"))return e;var t=e.offsets.reference,n=ir(e.instance.modifiers,(function(e){return"preventOverflow"===e.name})).boundaries;if(t.bottom<n.top||t.left>n.right||t.top>n.bottom||t.right<n.left){if(!0===e.hide)return e;e.hide=!0,e.attributes["x-out-of-boundaries"]=""}else{if(!1===e.hide)return e;e.hide=!1,e.attributes["x-out-of-boundaries"]=!1}return e}},computeStyle:{order:850,enabled:!0,fn:function(e,t){var n=t.x,r=t.y,o=e.offsets.popper,i=ir(e.instance.modifiers,(function(e){return"applyStyle"===e.name})).gpuAcceleration;void 0!==i&&console.warn("WARNING: `gpuAcceleration` option moved to `computeStyle` modifier and will not be supported in future versions of Popper.js!");var a=void 0!==i?i:t.gpuAcceleration,l=jn(e.instance.popper),s=Gn(l),u={position:o.position},c=function(e,t){var n=e.offsets,r=n.popper,o=n.reference,i=Math.round,a=Math.floor,l=function(e){return e},s=i(o.width),u=i(r.width),c=-1!==["left","right"].indexOf(e.placement),f=-1!==e.placement.indexOf("-"),p=t?c||f||s%2==u%2?i:a:l,d=t?i:l;return{left:p(s%2==1&&u%2==1&&!f&&t?r.left-1:r.left),top:d(r.top),bottom:d(r.bottom),right:p(r.right)}}(e,window.devicePixelRatio<2||!yr),f="bottom"===n?"top":"bottom",p="right"===r?"left":"right",d=ur("transform"),h=void 0,m=void 0;if(m="bottom"===f?"HTML"===l.nodeName?-l.clientHeight+c.bottom:-s.height+c.bottom:c.top,h="right"===p?"HTML"===l.nodeName?-l.clientWidth+c.right:-s.width+c.right:c.left,a&&d)u[d]="translate3d("+h+"px, "+m+"px, 0)",u[f]=0,u[p]=0,u.willChange="transform";else{var v="bottom"===f?-1:1,g="right"===p?-1:1;u[f]=m*v,u[p]=h*g,u.willChange=f+", "+p}var y={"x-placement":e.placement};return e.attributes=$n({},y,e.attributes),e.styles=$n({},u,e.styles),e.arrowStyles=$n({},e.offsets.arrow,e.arrowStyles),e},gpuAcceleration:!0,x:"bottom",y:"right"},applyStyle:{order:900,enabled:!0,fn:function(e){var t,n;return gr(e.instance.popper,e.styles),t=e.instance.popper,n=e.attributes,Object.keys(n).forEach((function(e){!1!==n[e]?t.setAttribute(e,n[e]):t.removeAttribute(e)})),e.arrowElement&&Object.keys(e.arrowStyles).length&&gr(e.arrowElement,e.arrowStyles),e},onLoad:function(e,t,n,r,o){var i=tr(o,t,e,n.positionFixed),a=er(n.placement,i,t,e,n.modifiers.flip.boundariesElement,n.modifiers.flip.padding);return t.setAttribute("x-placement",a),gr(t,{position:n.positionFixed?"fixed":"absolute"}),n},gpuAcceleration:void 0}},Cr={placement:"bottom",positionFixed:!1,eventsEnabled:!0,removeOnDestroy:!1,onCreate:function(){},onUpdate:function(){},modifiers:Or},Nr=function(){function e(t,n){var r=this,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Un(this,e),this.scheduleUpdate=function(){return requestAnimationFrame(r.update)},this.update=Tn(this.update.bind(this)),this.options=$n({},e.Defaults,o),this.state={isDestroyed:!1,isCreated:!1,scrollParents:[]},this.reference=t&&t.jquery?t[0]:t,this.popper=n&&n.jquery?n[0]:n,this.options.modifiers={},Object.keys($n({},e.Defaults.modifiers,o.modifiers)).forEach((function(t){r.options.modifiers[t]=$n({},e.Defaults.modifiers[t]||{},o.modifiers?o.modifiers[t]:{})})),this.modifiers=Object.keys(this.options.modifiers).map((function(e){return $n({name:e},r.options.modifiers[e])})).sort((function(e,t){return e.order-t.order})),this.modifiers.forEach((function(e){e.enabled&&_n(e.onLoad)&&e.onLoad(r.reference,r.popper,r.options,e,r.state)})),this.update();var i=this.options.eventsEnabled;i&&this.enableEventListeners(),this.state.eventsEnabled=i}return Wn(e,[{key:"update",value:function(){return lr.call(this)}},{key:"destroy",value:function(){return cr.call(this)}},{key:"enableEventListeners",value:function(){return hr.call(this)}},{key:"disableEventListeners",value:function(){return mr.call(this)}}]),e}();Nr.Utils=("undefined"!=typeof window?window:global).PopperUtils,Nr.placements=wr,Nr.Defaults=Cr;var Mr=Nr;var Pr="undefined"!=typeof window?e.useLayoutEffect:e.useEffect,zr=e.forwardRef((function(t,n){var r=t.children,o=t.container,i=t.disablePortal,a=void 0!==i&&i,l=t.onRendered,s=e.useState(null),u=s[0],c=s[1],f=D(e.isValidElement(r)?r.ref:null,n);return Pr((function(){a||c(function(e){return e="function"==typeof e?e():e,ee.findDOMNode(e)}(o)||document.body)}),[o,a]),Pr((function(){if(u&&!a)return B(n,u),function(){B(n,null)}}),[n,u,a]),Pr((function(){l&&(u||a)&&l()}),[l,u,a]),a?e.isValidElement(r)?e.cloneElement(r,{ref:f}):r:u?ee.createPortal(r,u):u}));function Ar(e){return"function"==typeof e?e():e}var jr="undefined"!=typeof window?e.useLayoutEffect:e.useEffect,Rr={},Dr=e.forwardRef((function(t,n){var r=t.anchorEl,o=t.children,i=t.container,a=t.disablePortal,l=void 0!==a&&a,s=t.keepMounted,u=void 0!==s&&s,c=t.modifiers,f=t.open,p=t.placement,d=void 0===p?"bottom":p,h=t.popperOptions,m=void 0===h?Rr:h,v=t.popperRef,g=t.style,y=t.transition,b=void 0!==y&&y,w=j(t,["anchorEl","children","container","disablePortal","keepMounted","modifiers","open","placement","popperOptions","popperRef","style","transition"]),x=e.useRef(null),E=D(x,n),k=e.useRef(null),S=D(k,v),T=e.useRef(S);jr((function(){T.current=S}),[S]),e.useImperativeHandle(v,(function(){return k.current}),[]);var _=e.useState(!0),O=_[0],C=_[1],N=function(e,t){if("ltr"===(t&&t.direction||"ltr"))return e;switch(e){case"bottom-end":return"bottom-start";case"bottom-start":return"bottom-end";case"top-end":return"top-start";case"top-start":return"top-end";default:return e}}(d,ne()),P=e.useState(N),z=P[0],A=P[1];e.useEffect((function(){k.current&&k.current.update()}));var R=e.useCallback((function(){if(x.current&&r&&f){k.current&&(k.current.destroy(),T.current(null));var e=function(e){A(e.placement)};Ar(r);var t=new Mr(Ar(r),x.current,M({placement:N},m,{modifiers:M({},l?{}:{preventOverflow:{boundariesElement:"window"}},c,m.modifiers),onCreate:H(e,m.onCreate),onUpdate:H(e,m.onUpdate)}));T.current(t)}}),[r,l,c,f,N,m]),F=e.useCallback((function(e){B(E,e),R()}),[E,R]),L=function(){k.current&&(k.current.destroy(),T.current(null))};if(e.useEffect((function(){return function(){L()}}),[]),e.useEffect((function(){f||b||L()}),[f,b]),!u&&!f&&(!b||O))return null;var I={placement:z};return b&&(I.TransitionProps={in:f,onEnter:function(){C(!1)},onExited:function(){C(!0),L()}}),e.createElement(zr,{disablePortal:l,container:i},e.createElement("div",M({ref:F,role:"tooltip"},w,{style:M({position:"fixed",top:0,left:0,display:f||!u||b?null:"none"},g)}),"function"==typeof o?o(I):o))})),Fr=Dr;function Lr(e){return Math.round(1e5*e)/1e5}var Ir=!1,Br=null,Hr=e.forwardRef((function(t,n){var r=t.arrow,o=void 0!==r&&r,i=t.children,a=t.classes,l=t.disableFocusListener,s=void 0!==l&&l,u=t.disableHoverListener,c=void 0!==u&&u,f=t.disableTouchListener,p=void 0!==f&&f,d=t.enterDelay,h=void 0===d?100:d,m=t.enterNextDelay,v=void 0===m?0:m,g=t.enterTouchDelay,y=void 0===g?700:g,b=t.id,w=t.interactive,x=void 0!==w&&w,E=t.leaveDelay,k=void 0===E?0:E,S=t.leaveTouchDelay,T=void 0===S?1500:S,_=t.onClose,O=t.onOpen,C=t.open,N=t.placement,z=void 0===N?"bottom":N,A=t.PopperComponent,F=void 0===A?Fr:A,I=t.PopperProps,H=t.title,$=t.TransitionComponent,V=void 0===$?En:$,G=t.TransitionProps,Y=j(t,["arrow","children","classes","disableFocusListener","disableHoverListener","disableTouchListener","enterDelay","enterNextDelay","enterTouchDelay","id","interactive","leaveDelay","leaveTouchDelay","onClose","onOpen","open","placement","PopperComponent","PopperProps","title","TransitionComponent","TransitionProps"]),X=gn(),K=e.useState(),J=K[0],Q=K[1],Z=e.useState(null),te=Z[0],ne=Z[1],re=e.useRef(!1),oe=e.useRef(),ie=e.useRef(),le=e.useRef(),se=e.useRef(),ue=ae(U({controlled:C,default:!1,name:"Tooltip",state:"open"}),2),ce=ue[0],fe=ue[1],pe=ce,de=W(b);e.useEffect((function(){return function(){clearTimeout(oe.current),clearTimeout(ie.current),clearTimeout(le.current),clearTimeout(se.current)}}),[]);var he=function(e){clearTimeout(Br),Ir=!0,fe(!0),O&&O(e)},me=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return function(t){var n=i.props;"mouseover"===t.type&&n.onMouseOver&&e&&n.onMouseOver(t),re.current&&"touchstart"!==t.type||(J&&J.removeAttribute("title"),clearTimeout(ie.current),clearTimeout(le.current),h||Ir&&v?(t.persist(),ie.current=setTimeout((function(){he(t)}),Ir?v:h)):he(t))}},ve=R(),ge=ve.isFocusVisible,ye=ve.onBlurVisible,be=ve.ref,we=e.useState(!1),xe=we[0],Ee=we[1],ke=function(){xe&&(Ee(!1),ye())},Se=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return function(t){J||Q(t.currentTarget),ge(t)&&(Ee(!0),me()(t));var n=i.props;n.onFocus&&e&&n.onFocus(t)}},Te=function(e){clearTimeout(Br),Br=setTimeout((function(){Ir=!1}),800+k),fe(!1),_&&_(e),clearTimeout(oe.current),oe.current=setTimeout((function(){re.current=!1}),X.transitions.duration.shortest)},_e=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return function(t){var n=i.props;"blur"===t.type&&(n.onBlur&&e&&n.onBlur(t),ke()),"mouseleave"===t.type&&n.onMouseLeave&&t.currentTarget===J&&n.onMouseLeave(t),clearTimeout(ie.current),clearTimeout(le.current),t.persist(),le.current=setTimeout((function(){Te(t)}),k)}},Oe=function(e){re.current=!0;var t=i.props;t.onTouchStart&&t.onTouchStart(e)},Ce=D(Q,n),Ne=D(be,Ce),Me=e.useCallback((function(e){B(Ne,ee.findDOMNode(e))}),[Ne]),Pe=D(i.ref,Me);""===H&&(pe=!1);var ze=M({"aria-describedby":pe?de:null,title:!pe&&!c&&"string"==typeof H?H:null},Y,i.props,{className:P(Y.className,i.props.className),onTouchStart:Oe,ref:Pe}),Ae={};p||(ze.onTouchStart=function(e){Oe(e),clearTimeout(le.current),clearTimeout(oe.current),clearTimeout(se.current),e.persist(),se.current=setTimeout((function(){me()(e)}),y)},ze.onTouchEnd=function(e){i.props.onTouchEnd&&i.props.onTouchEnd(e),clearTimeout(se.current),clearTimeout(le.current),e.persist(),le.current=setTimeout((function(){Te(e)}),T)}),c||(ze.onMouseOver=me(),ze.onMouseLeave=_e(),x&&(Ae.onMouseOver=me(!1),Ae.onMouseLeave=_e(!1))),s||(ze.onFocus=Se(),ze.onBlur=_e(),x&&(Ae.onFocus=Se(!1),Ae.onBlur=_e(!1)));var je=e.useMemo((function(){return q({popperOptions:{modifiers:{arrow:{enabled:Boolean(te),element:te}}}},I)}),[te,I]);return e.createElement(e.Fragment,null,e.cloneElement(i,ze),e.createElement(F,M({className:P(a.popper,x&&a.popperInteractive,o&&a.popperArrow),placement:z,anchorEl:J,open:!!J&&pe,id:ze["aria-describedby"],transition:!0},Ae,je),(function(t){var n=t.placement,r=t.TransitionProps;return e.createElement(V,M({timeout:X.transitions.duration.shorter},r,G),e.createElement("div",{className:P(a.tooltip,a["tooltipPlacement".concat(L(n.split("-")[0]))],re.current&&a.touch,o&&a.tooltipArrow)},H,o?e.createElement("span",{className:a.arrow,ref:ne}):null))})))})),Ur=A((function(e){return{popper:{zIndex:e.zIndex.tooltip,pointerEvents:"none"},popperInteractive:{pointerEvents:"auto"},popperArrow:{'&[x-placement*="bottom"] $arrow':{top:0,left:0,marginTop:"-0.71em",marginLeft:4,marginRight:4,"&::before":{transformOrigin:"0 100%"}},'&[x-placement*="top"] $arrow':{bottom:0,left:0,marginBottom:"-0.71em",marginLeft:4,marginRight:4,"&::before":{transformOrigin:"100% 0"}},'&[x-placement*="right"] $arrow':{left:0,marginLeft:"-0.71em",height:"1em",width:"0.71em",marginTop:4,marginBottom:4,"&::before":{transformOrigin:"100% 100%"}},'&[x-placement*="left"] $arrow':{right:0,marginRight:"-0.71em",height:"1em",width:"0.71em",marginTop:4,marginBottom:4,"&::before":{transformOrigin:"0 0"}}},tooltip:{backgroundColor:F(e.palette.grey[700],.9),borderRadius:e.shape.borderRadius,color:e.palette.common.white,fontFamily:e.typography.fontFamily,padding:"4px 8px",fontSize:e.typography.pxToRem(10),lineHeight:"".concat(Lr(1.4),"em"),maxWidth:300,wordWrap:"break-word",fontWeight:e.typography.fontWeightMedium},tooltipArrow:{position:"relative",margin:"0"},arrow:{overflow:"hidden",position:"absolute",width:"1em",height:"0.71em",boxSizing:"border-box",color:F(e.palette.grey[700],.9),"&::before":{content:'""',margin:"auto",display:"block",width:"100%",height:"100%",backgroundColor:"currentColor",transform:"rotate(45deg)"}},touch:{padding:"8px 16px",fontSize:e.typography.pxToRem(14),lineHeight:"".concat(Lr(16/14),"em"),fontWeight:e.typography.fontWeightRegular},tooltipPlacementLeft:$({transformOrigin:"right center",margin:"0 24px "},e.breakpoints.up("sm"),{margin:"0 14px"}),tooltipPlacementRight:$({transformOrigin:"left center",margin:"0 24px"},e.breakpoints.up("sm"),{margin:"0 14px"}),tooltipPlacementTop:$({transformOrigin:"center bottom",margin:"24px 0"},e.breakpoints.up("sm"),{margin:"14px 0"}),tooltipPlacementBottom:$({transformOrigin:"center top",margin:"24px 0"},e.breakpoints.up("sm"),{margin:"14px 0"})}}),{name:"MuiTooltip",flip:!1})(Hr);const Wr=()=>t.createElement("div",{id:"resetBtn"},t.createElement(Ur,{title:"回到原來位置與大小"},t.createElement(hn,null,t.createElement(vn,null))));Wr.propTypes={};Z(".SNA {\n overflow: hidden;\n object-fit: contain;\n position: relative;\n font-size: 0.75rem;\n width: 100%; }\n .SNA--smallSize .node {\n padding-top: 8px;\n font-size: 0.75rem;\n width: 3rem;\n height: 3rem;\n overflow: hidden;\n white-space: pre-wrap;\n text-overflow: ellipsis;\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical; }\n .SNA .node {\n background-color: #4a4e69;\n border-radius: 50%;\n color: #fff;\n font-size: 20px;\n font-weight: 500;\n height: 54px;\n width: 54px;\n padding-top: 15px;\n position: absolute;\n text-align: center;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n cursor: grab; }\n .SNA .links line {\n stroke: #c7bfb4;\n stroke-width: 2; }\n .SNA .mainNode {\n fill: #4e3a16; }\n .SNA .person {\n fill: #867b3a; }\n .SNA .publication {\n fill: #825c0d; }\n .SNA .article {\n fill: #afafaf; }\n .SNA .keyword {\n fill: #fcfae8; }\n .SNA .org {\n fill: #000000; }\n .SNA #resetBtn {\n float: right; }\n\n@media only screen and (max-width: 484px) {\n .SNA {\n margin-left: 0px; }\n .SNA .node {\n background-color: #4a4e69;\n border-radius: 50%;\n color: #fff;\n font-size: 1px;\n font-weight: 500;\n height: 44px;\n width: 44px;\n padding-top: 12px;\n position: absolute;\n text-align: center;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n cursor: grab; } }\n\n@media only screen and (max-width: 484px) {\n .SNA {\n margin-left: 0px; } }\n");var qr=function(e){var l,s=e.className,u=e.intl,c=e.exclude,f=e.distance,p=e.SNAData,d=e.handleClickNodeGoto,h=e.DownloadExcel,_=e.width,O=e.height,C=e.fontColor,N=e.backgroundColor,M=e.iconColor;if(!p||0===p.nodes.length)return t.createElement("div",{className:"noData"},u?u.formatMessage({id:"common.noData"}):"暫無資料");var P=function(){var e=r(!1),t=e[0],l=e[1],s=o(null);i((function(){var e=function(){l(ot.fullscreenElement===s.current)};return ot.addEventListener("fullscreenchange",e),function(){return ot.removeEventListener("fullscreenchange",e)}}),[]);var u=a((function(){return ot.fullscreenElement?ot.exitFullscreen().then((function(){return ot.requestFullscreen(s.current)})):s.current?ot.requestFullscreen(s.current):void 0}),[]),c=a((function(){return ot.fullscreenElement===s.current?ot.exitFullscreen():Promise.resolve()}),[]);return n((function(){return{active:t,enter:u,exit:c,node:s}}),[t,u,c])}(),z=n((function(){return P.active?screen.width:screen.width>1050?_:screen.width-80}),[P.active,screen.width]),A=n((function(){return P.active?screen.height:screen.width>1050?O:screen.height-300}),[P.active,screen.width]),j=function(e){return function(){var e,t,n,r,o=ge,i=ye,a=be,l=we,s={},u=y("start","drag","end"),c=0,f=0;function p(e){e.on("mousedown.drag",d).filter(l).on("touchstart.drag",w).on("touchmove.drag",x).on("touchend.drag touchcancel.drag",E).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function d(){if(!r&&o.apply(this,arguments)){var a=k("mouse",i.apply(this,arguments),ue,this,arguments);a&&(g(v.view).on("mousemove.drag",h,!0).on("mouseup.drag",m,!0),de(v.view),fe(),n=!1,e=v.clientX,t=v.clientY,a("start"))}}function h(){if(pe(),!n){var r=v.clientX-e,o=v.clientY-t;n=r*r+o*o>f}s.mouse("drag")}function m(){g(v.view).on("mousemove.drag mouseup.drag",null),he(v.view,n),pe(),s.mouse("end")}function w(){if(o.apply(this,arguments)){var e,t,n=v.changedTouches,r=i.apply(this,arguments),a=n.length;for(e=0;e<a;++e)(t=k(n[e].identifier,r,ce,this,arguments))&&(fe(),t("start"))}}function x(){var e,t,n=v.changedTouches,r=n.length;for(e=0;e<r;++e)(t=s[n[e].identifier])&&(pe(),t("drag"))}function E(){var e,t,n=v.changedTouches,o=n.length;for(r&&clearTimeout(r),r=setTimeout((function(){r=null}),500),e=0;e<o;++e)(t=s[n[e].identifier])&&(fe(),t("end"))}function k(e,t,n,r,o){var i,l,f,d=n(t,e),h=u.copy();if(b(new ve(p,"beforestart",i,e,c,d[0],d[1],0,0,h),(function(){return null!=(v.subject=i=a.apply(r,o))&&(l=i.x-d[0]||0,f=i.y-d[1]||0,!0)})))return function a(u){var m,v=d;switch(u){case"start":s[e]=a,m=c++;break;case"end":delete s[e],--c;case"drag":d=n(t,e),m=c}b(new ve(p,u,i,e,m,d[0]+l,d[1]+f,d[0]-v[0],d[1]-v[1],h),h.apply,h,[u,r,o])}}return p.filter=function(e){return arguments.length?(o="function"==typeof e?e:me(!!e),p):o},p.container=function(e){return arguments.length?(i="function"==typeof e?e:me(e),p):i},p.subject=function(e){return arguments.length?(a="function"==typeof e?e:me(e),p):a},p.touchable=function(e){return arguments.length?(l="function"==typeof e?e:me(!!e),p):l},p.on=function(){var e=u.on.apply(u,arguments);return e===u?p:e},p.clickDistance=function(e){return arguments.length?(f=(e=+e)*e,p):Math.sqrt(f)},p}().on("start",(function(t){v.active||e.alphaTarget(.3).restart(),t.fx=t.x,t.fy=t.y})).on("drag",(function(e){e.fx=v.x>z-10||v.x<20?e.x:v.x,e.fy=v.y>A-10||v.y<20?e.y:v.y}))},R=function(e,t,n){var r=function(e,t,n){var r=.5*(t.x+e.x),o=.5*(t.y+e.y),i=t.x-e.x,a=t.y-e.y,l=Math.pow(Math.pow(i,2)+Math.pow(a,2),.5);return{qx:r-a*n/l,qy:o+i*n/l}}(e,t,n),o=r.qx,i=r.qy;return isNaN(o)?"M".concat(e.x,", ").concat(e.y," Q0 0 ").concat(t.x," ").concat(t.y):"M".concat(e.x,", ").concat(e.y," Q").concat(o," ").concat(i," ").concat(t.x," ").concat(t.y)},D=function(e){var t=8.5,n="-0 -".concat(t," ").concat(17," ").concat(17),r="M 0,-".concat(6.800000000000001," L ").concat(13.600000000000001," ,0 L 0,").concat(6.800000000000001),o=T(He),i=e.links.map((function(e){return Object.create(e)})),a=e.nodes.map((function(e){return Object.create(e)})),s=function(e){var t,n=1,r=.001,o=1-Math.pow(r,1/300),i=0,a=.6,l=w(),s=x(c),u=y("tick","end");function c(){f(),u.call("tick",t),n<r&&(s.stop(),u.call("end",t))}function f(r){var s,u,c=e.length;void 0===r&&(r=1);for(var f=0;f<r;++f)for(n+=(i-n)*o,l.each((function(e){e(n)})),s=0;s<c;++s)null==(u=e[s]).fx?u.x+=u.vx*=a:(u.x=u.fx,u.vx=0),null==u.fy?u.y+=u.vy*=a:(u.y=u.fy,u.vy=0);return t}function p(){for(var t,n=0,r=e.length;n<r;++n){if((t=e[n]).index=n,null!=t.fx&&(t.x=t.fx),null!=t.fy&&(t.y=t.fy),isNaN(t.x)||isNaN(t.y)){var o=10*Math.sqrt(n),i=n*Be;t.x=o*Math.cos(i),t.y=o*Math.sin(i)}(isNaN(t.vx)||isNaN(t.vy))&&(t.vx=t.vy=0)}}function d(t){return t.initialize&&t.initialize(e),t}return null==e&&(e=[]),p(),t={tick:f,restart:function(){return s.restart(c),t},stop:function(){return s.stop(),t},nodes:function(n){return arguments.length?(e=n,p(),l.each(d),t):e},alpha:function(e){return arguments.length?(n=+e,t):n},alphaMin:function(e){return arguments.length?(r=+e,t):r},alphaDecay:function(e){return arguments.length?(o=+e,t):+o},alphaTarget:function(e){return arguments.length?(i=+e,t):i},velocityDecay:function(e){return arguments.length?(a=1-e,t):1-a},force:function(e,n){return arguments.length>1?(null==n?l.remove(e):l.set(e,d(n)),t):l.get(e)},find:function(t,n,r){var o,i,a,l,s,u=0,c=e.length;for(null==r?r=1/0:r*=r,u=0;u<c;++u)(a=(o=t-(l=e[u]).x)*o+(i=n-l.y)*i)<r&&(s=l,r=a);return s},on:function(e,n){return arguments.length>1?(u.on(e,n),t):u.on(e)}}}(a).force("link",function(e){var t,n,r,o,i,a=De,l=function(e){return 1/Math.min(o[e.source.index],o[e.target.index])},s=Se(30),u=1;function c(r){for(var o=0,a=e.length;o<u;++o)for(var l,s,c,f,p,d,h,m=0;m<a;++m)s=(l=e[m]).source,f=(c=l.target).x+c.vx-s.x-s.vx||Te(),p=c.y+c.vy-s.y-s.vy||Te(),f*=d=((d=Math.sqrt(f*f+p*p))-n[m])/d*r*t[m],p*=d,c.vx-=f*(h=i[m]),c.vy-=p*h,s.vx+=f*(h=1-h),s.vy+=p*h}function f(){if(r){var l,s,u=r.length,c=e.length,f=w(r,a);for(l=0,o=new Array(u);l<c;++l)(s=e[l]).index=l,"object"!=typeof s.source&&(s.source=Fe(f,s.source)),"object"!=typeof s.target&&(s.target=Fe(f,s.target)),o[s.source.index]=(o[s.source.index]||0)+1,o[s.target.index]=(o[s.target.index]||0)+1;for(l=0,i=new Array(c);l<c;++l)s=e[l],i[l]=o[s.source.index]/(o[s.source.index]+o[s.target.index]);t=new Array(c),p(),n=new Array(c),d()}}function p(){if(r)for(var n=0,o=e.length;n<o;++n)t[n]=+l(e[n],n,e)}function d(){if(r)for(var t=0,o=e.length;t<o;++t)n[t]=+s(e[t],t,e)}return null==e&&(e=[]),c.initialize=function(e){r=e,f()},c.links=function(t){return arguments.length?(e=t,f(),c):e},c.id=function(e){return arguments.length?(a=e,c):a},c.iterations=function(e){return arguments.length?(u=+e,c):u},c.strength=function(e){return arguments.length?(l="function"==typeof e?e:Se(+e),p(),c):l},c.distance=function(e){return arguments.length?(s="function"==typeof e?e:Se(+e),d(),c):s},c}(i).id((function(e){return e.index})).distance(50)).force("charge",function(){var e,t,n,r,o=Se(-30),i=1,a=1/0,l=.81;function s(r){var o,i=e.length,a=Me(e,Le,Ie).visitAfter(c);for(n=r,o=0;o<i;++o)t=e[o],a.visit(f)}function u(){if(e){var t,n,i=e.length;for(r=new Array(i),t=0;t<i;++t)n=e[t],r[n.index]=+o(n,t,e)}}function c(e){var t,n,o,i,a,l=0,s=0;if(e.length){for(o=i=a=0;a<4;++a)(t=e[a])&&(n=Math.abs(t.value))&&(l+=t.value,s+=n,o+=n*t.x,i+=n*t.y);e.x=o/s,e.y=i/s}else{(t=e).x=t.data.x,t.y=t.data.y;do{l+=r[t.data.index]}while(t=t.next)}e.value=l}function f(e,o,s,u){if(!e.value)return!0;var c=e.x-t.x,f=e.y-t.y,p=u-o,d=c*c+f*f;if(p*p/l<d)return d<a&&(0===c&&(d+=(c=Te())*c),0===f&&(d+=(f=Te())*f),d<i&&(d=Math.sqrt(i*d)),t.vx+=c*e.value*n/d,t.vy+=f*e.value*n/d),!0;if(!(e.length||d>=a)){(e.data!==t||e.next)&&(0===c&&(d+=(c=Te())*c),0===f&&(d+=(f=Te())*f),d<i&&(d=Math.sqrt(i*d)));do{e.data!==t&&(p=r[e.data.index]*n/d,t.vx+=c*p,t.vy+=f*p)}while(e=e.next)}}return s.initialize=function(t){e=t,u()},s.strength=function(e){return arguments.length?(o="function"==typeof e?e:Se(+e),u(),s):o},s.distanceMin=function(e){return arguments.length?(i=e*e,s):Math.sqrt(i)},s.distanceMax=function(e){return arguments.length?(a=e*e,s):Math.sqrt(a)},s.theta=function(e){return arguments.length?(l=e*e,s):Math.sqrt(l)},s}().strength(-200).distanceMax(1e3)).force("center",function(e,t){var n;function r(){var r,o,i=n.length,a=0,l=0;for(r=0;r<i;++r)a+=(o=n[r]).x,l+=o.y;for(a=a/i-e,l=l/i-t,r=0;r<i;++r)(o=n[r]).x-=a,o.y-=l}return null==e&&(e=0),null==t&&(t=0),r.initialize=function(e){n=e},r.x=function(t){return arguments.length?(e=+t,r):e},r.y=function(e){return arguments.length?(t=+e,r):t},r}(z/2,A/2)).force("collide",function(e){var t,n,r=1,o=1;function i(){for(var e,i,l,s,u,c,f,p=t.length,d=0;d<o;++d)for(i=Me(t,je,Re).visitAfter(a),e=0;e<p;++e)l=t[e],c=n[l.index],f=c*c,s=l.x+l.vx,u=l.y+l.vy,i.visit(h);function h(e,t,n,o,i){var a=e.data,p=e.r,d=c+p;if(!a)return t>s+d||o<s-d||n>u+d||i<u-d;if(a.index>l.index){var h=s-a.x-a.vx,m=u-a.y-a.vy,v=h*h+m*m;v<d*d&&(0===h&&(v+=(h=Te())*h),0===m&&(v+=(m=Te())*m),v=(d-(v=Math.sqrt(v)))/v*r,l.vx+=(h*=v)*(d=(p*=p)/(f+p)),l.vy+=(m*=v)*d,a.vx-=h*(d=1-d),a.vy-=m*d)}}}function a(e){if(e.data)return e.r=n[e.data.index];for(var t=e.r=0;t<4;++t)e[t]&&e[t].r>e.r&&(e.r=e[t].r)}function l(){if(t){var r,o,i=t.length;for(n=new Array(i),r=0;r<i;++r)o=t[r],n[o.index]=+e(o,r,t)}}return"function"!=typeof e&&(e=Se(null==e?1:+e)),i.initialize=function(e){t=e,l()},i.iterations=function(e){return arguments.length?(o=+e,i):o},i.strength=function(e){return arguments.length?(r=+e,i):r},i.radius=function(t){return arguments.length?(e="function"==typeof t?t:Se(+t),l(),i):e},i}().radius((function(){return 13.5})).strength(1).iterations(10)).force("x",function(e){var t,n,r,o=Se(.1);function i(e){for(var o,i=0,a=t.length;i<a;++i)(o=t[i]).vx+=(r[i]-o.x)*n[i]*e}function a(){if(t){var i,a=t.length;for(n=new Array(a),r=new Array(a),i=0;i<a;++i)n[i]=isNaN(r[i]=+e(t[i],i,t))?0:+o(t[i],i,t)}}return"function"!=typeof e&&(e=Se(null==e?0:+e)),i.initialize=function(e){t=e,a()},i.strength=function(e){return arguments.length?(o="function"==typeof e?e:Se(+e),a(),i):o},i.x=function(t){return arguments.length?(e="function"==typeof t?t:Se(+t),a(),i):e},i}(z/2)).force("y",function(e){var t,n,r,o=Se(.1);function i(e){for(var o,i=0,a=t.length;i<a;++i)(o=t[i]).vy+=(r[i]-o.y)*n[i]*e}function a(){if(t){var i,a=t.length;for(n=new Array(a),r=new Array(a),i=0;i<a;++i)n[i]=isNaN(r[i]=+e(t[i],i,t))?0:+o(t[i],i,t)}}return"function"!=typeof e&&(e=Se(null==e?0:+e)),i.initialize=function(e){t=e,a()},i.strength=function(e){return arguments.length?(o="function"==typeof e?e:Se(+e),a(),i):o},i.y=function(t){return arguments.length?(e="function"==typeof t?t:Se(+t),a(),i):e},i}(A/2)).force("radial",function(e,t,n){var r,o,i,a=Se(.1);function l(e){for(var a=0,l=r.length;a<l;++a){var s=r[a],u=s.x-t||1e-6,c=s.y-n||1e-6,f=Math.sqrt(u*u+c*c),p=(i[a]-f)*o[a]*e/f;s.vx+=u*p,s.vy+=c*p}}function s(){if(r){var t,n=r.length;for(o=new Array(n),i=new Array(n),t=0;t<n;++t)i[t]=+e(r[t],t,r),o[t]=isNaN(i[t])?0:+a(r[t],t,r)}}return"function"!=typeof e&&(e=Se(+e)),null==t&&(t=0),null==n&&(n=0),l.initialize=function(e){r=e,s()},l.strength=function(e){return arguments.length?(a="function"==typeof e?e:Se(+e),s(),l):a},l.radius=function(t){return arguments.length?(e="function"==typeof t?t:Se(+t),s(),l):e},l.x=function(e){return arguments.length?(t=+e,l):t},l.y=function(e){return arguments.length?(n=+e,l):n},l}(100,z/1.5,A/1.5)),c=g(".chart").append("svg").attr("viewBox",[0,0,z,A]).style("background-color",N);c.append("defs").append("marker").attr("id","arrowhead").attr("viewBox",n).attr("refX",23.8).attr("refY",0).attr("orient","auto").attr("markerWidth",15.3).attr("markerHeight",15.3).attr("xoverflow","visible").append("svg:path").attr("d",r).attr("fill","#999").style("stroke","none"),l=c.append("g");var f=function(){var e,t,n=Ve,r=Ge,o=Je,i=Xe,a=Ke,l=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],u=250,c=ke,f=y("start","zoom","end"),p=500,d=0;function h(e){e.property("__zoom",Ye).on("wheel.zoom",C).on("mousedown.zoom",N).on("dblclick.zoom",M).filter(a).on("touchstart.zoom",P).on("touchmove.zoom",z).on("touchend.zoom touchcancel.zoom",A).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function m(e,t){return(t=Math.max(l[0],Math.min(l[1],t)))===e.k?e:new E(t,e.x,e.y)}function w(e,t,n){var r=t[0]-n[0]*e.k,o=t[1]-n[1]*e.k;return r===e.x&&o===e.y?e:new E(e.k,r,o)}function x(e){return[(+e[0][0]+ +e[1][0])/2,(+e[0][1]+ +e[1][1])/2]}function T(e,t,n){e.on("start.zoom",(function(){_(this,arguments).start()})).on("interrupt.zoom end.zoom",(function(){_(this,arguments).end()})).tween("zoom",(function(){var e=this,o=arguments,i=_(e,o),a=r.apply(e,o),l=null==n?x(a):"function"==typeof n?n.apply(e,o):n,s=Math.max(a[1][0]-a[0][0],a[1][1]-a[0][1]),u=e.__zoom,f="function"==typeof t?t.apply(e,o):t,p=c(u.invert(l).concat(s/u.k),f.invert(l).concat(s/f.k));return function(e){if(1===e)e=f;else{var t=p(e),n=s/t[2];e=new E(n,l[0]-t[0]*n,l[1]-t[1]*n)}i.zoom(null,e)}}))}function _(e,t,n){return!n&&e.__zooming||new O(e,t)}function O(e,t){this.that=e,this.args=t,this.active=0,this.extent=r.apply(e,t),this.taps=0}function C(){if(n.apply(this,arguments)){var e=_(this,arguments),t=this.__zoom,r=Math.max(l[0],Math.min(l[1],t.k*Math.pow(2,i.apply(this,arguments)))),a=ue(this);if(e.wheel)e.mouse[0][0]===a[0]&&e.mouse[0][1]===a[1]||(e.mouse[1]=t.invert(e.mouse[0]=a)),clearTimeout(e.wheel);else{if(t.k===r)return;e.mouse=[a,t.invert(a)],S(this),e.start()}$e(),e.wheel=setTimeout(u,150),e.zoom("mouse",o(w(m(t,r),e.mouse[0],e.mouse[1]),e.extent,s))}function u(){e.wheel=null,e.end()}}function N(){if(!t&&n.apply(this,arguments)){var e=_(this,arguments,!0),r=g(v.view).on("mousemove.zoom",u,!0).on("mouseup.zoom",c,!0),i=ue(this),a=v.clientX,l=v.clientY;de(v.view),qe(),e.mouse=[i,this.__zoom.invert(i)],S(this),e.start()}function u(){if($e(),!e.moved){var t=v.clientX-a,n=v.clientY-l;e.moved=t*t+n*n>d}e.zoom("mouse",o(w(e.that.__zoom,e.mouse[0]=ue(e.that),e.mouse[1]),e.extent,s))}function c(){r.on("mousemove.zoom mouseup.zoom",null),he(v.view,e.moved),$e(),e.end()}}function M(){if(n.apply(this,arguments)){var e=this.__zoom,t=ue(this),i=e.invert(t),a=e.k*(v.shiftKey?.5:2),l=o(w(m(e,a),t,i),r.apply(this,arguments),s);$e(),u>0?g(this).transition().duration(u).call(T,l,t):g(this).call(h.transform,l)}}function P(){if(n.apply(this,arguments)){var t,r,o,i,a=v.touches,l=a.length,s=_(this,arguments,v.changedTouches.length===l);for(qe(),r=0;r<l;++r)i=[i=ce(this,a,(o=a[r]).identifier),this.__zoom.invert(i),o.identifier],s.touch0?s.touch1||s.touch0[2]===i[2]||(s.touch1=i,s.taps=0):(s.touch0=i,t=!0,s.taps=1+!!e);e&&(e=clearTimeout(e)),t&&(s.taps<2&&(e=setTimeout((function(){e=null}),p)),S(this),s.start())}}function z(){if(this.__zooming){var t,n,r,i,a=_(this,arguments),l=v.changedTouches,u=l.length;for($e(),e&&(e=clearTimeout(e)),a.taps=0,t=0;t<u;++t)r=ce(this,l,(n=l[t]).identifier),a.touch0&&a.touch0[2]===n.identifier?a.touch0[0]=r:a.touch1&&a.touch1[2]===n.identifier&&(a.touch1[0]=r);if(n=a.that.__zoom,a.touch1){var c=a.touch0[0],f=a.touch0[1],p=a.touch1[0],d=a.touch1[1],h=(h=p[0]-c[0])*h+(h=p[1]-c[1])*h,g=(g=d[0]-f[0])*g+(g=d[1]-f[1])*g;n=m(n,Math.sqrt(h/g)),r=[(c[0]+p[0])/2,(c[1]+p[1])/2],i=[(f[0]+d[0])/2,(f[1]+d[1])/2]}else{if(!a.touch0)return;r=a.touch0[0],i=a.touch0[1]}a.zoom("touch",o(w(n,r,i),a.extent,s))}}function A(){if(this.__zooming){var e,n,r=_(this,arguments),o=v.changedTouches,i=o.length;for(qe(),t&&clearTimeout(t),t=setTimeout((function(){t=null}),p),e=0;e<i;++e)n=o[e],r.touch0&&r.touch0[2]===n.identifier?delete r.touch0:r.touch1&&r.touch1[2]===n.identifier&&delete r.touch1;if(r.touch1&&!r.touch0&&(r.touch0=r.touch1,delete r.touch1),r.touch0)r.touch0[1]=this.__zoom.invert(r.touch0[0]);else if(r.end(),2===r.taps){var a=g(this).on("dblclick.zoom");a&&a.apply(this,arguments)}}}return h.transform=function(e,t,n){var r=e.selection?e.selection():e;r.property("__zoom",Ye),e!==r?T(e,t,n):r.interrupt().each((function(){_(this,arguments).start().zoom(null,"function"==typeof t?t.apply(this,arguments):t).end()}))},h.scaleBy=function(e,t,n){h.scaleTo(e,(function(){return this.__zoom.k*("function"==typeof t?t.apply(this,arguments):t)}),n)},h.scaleTo=function(e,t,n){h.transform(e,(function(){var e=r.apply(this,arguments),i=this.__zoom,a=null==n?x(e):"function"==typeof n?n.apply(this,arguments):n,l=i.invert(a),u="function"==typeof t?t.apply(this,arguments):t;return o(w(m(i,u),a,l),e,s)}),n)},h.translateBy=function(e,t,n){h.transform(e,(function(){return o(this.__zoom.translate("function"==typeof t?t.apply(this,arguments):t,"function"==typeof n?n.apply(this,arguments):n),r.apply(this,arguments),s)}))},h.translateTo=function(e,t,n,i){h.transform(e,(function(){var e=r.apply(this,arguments),a=this.__zoom,l=null==i?x(e):"function"==typeof i?i.apply(this,arguments):i;return o(k.translate(l[0],l[1]).scale(a.k).translate("function"==typeof t?-t.apply(this,arguments):-t,"function"==typeof n?-n.apply(this,arguments):-n),e,s)}),i)},O.prototype={start:function(){return 1==++this.active&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(e,t){return this.mouse&&"mouse"!==e&&(this.mouse[1]=t.invert(this.mouse[0])),this.touch0&&"touch"!==e&&(this.touch0[1]=t.invert(this.touch0[0])),this.touch1&&"touch"!==e&&(this.touch1[1]=t.invert(this.touch1[0])),this.that.__zoom=t,this.emit("zoom"),this},end:function(){return 0==--this.active&&(delete this.that.__zooming,this.emit("end")),this},emit:function(e){b(new We(h,e,this.that.__zoom),f.apply,f,[e,this.that,this.args])}},h.wheelDelta=function(e){return arguments.length?(i="function"==typeof e?e:Ue(+e),h):i},h.filter=function(e){return arguments.length?(n="function"==typeof e?e:Ue(!!e),h):n},h.touchable=function(e){return arguments.length?(a="function"==typeof e?e:Ue(!!e),h):a},h.extent=function(e){return arguments.length?(r="function"==typeof e?e:Ue([[+e[0][0],+e[0][1]],[+e[1][0],+e[1][1]]]),h):r},h.scaleExtent=function(e){return arguments.length?(l[0]=+e[0],l[1]=+e[1],h):[l[0],l[1]]},h.translateExtent=function(e){return arguments.length?(s[0][0]=+e[0][0],s[1][0]=+e[1][0],s[0][1]=+e[0][1],s[1][1]=+e[1][1],h):[[s[0][0],s[0][1]],[s[1][0],s[1][1]]]},h.constrain=function(e){return arguments.length?(o=e,h):o},h.duration=function(e){return arguments.length?(u=+e,h):u},h.interpolate=function(e){return arguments.length?(c=e,h):c},h.on=function(){var e=f.on.apply(f,arguments);return e===f?h:e},h.clickDistance=function(e){return arguments.length?(d=(e=+e)*e,h):Math.sqrt(d)},h}().scaleExtent([.5,20]).extent([[0,0],[z,A]]).on("zoom",(function(){l.attr("transform",v.transform)}));f(c),g("#resetBtn").on("click",(function(){c.transition().duration(750).call(f.transform,k)}));var p=l.append("g").attr("stroke","#999").attr("stroke-opacity",.6).selectAll("line").data(i).join("path").attr("fill","none").attr("stroke-dasharray",(function(e){return"protege"===e.ontology?"2,5,3":""})).attr("key",(function(e){return e.type})),h=l.append("g").attr("stroke","#fff").attr("stroke-width",1.5).selectAll("circle").data(a).join("circle").attr("r",(function(e){return"mainNode"===e.type?13.5:t})).attr("fill",(function(e){return o(e.type)})).attr("key",(function(e){return e.type})).attr("class",(function(e){return"node node-".concat(e.id," ").concat(e.type&&"organization"===e.type?"org":"person"===e.type?"person":"publication"===e.type?"publication":"mainNode"===e.type?"mainNode":"article"===e.type?"article":"keyword"===e.type?"keyword":"event"===e.type?"event":"")})).on("click",(function(e){return e.hasClick?d({name:e.name,id:e.id,type:e.type}):null})).call(j(s));h.append("title").text((function(e){return"".concat(e.name,"-").concat(function(e){switch(e){case"mainNode":return u?u.formatMessage({id:"SNA.search.center"}):"主要搜尋中心";case"organization":return u?u.formatMessage({id:"SNA.organization"}):"組織";case"person":return u?u.formatMessage({id:"SNA.author"}):"作家";case"publication":return u?u.formatMessage({id:"SNA.publication"}):"作家";case"article":return u?u.formatMessage({id:"SNA.article"}):"單篇作品";case"keyword":return u?u.formatMessage({id:"SNA.keyword"}):"關鍵字";case"event":return u?u.formatMessage({id:"SNA.event"}):"事件";default:return""}}(e.type))}));var m=l.append("g").selectAll("text").data(a).join("text").attr("fill",C).attr("text-anchor","middle").attr("key",(function(e){return e.type})).style("color","#fff").style("font-size","14px").text((function(e){return e.name})),_=l.selectAll(".edgepath").data(i).enter().append("path").attr("class","edgepath").attr("fill-opacity",0).attr("stroke-opacity",0).attr("id",(function(e,t){return"edgepath".concat(t)})).style("pointer-events","none");l.selectAll(".edgelabel").data(i).enter().append("text").style("pointer-events","none").attr("class","edgelabel").attr("font-size","10px").attr("fill","#aaa").attr("visibility","visible").attr("key",(function(e){return e.type})).attr("id",(function(e,t){return"edgelabel".concat(t)})).append("textPath").attr("xlink:href",(function(e,t){return"#edgepath".concat(t)})).style("text-anchor","middle").style("pointer-events","none").attr("startOffset","50%").text((function(e){return e.property})),s.on("tick",(function(){a.forEach((function(e){e.x>=z-20&&(e.x=z-20),e.y>=A-20&&(e.y=A-20),e.x<=20&&(e.x=20),e.y<=20&&(e.y=20)})),p.attr("d",(function(e){return R(e.source,e.target,30)})),h.attr("cx",(function(e){return e.x})).attr("cy",(function(e){return e.y})),m.attr("x",(function(e){return e.x})).attr("y",(function(e){return e.y-t})),_.attr("d",(function(e){return R(e.source,e.target,30)}))}))};return i((function(){if(p&&p.nodes&&p.nodes.length>0){var e=document.getElementById("network-graph");e&&e.childNodes[0]&&e.removeChild(e.childNodes[0]),D(p)}}),[p,P.active]),t.createElement("div",{className:m("SNA",{"SNA--smallSize":f<200},s),style:{contentWidth:z,contentHeight:A,backgroundColor:N}},t.createElement(Vt,{intl:u,data:p,iconColor:M,domToImageId:"network-graph",fullScreenHandle:P,exclude:c,DownloadExcel:h}),t.createElement(Wr,null),t.createElement(it,{handle:P},t.createElement("div",{className:"chart",id:"network-graph"},P.active&&t.createElement("div",{className:"fullscreenExit",style:{backgroundColor:N}},t.createElement(lt,{fontSize:"large",style:{color:M},onClick:P.exit,title:u?u.formatMessage({id:"knowledge.writersAndWorksSNA.fullscreenExit"}):"離開全螢幕"})))))};qr.defaultProps={className:void 0,intl:void 0,width:1050,height:600,distance:400,SNAData:null,fontColor:"#000000",backgroundColor:"#FFFFFF",iconColor:"#825c0d",exclude:["downloadXls","downloadTsv"],handleClickNodeGoto:null,DownloadExcel:void 0},qr.propTypes={className:p.string,intl:p.objectOf(p.any),width:p.number,height:p.number,distance:p.number,SNAData:p.objectOf(p.any),fontColor:p.string,backgroundColor:p.string,iconColor:p.string,exclude:p.arrayOf(p.string),handleClickNodeGoto:p.func,DownloadExcel:p.oneOfType([p.node,p.func])};export{qr as default};
|
package/package.json
CHANGED