@daoyi/nmtl-ui 2.0.1-beta.19 → 2.0.1-beta.20
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
import t,{useEffect as n}from"react";import{c as r}from"./index-b2745105.js";import e from"prop-types";import{f as a,g as i,h as o,j as u,k as c,o as l,l as s,n as f,s as h,p as d,d as m}from"./transform-f1ccabd1.js";import{s as g}from"./style-inject.es-1f59c1d0.js";function p(t,n,r){t=+t,n=+n,r=(a=arguments.length)<2?(n=t,t=0,1):a<3?1:+r;for(var e=-1,a=0|Math.max(0,Math.ceil((n-t)/r)),i=new Array(a);++e<a;)i[e]=t+e*r;return i}var v=Math.sqrt(50),M=Math.sqrt(10),y=Math.sqrt(2);function b(t,n,r){var e=(n-t)/Math.max(0,r),a=Math.floor(Math.log(e)/Math.LN10),i=e/Math.pow(10,a);return a>=0?(i>=v?10:i>=M?5:i>=y?2:1)*Math.pow(10,a):-Math.pow(10,-a)/(i>=v?10:i>=M?5:i>=y?2:1)}var w=Array.prototype.slice;function x(t){return t}function k(t){return"translate("+(t+.5)+",0)"}function N(t){return"translate(0,"+(t+.5)+")"}function A(t){return function(n){return+t(n)}}function C(t){var n=Math.max(0,t.bandwidth()-1)/2;return t.round()&&(n=Math.round(n)),function(r){return+t(r)+n}}function S(){return!this.__axis}function j(t,n){var r=[],e=null,a=null,i=6,o=6,u=3,c=1===t||4===t?-1:1,l=4===t||2===t?"x":"y",s=1===t||3===t?k:N;function f(f){var h=null==e?n.ticks?n.ticks.apply(n,r):n.domain():e,d=null==a?n.tickFormat?n.tickFormat.apply(n,r):x:a,m=Math.max(i,0)+u,g=n.range(),p=+g[0]+.5,v=+g[g.length-1]+.5,M=(n.bandwidth?C:A)(n.copy()),y=f.selection?f.selection():f,b=y.selectAll(".domain").data([null]),w=y.selectAll(".tick").data(h,n).order(),k=w.exit(),N=w.enter().append("g").attr("class","tick"),j=w.select("line"),z=w.select("text");b=b.merge(b.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),w=w.merge(N),j=j.merge(N.append("line").attr("stroke","currentColor").attr(l+"2",c*i)),z=z.merge(N.append("text").attr("fill","currentColor").attr(l,c*m).attr("dy",1===t?"0em":3===t?"0.71em":"0.32em")),f!==y&&(b=b.transition(f),w=w.transition(f),j=j.transition(f),z=z.transition(f),k=k.transition(f).attr("opacity",1e-6).attr("transform",(function(t){return isFinite(t=M(t))?s(t):this.getAttribute("transform")})),N.attr("opacity",1e-6).attr("transform",(function(t){var n=this.parentNode.__axis;return s(n&&isFinite(n=n(t))?n:M(t))}))),k.remove(),b.attr("d",4===t||2==t?o?"M"+c*o+","+p+"H0.5V"+v+"H"+c*o:"M0.5,"+p+"V"+v:o?"M"+p+","+c*o+"V0.5H"+v+"V"+c*o:"M"+p+",0.5H"+v),w.attr("opacity",1).attr("transform",(function(t){return s(M(t))})),j.attr(l+"2",c*i),z.attr(l,c*m).text(d),y.filter(S).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",2===t?"start":4===t?"end":"middle"),y.each((function(){this.__axis=M}))}return f.scale=function(t){return arguments.length?(n=t,f):n},f.ticks=function(){return r=w.call(arguments),f},f.tickArguments=function(t){return arguments.length?(r=null==t?[]:w.call(t),f):r.slice()},f.tickValues=function(t){return arguments.length?(e=null==t?null:w.call(t),f):e&&e.slice()},f.tickFormat=function(t){return arguments.length?(a=t,f):a},f.tickSize=function(t){return arguments.length?(i=o=+t,f):i},f.tickSizeInner=function(t){return arguments.length?(i=+t,f):i},f.tickSizeOuter=function(t){return arguments.length?(o=+t,f):o},f.tickPadding=function(t){return arguments.length?(u=+t,f):u},f}function z(t,n){n||(n=[]);var r,e=t?Math.min(n.length,t.length):0,a=n.slice();return function(i){for(r=0;r<e;++r)a[r]=t[r]*(1-i)+n[r]*i;return a}}function E(t,n){var r,e=n?n.length:0,a=t?Math.min(e,t.length):0,i=new Array(a),o=new Array(e);for(r=0;r<a;++r)i[r]=I(t[r],n[r]);for(;r<e;++r)o[r]=n[r];return function(t){for(r=0;r<a;++r)o[r]=i[r](t);return o}}function F(t,n){var r=new Date;return t=+t,n=+n,function(e){return r.setTime(t*(1-e)+n*e),r}}function _(t,n){var r,e={},a={};for(r in null!==t&&"object"==typeof t||(t={}),null!==n&&"object"==typeof n||(n={}),n)r in t?e[r]=I(t[r],n[r]):a[r]=n[r];return function(t){for(r in e)a[r]=e[r](t);return a}}function I(t,n){var r,e,l=typeof n;return null==n||"boolean"===l?a(n):("number"===l?i:"string"===l?(r=o(n))?(n=r,u):c:n instanceof o?u:n instanceof Date?F:(e=n,!ArrayBuffer.isView(e)||e instanceof DataView?Array.isArray(n)?E:"function"!=typeof n.valueOf&&"function"!=typeof n.toString||isNaN(n)?_:i:z))(t,n)}function L(t,n){return t=+t,n=+n,function(r){return Math.round(t*(1-r)+n*r)}}function V(t,n){if((r=(t=n?t.toExponential(n-1):t.toExponential()).indexOf("e"))<0)return null;var r,e=t.slice(0,r);return[e.length>1?e[0]+e.slice(2):e,+t.slice(r+1)]}function D(t){return(t=V(Math.abs(t)))?t[1]:NaN}var O,P=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function B(t){if(!(n=P.exec(t)))throw new Error("invalid format: "+t);var n;return new $({fill:n[1],align:n[2],sign:n[3],symbol:n[4],zero:n[5],width:n[6],comma:n[7],precision:n[8]&&n[8].slice(1),trim:n[9],type:n[10]})}function $(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}function H(t,n){var r=V(t,n);if(!r)return t+"";var e=r[0],a=r[1];return a<0?"0."+new Array(-a).join("0")+e:e.length>a+1?e.slice(0,a+1)+"."+e.slice(a+1):e+new Array(a-e.length+2).join("0")}B.prototype=$.prototype,$.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var Y={"%":function(t,n){return(100*t).toFixed(n)},b:function(t){return Math.round(t).toString(2)},c:function(t){return t+""},d:function(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},e:function(t,n){return t.toExponential(n)},f:function(t,n){return t.toFixed(n)},g:function(t,n){return t.toPrecision(n)},o:function(t){return Math.round(t).toString(8)},p:function(t,n){return H(100*t,n)},r:H,s:function(t,n){var r=V(t,n);if(!r)return t+"";var e=r[0],a=r[1],i=a-(O=3*Math.max(-8,Math.min(8,Math.floor(a/3))))+1,o=e.length;return i===o?e:i>o?e+new Array(i-o+1).join("0"):i>0?e.slice(0,i)+"."+e.slice(i):"0."+new Array(1-i).join("0")+V(t,Math.max(0,n+i-1))[0]},X:function(t){return Math.round(t).toString(16).toUpperCase()},x:function(t){return Math.round(t).toString(16)}};function q(t){return t}var T,R,W,X=Array.prototype.map,G=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function U(t){var n,r,e=void 0===t.grouping||void 0===t.thousands?q:(n=X.call(t.grouping,Number),r=t.thousands+"",function(t,e){for(var a=t.length,i=[],o=0,u=n[0],c=0;a>0&&u>0&&(c+u+1>e&&(u=Math.max(1,e-c)),i.push(t.substring(a-=u,a+u)),!((c+=u+1)>e));)u=n[o=(o+1)%n.length];return i.reverse().join(r)}),a=void 0===t.currency?"":t.currency[0]+"",i=void 0===t.currency?"":t.currency[1]+"",o=void 0===t.decimal?".":t.decimal+"",u=void 0===t.numerals?q:function(t){return function(n){return n.replace(/[0-9]/g,(function(n){return t[+n]}))}}(X.call(t.numerals,String)),c=void 0===t.percent?"%":t.percent+"",l=void 0===t.minus?"-":t.minus+"",s=void 0===t.nan?"NaN":t.nan+"";function f(t){var n=(t=B(t)).fill,r=t.align,f=t.sign,h=t.symbol,d=t.zero,m=t.width,g=t.comma,p=t.precision,v=t.trim,M=t.type;"n"===M?(g=!0,M="g"):Y[M]||(void 0===p&&(p=12),v=!0,M="g"),(d||"0"===n&&"="===r)&&(d=!0,n="0",r="=");var y="$"===h?a:"#"===h&&/[boxX]/.test(M)?"0"+M.toLowerCase():"",b="$"===h?i:/[%p]/.test(M)?c:"",w=Y[M],x=/[defgprs%]/.test(M);function k(t){var a,i,c,h=y,k=b;if("c"===M)k=w(t)+k,t="";else{var N=(t=+t)<0||1/t<0;if(t=isNaN(t)?s:w(Math.abs(t),p),v&&(t=function(t){t:for(var n,r=t.length,e=1,a=-1;e<r;++e)switch(t[e]){case".":a=n=e;break;case"0":0===a&&(a=e),n=e;break;default:if(!+t[e])break t;a>0&&(a=0)}return a>0?t.slice(0,a)+t.slice(n+1):t}(t)),N&&0==+t&&"+"!==f&&(N=!1),h=(N?"("===f?f:l:"-"===f||"("===f?"":f)+h,k=("s"===M?G[8+O/3]:"")+k+(N&&"("===f?")":""),x)for(a=-1,i=t.length;++a<i;)if(48>(c=t.charCodeAt(a))||c>57){k=(46===c?o+t.slice(a+1):t.slice(a))+k,t=t.slice(0,a);break}}g&&!d&&(t=e(t,1/0));var A=h.length+t.length+k.length,C=A<m?new Array(m-A+1).join(n):"";switch(g&&d&&(t=e(C+t,C.length?m-k.length:1/0),C=""),r){case"<":t=h+t+k+C;break;case"=":t=h+C+t+k;break;case"^":t=C.slice(0,A=C.length>>1)+h+t+k+C.slice(A);break;default:t=C+h+t+k}return u(t)}return p=void 0===p?6:/[gprs]/.test(M)?Math.max(1,Math.min(21,p)):Math.max(0,Math.min(20,p)),k.toString=function(){return t+""},k}return{format:f,formatPrefix:function(t,n){var r=f(((t=B(t)).type="f",t)),e=3*Math.max(-8,Math.min(8,Math.floor(D(n)/3))),a=Math.pow(10,-e),i=G[8+e/3];return function(t){return r(a*t)+i}}}}function Z(){var t,n,r=l().unknown(void 0),e=r.domain,a=r.range,i=[0,1],o=!1,u=0,c=0,f=.5;function h(){var r=e().length,l=i[1]<i[0],s=i[l-0],h=i[1-l];t=(h-s)/Math.max(1,r-u+2*c),o&&(t=Math.floor(t)),s+=(h-s-t*(r-u))*f,n=t*(1-u),o&&(s=Math.round(s),n=Math.round(n));var d=p(r).map((function(n){return s+t*n}));return a(l?d.reverse():d)}return delete r.unknown,r.domain=function(t){return arguments.length?(e(t),h()):e()},r.range=function(t){return arguments.length?(i=[+t[0],+t[1]],h()):i.slice()},r.rangeRound=function(t){return i=[+t[0],+t[1]],o=!0,h()},r.bandwidth=function(){return n},r.step=function(){return t},r.round=function(t){return arguments.length?(o=!!t,h()):o},r.padding=function(t){return arguments.length?(u=Math.min(1,c=+t),h()):u},r.paddingInner=function(t){return arguments.length?(u=Math.min(1,t),h()):u},r.paddingOuter=function(t){return arguments.length?(c=+t,h()):c},r.align=function(t){return arguments.length?(f=Math.max(0,Math.min(1,t)),h()):f},r.copy=function(){return Z(e(),i).round(o).paddingInner(u).paddingOuter(c).align(f)},s.apply(h(),arguments)}function J(t){return+t}T=U({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"}),R=T.format,W=T.formatPrefix;var K=[0,1];function Q(t){return t}function tt(t,n){return(n-=t=+t)?function(r){return(r-t)/n}:(r=isNaN(n)?NaN:.5,function(){return r});var r}function nt(t){var n,r=t[0],e=t[t.length-1];return r>e&&(n=r,r=e,e=n),function(t){return Math.max(r,Math.min(e,t))}}function rt(t,n,r){var e=t[0],a=t[1],i=n[0],o=n[1];return a<e?(e=tt(a,e),i=r(o,i)):(e=tt(e,a),i=r(i,o)),function(t){return i(e(t))}}function et(t,n,r){var e=Math.min(t.length,n.length)-1,a=new Array(e),i=new Array(e),o=-1;for(t[e]<t[0]&&(t=t.slice().reverse(),n=n.slice().reverse());++o<e;)a[o]=tt(t[o],t[o+1]),i[o]=r(n[o],n[o+1]);return function(n){var r=d(t,n,1,e)-1;return i[r](a[r](n))}}function at(t,n){return n.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}function it(t,n){return function(){var t,n,r,e,a,o,u=K,c=K,l=I,s=Q;function d(){return e=Math.min(u.length,c.length)>2?et:rt,a=o=null,m}function m(n){return isNaN(n=+n)?r:(a||(a=e(u.map(t),c,l)))(t(s(n)))}return m.invert=function(r){return s(n((o||(o=e(c,u.map(t),i)))(r)))},m.domain=function(t){return arguments.length?(u=f.call(t,J),s===Q||(s=nt(u)),d()):u.slice()},m.range=function(t){return arguments.length?(c=h.call(t),d()):c.slice()},m.rangeRound=function(t){return c=h.call(t),l=L,d()},m.clamp=function(t){return arguments.length?(s=t?nt(u):Q,m):s!==Q},m.interpolate=function(t){return arguments.length?(l=t,d()):l},m.unknown=function(t){return arguments.length?(r=t,m):r},function(r,e){return t=r,n=e,d()}}()(t,n)}function ot(t,n,r,e){var a,i=function(t,n,r){var e=Math.abs(n-t)/Math.max(0,r),a=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),i=e/a;return i>=v?a*=10:i>=M?a*=5:i>=y&&(a*=2),n<t?-a:a}(t,n,r);switch((e=B(null==e?",f":e)).type){case"s":var o=Math.max(Math.abs(t),Math.abs(n));return null!=e.precision||isNaN(a=function(t,n){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(D(n)/3)))-D(Math.abs(t)))}(i,o))||(e.precision=a),W(e,o);case"":case"e":case"g":case"p":case"r":null!=e.precision||isNaN(a=function(t,n){return t=Math.abs(t),n=Math.abs(n)-t,Math.max(0,D(n)-D(t))+1}(i,Math.max(Math.abs(t),Math.abs(n))))||(e.precision=a-("e"===e.type));break;case"f":case"%":null!=e.precision||isNaN(a=function(t){return Math.max(0,-D(Math.abs(t)))}(i))||(e.precision=a-2*("%"===e.type))}return R(e)}function ut(t){var n=t.domain;return t.ticks=function(t){var r=n();return function(t,n,r){var e,a,i,o,u=-1;if(r=+r,(t=+t)==(n=+n)&&r>0)return[t];if((e=n<t)&&(a=t,t=n,n=a),0===(o=b(t,n,r))||!isFinite(o))return[];if(o>0)for(t=Math.ceil(t/o),n=Math.floor(n/o),i=new Array(a=Math.ceil(n-t+1));++u<a;)i[u]=(t+u)*o;else for(t=Math.floor(t*o),n=Math.ceil(n*o),i=new Array(a=Math.ceil(t-n+1));++u<a;)i[u]=(t-u)/o;return e&&i.reverse(),i}(r[0],r[r.length-1],null==t?10:t)},t.tickFormat=function(t,r){var e=n();return ot(e[0],e[e.length-1],null==t?10:t,r)},t.nice=function(r){null==r&&(r=10);var e,a=n(),i=0,o=a.length-1,u=a[i],c=a[o];return c<u&&(e=u,u=c,c=e,e=i,i=o,o=e),(e=b(u,c,r))>0?e=b(u=Math.floor(u/e)*e,c=Math.ceil(c/e)*e,r):e<0&&(e=b(u=Math.ceil(u*e)/e,c=Math.floor(c*e)/e,r)),e>0?(a[i]=Math.floor(u/e)*e,a[o]=Math.ceil(c/e)*e,n(a)):e<0&&(a[i]=Math.ceil(u*e)/e,a[o]=Math.floor(c*e)/e,n(a)),t},t}function ct(){var t=it(Q,Q);return t.copy=function(){return at(t,ct())},s.apply(t,arguments),ut(t)}g("#barChart {\n width: 100%; }\n");var lt=function(e){var a=e.className,i=e.barChartData,o=e.setSelectedYear,u=e.fontColor,c=e.barColor,l=e.width;if(!i||0===i.length)return null;var s=100,f=30,h=90,d=30,g=window.innerWidth<767?2*window.innerWidth-s-h:700-s-h,v=function(t){var n=0;t.forEach((function(t){parseInt(t.count,10)>n&&(n=parseInt(t.count,10))})),m("div#barChart").html("");var r,e=m("#barChart").append("svg").attr("width",l+d+f).attr("height",g+s+h).append("g").attr("transform","translate(".concat(d,",").concat(s,")")),a=Z().range([0,l]).domain(t.map((function(t){return t.year}))).padding(.2);e.append("g").attr("transform","translate(0,".concat(g,")")).call((r=a,j(3,r))).style("color",u).selectAll("text").attr("transform","translate(-10,0)rotate(-45)").style("text-anchor","end").style("color",u).style("font-size",16);var i=ct().domain([0,n]).range([g,0]);e.selectAll("mybar").data(t).enter().append("rect").attr("x",(function(t){return a(t.year)})).attr("width",a.bandwidth()).attr("fill",c).attr("title",(function(t){return t.count})).attr("height",(function(){return g-i(0)})).attr("y",(function(){return i(0)})).style("cursor","pointer").on("click",(function(t){return o(t.year)})).append("svg:title").text((function(t){return"數量:".concat(t.count)})),e.selectAll("rect").transition().duration(800).attr("y",(function(t){return i(t.count)})).attr("height",(function(t){return g-i(t.count)})).delay((function(t,n){return 10*n})),e.append("g").call(function(t){return j(4,t)}(i).tickValues(p(i.domain()[0],i.domain()[1]+1,1)).tickFormat((function(t){return Math.round(t)}))).attr("id","yaxis").style("color",u).style("font-size",15)};function M(){var t=document.getElementById("barChart__block");0===t.scrollLeft&&document.getElementById("yaxis").setAttribute("transform","translate(0, 0 )"),t.scrollLeft>0&&document.getElementById("yaxis").setAttribute("transform","translate(".concat(t.scrollLeft,", 0)"))}return n((function(){i.length>0&&v(i),document.getElementById("barChart__block").addEventListener("scroll",M)}),[i]),t.createElement("div",{id:"barChart",className:r("barChart",a)})};lt.defaultProps={className:void 0,barChartData:[],setSelectedYear:function(){return null},fontColor:"#000",barColor:"#69b3a2",width:2e3},lt.propTypes={className:e.string,barChartData:e.arrayOf(e.any),setSelectedYear:e.func,fontColor:e.string,barColor:e.string,width:e.number};export{lt as default};
|
|
1
|
+
import t,{useEffect as n}from"react";import{c as r}from"./index-b2745105.js";import e from"prop-types";import{f as a,g as i,h as o,j as u,k as c,o as l,l as s,n as f,s as h,p as d,d as m}from"./transform-011f0fe5.js";import{s as g}from"./style-inject.es-1f59c1d0.js";function p(t,n,r){t=+t,n=+n,r=(a=arguments.length)<2?(n=t,t=0,1):a<3?1:+r;for(var e=-1,a=0|Math.max(0,Math.ceil((n-t)/r)),i=new Array(a);++e<a;)i[e]=t+e*r;return i}var v=Math.sqrt(50),M=Math.sqrt(10),y=Math.sqrt(2);function b(t,n,r){var e=(n-t)/Math.max(0,r),a=Math.floor(Math.log(e)/Math.LN10),i=e/Math.pow(10,a);return a>=0?(i>=v?10:i>=M?5:i>=y?2:1)*Math.pow(10,a):-Math.pow(10,-a)/(i>=v?10:i>=M?5:i>=y?2:1)}var w=Array.prototype.slice;function x(t){return t}function k(t){return"translate("+(t+.5)+",0)"}function N(t){return"translate(0,"+(t+.5)+")"}function A(t){return function(n){return+t(n)}}function C(t){var n=Math.max(0,t.bandwidth()-1)/2;return t.round()&&(n=Math.round(n)),function(r){return+t(r)+n}}function S(){return!this.__axis}function j(t,n){var r=[],e=null,a=null,i=6,o=6,u=3,c=1===t||4===t?-1:1,l=4===t||2===t?"x":"y",s=1===t||3===t?k:N;function f(f){var h=null==e?n.ticks?n.ticks.apply(n,r):n.domain():e,d=null==a?n.tickFormat?n.tickFormat.apply(n,r):x:a,m=Math.max(i,0)+u,g=n.range(),p=+g[0]+.5,v=+g[g.length-1]+.5,M=(n.bandwidth?C:A)(n.copy()),y=f.selection?f.selection():f,b=y.selectAll(".domain").data([null]),w=y.selectAll(".tick").data(h,n).order(),k=w.exit(),N=w.enter().append("g").attr("class","tick"),j=w.select("line"),z=w.select("text");b=b.merge(b.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),w=w.merge(N),j=j.merge(N.append("line").attr("stroke","currentColor").attr(l+"2",c*i)),z=z.merge(N.append("text").attr("fill","currentColor").attr(l,c*m).attr("dy",1===t?"0em":3===t?"0.71em":"0.32em")),f!==y&&(b=b.transition(f),w=w.transition(f),j=j.transition(f),z=z.transition(f),k=k.transition(f).attr("opacity",1e-6).attr("transform",(function(t){return isFinite(t=M(t))?s(t):this.getAttribute("transform")})),N.attr("opacity",1e-6).attr("transform",(function(t){var n=this.parentNode.__axis;return s(n&&isFinite(n=n(t))?n:M(t))}))),k.remove(),b.attr("d",4===t||2==t?o?"M"+c*o+","+p+"H0.5V"+v+"H"+c*o:"M0.5,"+p+"V"+v:o?"M"+p+","+c*o+"V0.5H"+v+"V"+c*o:"M"+p+",0.5H"+v),w.attr("opacity",1).attr("transform",(function(t){return s(M(t))})),j.attr(l+"2",c*i),z.attr(l,c*m).text(d),y.filter(S).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",2===t?"start":4===t?"end":"middle"),y.each((function(){this.__axis=M}))}return f.scale=function(t){return arguments.length?(n=t,f):n},f.ticks=function(){return r=w.call(arguments),f},f.tickArguments=function(t){return arguments.length?(r=null==t?[]:w.call(t),f):r.slice()},f.tickValues=function(t){return arguments.length?(e=null==t?null:w.call(t),f):e&&e.slice()},f.tickFormat=function(t){return arguments.length?(a=t,f):a},f.tickSize=function(t){return arguments.length?(i=o=+t,f):i},f.tickSizeInner=function(t){return arguments.length?(i=+t,f):i},f.tickSizeOuter=function(t){return arguments.length?(o=+t,f):o},f.tickPadding=function(t){return arguments.length?(u=+t,f):u},f}function z(t,n){n||(n=[]);var r,e=t?Math.min(n.length,t.length):0,a=n.slice();return function(i){for(r=0;r<e;++r)a[r]=t[r]*(1-i)+n[r]*i;return a}}function E(t,n){var r,e=n?n.length:0,a=t?Math.min(e,t.length):0,i=new Array(a),o=new Array(e);for(r=0;r<a;++r)i[r]=I(t[r],n[r]);for(;r<e;++r)o[r]=n[r];return function(t){for(r=0;r<a;++r)o[r]=i[r](t);return o}}function F(t,n){var r=new Date;return t=+t,n=+n,function(e){return r.setTime(t*(1-e)+n*e),r}}function _(t,n){var r,e={},a={};for(r in null!==t&&"object"==typeof t||(t={}),null!==n&&"object"==typeof n||(n={}),n)r in t?e[r]=I(t[r],n[r]):a[r]=n[r];return function(t){for(r in e)a[r]=e[r](t);return a}}function I(t,n){var r,e,l=typeof n;return null==n||"boolean"===l?a(n):("number"===l?i:"string"===l?(r=o(n))?(n=r,u):c:n instanceof o?u:n instanceof Date?F:(e=n,!ArrayBuffer.isView(e)||e instanceof DataView?Array.isArray(n)?E:"function"!=typeof n.valueOf&&"function"!=typeof n.toString||isNaN(n)?_:i:z))(t,n)}function L(t,n){return t=+t,n=+n,function(r){return Math.round(t*(1-r)+n*r)}}function V(t,n){if((r=(t=n?t.toExponential(n-1):t.toExponential()).indexOf("e"))<0)return null;var r,e=t.slice(0,r);return[e.length>1?e[0]+e.slice(2):e,+t.slice(r+1)]}function D(t){return(t=V(Math.abs(t)))?t[1]:NaN}var O,P=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function B(t){if(!(n=P.exec(t)))throw new Error("invalid format: "+t);var n;return new $({fill:n[1],align:n[2],sign:n[3],symbol:n[4],zero:n[5],width:n[6],comma:n[7],precision:n[8]&&n[8].slice(1),trim:n[9],type:n[10]})}function $(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}function H(t,n){var r=V(t,n);if(!r)return t+"";var e=r[0],a=r[1];return a<0?"0."+new Array(-a).join("0")+e:e.length>a+1?e.slice(0,a+1)+"."+e.slice(a+1):e+new Array(a-e.length+2).join("0")}B.prototype=$.prototype,$.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var Y={"%":function(t,n){return(100*t).toFixed(n)},b:function(t){return Math.round(t).toString(2)},c:function(t){return t+""},d:function(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},e:function(t,n){return t.toExponential(n)},f:function(t,n){return t.toFixed(n)},g:function(t,n){return t.toPrecision(n)},o:function(t){return Math.round(t).toString(8)},p:function(t,n){return H(100*t,n)},r:H,s:function(t,n){var r=V(t,n);if(!r)return t+"";var e=r[0],a=r[1],i=a-(O=3*Math.max(-8,Math.min(8,Math.floor(a/3))))+1,o=e.length;return i===o?e:i>o?e+new Array(i-o+1).join("0"):i>0?e.slice(0,i)+"."+e.slice(i):"0."+new Array(1-i).join("0")+V(t,Math.max(0,n+i-1))[0]},X:function(t){return Math.round(t).toString(16).toUpperCase()},x:function(t){return Math.round(t).toString(16)}};function q(t){return t}var T,R,W,X=Array.prototype.map,G=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function U(t){var n,r,e=void 0===t.grouping||void 0===t.thousands?q:(n=X.call(t.grouping,Number),r=t.thousands+"",function(t,e){for(var a=t.length,i=[],o=0,u=n[0],c=0;a>0&&u>0&&(c+u+1>e&&(u=Math.max(1,e-c)),i.push(t.substring(a-=u,a+u)),!((c+=u+1)>e));)u=n[o=(o+1)%n.length];return i.reverse().join(r)}),a=void 0===t.currency?"":t.currency[0]+"",i=void 0===t.currency?"":t.currency[1]+"",o=void 0===t.decimal?".":t.decimal+"",u=void 0===t.numerals?q:function(t){return function(n){return n.replace(/[0-9]/g,(function(n){return t[+n]}))}}(X.call(t.numerals,String)),c=void 0===t.percent?"%":t.percent+"",l=void 0===t.minus?"-":t.minus+"",s=void 0===t.nan?"NaN":t.nan+"";function f(t){var n=(t=B(t)).fill,r=t.align,f=t.sign,h=t.symbol,d=t.zero,m=t.width,g=t.comma,p=t.precision,v=t.trim,M=t.type;"n"===M?(g=!0,M="g"):Y[M]||(void 0===p&&(p=12),v=!0,M="g"),(d||"0"===n&&"="===r)&&(d=!0,n="0",r="=");var y="$"===h?a:"#"===h&&/[boxX]/.test(M)?"0"+M.toLowerCase():"",b="$"===h?i:/[%p]/.test(M)?c:"",w=Y[M],x=/[defgprs%]/.test(M);function k(t){var a,i,c,h=y,k=b;if("c"===M)k=w(t)+k,t="";else{var N=(t=+t)<0||1/t<0;if(t=isNaN(t)?s:w(Math.abs(t),p),v&&(t=function(t){t:for(var n,r=t.length,e=1,a=-1;e<r;++e)switch(t[e]){case".":a=n=e;break;case"0":0===a&&(a=e),n=e;break;default:if(!+t[e])break t;a>0&&(a=0)}return a>0?t.slice(0,a)+t.slice(n+1):t}(t)),N&&0==+t&&"+"!==f&&(N=!1),h=(N?"("===f?f:l:"-"===f||"("===f?"":f)+h,k=("s"===M?G[8+O/3]:"")+k+(N&&"("===f?")":""),x)for(a=-1,i=t.length;++a<i;)if(48>(c=t.charCodeAt(a))||c>57){k=(46===c?o+t.slice(a+1):t.slice(a))+k,t=t.slice(0,a);break}}g&&!d&&(t=e(t,1/0));var A=h.length+t.length+k.length,C=A<m?new Array(m-A+1).join(n):"";switch(g&&d&&(t=e(C+t,C.length?m-k.length:1/0),C=""),r){case"<":t=h+t+k+C;break;case"=":t=h+C+t+k;break;case"^":t=C.slice(0,A=C.length>>1)+h+t+k+C.slice(A);break;default:t=C+h+t+k}return u(t)}return p=void 0===p?6:/[gprs]/.test(M)?Math.max(1,Math.min(21,p)):Math.max(0,Math.min(20,p)),k.toString=function(){return t+""},k}return{format:f,formatPrefix:function(t,n){var r=f(((t=B(t)).type="f",t)),e=3*Math.max(-8,Math.min(8,Math.floor(D(n)/3))),a=Math.pow(10,-e),i=G[8+e/3];return function(t){return r(a*t)+i}}}}function Z(){var t,n,r=l().unknown(void 0),e=r.domain,a=r.range,i=[0,1],o=!1,u=0,c=0,f=.5;function h(){var r=e().length,l=i[1]<i[0],s=i[l-0],h=i[1-l];t=(h-s)/Math.max(1,r-u+2*c),o&&(t=Math.floor(t)),s+=(h-s-t*(r-u))*f,n=t*(1-u),o&&(s=Math.round(s),n=Math.round(n));var d=p(r).map((function(n){return s+t*n}));return a(l?d.reverse():d)}return delete r.unknown,r.domain=function(t){return arguments.length?(e(t),h()):e()},r.range=function(t){return arguments.length?(i=[+t[0],+t[1]],h()):i.slice()},r.rangeRound=function(t){return i=[+t[0],+t[1]],o=!0,h()},r.bandwidth=function(){return n},r.step=function(){return t},r.round=function(t){return arguments.length?(o=!!t,h()):o},r.padding=function(t){return arguments.length?(u=Math.min(1,c=+t),h()):u},r.paddingInner=function(t){return arguments.length?(u=Math.min(1,t),h()):u},r.paddingOuter=function(t){return arguments.length?(c=+t,h()):c},r.align=function(t){return arguments.length?(f=Math.max(0,Math.min(1,t)),h()):f},r.copy=function(){return Z(e(),i).round(o).paddingInner(u).paddingOuter(c).align(f)},s.apply(h(),arguments)}function J(t){return+t}T=U({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"}),R=T.format,W=T.formatPrefix;var K=[0,1];function Q(t){return t}function tt(t,n){return(n-=t=+t)?function(r){return(r-t)/n}:(r=isNaN(n)?NaN:.5,function(){return r});var r}function nt(t){var n,r=t[0],e=t[t.length-1];return r>e&&(n=r,r=e,e=n),function(t){return Math.max(r,Math.min(e,t))}}function rt(t,n,r){var e=t[0],a=t[1],i=n[0],o=n[1];return a<e?(e=tt(a,e),i=r(o,i)):(e=tt(e,a),i=r(i,o)),function(t){return i(e(t))}}function et(t,n,r){var e=Math.min(t.length,n.length)-1,a=new Array(e),i=new Array(e),o=-1;for(t[e]<t[0]&&(t=t.slice().reverse(),n=n.slice().reverse());++o<e;)a[o]=tt(t[o],t[o+1]),i[o]=r(n[o],n[o+1]);return function(n){var r=d(t,n,1,e)-1;return i[r](a[r](n))}}function at(t,n){return n.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}function it(t,n){return function(){var t,n,r,e,a,o,u=K,c=K,l=I,s=Q;function d(){return e=Math.min(u.length,c.length)>2?et:rt,a=o=null,m}function m(n){return isNaN(n=+n)?r:(a||(a=e(u.map(t),c,l)))(t(s(n)))}return m.invert=function(r){return s(n((o||(o=e(c,u.map(t),i)))(r)))},m.domain=function(t){return arguments.length?(u=f.call(t,J),s===Q||(s=nt(u)),d()):u.slice()},m.range=function(t){return arguments.length?(c=h.call(t),d()):c.slice()},m.rangeRound=function(t){return c=h.call(t),l=L,d()},m.clamp=function(t){return arguments.length?(s=t?nt(u):Q,m):s!==Q},m.interpolate=function(t){return arguments.length?(l=t,d()):l},m.unknown=function(t){return arguments.length?(r=t,m):r},function(r,e){return t=r,n=e,d()}}()(t,n)}function ot(t,n,r,e){var a,i=function(t,n,r){var e=Math.abs(n-t)/Math.max(0,r),a=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),i=e/a;return i>=v?a*=10:i>=M?a*=5:i>=y&&(a*=2),n<t?-a:a}(t,n,r);switch((e=B(null==e?",f":e)).type){case"s":var o=Math.max(Math.abs(t),Math.abs(n));return null!=e.precision||isNaN(a=function(t,n){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(D(n)/3)))-D(Math.abs(t)))}(i,o))||(e.precision=a),W(e,o);case"":case"e":case"g":case"p":case"r":null!=e.precision||isNaN(a=function(t,n){return t=Math.abs(t),n=Math.abs(n)-t,Math.max(0,D(n)-D(t))+1}(i,Math.max(Math.abs(t),Math.abs(n))))||(e.precision=a-("e"===e.type));break;case"f":case"%":null!=e.precision||isNaN(a=function(t){return Math.max(0,-D(Math.abs(t)))}(i))||(e.precision=a-2*("%"===e.type))}return R(e)}function ut(t){var n=t.domain;return t.ticks=function(t){var r=n();return function(t,n,r){var e,a,i,o,u=-1;if(r=+r,(t=+t)==(n=+n)&&r>0)return[t];if((e=n<t)&&(a=t,t=n,n=a),0===(o=b(t,n,r))||!isFinite(o))return[];if(o>0)for(t=Math.ceil(t/o),n=Math.floor(n/o),i=new Array(a=Math.ceil(n-t+1));++u<a;)i[u]=(t+u)*o;else for(t=Math.floor(t*o),n=Math.ceil(n*o),i=new Array(a=Math.ceil(t-n+1));++u<a;)i[u]=(t-u)/o;return e&&i.reverse(),i}(r[0],r[r.length-1],null==t?10:t)},t.tickFormat=function(t,r){var e=n();return ot(e[0],e[e.length-1],null==t?10:t,r)},t.nice=function(r){null==r&&(r=10);var e,a=n(),i=0,o=a.length-1,u=a[i],c=a[o];return c<u&&(e=u,u=c,c=e,e=i,i=o,o=e),(e=b(u,c,r))>0?e=b(u=Math.floor(u/e)*e,c=Math.ceil(c/e)*e,r):e<0&&(e=b(u=Math.ceil(u*e)/e,c=Math.floor(c*e)/e,r)),e>0?(a[i]=Math.floor(u/e)*e,a[o]=Math.ceil(c/e)*e,n(a)):e<0&&(a[i]=Math.ceil(u*e)/e,a[o]=Math.floor(c*e)/e,n(a)),t},t}function ct(){var t=it(Q,Q);return t.copy=function(){return at(t,ct())},s.apply(t,arguments),ut(t)}g("#barChart {\n width: 100%; }\n");var lt=function(e){var a=e.className,i=e.barChartData,o=e.setSelectedYear,u=e.fontColor,c=e.barColor,l=e.width;if(!i||0===i.length)return null;var s=100,f=30,h=90,d=30,g=window.innerWidth<767?2*window.innerWidth-s-h:700-s-h,v=function(t){var n=0;t.forEach((function(t){parseInt(t.count,10)>n&&(n=parseInt(t.count,10))})),m("div#barChart").html("");var r,e=m("#barChart").append("svg").attr("width",l+d+f).attr("height",g+s+h).append("g").attr("transform","translate(".concat(d,",").concat(s,")")),a=Z().range([0,l]).domain(t.map((function(t){return t.year}))).padding(.2);e.append("g").attr("transform","translate(0,".concat(g,")")).call((r=a,j(3,r))).style("color",u).selectAll("text").attr("transform","translate(-10,0)rotate(-45)").style("text-anchor","end").style("color",u).style("font-size",16);var i=ct().domain([0,n]).range([g,0]);e.selectAll("mybar").data(t).enter().append("rect").attr("x",(function(t){return a(t.year)})).attr("width",a.bandwidth()).attr("fill",c).attr("title",(function(t){return t.count})).attr("height",(function(){return g-i(0)})).attr("y",(function(){return i(0)})).style("cursor","pointer").on("click",(function(t){return o(t.year)})).append("svg:title").text((function(t){return"數量:".concat(t.count)})),e.selectAll("rect").transition().duration(800).attr("y",(function(t){return i(t.count)})).attr("height",(function(t){return g-i(t.count)})).delay((function(t,n){return 10*n})),e.append("g").call(function(t){return j(4,t)}(i).tickValues(p(i.domain()[0],i.domain()[1]+1,1)).tickFormat((function(t){return Math.round(t)}))).attr("id","yaxis").style("color",u).style("font-size",15)};function M(){var t=document.getElementById("barChart__block");0===t.scrollLeft&&document.getElementById("yaxis").setAttribute("transform","translate(0, 0 )"),t.scrollLeft>0&&document.getElementById("yaxis").setAttribute("transform","translate(".concat(t.scrollLeft,", 0)"))}return n((function(){i.length>0&&v(i),document.getElementById("barChart__block").addEventListener("scroll",M)}),[i]),t.createElement("div",{id:"barChart",className:r("barChart",a)})};lt.defaultProps={className:void 0,barChartData:[],setSelectedYear:function(){return null},fontColor:"#000",barColor:"#69b3a2",width:2e3},lt.propTypes={className:e.string,barChartData:e.arrayOf(e.any),setSelectedYear:e.func,fontColor:e.string,barColor:e.string,width:e.number};export{lt as default};
|
package/lib/components/SNA.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import*as e from"react";import t,{useMemo as n,useState as r,useRef as o,useEffect as i,useCallback as a,Component as l,forwardRef as c}from"react";import u from"prop-types";import{c as s,b as f,u as h}from"./index-b2745105.js";import{e as d,S as p,r as m,d as y,a as g,c as v,m as w,t as b,T as x,i as _,b as E,o as k}from"./transform-f1ccabd1.js";import{_ as S}from"./_rollupPluginBabelHelpers-b6a1ebe2.js";import{Menu as C,MenuItem as z,Tooltip as T,IconButton as P}from"@material-ui/core";import N from"./Tooltip.js";import{s as O,f as A,a as j}from"./dataExport-d55d6fa3.js";import{s as M}from"./style-inject.es-1f59c1d0.js";import{i as F,a as D,r as I}from"./createSvgIcon-65652f3a.js";import"@material-ui/styles";import"react-dom";function B(){for(var e,t=d;e=t.sourceEvent;)t=e;return t}function R(e,t){var n=e.ownerSVGElement||e;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=t.clientX,r.y=t.clientY,[(r=r.matrixTransform(e.getScreenCTM().inverse())).x,r.y]}var o=e.getBoundingClientRect();return[t.clientX-o.left-e.clientLeft,t.clientY-o.top-e.clientTop]}function L(e){var t=B();return t.changedTouches&&(t=t.changedTouches[0]),R(e,t)}function q(e,t,n){arguments.length<3&&(n=t,t=B().changedTouches);for(var r,o=0,i=t?t.length:0;o<i;++o)if((r=t[o]).identifier===n)return R(e,r);return null}function U(){d.stopImmediatePropagation()}function G(){d.preventDefault(),d.stopImmediatePropagation()}function $(e){var t=e.document.documentElement,n=y(e).on("dragstart.drag",G,!0);"onselectstart"in t?n.on("selectstart.drag",G,!0):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function H(e,t){var n=e.document.documentElement,r=y(e).on("dragstart.drag",null);t&&(r.on("click.drag",G,!0),setTimeout((function(){r.on("click.drag",null)}),0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}function W(e){return function(){return e}}function V(e,t,n,r,o,i,a,l,c,u){this.target=e,this.type=t,this.subject=n,this.identifier=r,this.active=o,this.x=i,this.y=a,this.dx=l,this.dy=c,this._=u}function X(){return!d.ctrlKey&&!d.button}function Y(){return this.parentNode}function K(e){return null==e?{x:d.x,y:d.y}:e}function J(){return navigator.maxTouchPoints||"ontouchstart"in this}V.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};var Q=Math.SQRT2;function Z(e){return((e=Math.exp(e))+1/e)/2}function ee(e,t){var n,r,o=e[0],i=e[1],a=e[2],l=t[0],c=t[1],u=t[2],s=l-o,f=c-i,h=s*s+f*f;if(h<1e-12)r=Math.log(u/a)/Q,n=function(e){return[o+e*s,i+e*f,a*Math.exp(Q*e*r)]};else{var d=Math.sqrt(h),p=(u*u-a*a+4*h)/(2*a*2*d),m=(u*u-a*a-4*h)/(2*u*2*d),y=Math.log(Math.sqrt(p*p+1)-p),g=Math.log(Math.sqrt(m*m+1)-m);r=(g-y)/Q,n=function(e){var t=e*r,n=Z(y),l=a/(2*d)*(n*function(e){return((e=Math.exp(2*e))-1)/(e+1)}(Q*t+y)-function(e){return((e=Math.exp(e))-1/e)/2}(y));return[o+l*s,i+l*f,a*n/Z(Q*t+y)]}}return n.duration=1e3*r,n}function te(e){return function(){return e}}function ne(){return 1e-6*(Math.random()-.5)}function re(e,t,n,r){if(isNaN(t)||isNaN(n))return e;var o,i,a,l,c,u,s,f,h,d=e._root,p={data:r},m=e._x0,y=e._y0,g=e._x1,v=e._y1;if(!d)return e._root=p,e;for(;d.length;)if((u=t>=(i=(m+g)/2))?m=i:g=i,(s=n>=(a=(y+v)/2))?y=a:v=a,o=d,!(d=d[f=s<<1|u]))return o[f]=p,e;if(l=+e._x.call(null,d.data),c=+e._y.call(null,d.data),t===l&&n===c)return p.next=d,o?o[f]=p:e._root=p,e;do{o=o?o[f]=new Array(4):e._root=new Array(4),(u=t>=(i=(m+g)/2))?m=i:g=i,(s=n>=(a=(y+v)/2))?y=a:v=a}while((f=s<<1|u)==(h=(c>=a)<<1|l>=i));return o[h]=d,o[f]=p,e}function oe(e,t,n,r,o){this.node=e,this.x0=t,this.y0=n,this.x1=r,this.y1=o}function ie(e){return e[0]}function ae(e){return e[1]}function le(e,t,n){var r=new ce(null==t?ie:t,null==n?ae:n,NaN,NaN,NaN,NaN);return null==e?r:r.addAll(e)}function ce(e,t,n,r,o,i){this._x=e,this._y=t,this._x0=n,this._y0=r,this._x1=o,this._y1=i,this._root=void 0}function ue(e){for(var t={data:e.data},n=t;e=e.next;)n=n.next={data:e.data};return t}var se=le.prototype=ce.prototype;function fe(e){return e.x+e.vx}function he(e){return e.y+e.vy}function de(e){return e.index}function pe(e,t){var n=e.get(t);if(!n)throw new Error("missing: "+t);return n}function me(e){return e.x}function ye(e){return e.y}se.copy=function(){var e,t,n=new ce(this._x,this._y,this._x0,this._y0,this._x1,this._y1),r=this._root;if(!r)return n;if(!r.length)return n._root=ue(r),n;for(e=[{source:r,target:n._root=new Array(4)}];r=e.pop();)for(var o=0;o<4;++o)(t=r.source[o])&&(t.length?e.push({source:t,target:r.target[o]=new Array(4)}):r.target[o]=ue(t));return n},se.add=function(e){var t=+this._x.call(null,e),n=+this._y.call(null,e);return re(this.cover(t,n),t,n,e)},se.addAll=function(e){var t,n,r,o,i=e.length,a=new Array(i),l=new Array(i),c=1/0,u=1/0,s=-1/0,f=-1/0;for(n=0;n<i;++n)isNaN(r=+this._x.call(null,t=e[n]))||isNaN(o=+this._y.call(null,t))||(a[n]=r,l[n]=o,r<c&&(c=r),r>s&&(s=r),o<u&&(u=o),o>f&&(f=o));if(c>s||u>f)return this;for(this.cover(c,u).cover(s,f),n=0;n<i;++n)re(this,a[n],l[n],e[n]);return this},se.cover=function(e,t){if(isNaN(e=+e)||isNaN(t=+t))return this;var n=this._x0,r=this._y0,o=this._x1,i=this._y1;if(isNaN(n))o=(n=Math.floor(e))+1,i=(r=Math.floor(t))+1;else{for(var a,l,c=o-n,u=this._root;n>e||e>=o||r>t||t>=i;)switch(l=(t<r)<<1|e<n,(a=new Array(4))[l]=u,u=a,c*=2,l){case 0:o=n+c,i=r+c;break;case 1:n=o-c,i=r+c;break;case 2:o=n+c,r=i-c;break;case 3:n=o-c,r=i-c}this._root&&this._root.length&&(this._root=u)}return this._x0=n,this._y0=r,this._x1=o,this._y1=i,this},se.data=function(){var e=[];return this.visit((function(t){if(!t.length)do{e.push(t.data)}while(t=t.next)})),e},se.extent=function(e){return arguments.length?this.cover(+e[0][0],+e[0][1]).cover(+e[1][0],+e[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]},se.find=function(e,t,n){var r,o,i,a,l,c,u,s=this._x0,f=this._y0,h=this._x1,d=this._y1,p=[],m=this._root;for(m&&p.push(new oe(m,s,f,h,d)),null==n?n=1/0:(s=e-n,f=t-n,h=e+n,d=t+n,n*=n);c=p.pop();)if(!(!(m=c.node)||(o=c.x0)>h||(i=c.y0)>d||(a=c.x1)<s||(l=c.y1)<f))if(m.length){var y=(o+a)/2,g=(i+l)/2;p.push(new oe(m[3],y,g,a,l),new oe(m[2],o,g,y,l),new oe(m[1],y,i,a,g),new oe(m[0],o,i,y,g)),(u=(t>=g)<<1|e>=y)&&(c=p[p.length-1],p[p.length-1]=p[p.length-1-u],p[p.length-1-u]=c)}else{var v=e-+this._x.call(null,m.data),w=t-+this._y.call(null,m.data),b=v*v+w*w;if(b<n){var x=Math.sqrt(n=b);s=e-x,f=t-x,h=e+x,d=t+x,r=m.data}}return r},se.remove=function(e){if(isNaN(i=+this._x.call(null,e))||isNaN(a=+this._y.call(null,e)))return this;var t,n,r,o,i,a,l,c,u,s,f,h,d=this._root,p=this._x0,m=this._y0,y=this._x1,g=this._y1;if(!d)return this;if(d.length)for(;;){if((u=i>=(l=(p+y)/2))?p=l:y=l,(s=a>=(c=(m+g)/2))?m=c:g=c,t=d,!(d=d[f=s<<1|u]))return this;if(!d.length)break;(t[f+1&3]||t[f+2&3]||t[f+3&3])&&(n=t,h=f)}for(;d.data!==e;)if(r=d,!(d=d.next))return this;return(o=d.next)&&delete d.next,r?(o?r.next=o:delete r.next,this):t?(o?t[f]=o:delete t[f],(d=t[0]||t[1]||t[2]||t[3])&&d===(t[3]||t[2]||t[1]||t[0])&&!d.length&&(n?n[h]=d:this._root=d),this):(this._root=o,this)},se.removeAll=function(e){for(var t=0,n=e.length;t<n;++t)this.remove(e[t]);return this},se.root=function(){return this._root},se.size=function(){var e=0;return this.visit((function(t){if(!t.length)do{++e}while(t=t.next)})),e},se.visit=function(e){var t,n,r,o,i,a,l=[],c=this._root;for(c&&l.push(new oe(c,this._x0,this._y0,this._x1,this._y1));t=l.pop();)if(!e(c=t.node,r=t.x0,o=t.y0,i=t.x1,a=t.y1)&&c.length){var u=(r+i)/2,s=(o+a)/2;(n=c[3])&&l.push(new oe(n,u,s,i,a)),(n=c[2])&&l.push(new oe(n,r,s,u,a)),(n=c[1])&&l.push(new oe(n,u,o,i,s)),(n=c[0])&&l.push(new oe(n,r,o,u,s))}return this},se.visitAfter=function(e){var t,n=[],r=[];for(this._root&&n.push(new oe(this._root,this._x0,this._y0,this._x1,this._y1));t=n.pop();){var o=t.node;if(o.length){var i,a=t.x0,l=t.y0,c=t.x1,u=t.y1,s=(a+c)/2,f=(l+u)/2;(i=o[0])&&n.push(new oe(i,a,l,s,f)),(i=o[1])&&n.push(new oe(i,s,l,c,f)),(i=o[2])&&n.push(new oe(i,a,f,s,u)),(i=o[3])&&n.push(new oe(i,s,f,c,u))}r.push(t)}for(;t=r.pop();)e(t.node,t.x0,t.y0,t.x1,t.y1);return this},se.x=function(e){return arguments.length?(this._x=e,this):this._x},se.y=function(e){return arguments.length?(this._y=e,this):this._y};var ge=Math.PI*(3-Math.sqrt(5));var ve=function(e){for(var t=e.length/6|0,n=new Array(t),r=0;r<t;)n[r]="#"+e.slice(6*r,6*++r);return n}("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf");function we(e){return function(){return e}}function be(e,t,n){this.target=e,this.type=t,this.transform=n}function xe(){d.stopImmediatePropagation()}function _e(){d.preventDefault(),d.stopImmediatePropagation()}function Ee(){return!d.ctrlKey&&!d.button}function ke(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e).hasAttribute("viewBox")?[[(e=e.viewBox.baseVal).x,e.y],[e.x+e.width,e.y+e.height]]:[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]:[[0,0],[e.clientWidth,e.clientHeight]]}function Se(){return this.__zoom||_}function Ce(){return-d.deltaY*(1===d.deltaMode?.05:d.deltaMode?1:.002)}function ze(){return navigator.maxTouchPoints||"ontouchstart"in this}function Te(e,t,n){var r=e.invertX(t[0][0])-n[0][0],o=e.invertX(t[1][0])-n[1][0],i=e.invertY(t[0][1])-n[0][1],a=e.invertY(t[1][1])-n[1][1];return e.translate(o>r?(r+o)/2:Math.min(0,r)||Math.max(0,o),a>i?(i+a)/2:Math.min(0,i)||Math.max(0,a))}var Pe={fullscreenEnabled:0,fullscreenElement:1,requestFullscreen:2,exitFullscreen:3,fullscreenchange:4,fullscreenerror:5,fullscreen:6},Ne=["webkitFullscreenEnabled","webkitFullscreenElement","webkitRequestFullscreen","webkitExitFullscreen","webkitfullscreenchange","webkitfullscreenerror","-webkit-full-screen"],Oe=["mozFullScreenEnabled","mozFullScreenElement","mozRequestFullScreen","mozCancelFullScreen","mozfullscreenchange","mozfullscreenerror","-moz-full-screen"],Ae=["msFullscreenEnabled","msFullscreenElement","msRequestFullscreen","msExitFullscreen","MSFullscreenChange","MSFullscreenError","-ms-fullscreen"],je="undefined"!=typeof window&&void 0!==window.document?window.document:{},Me="fullscreenEnabled"in je&&Object.keys(Pe)||Ne[0]in je&&Ne||Oe[0]in je&&Oe||Ae[0]in je&&Ae||[],Fe={requestFullscreen:function(e){return e[Me[Pe.requestFullscreen]]()},requestFullscreenFunction:function(e){return e[Me[Pe.requestFullscreen]]},get exitFullscreen(){return je[Me[Pe.exitFullscreen]].bind(je)},get fullscreenPseudoClass(){return":"+Me[Pe.fullscreen]},addEventListener:function(e,t,n){return je.addEventListener(Me[Pe[e]],t,n)},removeEventListener:function(e,t,n){return je.removeEventListener(Me[Pe[e]],t,n)},get fullscreenEnabled(){return Boolean(je[Me[Pe.fullscreenEnabled]])},set fullscreenEnabled(e){},get fullscreenElement(){return je[Me[Pe.fullscreenElement]]},set fullscreenElement(e){},get onfullscreenchange(){return je[("on"+Me[Pe.fullscreenchange]).toLowerCase()]},set onfullscreenchange(e){return je[("on"+Me[Pe.fullscreenchange]).toLowerCase()]=e},get onfullscreenerror(){return je[("on"+Me[Pe.fullscreenerror]).toLowerCase()]},set onfullscreenerror(e){return je[("on"+Me[Pe.fullscreenerror]).toLowerCase()]=e}};var De=function(){return De=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},De.apply(this,arguments)},Ie=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n};var Be,Re=(Be=function(e,t){return Be=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},Be(e,t)},function(e,t){function n(){this.constructor=e}Be(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),Le=function(){return Le=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Le.apply(this,arguments)},qe=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function l(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,l)}c((r=r.apply(e,t||[])).next())}))},Ue=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(i){return function(l){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,l])}}},Ge=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n},$e=function(e){return!!e&&("object"==typeof e||"function"==typeof e)&&"function"==typeof e.then},He=function(e,t){return{left:window.outerWidth/2+(window.screenX||window.screenLeft||0)-e/2,top:window.outerHeight/2+(window.screenY||window.screenTop||0)-t/2}},We=function(e,t){return{top:(window.screen.height-t)/2,left:(window.screen.width-e)/2}};function Ve(e,t,n){var r=t.height,o=t.width,i=Ge(t,["height","width"]),a=Le({height:r,width:o,location:"no",toolbar:"no",status:"no",directories:"no",menubar:"no",scrollbars:"yes",resizable:"no",centerscreen:"yes",chrome:"yes"},i),l=window.open(e,"",Object.keys(a).map((function(e){return e+"="+a[e]})).join(", "));if(n)var c=window.setInterval((function(){try{(null===l||l.closed)&&(window.clearInterval(c),n(l))}catch(e){console.error(e)}}),1e3);return l}var Xe=function(e){function n(){var t=null!==e&&e.apply(this,arguments)||this;return t.openShareDialog=function(e){var n=t.props,r=n.onShareWindowClose,o=n.windowHeight,i=void 0===o?400:o,a=n.windowPosition,l=void 0===a?"windowCenter":a,c=n.windowWidth,u=void 0===c?550:c;Ve(e,Le({height:i,width:u},"windowCenter"===l?He(u,i):We(u,i)),r)},t.handleClick=function(e){return qe(t,void 0,void 0,(function(){var t,n,r,o,i,a,l,c,u,s;return Ue(this,(function(f){switch(f.label){case 0:return t=this.props,n=t.beforeOnClick,r=t.disabled,o=t.networkLink,i=t.onClick,a=t.url,l=t.openShareDialogOnClick,c=t.opts,u=o(a,c),r?[2]:(e.preventDefault(),n?(s=n(),$e(s)?[4,s]:[3,2]):[3,2]);case 1:f.sent(),f.label=2;case 2:return l&&this.openShareDialog(u),i&&i(e,u),[2]}}))}))},t}return Re(n,e),n.prototype.render=function(){var e=this.props;e.beforeOnClick;var n=e.children,r=e.className,o=e.disabled,i=e.disabledStyle,a=e.forwardedRef;e.networkLink;var l=e.networkName;e.onShareWindowClose,e.openShareDialogOnClick,e.opts;var c=e.resetButtonStyle,u=e.style;e.url,e.windowHeight,e.windowPosition,e.windowWidth;var f=Ge(e,["beforeOnClick","children","className","disabled","disabledStyle","forwardedRef","networkLink","networkName","onShareWindowClose","openShareDialogOnClick","opts","resetButtonStyle","style","url","windowHeight","windowPosition","windowWidth"]),h=s("react-share__ShareButton",{"react-share__ShareButton--disabled":!!o,disabled:!!o},r),d=Le(Le(c?{backgroundColor:"transparent",border:"none",padding:0,font:"inherit",color:"inherit",cursor:"pointer"}:{},u),o&&i);return t.createElement("button",Le({},f,{"aria-label":f["aria-label"]||l,className:h,onClick:this.handleClick,ref:a,style:d}),n)},n.defaultProps={disabledStyle:{opacity:.6},openShareDialogOnClick:!0,resetButtonStyle:!0},n}(l),Ye=Xe,Ke=function(){return Ke=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Ke.apply(this,arguments)};var Je,Qe,Ze=(Je={color:"#3b5998",networkName:"facebook",path:"M34.1,47V33.3h4.6l0.7-5.3h-5.3v-3.4c0-1.5,0.4-2.6,2.6-2.6l2.8,0v-4.8c-0.5-0.1-2.2-0.2-4.1-0.2 c-4.1,0-6.9,2.5-6.9,7V28H24v5.3h4.6V47H34.1z"},(Qe=function(e){var n=e.bgStyle,r=e.borderRadius,o=e.iconFillColor,i=e.round,a=e.size,l=Ie(e,["bgStyle","borderRadius","iconFillColor","round","size"]);return t.createElement("svg",De({viewBox:"0 0 64 64",width:a,height:a},l),i?t.createElement("circle",{cx:"32",cy:"32",r:"31",fill:Je.color,style:n}):t.createElement("rect",{width:"64",height:"64",rx:r,ry:r,fill:Je.color,style:n}),t.createElement("path",{d:Je.path,fill:o}))}).defaultProps={bgStyle:{},borderRadius:0,iconFillColor:"white",size:64},Qe),et=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),tt=function(e){function t(t){var n=e.call(this,t)||this;return n.name="AssertionError",n}return et(t,e),t}(Error);var nt=function(e,n,r,o){function i(i,a){var l=r(i),c=Ke({},i);return Object.keys(l).forEach((function(e){delete c[e]})),t.createElement(Ye,Ke({},o,c,{forwardedRef:a,networkName:e,networkLink:n,opts:r(i)}))}return i.displayName="ShareButton-"+e,c(i)}("facebook",(function(e,t){var n,r,o=t.quote,i=t.hashtag;return function(e,t){if(!e)throw new tt(t)}(e,"facebook.url"),"https://www.facebook.com/sharer/sharer.php"+(n={u:e,quote:o,hashtag:i},r=Object.entries(n).filter((function(e){return null!=e[1]})).map((function(e){var t=e[0],n=e[1];return encodeURIComponent(t)+"="+encodeURIComponent(String(n))})),r.length>0?"?"+r.join("&"):"")}),(function(e){return{quote:e.quote,hashtag:e.hashtag}}),{windowWidth:550,windowHeight:400}),rt=nt,ot=f((function(e){
|
|
1
|
+
import*as e from"react";import t,{useMemo as n,useState as r,useRef as o,useEffect as i,useCallback as a,Component as l,forwardRef as c}from"react";import u from"prop-types";import{c as s,b as f,u as h}from"./index-b2745105.js";import{e as d,d as p,a as m,c as y,m as g,t as v,T as w,i as b,b as x,o as _}from"./transform-011f0fe5.js";import{_ as E}from"./_rollupPluginBabelHelpers-b6a1ebe2.js";import{Menu as k,MenuItem as S,Tooltip as C,IconButton as z}from"@material-ui/core";import T from"./Tooltip.js";import{s as P,f as N,a as O}from"./dataExport-d55d6fa3.js";import{s as A}from"./style-inject.es-1f59c1d0.js";import{i as j,a as M,r as F}from"./createSvgIcon-65652f3a.js";import"@material-ui/styles";import"react-dom";function D(){for(var e,t=d;e=t.sourceEvent;)t=e;return t}function I(e,t){var n=e.ownerSVGElement||e;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=t.clientX,r.y=t.clientY,[(r=r.matrixTransform(e.getScreenCTM().inverse())).x,r.y]}var o=e.getBoundingClientRect();return[t.clientX-o.left-e.clientLeft,t.clientY-o.top-e.clientTop]}function B(e){var t=D();return t.changedTouches&&(t=t.changedTouches[0]),I(e,t)}function R(e,t,n){arguments.length<3&&(n=t,t=D().changedTouches);for(var r,o=0,i=t?t.length:0;o<i;++o)if((r=t[o]).identifier===n)return I(e,r);return null}function L(){d.stopImmediatePropagation()}function q(){d.preventDefault(),d.stopImmediatePropagation()}function U(e){var t=e.document.documentElement,n=p(e).on("dragstart.drag",q,!0);"onselectstart"in t?n.on("selectstart.drag",q,!0):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function G(e,t){var n=e.document.documentElement,r=p(e).on("dragstart.drag",null);t&&(r.on("click.drag",q,!0),setTimeout((function(){r.on("click.drag",null)}),0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}function $(e){return function(){return e}}function H(e,t,n,r,o,i,a,l,c,u){this.target=e,this.type=t,this.subject=n,this.identifier=r,this.active=o,this.x=i,this.y=a,this.dx=l,this.dy=c,this._=u}function W(){return!d.ctrlKey&&!d.button}function V(){return this.parentNode}function X(e){return null==e?{x:d.x,y:d.y}:e}function Y(){return navigator.maxTouchPoints||"ontouchstart"in this}H.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};var K=Math.SQRT2;function J(e){return((e=Math.exp(e))+1/e)/2}function Q(e,t){var n,r,o=e[0],i=e[1],a=e[2],l=t[0],c=t[1],u=t[2],s=l-o,f=c-i,h=s*s+f*f;if(h<1e-12)r=Math.log(u/a)/K,n=function(e){return[o+e*s,i+e*f,a*Math.exp(K*e*r)]};else{var d=Math.sqrt(h),p=(u*u-a*a+4*h)/(2*a*2*d),m=(u*u-a*a-4*h)/(2*u*2*d),y=Math.log(Math.sqrt(p*p+1)-p),g=Math.log(Math.sqrt(m*m+1)-m);r=(g-y)/K,n=function(e){var t=e*r,n=J(y),l=a/(2*d)*(n*function(e){return((e=Math.exp(2*e))-1)/(e+1)}(K*t+y)-function(e){return((e=Math.exp(e))-1/e)/2}(y));return[o+l*s,i+l*f,a*n/J(K*t+y)]}}return n.duration=1e3*r,n}function Z(e){return function(){return e}}function ee(){return 1e-6*(Math.random()-.5)}function te(e,t,n,r){if(isNaN(t)||isNaN(n))return e;var o,i,a,l,c,u,s,f,h,d=e._root,p={data:r},m=e._x0,y=e._y0,g=e._x1,v=e._y1;if(!d)return e._root=p,e;for(;d.length;)if((u=t>=(i=(m+g)/2))?m=i:g=i,(s=n>=(a=(y+v)/2))?y=a:v=a,o=d,!(d=d[f=s<<1|u]))return o[f]=p,e;if(l=+e._x.call(null,d.data),c=+e._y.call(null,d.data),t===l&&n===c)return p.next=d,o?o[f]=p:e._root=p,e;do{o=o?o[f]=new Array(4):e._root=new Array(4),(u=t>=(i=(m+g)/2))?m=i:g=i,(s=n>=(a=(y+v)/2))?y=a:v=a}while((f=s<<1|u)==(h=(c>=a)<<1|l>=i));return o[h]=d,o[f]=p,e}function ne(e,t,n,r,o){this.node=e,this.x0=t,this.y0=n,this.x1=r,this.y1=o}function re(e){return e[0]}function oe(e){return e[1]}function ie(e,t,n){var r=new ae(null==t?re:t,null==n?oe:n,NaN,NaN,NaN,NaN);return null==e?r:r.addAll(e)}function ae(e,t,n,r,o,i){this._x=e,this._y=t,this._x0=n,this._y0=r,this._x1=o,this._y1=i,this._root=void 0}function le(e){for(var t={data:e.data},n=t;e=e.next;)n=n.next={data:e.data};return t}var ce=ie.prototype=ae.prototype;function ue(e){return e.x+e.vx}function se(e){return e.y+e.vy}function fe(e){return e.index}function he(e,t){var n=e.get(t);if(!n)throw new Error("missing: "+t);return n}function de(e){return e.x}function pe(e){return e.y}ce.copy=function(){var e,t,n=new ae(this._x,this._y,this._x0,this._y0,this._x1,this._y1),r=this._root;if(!r)return n;if(!r.length)return n._root=le(r),n;for(e=[{source:r,target:n._root=new Array(4)}];r=e.pop();)for(var o=0;o<4;++o)(t=r.source[o])&&(t.length?e.push({source:t,target:r.target[o]=new Array(4)}):r.target[o]=le(t));return n},ce.add=function(e){var t=+this._x.call(null,e),n=+this._y.call(null,e);return te(this.cover(t,n),t,n,e)},ce.addAll=function(e){var t,n,r,o,i=e.length,a=new Array(i),l=new Array(i),c=1/0,u=1/0,s=-1/0,f=-1/0;for(n=0;n<i;++n)isNaN(r=+this._x.call(null,t=e[n]))||isNaN(o=+this._y.call(null,t))||(a[n]=r,l[n]=o,r<c&&(c=r),r>s&&(s=r),o<u&&(u=o),o>f&&(f=o));if(c>s||u>f)return this;for(this.cover(c,u).cover(s,f),n=0;n<i;++n)te(this,a[n],l[n],e[n]);return this},ce.cover=function(e,t){if(isNaN(e=+e)||isNaN(t=+t))return this;var n=this._x0,r=this._y0,o=this._x1,i=this._y1;if(isNaN(n))o=(n=Math.floor(e))+1,i=(r=Math.floor(t))+1;else{for(var a,l,c=o-n,u=this._root;n>e||e>=o||r>t||t>=i;)switch(l=(t<r)<<1|e<n,(a=new Array(4))[l]=u,u=a,c*=2,l){case 0:o=n+c,i=r+c;break;case 1:n=o-c,i=r+c;break;case 2:o=n+c,r=i-c;break;case 3:n=o-c,r=i-c}this._root&&this._root.length&&(this._root=u)}return this._x0=n,this._y0=r,this._x1=o,this._y1=i,this},ce.data=function(){var e=[];return this.visit((function(t){if(!t.length)do{e.push(t.data)}while(t=t.next)})),e},ce.extent=function(e){return arguments.length?this.cover(+e[0][0],+e[0][1]).cover(+e[1][0],+e[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]},ce.find=function(e,t,n){var r,o,i,a,l,c,u,s=this._x0,f=this._y0,h=this._x1,d=this._y1,p=[],m=this._root;for(m&&p.push(new ne(m,s,f,h,d)),null==n?n=1/0:(s=e-n,f=t-n,h=e+n,d=t+n,n*=n);c=p.pop();)if(!(!(m=c.node)||(o=c.x0)>h||(i=c.y0)>d||(a=c.x1)<s||(l=c.y1)<f))if(m.length){var y=(o+a)/2,g=(i+l)/2;p.push(new ne(m[3],y,g,a,l),new ne(m[2],o,g,y,l),new ne(m[1],y,i,a,g),new ne(m[0],o,i,y,g)),(u=(t>=g)<<1|e>=y)&&(c=p[p.length-1],p[p.length-1]=p[p.length-1-u],p[p.length-1-u]=c)}else{var v=e-+this._x.call(null,m.data),w=t-+this._y.call(null,m.data),b=v*v+w*w;if(b<n){var x=Math.sqrt(n=b);s=e-x,f=t-x,h=e+x,d=t+x,r=m.data}}return r},ce.remove=function(e){if(isNaN(i=+this._x.call(null,e))||isNaN(a=+this._y.call(null,e)))return this;var t,n,r,o,i,a,l,c,u,s,f,h,d=this._root,p=this._x0,m=this._y0,y=this._x1,g=this._y1;if(!d)return this;if(d.length)for(;;){if((u=i>=(l=(p+y)/2))?p=l:y=l,(s=a>=(c=(m+g)/2))?m=c:g=c,t=d,!(d=d[f=s<<1|u]))return this;if(!d.length)break;(t[f+1&3]||t[f+2&3]||t[f+3&3])&&(n=t,h=f)}for(;d.data!==e;)if(r=d,!(d=d.next))return this;return(o=d.next)&&delete d.next,r?(o?r.next=o:delete r.next,this):t?(o?t[f]=o:delete t[f],(d=t[0]||t[1]||t[2]||t[3])&&d===(t[3]||t[2]||t[1]||t[0])&&!d.length&&(n?n[h]=d:this._root=d),this):(this._root=o,this)},ce.removeAll=function(e){for(var t=0,n=e.length;t<n;++t)this.remove(e[t]);return this},ce.root=function(){return this._root},ce.size=function(){var e=0;return this.visit((function(t){if(!t.length)do{++e}while(t=t.next)})),e},ce.visit=function(e){var t,n,r,o,i,a,l=[],c=this._root;for(c&&l.push(new ne(c,this._x0,this._y0,this._x1,this._y1));t=l.pop();)if(!e(c=t.node,r=t.x0,o=t.y0,i=t.x1,a=t.y1)&&c.length){var u=(r+i)/2,s=(o+a)/2;(n=c[3])&&l.push(new ne(n,u,s,i,a)),(n=c[2])&&l.push(new ne(n,r,s,u,a)),(n=c[1])&&l.push(new ne(n,u,o,i,s)),(n=c[0])&&l.push(new ne(n,r,o,u,s))}return this},ce.visitAfter=function(e){var t,n=[],r=[];for(this._root&&n.push(new ne(this._root,this._x0,this._y0,this._x1,this._y1));t=n.pop();){var o=t.node;if(o.length){var i,a=t.x0,l=t.y0,c=t.x1,u=t.y1,s=(a+c)/2,f=(l+u)/2;(i=o[0])&&n.push(new ne(i,a,l,s,f)),(i=o[1])&&n.push(new ne(i,s,l,c,f)),(i=o[2])&&n.push(new ne(i,a,f,s,u)),(i=o[3])&&n.push(new ne(i,s,f,c,u))}r.push(t)}for(;t=r.pop();)e(t.node,t.x0,t.y0,t.x1,t.y1);return this},ce.x=function(e){return arguments.length?(this._x=e,this):this._x},ce.y=function(e){return arguments.length?(this._y=e,this):this._y};var me=Math.PI*(3-Math.sqrt(5));var ye=function(e){for(var t=e.length/6|0,n=new Array(t),r=0;r<t;)n[r]="#"+e.slice(6*r,6*++r);return n}("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf");function ge(e){return function(){return e}}function ve(e,t,n){this.target=e,this.type=t,this.transform=n}function we(){d.stopImmediatePropagation()}function be(){d.preventDefault(),d.stopImmediatePropagation()}function xe(){return!d.ctrlKey&&!d.button}function _e(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e).hasAttribute("viewBox")?[[(e=e.viewBox.baseVal).x,e.y],[e.x+e.width,e.y+e.height]]:[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]:[[0,0],[e.clientWidth,e.clientHeight]]}function Ee(){return this.__zoom||b}function ke(){return-d.deltaY*(1===d.deltaMode?.05:d.deltaMode?1:.002)}function Se(){return navigator.maxTouchPoints||"ontouchstart"in this}function Ce(e,t,n){var r=e.invertX(t[0][0])-n[0][0],o=e.invertX(t[1][0])-n[1][0],i=e.invertY(t[0][1])-n[0][1],a=e.invertY(t[1][1])-n[1][1];return e.translate(o>r?(r+o)/2:Math.min(0,r)||Math.max(0,o),a>i?(i+a)/2:Math.min(0,i)||Math.max(0,a))}var ze={fullscreenEnabled:0,fullscreenElement:1,requestFullscreen:2,exitFullscreen:3,fullscreenchange:4,fullscreenerror:5,fullscreen:6},Te=["webkitFullscreenEnabled","webkitFullscreenElement","webkitRequestFullscreen","webkitExitFullscreen","webkitfullscreenchange","webkitfullscreenerror","-webkit-full-screen"],Pe=["mozFullScreenEnabled","mozFullScreenElement","mozRequestFullScreen","mozCancelFullScreen","mozfullscreenchange","mozfullscreenerror","-moz-full-screen"],Ne=["msFullscreenEnabled","msFullscreenElement","msRequestFullscreen","msExitFullscreen","MSFullscreenChange","MSFullscreenError","-ms-fullscreen"],Oe="undefined"!=typeof window&&void 0!==window.document?window.document:{},Ae="fullscreenEnabled"in Oe&&Object.keys(ze)||Te[0]in Oe&&Te||Pe[0]in Oe&&Pe||Ne[0]in Oe&&Ne||[],je={requestFullscreen:function(e){return e[Ae[ze.requestFullscreen]]()},requestFullscreenFunction:function(e){return e[Ae[ze.requestFullscreen]]},get exitFullscreen(){return Oe[Ae[ze.exitFullscreen]].bind(Oe)},get fullscreenPseudoClass(){return":"+Ae[ze.fullscreen]},addEventListener:function(e,t,n){return Oe.addEventListener(Ae[ze[e]],t,n)},removeEventListener:function(e,t,n){return Oe.removeEventListener(Ae[ze[e]],t,n)},get fullscreenEnabled(){return Boolean(Oe[Ae[ze.fullscreenEnabled]])},set fullscreenEnabled(e){},get fullscreenElement(){return Oe[Ae[ze.fullscreenElement]]},set fullscreenElement(e){},get onfullscreenchange(){return Oe[("on"+Ae[ze.fullscreenchange]).toLowerCase()]},set onfullscreenchange(e){return Oe[("on"+Ae[ze.fullscreenchange]).toLowerCase()]=e},get onfullscreenerror(){return Oe[("on"+Ae[ze.fullscreenerror]).toLowerCase()]},set onfullscreenerror(e){return Oe[("on"+Ae[ze.fullscreenerror]).toLowerCase()]=e}};var Me=function(){return Me=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Me.apply(this,arguments)},Fe=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n};var De,Ie=(De=function(e,t){return De=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},De(e,t)},function(e,t){function n(){this.constructor=e}De(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),Be=function(){return Be=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Be.apply(this,arguments)},Re=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function l(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,l)}c((r=r.apply(e,t||[])).next())}))},Le=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(i){return function(l){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,l])}}},qe=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n},Ue=function(e){return!!e&&("object"==typeof e||"function"==typeof e)&&"function"==typeof e.then},Ge=function(e,t){return{left:window.outerWidth/2+(window.screenX||window.screenLeft||0)-e/2,top:window.outerHeight/2+(window.screenY||window.screenTop||0)-t/2}},$e=function(e,t){return{top:(window.screen.height-t)/2,left:(window.screen.width-e)/2}};function He(e,t,n){var r=t.height,o=t.width,i=qe(t,["height","width"]),a=Be({height:r,width:o,location:"no",toolbar:"no",status:"no",directories:"no",menubar:"no",scrollbars:"yes",resizable:"no",centerscreen:"yes",chrome:"yes"},i),l=window.open(e,"",Object.keys(a).map((function(e){return e+"="+a[e]})).join(", "));if(n)var c=window.setInterval((function(){try{(null===l||l.closed)&&(window.clearInterval(c),n(l))}catch(e){console.error(e)}}),1e3);return l}var We=function(e){function n(){var t=null!==e&&e.apply(this,arguments)||this;return t.openShareDialog=function(e){var n=t.props,r=n.onShareWindowClose,o=n.windowHeight,i=void 0===o?400:o,a=n.windowPosition,l=void 0===a?"windowCenter":a,c=n.windowWidth,u=void 0===c?550:c;He(e,Be({height:i,width:u},"windowCenter"===l?Ge(u,i):$e(u,i)),r)},t.handleClick=function(e){return Re(t,void 0,void 0,(function(){var t,n,r,o,i,a,l,c,u,s;return Le(this,(function(f){switch(f.label){case 0:return t=this.props,n=t.beforeOnClick,r=t.disabled,o=t.networkLink,i=t.onClick,a=t.url,l=t.openShareDialogOnClick,c=t.opts,u=o(a,c),r?[2]:(e.preventDefault(),n?(s=n(),Ue(s)?[4,s]:[3,2]):[3,2]);case 1:f.sent(),f.label=2;case 2:return l&&this.openShareDialog(u),i&&i(e,u),[2]}}))}))},t}return Ie(n,e),n.prototype.render=function(){var e=this.props;e.beforeOnClick;var n=e.children,r=e.className,o=e.disabled,i=e.disabledStyle,a=e.forwardedRef;e.networkLink;var l=e.networkName;e.onShareWindowClose,e.openShareDialogOnClick,e.opts;var c=e.resetButtonStyle,u=e.style;e.url,e.windowHeight,e.windowPosition,e.windowWidth;var f=qe(e,["beforeOnClick","children","className","disabled","disabledStyle","forwardedRef","networkLink","networkName","onShareWindowClose","openShareDialogOnClick","opts","resetButtonStyle","style","url","windowHeight","windowPosition","windowWidth"]),h=s("react-share__ShareButton",{"react-share__ShareButton--disabled":!!o,disabled:!!o},r),d=Be(Be(c?{backgroundColor:"transparent",border:"none",padding:0,font:"inherit",color:"inherit",cursor:"pointer"}:{},u),o&&i);return t.createElement("button",Be({},f,{"aria-label":f["aria-label"]||l,className:h,onClick:this.handleClick,ref:a,style:d}),n)},n.defaultProps={disabledStyle:{opacity:.6},openShareDialogOnClick:!0,resetButtonStyle:!0},n}(l),Ve=We,Xe=function(){return Xe=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Xe.apply(this,arguments)};var Ye,Ke,Je=(Ye={color:"#3b5998",networkName:"facebook",path:"M34.1,47V33.3h4.6l0.7-5.3h-5.3v-3.4c0-1.5,0.4-2.6,2.6-2.6l2.8,0v-4.8c-0.5-0.1-2.2-0.2-4.1-0.2 c-4.1,0-6.9,2.5-6.9,7V28H24v5.3h4.6V47H34.1z"},(Ke=function(e){var n=e.bgStyle,r=e.borderRadius,o=e.iconFillColor,i=e.round,a=e.size,l=Fe(e,["bgStyle","borderRadius","iconFillColor","round","size"]);return t.createElement("svg",Me({viewBox:"0 0 64 64",width:a,height:a},l),i?t.createElement("circle",{cx:"32",cy:"32",r:"31",fill:Ye.color,style:n}):t.createElement("rect",{width:"64",height:"64",rx:r,ry:r,fill:Ye.color,style:n}),t.createElement("path",{d:Ye.path,fill:o}))}).defaultProps={bgStyle:{},borderRadius:0,iconFillColor:"white",size:64},Ke),Qe=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ze=function(e){function t(t){var n=e.call(this,t)||this;return n.name="AssertionError",n}return Qe(t,e),t}(Error);var et=function(e,n,r,o){function i(i,a){var l=r(i),c=Xe({},i);return Object.keys(l).forEach((function(e){delete c[e]})),t.createElement(Ve,Xe({},o,c,{forwardedRef:a,networkName:e,networkLink:n,opts:r(i)}))}return i.displayName="ShareButton-"+e,c(i)}("facebook",(function(e,t){var n,r,o=t.quote,i=t.hashtag;return function(e,t){if(!e)throw new Ze(t)}(e,"facebook.url"),"https://www.facebook.com/sharer/sharer.php"+(n={u:e,quote:o,hashtag:i},r=Object.entries(n).filter((function(e){return null!=e[1]})).map((function(e){var t=e[0],n=e[1];return encodeURIComponent(t)+"="+encodeURIComponent(String(n))})),r.length>0?"?"+r.join("&"):"")}),(function(e){return{quote:e.quote,hashtag:e.hashtag}}),{windowWidth:550,windowHeight:400}),tt=et,nt=f((function(e){
|
|
2
2
|
/*!
|
|
3
3
|
* screenfull
|
|
4
4
|
* v5.2.0 - 2021-11-03
|
|
5
5
|
* (c) Sindre Sorhus; MIT License
|
|
6
6
|
*/
|
|
7
|
-
!function(){var t="undefined"!=typeof window&&void 0!==window.document?window.document:{},n=e.exports,r=function(){for(var e,n=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror"],["webkitRequestFullScreen","webkitCancelFullScreen","webkitCurrentFullScreenElement","webkitCancelFullScreen","webkitfullscreenchange","webkitfullscreenerror"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError"]],r=0,o=n.length,i={};r<o;r++)if((e=n[r])&&e[1]in t){for(r=0;r<e.length;r++)i[n[0][r]]=e[r];return i}return!1}(),o={change:r.fullscreenchange,error:r.fullscreenerror},i={request:function(e,n){return new Promise(function(o,i){var a=function(){this.off("change",a),o()}.bind(this);this.on("change",a);var l=(e=e||t.documentElement)[r.requestFullscreen](n);l instanceof Promise&&l.then(a).catch(i)}.bind(this))},exit:function(){return new Promise(function(e,n){if(this.isFullscreen){var o=function(){this.off("change",o),e()}.bind(this);this.on("change",o);var i=t[r.exitFullscreen]();i instanceof Promise&&i.then(o).catch(n)}else e()}.bind(this))},toggle:function(e,t){return this.isFullscreen?this.exit():this.request(e,t)},onchange:function(e){this.on("change",e)},onerror:function(e){this.on("error",e)},on:function(e,n){var r=o[e];r&&t.addEventListener(r,n,!1)},off:function(e,n){var r=o[e];r&&t.removeEventListener(r,n,!1)},raw:r};r?(Object.defineProperties(i,{isFullscreen:{get:function(){return Boolean(t[r.fullscreenElement])}},element:{enumerable:!0,get:function(){return t[r.fullscreenElement]}},isEnabled:{enumerable:!0,get:function(){return Boolean(t[r.fullscreenEnabled])}}}),n?e.exports=i:window.screenfull=i):n?e.exports={isEnabled:!1}:window.screenfull={isEnabled:!1}}()}));
|
|
7
|
+
!function(){var t="undefined"!=typeof window&&void 0!==window.document?window.document:{},n=e.exports,r=function(){for(var e,n=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror"],["webkitRequestFullScreen","webkitCancelFullScreen","webkitCurrentFullScreenElement","webkitCancelFullScreen","webkitfullscreenchange","webkitfullscreenerror"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError"]],r=0,o=n.length,i={};r<o;r++)if((e=n[r])&&e[1]in t){for(r=0;r<e.length;r++)i[n[0][r]]=e[r];return i}return!1}(),o={change:r.fullscreenchange,error:r.fullscreenerror},i={request:function(e,n){return new Promise(function(o,i){var a=function(){this.off("change",a),o()}.bind(this);this.on("change",a);var l=(e=e||t.documentElement)[r.requestFullscreen](n);l instanceof Promise&&l.then(a).catch(i)}.bind(this))},exit:function(){return new Promise(function(e,n){if(this.isFullscreen){var o=function(){this.off("change",o),e()}.bind(this);this.on("change",o);var i=t[r.exitFullscreen]();i instanceof Promise&&i.then(o).catch(n)}else e()}.bind(this))},toggle:function(e,t){return this.isFullscreen?this.exit():this.request(e,t)},onchange:function(e){this.on("change",e)},onerror:function(e){this.on("error",e)},on:function(e,n){var r=o[e];r&&t.addEventListener(r,n,!1)},off:function(e,n){var r=o[e];r&&t.removeEventListener(r,n,!1)},raw:r};r?(Object.defineProperties(i,{isFullscreen:{get:function(){return Boolean(t[r.fullscreenElement])}},element:{enumerable:!0,get:function(){return t[r.fullscreenElement]}},isEnabled:{enumerable:!0,get:function(){return Boolean(t[r.fullscreenEnabled])}}}),n?e.exports=i:window.screenfull=i):n?e.exports={isEnabled:!1}:window.screenfull={isEnabled:!1}}()}));nt.isEnabled;var rt=f((function(e,t){window,e.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=8)}([function(e,t,n){e.exports=n(2)},function(e,t,n){var r=n(4);"string"==typeof r&&(r=[[e.i,r,""]]);var o={hmr:!0,transform:void 0,insertInto:void 0};n(6)(r,o),r.locals&&(e.exports=r.locals)},function(e,t,n){
|
|
8
8
|
/** @license React v16.5.2
|
|
9
9
|
* react.production.min.js
|
|
10
10
|
*
|
|
@@ -19,4 +19,4 @@ object-assign
|
|
|
19
19
|
(c) Sindre Sorhus
|
|
20
20
|
@license MIT
|
|
21
21
|
*/
|
|
22
|
-
var r=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,a,l=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(e),c=1;c<arguments.length;c++){for(var u in n=Object(arguments[c]))o.call(n,u)&&(l[u]=n[u]);if(r){a=r(n);for(var s=0;s<a.length;s++)i.call(n,a[s])&&(l[a[s]]=n[a[s]])}}return l}},function(e,t,n){(e.exports=n(5)(!1)).push([e.i,".font-size-changer {\n display: inline-block; }\n .font-size-changer .font-size-changer-buttons > div {\n float: left;\n border: 1px solid;\n text-align: center;\n line-height: 40px;\n -webkit-box-sizing: border-box;\n /* Safari/Chrome, other WebKit */\n -moz-box-sizing: border-box;\n /* Firefox, other Gecko */\n box-sizing: border-box;\n -webkit-touch-callout: none;\n /* iOS Safari */\n -webkit-user-select: none;\n /* Safari */\n -khtml-user-select: none;\n /* Konqueror HTML */\n -moz-user-select: none;\n /* Firefox */\n -ms-user-select: none;\n /* Internet Explorer/Edge */\n user-select: none;\n /* Non-prefixed version, currently\r\n supported by Chrome and Opera */ }\n",""])},function(e,t){e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n=function(e,t){var n=e[1]||"",r=e[3];if(!r)return n;if(t&&"function"==typeof btoa){var o=function(e){return"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(e))))+" */"}(r),i=r.sources.map((function(e){return"/*# sourceURL="+r.sourceRoot+e+" */"}));return[n].concat(i).concat([o]).join("\n")}return[n].join("\n")}(t,e);return t[2]?"@media "+t[2]+"{"+n+"}":n})).join("")},t.i=function(e,n){"string"==typeof e&&(e=[[null,e,""]]);for(var r={},o=0;o<this.length;o++){var i=this[o][0];"number"==typeof i&&(r[i]=!0)}for(o=0;o<e.length;o++){var a=e[o];"number"==typeof a[0]&&r[a[0]]||(n&&!a[2]?a[2]=n:n&&(a[2]="("+a[2]+") and ("+n+")"),t.push(a))}},t}},function(e,t,n){var r={},o=function(e){var t;return function(){return void 0===t&&(t=e.apply(this,arguments)),t}}((function(){return window&&document&&document.all&&!window.atob})),i=function(e){var t={};return function(e,n){if("function"==typeof e)return e();if(void 0===t[e]){var r=function(e,t){return t?t.querySelector(e):document.querySelector(e)}.call(this,e,n);if(window.HTMLIFrameElement&&r instanceof window.HTMLIFrameElement)try{r=r.contentDocument.head}catch(e){r=null}t[e]=r}return t[e]}}(),a=null,l=0,c=[],u=n(7);function s(e,t){for(var n=0;n<e.length;n++){var o=e[n],i=r[o.id];if(i){i.refs++;for(var a=0;a<i.parts.length;a++)i.parts[a](o.parts[a]);for(;a<o.parts.length;a++)i.parts.push(y(o.parts[a],t))}else{var l=[];for(a=0;a<o.parts.length;a++)l.push(y(o.parts[a],t));r[o.id]={id:o.id,refs:1,parts:l}}}}function f(e,t){for(var n=[],r={},o=0;o<e.length;o++){var i=e[o],a=t.base?i[0]+t.base:i[0],l={css:i[1],media:i[2],sourceMap:i[3]};r[a]?r[a].parts.push(l):n.push(r[a]={id:a,parts:[l]})}return n}function h(e,t){var n=i(e.insertInto);if(!n)throw new Error("Couldn't find a style target. This probably means that the value for the 'insertInto' parameter is invalid.");var r=c[c.length-1];if("top"===e.insertAt)r?r.nextSibling?n.insertBefore(t,r.nextSibling):n.appendChild(t):n.insertBefore(t,n.firstChild),c.push(t);else if("bottom"===e.insertAt)n.appendChild(t);else{if("object"!=typeof e.insertAt||!e.insertAt.before)throw new Error("[Style Loader]\n\n Invalid value for parameter 'insertAt' ('options.insertAt') found.\n Must be 'top', 'bottom', or Object.\n (https://github.com/webpack-contrib/style-loader#insertat)\n");var o=i(e.insertAt.before,n);n.insertBefore(t,o)}}function d(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e);var t=c.indexOf(e);t>=0&&c.splice(t,1)}function p(e){var t=document.createElement("style");if(void 0===e.attrs.type&&(e.attrs.type="text/css"),void 0===e.attrs.nonce){var r=n.nc;r&&(e.attrs.nonce=r)}return m(t,e.attrs),h(e,t),t}function m(e,t){Object.keys(t).forEach((function(n){e.setAttribute(n,t[n])}))}function y(e,t){var n,r,o,i;if(t.transform&&e.css){if(!(i=t.transform(e.css)))return function(){};e.css=i}if(t.singleton){var c=l++;n=a||(a=p(t)),r=v.bind(null,n,c,!1),o=v.bind(null,n,c,!0)}else e.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=function(e){var t=document.createElement("link");return void 0===e.attrs.type&&(e.attrs.type="text/css"),e.attrs.rel="stylesheet",m(t,e.attrs),h(e,t),t}(t),r=function(e,t,n){var r=n.css,o=n.sourceMap,i=void 0===t.convertToAbsoluteUrls&&o;(t.convertToAbsoluteUrls||i)&&(r=u(r)),o&&(r+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(o))))+" */");var a=new Blob([r],{type:"text/css"}),l=e.href;e.href=URL.createObjectURL(a),l&&URL.revokeObjectURL(l)}.bind(null,n,t),o=function(){d(n),n.href&&URL.revokeObjectURL(n.href)}):(n=p(t),r=function(e,t){var n=t.css,r=t.media;if(r&&e.setAttribute("media",r),e.styleSheet)e.styleSheet.cssText=n;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}.bind(null,n),o=function(){d(n)});return r(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;r(e=t)}else o()}}e.exports=function(e,t){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");(t=t||{}).attrs="object"==typeof t.attrs?t.attrs:{},t.singleton||"boolean"==typeof t.singleton||(t.singleton=o()),t.insertInto||(t.insertInto="head"),t.insertAt||(t.insertAt="bottom");var n=f(e,t);return s(n,t),function(e){for(var o=[],i=0;i<n.length;i++){var a=n[i];(l=r[a.id]).refs--,o.push(l)}for(e&&s(f(e,t),t),i=0;i<o.length;i++){var l;if(0===(l=o[i]).refs){for(var c=0;c<l.parts.length;c++)l.parts[c]();delete r[l.id]}}}};var g=function(){var e=[];return function(t,n){return e[t]=n,e.filter(Boolean).join("\n")}}();function v(e,t,n,r){var o=n?"":r.css;if(e.styleSheet)e.styleSheet.cssText=g(t,o);else{var i=document.createTextNode(o),a=e.childNodes;a[t]&&e.removeChild(a[t]),a.length?e.insertBefore(i,a[t]):e.appendChild(i)}}},function(e,t){e.exports=function(e){var t="undefined"!=typeof window&&window.location;if(!t)throw new Error("fixUrls requires window.location");if(!e||"string"!=typeof e)return e;var n=t.protocol+"//"+t.host,r=n+t.pathname.replace(/\/[^\/]*$/,"/");return e.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi,(function(e,t){var o,i=t.trim().replace(/^"(.*)"$/,(function(e,t){return t})).replace(/^'(.*)'$/,(function(e,t){return t}));return/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/|\s*$)/i.test(i)?e:(o=0===i.indexOf("//")?i:0===i.indexOf("/")?n+i:r+i.replace(/^\.\//,""),"url("+JSON.stringify(o)+")")}))}},function(e,t,n){n.r(t);var r=n(0),o=n.n(r),i="up",a="down";function l(e){return(l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function c(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)}}function u(e){return(u=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function s(e,t){return(s=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function f(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var h=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(e,t){return!t||"object"!==l(t)&&"function"!=typeof t?f(e):t}(this,u(t).call(this))).onClick=e.onClick.bind(f(f(e))),e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&s(e,t)}(t,r.Component),function(e,t,n){t&&c(e.prototype,t),n&&c(e,n)}(t,[{key:"onClick",value:function(){(0,this.props.onClick)()}},{key:"getDefaultButtonContent",value:function(){var e=this.props.direction===i?"36px":"20px";return o.a.createElement("span",{style:{fontSize:e}},"A")}},{key:"render",value:function(){var e=this.props.direction,t=this.props,n=t.style,r=void 0===n?{}:n,i=t.customButton,a=void 0===i?this.getDefaultButtonContent():i;return o.a.createElement("div",{className:"font-size-".concat(e),style:r,onClick:this.onClick},a)}}]),t}();function d(e){return(d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function p(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)}}function m(e){return(m=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function y(e,t){return(y=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function g(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}n(1);var v=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(e,t){return!t||"object"!==d(t)&&"function"!=typeof t?g(e):t}(this,m(t).call(this))).handleChange.bind(g(g(e))),e.setChangeDirection.bind(g(g(e))),e.state={options:{stepSize:2,range:3},changeCount:0,changeDirection:null},e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&y(e,t)}(t,r.Component),function(e,t,n){t&&p(e.prototype,t),n&&p(e,n)}(t,[{key:"handleChange",value:function(e,t,n){this.props.onChange&&(0,this.props.onChange)(e,t,n)}},{key:"componentDidMount",value:function(){var e=this.props.options;this.setState({options:Object.assign({},this.state.options,e)})}},{key:"getFontSizeDetails",value:function(e){var t=parseFloat(e);return{value:t,unit:e.toString().replace(t.toString(),"")}}},{key:"applyFontSize",value:function(e){var t=this.state.options.stepSize,n=this.state.changeDirection===i?t:-1*t,r=window.getComputedStyle(e,null).getPropertyValue("font-size"),o=this.getFontSizeDetails(r).value,a=o+n;e.style.fontSize=a+"px",a!==o&&this.handleChange(e,a,o)}},{key:"iterateChildren",value:function(e){if(this.applyFontSize(e),e.children&&0!==e.children.length){var t=!0,n=!1,r=void 0;try{for(var o,i=e.children[Symbol.iterator]();!(t=(o=i.next()).done);t=!0){var a=o.value;this.iterateChildren(a)}}catch(e){n=!0,r=e}finally{try{t||null==i.return||i.return()}finally{if(n)throw r}}}}},{key:"updateChangeCount",value:function(){var e=this.state,t=e.changeCount,n=e.changeDirection===i?1:-1;this.setState({changeCount:t+n})}},{key:"iterateElementsAndApplyFontSizeChange",value:function(){var e=this.props.targets,t=!0,n=!1,r=void 0;try{for(var o,i=e[Symbol.iterator]();!(t=(o=i.next()).done);t=!0){var a=o.value,l=document.querySelectorAll(a),c=!0,u=!1,s=void 0;try{for(var f,h=l[Symbol.iterator]();!(c=(f=h.next()).done);c=!0){var d=f.value;this.iterateChildren(d)}}catch(e){u=!0,s=e}finally{try{c||null==h.return||h.return()}finally{if(u)throw s}}}}catch(e){n=!0,r=e}finally{try{t||null==i.return||i.return()}finally{if(n)throw r}}this.updateChangeCount()}},{key:"validateChangePerRange",value:function(){var e=this.state,t=e.changeCount,n=e.changeDirection,r=this.state.options.range,o=!0;return n===i&&t>=r&&(o=!1),n===a&&t<=-1*r&&(o=!1),o}},{key:"initFontSizeChange",value:function(){this.validateChangePerRange()&&this.iterateElementsAndApplyFontSizeChange()}},{key:"setChangeDirection",value:function(e,t){var n=e?i:a;this.setState({changeDirection:n},t)}},{key:"onFontSizeUp",value:function(){this.setChangeDirection(!0,this.initFontSizeChange)}},{key:"onFontSizeDown",value:function(){this.setChangeDirection(!1,this.initFontSizeChange)}},{key:"getFontSizeChangerStyle",value:function(e){var t=e.style,n=void 0===t?{}:t,r=e.verticalAlignment,o=void 0!==r&&r,i=e.buttonsMargin,a=void 0===i?4:i,l=this.getFontSizeDetails(n.width||"40px"),c=this.getFontSizeDetails(n.height||"40px");return{width:(!1===o?2*l.value+a:l.value)+l.unit,height:(!1===o?c.value:2*c.value+a)+c.unit}}},{key:"getFontSizeChangerButtonStyle",value:function(e,t){var n=t.style,r=void 0===n?{}:n,o=t.verticalAlignment,l=void 0!==o&&o,c=t.reverseOrder,u=void 0!==c&&c,s=t.buttonsMargin,f=void 0===s?4:s,h=this.getFontSizeDetails(r.width||"40px"),d=this.getFontSizeDetails(r.height||"40px"),p={width:h.value+h.unit,height:d.value+d.unit},m=f+(!1===l?h.unit:d.unit);return(e===i&&!1===u||e===a&&!0===u)&&(!1===l?p.marginRight=m:p.marginBottom=m),Object.assign({},r,p)}},{key:"render",value:function(){var e=this.props.customButtons,t=void 0===e?{}:e,n=t.up,r=t.down,l=this.getFontSizeChangerStyle(t),c=this.getFontSizeChangerButtonStyle(i,t),u=this.getFontSizeChangerButtonStyle(a,t);return o.a.createElement("div",{className:"font-size-changer",style:l},o.a.createElement("div",{className:"font-size-changer-buttons",style:l},o.a.createElement(h,{direction:i,customButton:n,onClick:this.onFontSizeUp.bind(this),style:c}),o.a.createElement(h,{direction:a,customButton:r,onClick:this.onFontSizeDown.bind(this),style:u})))}}]),t}();t.default=v}])})),at=h(it),lt=f((function(e){!function(t){var n=function(){return{escape:function(e){return e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1")},parseExtension:e,mimeType:function(t){var n=e(t).toLowerCase();return(r="application/font-woff",o="image/jpeg",{woff:r,woff2:r,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:o,jpeg:o,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml"})[n]||"";var r,o},dataAsUrl:function(e,t){return"data:"+t+";base64,"+e},isDataUrl:function(e){return-1!==e.search(/^(data:)/)},canvasToBlob:function(e){return e.toBlob?new Promise((function(t){e.toBlob(t)})):function(e){return new Promise((function(t){for(var n=window.atob(e.toDataURL().split(",")[1]),r=n.length,o=new Uint8Array(r),i=0;i<r;i++)o[i]=n.charCodeAt(i);t(new Blob([o],{type:"image/png"}))}))}(e)},resolveUrl:function(e,t){var n=document.implementation.createHTMLDocument(),r=n.createElement("base");n.head.appendChild(r);var o=n.createElement("a");return n.body.appendChild(o),r.href=t,o.href=e,o.href},getAndEncode:function(e){var t=3e4;l.impl.options.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+(new Date).getTime());return new Promise((function(n){var r,o=new XMLHttpRequest;if(o.onreadystatechange=a,o.ontimeout=c,o.responseType="blob",o.timeout=t,o.open("GET",e,!0),o.send(),l.impl.options.imagePlaceholder){var i=l.impl.options.imagePlaceholder.split(/,/);i&&i[1]&&(r=i[1])}function a(){if(4===o.readyState)if(200===o.status){var t=new FileReader;t.onloadend=function(){var e=t.result.split(/,/)[1];n(e)},t.readAsDataURL(o.response)}else r?n(r):u("cannot fetch resource: "+e+", status: "+o.status)}function c(){r?n(r):u("timeout of "+t+"ms occured while fetching resource: "+e)}function u(e){console.error(e),n("")}}))},uid:function(){var e=0;return function(){return"u"+t()+e++;function t(){return("0000"+(Math.random()*Math.pow(36,4)<<0).toString(36)).slice(-4)}}}(),delay:function(e){return function(t){return new Promise((function(n){setTimeout((function(){n(t)}),e)}))}},asArray:function(e){for(var t=[],n=e.length,r=0;r<n;r++)t.push(e[r]);return t},escapeXhtml:function(e){return e.replace(/#/g,"%23").replace(/\n/g,"%0A")},makeImage:function(e){return new Promise((function(t,n){var r=new Image;r.onload=function(){t(r)},r.onerror=n,r.src=e}))},width:function(e){var n=t(e,"border-left-width"),r=t(e,"border-right-width");return e.scrollWidth+n+r},height:function(e){var n=t(e,"border-top-width"),r=t(e,"border-bottom-width");return e.scrollHeight+n+r}};function e(e){var t=/\.([^\.\/]*?)$/g.exec(e);return t?t[1]:""}function t(e,t){var n=window.getComputedStyle(e).getPropertyValue(t);return parseFloat(n.replace("px",""))}}(),r=function(){var e=/url\(['"]?([^'"]+?)['"]?\)/g;return{inlineAll:function(e,n,i){return a()?Promise.resolve(e):Promise.resolve(e).then(r).then((function(t){var r=Promise.resolve(e);return t.forEach((function(e){r=r.then((function(t){return o(t,e,n,i)}))})),r}));function a(){return!t(e)}},shouldProcess:t,impl:{readUrls:r,inline:o}};function t(t){return-1!==t.search(e)}function r(t){for(var r,o=[];null!==(r=e.exec(t));)o.push(r[1]);return o.filter((function(e){return!n.isDataUrl(e)}))}function o(e,t,r,o){return Promise.resolve(t).then((function(e){return r?n.resolveUrl(e,r):e})).then(o||n.getAndEncode).then((function(e){return n.dataAsUrl(e,n.mimeType(t))})).then((function(r){return e.replace(function(e){return new RegExp("(url\\(['\"]?)("+n.escape(e)+")(['\"]?\\))","g")}(t),"$1"+r+"$3")}))}}(),o=function(){return{resolveAll:function(){return e().then((function(e){return Promise.all(e.map((function(e){return e.resolve()})))})).then((function(e){return e.join("\n")}))},impl:{readAll:e}};function e(){return Promise.resolve(n.asArray(document.styleSheets)).then((function(e){var t=[];return e.forEach((function(e){try{n.asArray(e.cssRules||[]).forEach(t.push.bind(t))}catch(t){console.log("Error while reading CSS rules from "+e.href,t.toString())}})),t})).then((function(e){return e.filter((function(e){return e.type===CSSRule.FONT_FACE_RULE})).filter((function(e){return r.shouldProcess(e.style.getPropertyValue("src"))}))})).then((function(t){return t.map(e)}));function e(e){return{resolve:function(){var t=(e.parentStyleSheet||{}).href;return r.inlineAll(e.cssText,t)},src:function(){return e.style.getPropertyValue("src")}}}}}(),i=function(){return{inlineAll:function t(o){return o instanceof Element?i(o).then((function(){return o instanceof HTMLImageElement?e(o).inline():Promise.all(n.asArray(o.childNodes).map((function(e){return t(e)})))})):Promise.resolve(o);function i(e){var t=e.style.getPropertyValue("background");return t?r.inlineAll(t).then((function(t){e.style.setProperty("background",t,e.style.getPropertyPriority("background"))})).then((function(){return e})):Promise.resolve(e)}},impl:{newImage:e}};function e(e){return{inline:function(t){return n.isDataUrl(e.src)?Promise.resolve():Promise.resolve(e.src).then(t||n.getAndEncode).then((function(t){return n.dataAsUrl(t,n.mimeType(e.src))})).then((function(t){return new Promise((function(n,r){e.onload=n,e.onerror=r,e.src=t}))}))}}}}(),a={imagePlaceholder:void 0,cacheBust:!1},l={toSvg:c,toPng:function(e,t){return u(e,t||{}).then((function(e){return e.toDataURL()}))},toJpeg:function(e,t){return u(e,t=t||{}).then((function(e){return e.toDataURL("image/jpeg",t.quality||1)}))},toBlob:function(e,t){return u(e,t||{}).then(n.canvasToBlob)},toPixelData:function(e,t){return u(e,t||{}).then((function(t){return t.getContext("2d").getImageData(0,0,n.width(e),n.height(e)).data}))},impl:{fontFaces:o,images:i,util:n,inliner:r,options:{}}};function c(e,t){return function(e){void 0===e.imagePlaceholder?l.impl.options.imagePlaceholder=a.imagePlaceholder:l.impl.options.imagePlaceholder=e.imagePlaceholder;void 0===e.cacheBust?l.impl.options.cacheBust=a.cacheBust:l.impl.options.cacheBust=e.cacheBust}(t=t||{}),Promise.resolve(e).then((function(e){return s(e,t.filter,!0)})).then(f).then(h).then((function(e){t.bgcolor&&(e.style.backgroundColor=t.bgcolor);t.width&&(e.style.width=t.width+"px");t.height&&(e.style.height=t.height+"px");t.style&&Object.keys(t.style).forEach((function(n){e.style[n]=t.style[n]}));return e})).then((function(r){return function(e,t,r){return Promise.resolve(e).then((function(e){return e.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),(new XMLSerializer).serializeToString(e)})).then(n.escapeXhtml).then((function(e){return'<foreignObject x="0" y="0" width="100%" height="100%">'+e+"</foreignObject>"})).then((function(e){return'<svg xmlns="http://www.w3.org/2000/svg" width="'+t+'" height="'+r+'">'+e+"</svg>"})).then((function(e){return"data:image/svg+xml;charset=utf-8,"+e}))}(r,t.width||n.width(e),t.height||n.height(e))}))}function u(e,t){return c(e,t).then(n.makeImage).then(n.delay(100)).then((function(r){var o=function(e){var r=document.createElement("canvas");if(r.width=t.width||n.width(e),r.height=t.height||n.height(e),t.bgcolor){var o=r.getContext("2d");o.fillStyle=t.bgcolor,o.fillRect(0,0,r.width,r.height)}return r}(e);return o.getContext("2d").drawImage(r,0,0),o}))}function s(e,t,r){return r||!t||t(e)?Promise.resolve(e).then((function(e){return e instanceof HTMLCanvasElement?n.makeImage(e.toDataURL()):e.cloneNode(!1)})).then((function(r){return function(e,t,r){var o=e.childNodes;return 0===o.length?Promise.resolve(t):i(t,n.asArray(o),r).then((function(){return t}));function i(e,t,n){var r=Promise.resolve();return t.forEach((function(t){r=r.then((function(){return s(t,n)})).then((function(t){t&&e.appendChild(t)}))})),r}}(e,r,t)})).then((function(t){return function(e,t){return t instanceof Element?Promise.resolve().then(r).then(o).then(i).then(a).then((function(){return t})):t;function r(){function r(e,t){function r(e,t){n.asArray(e).forEach((function(n){t.setProperty(n,e.getPropertyValue(n),e.getPropertyPriority(n))}))}e.cssText?t.cssText=e.cssText:r(e,t)}r(window.getComputedStyle(e),t.style)}function o(){function r(r){var o=window.getComputedStyle(e,r),i=o.getPropertyValue("content");if(""!==i&&"none"!==i){var a=n.uid();t.className=t.className+" "+a;var l=document.createElement("style");l.appendChild(c(a,r,o)),t.appendChild(l)}function c(e,t,r){var o="."+e+":"+t,i=r.cssText?a(r):l(r);return document.createTextNode(o+"{"+i+"}");function a(e){var t=e.getPropertyValue("content");return e.cssText+" content: "+t+";"}function l(e){return n.asArray(e).map(t).join("; ")+";";function t(t){return t+": "+e.getPropertyValue(t)+(e.getPropertyPriority(t)?" !important":"")}}}}[":before",":after"].forEach((function(e){r(e)}))}function i(){e instanceof HTMLTextAreaElement&&(t.innerHTML=e.value),e instanceof HTMLInputElement&&t.setAttribute("value",e.value)}function a(){t instanceof SVGElement&&(t.setAttribute("xmlns","http://www.w3.org/2000/svg"),t instanceof SVGRectElement&&["width","height"].forEach((function(e){var n=t.getAttribute(e);n&&t.style.setProperty(e,n)})))}}(e,t)})):Promise.resolve()}function f(e){return o.resolveAll().then((function(t){var n=document.createElement("style");return e.appendChild(n),n.appendChild(document.createTextNode(t)),e}))}function h(e){return i.inlineAll(e).then((function(){return e}))}e.exports=l}()}));const ct=require("jszip"),ut=require("react-file-download"),st=e=>{const{nodes:t,links:n}=e,r=(n||[]).map((e=>{let{source:n,target:r}=e;return{source:t[n].name,target:t[r].name,sourceType:t[n].type,targetType:t[r].type}})),{nodeMap:o,nodesTsv:i}=(e=>{let t=1e7;const n={};let r=!1;e.forEach((e=>{let{source:o,target:i,sourceType:a,targetType:l}=e;""!==i&&""!==o&&(Object.keys(n).indexOf(o)<0?(""!==a?(r=!0,n[o]={ID:t,WEIGHT:1,NODE_TYPE:a}):n[o]={ID:t,WEIGHT:1},t+=1):n[o].WEIGHT+=1,Object.keys(n).indexOf(i)<0?(""!==l?(r=!0,n[i]={ID:t,WEIGHT:1,NODE_TYPE:l}):n[i]={ID:t,WEIGHT:1},t+=1):n[i].WEIGHT+=1)}));let o=r?"ID\tLABEL\tWEIGHT\tNODE_TYPE\r\n":"ID\tLABEL\tWEIGHT\r\n";return Object.keys(n).forEach((e=>{const t=n[e].ID,i=n[e].WEIGHT,a=r?n[e].NODE_TYPE:"";o+=r?`${t}\t${e}\t${i}\t${a}\r\n`:`${t}\t${e}\t${i}\r\n`})),{nodeMap:n,nodesTsv:o}})(r),a=((e,t)=>{let n="SOURCE\tTARGET\tWEIGHT\tTYPE\r\n";return e.forEach((e=>{let{source:r,target:o}=e;if(""===o||""===r)return;const i=t[r].ID,a=t[o].ID;n+=`${i}\t${a}\t1\tUndirected\r\n`})),n})(r,o),l=new ct;l.file("Node_Table.tsv",i),l.file("Edge_Table.tsv",a),l.generateAsync({type:"blob"}).then((e=>{ut(e,"Gephi_generated_by_NMTL.zip")}))},ft=e=>{let t,{data:n,dataType:r,extType:o="xlsx"}=e;if("sna"===r)t=O(n);else t=n;A(`\ufeff${j(t)}`,`output.${o}`)};ft.chronologyConvert=e=>{const t=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";const[t,n]=e.split('<span class="tooltip">');return{before:t,after:n}};return(e||[]).map((e=>{let{start_date:{day:n,month:r,year:o},display_date:i,text:{headline:a,text:l}}=e;return{"日期":`${o||""}/${r||""}/${n||""}`,"名稱":(i||"").replace("<span>","").replace("</span>",""),"描述":(a||"").replaceAll(/(<([^>]+)>)/gi,""),"類型":t(l).before,"註(資料集名稱)":t(l).after.replaceAll("\n","").replaceAll("\t","").replace("註","").replace("資料來源:","").replaceAll(/(<([^>]+)>)/gi,"")}}))},ft.mapConvert=e=>(e||[]).map((e=>{let{title:t,author:n,publisher:r,locations:o,posX:i,posY:a}=e;return{"名稱(書名/文章名)":t||"","作者":n||"","出版者":r||"","地點(作品描述區域)":o||"","經度":i||"","緯度":a||""}})),ft.mapLgConvert=e=>(e||[]).map((e=>{let{title:t,locationOfFormation:n,workLocations:r,createPosX:o,createPosY:i,activePosX:a,activePosY:l}=e;return{"組織名稱":t||"","創立地點":n,"創立地點經度":o||"","創立地點緯度":i||"","活動地點":r||"","活動地點經度":a||"","活動地點緯度":l||""}})),ft.worksBarChart=e=>(e||[]).map((e=>{let{date:t,year:n,title:r,keywords:o,authors:i,genreName:a}=e;return{"出版年/發表年":t||n||"","名稱(書名/文章名)":r||"","作者":(i||[]).map((e=>{let{author:t}=e;return t})).join(","),"關鍵字":(o||"").replaceAll("\n",""),"文學分類":a||""}})),ft.worksSlider=e=>(e||[]).map((e=>{let{title:t,author:n,date:r}=e;return{"名稱(書名/文章名)":t||"","作者":n||"","出版日期/發表日期":r||""}}));const ht=e=>{let{fill:n="#825c0d"}=e;return t.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:32,height:32,viewBox:"0 0 32 32"},t.createElement("defs",null,t.createElement("clipPath",{id:"a"},t.createElement("path",{"data-name":"Rectangle 125",style:{fill:"#fff"},d:"M0 0h32v32H0z"}))),t.createElement("g",{style:{clipPath:"url(#a)"}},t.createElement("path",{d:"M-960 600h-20v-10h4v2h-2v6h16v-6h-2v-2h4zm-5.06-12.608-1.348-1.454-2.592 2.427V580h-2v8.365l-2.544-2.427-1.362 1.454 4.948 4.671z",transform:"translate(986 -574)",style:{fill:n},"data-name":"Mask Group 42"})))},dt=t=>{let{fill:n="#825c0d"}=t;return e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:32,height:32,viewBox:"0 0 32 32"},e.createElement("defs",null,e.createElement("clipPath",{id:"clip-path"},e.createElement("path",{id:"Rectangle_128","data-name":"Rectangle 128",style:{fill:"#fff"},d:"M0 0h32v32H0z"})),e.createElement("style",null,`\n .cls-3{fill:${n}}\n `)),e.createElement("g",{id:"Mask_Group_47","data-name":"Mask Group 47",style:{clipPath:"url(#clip-path)"}},e.createElement("g",{id:"Group_3633","data-name":"Group 3633",transform:"translate(6 6)"},e.createElement("path",{id:"Path_181","data-name":"Path 181",className:"cls-3",d:"M514 371v-2h-2v2h-2v2h2v2h2v-2h2v-2z",transform:"translate(-495 -369)"}),e.createElement("g",{id:"Group_3632","data-name":"Group 3632",transform:"translate(0 2)"},e.createElement("path",{id:"Path_182","data-name":"Path 182",className:"cls-3",d:"M502.276 371h3.447L512 389h-3.164l-1.595-5.129h-6.586L499.036 389H496zm-.926 10.649h5.17l-.746-2.419c-.643-1.953-1.209-3.956-1.776-5.983h-.128a126.193 126.193 0 0 1-1.748 5.983z",transform:"translate(-496 -371)"})))))},pt=t=>{let{fill:n="#825c0d"}=t;return e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:32,height:32,viewBox:"0 0 32 32"},e.createElement("defs",null,e.createElement("clipPath",{id:"clip-path"},e.createElement("path",{id:"Rectangle_129","data-name":"Rectangle 129",style:{fill:"#fff"},d:"M0 0h32v32H0z"})),e.createElement("style",null,`\n .cls-3{fill:${n}}\n `)),e.createElement("g",{id:"Mask_Group_48","data-name":"Mask Group 48",style:{clipPath:"url(#clip-path)"}},e.createElement("g",{id:"Group_3635","data-name":"Group 3635",transform:"translate(6 8)"},e.createElement("path",{id:"Path_181","data-name":"Path 181",className:"cls-3",d:"M510 371v2h6v-2z",transform:"translate(-495 -371)"}),e.createElement("g",{id:"Group_3632","data-name":"Group 3632"},e.createElement("path",{id:"Path_182","data-name":"Path 182",className:"cls-3",d:"M502.276 371h3.447L512 389h-3.164l-1.595-5.129h-6.586L499.036 389H496zm-.926 10.649h5.17l-.746-2.419c-.643-1.953-1.209-3.956-1.776-5.983h-.128a126.193 126.193 0 0 1-1.748 5.983z",transform:"translate(-496 -371)"})))))},mt=t=>{let{fill:n="#825c0d"}=t;return e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:32,height:32,viewBox:"0 0 32 32"},e.createElement("defs",null,e.createElement("clipPath",{id:"clip-path"},e.createElement("path",{id:"Rectangle_124","data-name":"Rectangle 124",style:{fill:"#fff"},d:"M0 0h32v32H0z"})),e.createElement("style",null,`\n .cls-3{fill:${n}}\n `)),e.createElement("g",{id:"Mask_Group_46","data-name":"Mask Group 46",style:{clipPath:"url(#clip-path)"}},e.createElement("g",{id:"Group_3629","data-name":"Group 3629",transform:"translate(6 6.001)"},e.createElement("path",{id:"Path_176","data-name":"Path 176",className:"cls-3",d:"M-721 1949.376h2.5v-3.755h3.755v-2.5H-721z",transform:"translate(721.003 -1943.118)"}),e.createElement("path",{id:"Path_177","data-name":"Path 177",className:"cls-3",d:"M-721 1960.376h6.258v-2.5h-3.758v-3.755h-2.5z",transform:"translate(721.003 -1940.376)"}),e.createElement("path",{id:"Path_178","data-name":"Path 178",className:"cls-3",d:"M-703.744 1943.118H-710v2.5h3.755v3.755h2.5z",transform:"translate(723.744 -1943.118)"}),e.createElement("path",{id:"Path_179","data-name":"Path 179",className:"cls-3",d:"M-703.744 1960.376v-6.259h-2.5v3.755H-710v2.5z",transform:"translate(723.744 -1940.376)"}))))};M(".extraTools {\n width: 100%;\n display: inline-flex;\n justify-content: flex-end;\n align-items: center;\n gap: 1rem;\n padding: 0px 20px;\n padding-top: 12px; }\n .extraTools__share button {\n display: flex;\n justify-content: center;\n align-items: center; }\n .extraTools__download {\n cursor: pointer; }\n .extraTools__download-icon {\n display: flex;\n justify-content: center;\n align-items: center; }\n .extraTools__fullscreenBtn {\n cursor: pointer;\n padding-top: 0; }\n .extraTools__fullscreenBtn-icon {\n display: flex;\n justify-content: center;\n align-items: center; }\n .extraTools__fontsize {\n display: flex;\n justify-content: center;\n align-items: center; }\n .extraTools .font-size-changer,\n .extraTools .font-size-changer-buttons,\n .extraTools .font-size-up,\n .extraTools .font-size-down,\n .extraTools .tooltip {\n display: flex;\n justify-content: center;\n align-items: center; }\n .extraTools .font-size-up {\n width: 32px !important;\n cursor: pointer;\n margin-right: 16px !important; }\n .extraTools .font-size-down {\n cursor: pointer;\n width: 32px !important; }\n .extraTools .fullscreenExit {\n text-align: right;\n cursor: pointer;\n border: 0; }\n .extraTools #download-menu .MuiMenuItem-root {\n color: #4e3a16;\n width: auto;\n overflow: hidden;\n font-size: 1rem;\n box-sizing: border-box;\n min-height: 48px;\n font-weight: 400;\n line-height: 1;\n padding-top: 1rem;\n white-space: initial;\n border-bottom: 0;\n letter-spacing: 0.00938em;\n padding-bottom: 1rem; }\n");const yt=e=>{let{className:n}=e;return t.createElement("div",{className:s("extraTools__share",n)},t.createElement(rt,{url:document.location.href},t.createElement(Ze,{size:32,round:!0})))};yt.defaultProps={className:void 0},yt.propTypes={className:u.string};const gt=e=>{let{className:n,intl:o,exclude:i,iconColor:a,data:l,dataType:c,domToImageId:u,DownloadExcel:f}=e;const[h,d]=r(null),p=[{key:"downloadImage",onClick:()=>(e=>{let{id:t,fileName:n="image",quality:r=.95}=e;const o=document.getElementById(t),i=document.getElementById("yaxis"),a=document.getElementById("barChart__block");i&&i.setAttribute("transform","translate(0, 0 )"),lt.toPng(o,{quality:r}).then((e=>{const t=document.createElement("a");t.download=`${n}.png`,t.href=e,t.click(),i&&a&&(i.setAttribute("transform","translate(0, 0 )"),i.setAttribute("transform",`translate(${a.scrollLeft}, 0)`))})).catch((e=>{console.error("oops, something went wrong!",e)}))})({id:u}),label:o?"knowledge.writersAndWorksSNA.download.img":"下載圖片"},{key:"downloadGephi",onClick:()=>st(l),label:o?"knowledge.writersAndWorksSNA.download.gephi":"下載Gephi"},{key:"downloadTsv",onClick:()=>ft({data:l,dataType:c,extType:"tsv"}),label:o?"knowledge.writersAndWorksSNA.download.tsv":"下載Tsv"},{key:"downloadXls",label:o?"knowledge.writersAndWorksSNA.download.xls":"下載Excel"}];return t.createElement("div",{className:s("extraTools__download",n)},t.createElement(N,{title:o?o.formatMessage({id:"knowledge.writersAndWorksSNA.download"}):"下載",placement:"bottom"},t.createElement("div",{className:"extraTools__download-icon",onClick:e=>d(e.currentTarget)},t.createElement(ht,{fill:a}))),t.createElement(C,{id:"download-menu",anchorEl:h,keepMounted:!0,open:Boolean(h),onClose:()=>d(null)},p.map((e=>{let{key:n,onClick:r,label:a}=e;return c=n,!((i||[]).filter((e=>e===c)).length>0)&&((e,n)=>"downloadXls"===e&&f?t.createElement(f,{key:e,element:n,data:l}):n)(n,t.createElement(z,{key:n,onClick:r},o?o.formatMessage({id:a}):a));var c}))))};gt.defaultProps={className:void 0,intl:void 0,exclude:void 0,data:null,dataType:void 0,iconColor:"#825c0d",domToImageId:"network-graph",DownloadExcel:void 0},gt.propTypes={className:u.string,intl:u.objectOf(u.any),exclude:u.arrayOf(u.string),data:u.oneOfType([u.array,u.object]),dataType:u.string,iconColor:u.string,domToImageId:u.string,DownloadExcel:u.oneOfType([u.node,u.func])};const vt=e=>{let{className:n,intl:r,iconColor:o,fullscreenDomId:i}=e;return t.createElement("div",{className:s("extraTools__fullscreenBtn",n)},t.createElement(N,{title:r?r.formatMessage({id:"knowledge.writersAndWorksSNA.fullscreen"}):"全螢幕模式",placement:"bottom"},t.createElement("div",{className:"extraTools__fullscreenBtn-icon",onClick:()=>{ot.isEnabled&&i&&ot.request(document.getElementById(i))}},t.createElement(mt,{fill:o}))))};vt.defaultProps={className:void 0,intl:void 0,iconColor:"#825c0d",fullscreenDomId:void 0},vt.propTypes={className:u.string,intl:u.objectOf(u.any),iconColor:u.string,fullscreenDomId:u.string};const wt=e=>{let{className:n,intl:r,iconColor:o,FontSizeTargets:i,FontSizeOptions:a}=e;return t.createElement("div",{className:s("extraTools__fontsize",n)},t.createElement(at,{targets:i,options:a,customButtons:{up:t.createElement(N,{title:r?r.formatMessage({id:"knowledge.writersAndWorksSNA.big"}):"字級放大",placement:"bottom"},t.createElement(dt,{fill:o})),down:t.createElement(N,{title:r?r.formatMessage({id:"knowledge.writersAndWorksSNA.small"}):"字級縮小",placement:"bottom"},t.createElement(pt,{fill:o})),style:{border:"none"},buttonsMargin:10}}))};wt.defaultProps={className:void 0,intl:void 0,iconColor:"#825c0d",FontSizeTargets:["#network-graph svg g text"],FontSizeOptions:{stepSize:2,range:1}},wt.propTypes={className:u.string,intl:u.objectOf(u.any),iconColor:u.string,FontSizeTargets:u.arrayOf(u.string),FontSizeOptions:u.objectOf(u.any)};const bt=e=>{let{className:n,intl:r,exclude:o,data:i,dataType:a,iconColor:l,domToImageId:c,FontSizeTargets:u,FontSizeOptions:f,DownloadExcel:h,fullscreenDomId:d}=e;const p={intl:r,exclude:o,data:i,dataType:a,iconColor:l,domToImageId:c,FontSizeTargets:u,FontSizeOptions:f,DownloadExcel:h,fullscreenDomId:d},m=[{keys:["share"],Component:yt},{keys:["downloadImage","downloadGephi","downloadTsv","downloadXls"],Component:gt},{keys:["fullscreen"],Component:vt},{keys:["fontSizeChanger"],Component:wt}];return t.createElement("div",{className:s("extraTools",n)},m.map((e=>{let{keys:n,Component:r}=e;return!(e=>(o||[]).filter((t=>e.some((e=>e===t)))).length===e.length)(n)&&t.createElement(r,S({key:n[0]},p))})))};bt.ShareButton=yt,bt.DownloadMenu=gt,bt.FullscreenBtn=vt,bt.FontSizeChanger=wt,bt.defaultProps={className:void 0,intl:void 0,exclude:["downloadGephi"],data:null,dataType:void 0,iconColor:"#825c0d",domToImageId:"network-graph",FontSizeTargets:["#network-graph svg g text"],FontSizeOptions:{stepSize:2,range:1},DownloadExcel:void 0,fullscreenDomId:void 0},bt.propTypes={className:u.string,intl:u.objectOf(u.any),exclude:u.arrayOf(u.string),data:u.oneOfType([u.array,u.object]),dataType:u.string,iconColor:u.string,domToImageId:u.string,FontSizeTargets:u.arrayOf(u.string),FontSizeOptions:u.objectOf(u.any),DownloadExcel:u.oneOfType([u.node,u.func]),fullscreenDomId:u.string};var xt=f((function(e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=F(t),o=(0,D(I).default)(r.createElement("path",{d:"M12 5V1L7 6l5 5V7c3.31 0 6 2.69 6 6s-2.69 6-6 6-6-2.69-6-6H4c0 4.42 3.58 8 8 8s8-3.58 8-8-3.58-8-8-8z"}),"Replay");n.default=o})),_t=h(xt);const Et=()=>t.createElement("div",{id:"resetBtn"},t.createElement(T,{title:"回到原來位置與大小"},t.createElement(P,null,t.createElement(_t,null))));Et.propTypes={};M(".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 .SNA #network-graph svg {\n width: 100%;\n height: 100%; }\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 kt=function(e){var l,c=e.className,u=e.intl,f=e.exclude,h=e.distance,S=e.SNAData,C=e.handleClickNodeGoto,z=e.DownloadExcel,T=e.width,P=e.height,N=e.fontColor,O=e.backgroundColor,A=e.iconColor;if(!S||0===S.nodes.length)return t.createElement("div",{className:"noData"},u?u.formatMessage({id:"common.noData"}):"暫無資料");var j=function(){var e=r(!1),t=e[0],l=e[1],c=o(null);i((function(){var e=function(){l(Fe.fullscreenElement===c.current)};return Fe.addEventListener("fullscreenchange",e),function(){return Fe.removeEventListener("fullscreenchange",e)}}),[]);var u=a((function(){return Fe.fullscreenElement?Fe.exitFullscreen().then((function(){return Fe.requestFullscreen(c.current)})):c.current?Fe.requestFullscreen(c.current):void 0}),[]),s=a((function(){return Fe.fullscreenElement===c.current?Fe.exitFullscreen():Promise.resolve()}),[]);return n((function(){return{active:t,enter:u,exit:s,node:c}}),[t,u,s])}(),M=n((function(){return j.active?screen.width:screen.width>1050?T:screen.width-80}),[j.active,screen.width]),F=n((function(){return j.active?screen.height:screen.width>1050?P:screen.height-300}),[j.active,screen.width]),D=function(e){return function(){var e,t,n,r,o=X,i=Y,a=K,l=J,c={},u=g("start","drag","end"),s=0,f=0;function h(e){e.on("mousedown.drag",p).filter(l).on("touchstart.drag",b).on("touchmove.drag",x).on("touchend.drag touchcancel.drag",_).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function p(){if(!r&&o.apply(this,arguments)){var a=E("mouse",i.apply(this,arguments),L,this,arguments);a&&(y(d.view).on("mousemove.drag",m,!0).on("mouseup.drag",w,!0),$(d.view),U(),n=!1,e=d.clientX,t=d.clientY,a("start"))}}function m(){if(G(),!n){var r=d.clientX-e,o=d.clientY-t;n=r*r+o*o>f}c.mouse("drag")}function w(){y(d.view).on("mousemove.drag mouseup.drag",null),H(d.view,n),G(),c.mouse("end")}function b(){if(o.apply(this,arguments)){var e,t,n=d.changedTouches,r=i.apply(this,arguments),a=n.length;for(e=0;e<a;++e)(t=E(n[e].identifier,r,q,this,arguments))&&(U(),t("start"))}}function x(){var e,t,n=d.changedTouches,r=n.length;for(e=0;e<r;++e)(t=c[n[e].identifier])&&(G(),t("drag"))}function _(){var e,t,n=d.changedTouches,o=n.length;for(r&&clearTimeout(r),r=setTimeout((function(){r=null}),500),e=0;e<o;++e)(t=c[n[e].identifier])&&(U(),t("end"))}function E(e,t,n,r,o){var i,l,f,p=n(t,e),m=u.copy();if(v(new V(h,"beforestart",i,e,s,p[0],p[1],0,0,m),(function(){return null!=(d.subject=i=a.apply(r,o))&&(l=i.x-p[0]||0,f=i.y-p[1]||0,!0)})))return function a(u){var d,y=p;switch(u){case"start":c[e]=a,d=s++;break;case"end":delete c[e],--s;case"drag":p=n(t,e),d=s}v(new V(h,u,i,e,d,p[0]+l,p[1]+f,p[0]-y[0],p[1]-y[1],m),m.apply,m,[u,r,o])}}return h.filter=function(e){return arguments.length?(o="function"==typeof e?e:W(!!e),h):o},h.container=function(e){return arguments.length?(i="function"==typeof e?e:W(e),h):i},h.subject=function(e){return arguments.length?(a="function"==typeof e?e:W(e),h):a},h.touchable=function(e){return arguments.length?(l="function"==typeof e?e:W(!!e),h):l},h.on=function(){var e=u.on.apply(u,arguments);return e===u?h:e},h.clickDistance=function(e){return arguments.length?(f=(e=+e)*e,h):Math.sqrt(f)},h}().on("start",(function(t){d.active||e.alphaTarget(.3).restart(),t.fx=t.x,t.fy=t.y})).on("drag",(function(e){e.fx=d.x>M-10||d.x<20?e.x:d.x,e.fy=d.y>F-10||d.y<20?e.y:d.y}))},I=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)},B=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=k(ve),i=e.links.map((function(e){return Object.create(e)})),a=e.nodes.map((function(e){return Object.create(e)})),c=function(e){var t,n=1,r=.001,o=1-Math.pow(r,1/300),i=0,a=.6,l=w(),c=b(s),u=g("tick","end");function s(){f(),u.call("tick",t),n<r&&(c.stop(),u.call("end",t))}function f(r){var c,u,s=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)})),c=0;c<s;++c)null==(u=e[c]).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 h(){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*ge;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=[]),h(),t={tick:f,restart:function(){return c.restart(s),t},stop:function(){return c.stop(),t},nodes:function(n){return arguments.length?(e=n,h(),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,c,u=0,s=e.length;for(null==r?r=1/0:r*=r,u=0;u<s;++u)(a=(o=t-(l=e[u]).x)*o+(i=n-l.y)*i)<r&&(c=l,r=a);return c},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])},c=te(30),u=1;function s(r){for(var o=0,a=e.length;o<u;++o)for(var l,c,s,f,h,d,p,m=0;m<a;++m)c=(l=e[m]).source,f=(s=l.target).x+s.vx-c.x-c.vx||ne(),h=s.y+s.vy-c.y-c.vy||ne(),f*=d=((d=Math.sqrt(f*f+h*h))-n[m])/d*r*t[m],h*=d,s.vx-=f*(p=i[m]),s.vy-=h*p,c.vx+=f*(p=1-p),c.vy+=h*p}function f(){if(r){var l,c,u=r.length,s=e.length,f=w(r,a);for(l=0,o=new Array(u);l<s;++l)(c=e[l]).index=l,"object"!=typeof c.source&&(c.source=pe(f,c.source)),"object"!=typeof c.target&&(c.target=pe(f,c.target)),o[c.source.index]=(o[c.source.index]||0)+1,o[c.target.index]=(o[c.target.index]||0)+1;for(l=0,i=new Array(s);l<s;++l)c=e[l],i[l]=o[c.source.index]/(o[c.source.index]+o[c.target.index]);t=new Array(s),h(),n=new Array(s),d()}}function h(){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]=+c(e[t],t,e)}return null==e&&(e=[]),s.initialize=function(e){r=e,f()},s.links=function(t){return arguments.length?(e=t,f(),s):e},s.id=function(e){return arguments.length?(a=e,s):a},s.iterations=function(e){return arguments.length?(u=+e,s):u},s.strength=function(e){return arguments.length?(l="function"==typeof e?e:te(+e),h(),s):l},s.distance=function(e){return arguments.length?(c="function"==typeof e?e:te(+e),d(),s):c},s}(i).id((function(e){return e.index})).distance(50)).force("charge",function(){var e,t,n,r,o=te(-30),i=1,a=1/0,l=.81;function c(r){var o,i=e.length,a=le(e,me,ye).visitAfter(s);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 s(e){var t,n,o,i,a,l=0,c=0;if(e.length){for(o=i=a=0;a<4;++a)(t=e[a])&&(n=Math.abs(t.value))&&(l+=t.value,c+=n,o+=n*t.x,i+=n*t.y);e.x=o/c,e.y=i/c}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,c,u){if(!e.value)return!0;var s=e.x-t.x,f=e.y-t.y,h=u-o,d=s*s+f*f;if(h*h/l<d)return d<a&&(0===s&&(d+=(s=ne())*s),0===f&&(d+=(f=ne())*f),d<i&&(d=Math.sqrt(i*d)),t.vx+=s*e.value*n/d,t.vy+=f*e.value*n/d),!0;if(!(e.length||d>=a)){(e.data!==t||e.next)&&(0===s&&(d+=(s=ne())*s),0===f&&(d+=(f=ne())*f),d<i&&(d=Math.sqrt(i*d)));do{e.data!==t&&(h=r[e.data.index]*n/d,t.vx+=s*h,t.vy+=f*h)}while(e=e.next)}}return c.initialize=function(t){e=t,u()},c.strength=function(e){return arguments.length?(o="function"==typeof e?e:te(+e),u(),c):o},c.distanceMin=function(e){return arguments.length?(i=e*e,c):Math.sqrt(i)},c.distanceMax=function(e){return arguments.length?(a=e*e,c):Math.sqrt(a)},c.theta=function(e){return arguments.length?(l=e*e,c):Math.sqrt(l)},c}().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}(M/2,F/2)).force("collide",function(e){var t,n,r=1,o=1;function i(){for(var e,i,l,c,u,s,f,h=t.length,d=0;d<o;++d)for(i=le(t,fe,he).visitAfter(a),e=0;e<h;++e)l=t[e],s=n[l.index],f=s*s,c=l.x+l.vx,u=l.y+l.vy,i.visit(p);function p(e,t,n,o,i){var a=e.data,h=e.r,d=s+h;if(!a)return t>c+d||o<c-d||n>u+d||i<u-d;if(a.index>l.index){var p=c-a.x-a.vx,m=u-a.y-a.vy,y=p*p+m*m;y<d*d&&(0===p&&(y+=(p=ne())*p),0===m&&(y+=(m=ne())*m),y=(d-(y=Math.sqrt(y)))/y*r,l.vx+=(p*=y)*(d=(h*=h)/(f+h)),l.vy+=(m*=y)*d,a.vx-=p*(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=te(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:te(+t),l(),i):e},i}().radius((function(){return 13.5})).strength(1).iterations(10)).force("x",function(e){var t,n,r,o=te(.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=te(null==e?0:+e)),i.initialize=function(e){t=e,a()},i.strength=function(e){return arguments.length?(o="function"==typeof e?e:te(+e),a(),i):o},i.x=function(t){return arguments.length?(e="function"==typeof t?t:te(+t),a(),i):e},i}(M/2)).force("y",function(e){var t,n,r,o=te(.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=te(null==e?0:+e)),i.initialize=function(e){t=e,a()},i.strength=function(e){return arguments.length?(o="function"==typeof e?e:te(+e),a(),i):o},i.y=function(t){return arguments.length?(e="function"==typeof t?t:te(+t),a(),i):e},i}(F/2)).force("radial",function(e,t,n){var r,o,i,a=te(.1);function l(e){for(var a=0,l=r.length;a<l;++a){var c=r[a],u=c.x-t||1e-6,s=c.y-n||1e-6,f=Math.sqrt(u*u+s*s),h=(i[a]-f)*o[a]*e/f;c.vx+=u*h,c.vy+=s*h}}function c(){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=te(+e)),null==t&&(t=0),null==n&&(n=0),l.initialize=function(e){r=e,c()},l.strength=function(e){return arguments.length?(a="function"==typeof e?e:te(+e),c(),l):a},l.radius=function(t){return arguments.length?(e="function"==typeof t?t:te(+t),c(),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,M/1.5,F/1.5)),s=y("#sna-graph").append("svg").attr("viewBox",[0,0,M,F]).style("background-color",O);s.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=s.append("g");var f=function(){var e,t,n=Ee,r=ke,o=Te,i=Ce,a=ze,l=[0,1/0],c=[[-1/0,-1/0],[1/0,1/0]],u=250,s=ee,f=g("start","zoom","end"),h=500,p=0;function m(e){e.property("__zoom",Se).on("wheel.zoom",T).on("mousedown.zoom",P).on("dblclick.zoom",N).filter(a).on("touchstart.zoom",O).on("touchmove.zoom",A).on("touchend.zoom touchcancel.zoom",j).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function w(e,t){return(t=Math.max(l[0],Math.min(l[1],t)))===e.k?e:new x(t,e.x,e.y)}function b(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 x(e.k,r,o)}function k(e){return[(+e[0][0]+ +e[1][0])/2,(+e[0][1]+ +e[1][1])/2]}function S(e,t,n){e.on("start.zoom",(function(){C(this,arguments).start()})).on("interrupt.zoom end.zoom",(function(){C(this,arguments).end()})).tween("zoom",(function(){var e=this,o=arguments,i=C(e,o),a=r.apply(e,o),l=null==n?k(a):"function"==typeof n?n.apply(e,o):n,c=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,h=s(u.invert(l).concat(c/u.k),f.invert(l).concat(c/f.k));return function(e){if(1===e)e=f;else{var t=h(e),n=c/t[2];e=new x(n,l[0]-t[0]*n,l[1]-t[1]*n)}i.zoom(null,e)}}))}function C(e,t,n){return!n&&e.__zooming||new z(e,t)}function z(e,t){this.that=e,this.args=t,this.active=0,this.extent=r.apply(e,t),this.taps=0}function T(){if(n.apply(this,arguments)){var e=C(this,arguments),t=this.__zoom,r=Math.max(l[0],Math.min(l[1],t.k*Math.pow(2,i.apply(this,arguments)))),a=L(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)],E(this),e.start()}_e(),e.wheel=setTimeout(u,150),e.zoom("mouse",o(b(w(t,r),e.mouse[0],e.mouse[1]),e.extent,c))}function u(){e.wheel=null,e.end()}}function P(){if(!t&&n.apply(this,arguments)){var e=C(this,arguments,!0),r=y(d.view).on("mousemove.zoom",u,!0).on("mouseup.zoom",s,!0),i=L(this),a=d.clientX,l=d.clientY;$(d.view),xe(),e.mouse=[i,this.__zoom.invert(i)],E(this),e.start()}function u(){if(_e(),!e.moved){var t=d.clientX-a,n=d.clientY-l;e.moved=t*t+n*n>p}e.zoom("mouse",o(b(e.that.__zoom,e.mouse[0]=L(e.that),e.mouse[1]),e.extent,c))}function s(){r.on("mousemove.zoom mouseup.zoom",null),H(d.view,e.moved),_e(),e.end()}}function N(){if(n.apply(this,arguments)){var e=this.__zoom,t=L(this),i=e.invert(t),a=e.k*(d.shiftKey?.5:2),l=o(b(w(e,a),t,i),r.apply(this,arguments),c);_e(),u>0?y(this).transition().duration(u).call(S,l,t):y(this).call(m.transform,l)}}function O(){if(n.apply(this,arguments)){var t,r,o,i,a=d.touches,l=a.length,c=C(this,arguments,d.changedTouches.length===l);for(xe(),r=0;r<l;++r)i=[i=q(this,a,(o=a[r]).identifier),this.__zoom.invert(i),o.identifier],c.touch0?c.touch1||c.touch0[2]===i[2]||(c.touch1=i,c.taps=0):(c.touch0=i,t=!0,c.taps=1+!!e);e&&(e=clearTimeout(e)),t&&(c.taps<2&&(e=setTimeout((function(){e=null}),h)),E(this),c.start())}}function A(){if(this.__zooming){var t,n,r,i,a=C(this,arguments),l=d.changedTouches,u=l.length;for(_e(),e&&(e=clearTimeout(e)),a.taps=0,t=0;t<u;++t)r=q(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 s=a.touch0[0],f=a.touch0[1],h=a.touch1[0],p=a.touch1[1],m=(m=h[0]-s[0])*m+(m=h[1]-s[1])*m,y=(y=p[0]-f[0])*y+(y=p[1]-f[1])*y;n=w(n,Math.sqrt(m/y)),r=[(s[0]+h[0])/2,(s[1]+h[1])/2],i=[(f[0]+p[0])/2,(f[1]+p[1])/2]}else{if(!a.touch0)return;r=a.touch0[0],i=a.touch0[1]}a.zoom("touch",o(b(n,r,i),a.extent,c))}}function j(){if(this.__zooming){var e,n,r=C(this,arguments),o=d.changedTouches,i=o.length;for(xe(),t&&clearTimeout(t),t=setTimeout((function(){t=null}),h),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=y(this).on("dblclick.zoom");a&&a.apply(this,arguments)}}}return m.transform=function(e,t,n){var r=e.selection?e.selection():e;r.property("__zoom",Se),e!==r?S(e,t,n):r.interrupt().each((function(){C(this,arguments).start().zoom(null,"function"==typeof t?t.apply(this,arguments):t).end()}))},m.scaleBy=function(e,t,n){m.scaleTo(e,(function(){return this.__zoom.k*("function"==typeof t?t.apply(this,arguments):t)}),n)},m.scaleTo=function(e,t,n){m.transform(e,(function(){var e=r.apply(this,arguments),i=this.__zoom,a=null==n?k(e):"function"==typeof n?n.apply(this,arguments):n,l=i.invert(a),u="function"==typeof t?t.apply(this,arguments):t;return o(b(w(i,u),a,l),e,c)}),n)},m.translateBy=function(e,t,n){m.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),c)}))},m.translateTo=function(e,t,n,i){m.transform(e,(function(){var e=r.apply(this,arguments),a=this.__zoom,l=null==i?k(e):"function"==typeof i?i.apply(this,arguments):i;return o(_.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,c)}),i)},z.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){v(new be(m,e,this.that.__zoom),f.apply,f,[e,this.that,this.args])}},m.wheelDelta=function(e){return arguments.length?(i="function"==typeof e?e:we(+e),m):i},m.filter=function(e){return arguments.length?(n="function"==typeof e?e:we(!!e),m):n},m.touchable=function(e){return arguments.length?(a="function"==typeof e?e:we(!!e),m):a},m.extent=function(e){return arguments.length?(r="function"==typeof e?e:we([[+e[0][0],+e[0][1]],[+e[1][0],+e[1][1]]]),m):r},m.scaleExtent=function(e){return arguments.length?(l[0]=+e[0],l[1]=+e[1],m):[l[0],l[1]]},m.translateExtent=function(e){return arguments.length?(c[0][0]=+e[0][0],c[1][0]=+e[1][0],c[0][1]=+e[0][1],c[1][1]=+e[1][1],m):[[c[0][0],c[0][1]],[c[1][0],c[1][1]]]},m.constrain=function(e){return arguments.length?(o=e,m):o},m.duration=function(e){return arguments.length?(u=+e,m):u},m.interpolate=function(e){return arguments.length?(s=e,m):s},m.on=function(){var e=f.on.apply(f,arguments);return e===f?m:e},m.clickDistance=function(e){return arguments.length?(p=(e=+e)*e,m):Math.sqrt(p)},m}().scaleExtent([.5,20]).extent([[0,0],[M,F]]).on("zoom",(function(){l.attr("transform",d.transform)}));f(s),y("#resetBtn").on("click",(function(){var e;(e="#sna-graph","string"==typeof e?new p([document.querySelectorAll(e)],[document.documentElement]):new p([null==e?[]:e],m)).transition().duration(750).call(f.transform,_)}));var h=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})),S=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?C({name:e.name,id:e.id,type:e.type}):null})).call(D(c));S.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 z=l.append("g").selectAll("text").data(a).join("text").attr("fill",N).attr("text-anchor","middle").attr("key",(function(e){return e.type})).style("color","#fff").style("font-size","14px").text((function(e){return e.name})),T=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})),c.on("tick",(function(){a.forEach((function(e){e.x>=M-20&&(e.x=M-20),e.y>=F-20&&(e.y=F-20),e.x<=20&&(e.x=20),e.y<=20&&(e.y=20)})),h.attr("d",(function(e){return I(e.source,e.target,30)})),S.attr("cx",(function(e){return e.x})).attr("cy",(function(e){return e.y})),z.attr("x",(function(e){return e.x})).attr("y",(function(e){return e.y-t})),T.attr("d",(function(e){return I(e.source,e.target,30)}))}))};return i((function(){if(S&&S.nodes&&S.nodes.length>0){var e=document.getElementById("sna-graph");e&&e.childNodes[0]&&e.removeChild(e.childNodes[0]),B(S)}}),[S,j.active]),t.createElement("div",{className:s("SNA",{"SNA--smallSize":h<200},c),style:{contentWidth:M,contentHeight:F,backgroundColor:O}},t.createElement(bt,{intl:u,data:S,iconColor:A,domToImageId:"sna-graph",FontSizeTargets:["#sna-graph svg g text"],exclude:f,DownloadExcel:z,fullscreenDomId:"sna-graph"}),t.createElement(Et,null),t.createElement("div",{id:"sna-graph"}))};kt.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},kt.propTypes={className:u.string,intl:u.objectOf(u.any),width:u.number,height:u.number,distance:u.number,SNAData:u.objectOf(u.any),fontColor:u.string,backgroundColor:u.string,iconColor:u.string,exclude:u.arrayOf(u.string),handleClickNodeGoto:u.func,DownloadExcel:u.oneOfType([u.node,u.func])};export{kt as default};
|
|
22
|
+
var r=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,a,l=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(e),c=1;c<arguments.length;c++){for(var u in n=Object(arguments[c]))o.call(n,u)&&(l[u]=n[u]);if(r){a=r(n);for(var s=0;s<a.length;s++)i.call(n,a[s])&&(l[a[s]]=n[a[s]])}}return l}},function(e,t,n){(e.exports=n(5)(!1)).push([e.i,".font-size-changer {\n display: inline-block; }\n .font-size-changer .font-size-changer-buttons > div {\n float: left;\n border: 1px solid;\n text-align: center;\n line-height: 40px;\n -webkit-box-sizing: border-box;\n /* Safari/Chrome, other WebKit */\n -moz-box-sizing: border-box;\n /* Firefox, other Gecko */\n box-sizing: border-box;\n -webkit-touch-callout: none;\n /* iOS Safari */\n -webkit-user-select: none;\n /* Safari */\n -khtml-user-select: none;\n /* Konqueror HTML */\n -moz-user-select: none;\n /* Firefox */\n -ms-user-select: none;\n /* Internet Explorer/Edge */\n user-select: none;\n /* Non-prefixed version, currently\r\n supported by Chrome and Opera */ }\n",""])},function(e,t){e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n=function(e,t){var n=e[1]||"",r=e[3];if(!r)return n;if(t&&"function"==typeof btoa){var o=function(e){return"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(e))))+" */"}(r),i=r.sources.map((function(e){return"/*# sourceURL="+r.sourceRoot+e+" */"}));return[n].concat(i).concat([o]).join("\n")}return[n].join("\n")}(t,e);return t[2]?"@media "+t[2]+"{"+n+"}":n})).join("")},t.i=function(e,n){"string"==typeof e&&(e=[[null,e,""]]);for(var r={},o=0;o<this.length;o++){var i=this[o][0];"number"==typeof i&&(r[i]=!0)}for(o=0;o<e.length;o++){var a=e[o];"number"==typeof a[0]&&r[a[0]]||(n&&!a[2]?a[2]=n:n&&(a[2]="("+a[2]+") and ("+n+")"),t.push(a))}},t}},function(e,t,n){var r={},o=function(e){var t;return function(){return void 0===t&&(t=e.apply(this,arguments)),t}}((function(){return window&&document&&document.all&&!window.atob})),i=function(e){var t={};return function(e,n){if("function"==typeof e)return e();if(void 0===t[e]){var r=function(e,t){return t?t.querySelector(e):document.querySelector(e)}.call(this,e,n);if(window.HTMLIFrameElement&&r instanceof window.HTMLIFrameElement)try{r=r.contentDocument.head}catch(e){r=null}t[e]=r}return t[e]}}(),a=null,l=0,c=[],u=n(7);function s(e,t){for(var n=0;n<e.length;n++){var o=e[n],i=r[o.id];if(i){i.refs++;for(var a=0;a<i.parts.length;a++)i.parts[a](o.parts[a]);for(;a<o.parts.length;a++)i.parts.push(y(o.parts[a],t))}else{var l=[];for(a=0;a<o.parts.length;a++)l.push(y(o.parts[a],t));r[o.id]={id:o.id,refs:1,parts:l}}}}function f(e,t){for(var n=[],r={},o=0;o<e.length;o++){var i=e[o],a=t.base?i[0]+t.base:i[0],l={css:i[1],media:i[2],sourceMap:i[3]};r[a]?r[a].parts.push(l):n.push(r[a]={id:a,parts:[l]})}return n}function h(e,t){var n=i(e.insertInto);if(!n)throw new Error("Couldn't find a style target. This probably means that the value for the 'insertInto' parameter is invalid.");var r=c[c.length-1];if("top"===e.insertAt)r?r.nextSibling?n.insertBefore(t,r.nextSibling):n.appendChild(t):n.insertBefore(t,n.firstChild),c.push(t);else if("bottom"===e.insertAt)n.appendChild(t);else{if("object"!=typeof e.insertAt||!e.insertAt.before)throw new Error("[Style Loader]\n\n Invalid value for parameter 'insertAt' ('options.insertAt') found.\n Must be 'top', 'bottom', or Object.\n (https://github.com/webpack-contrib/style-loader#insertat)\n");var o=i(e.insertAt.before,n);n.insertBefore(t,o)}}function d(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e);var t=c.indexOf(e);t>=0&&c.splice(t,1)}function p(e){var t=document.createElement("style");if(void 0===e.attrs.type&&(e.attrs.type="text/css"),void 0===e.attrs.nonce){var r=n.nc;r&&(e.attrs.nonce=r)}return m(t,e.attrs),h(e,t),t}function m(e,t){Object.keys(t).forEach((function(n){e.setAttribute(n,t[n])}))}function y(e,t){var n,r,o,i;if(t.transform&&e.css){if(!(i=t.transform(e.css)))return function(){};e.css=i}if(t.singleton){var c=l++;n=a||(a=p(t)),r=v.bind(null,n,c,!1),o=v.bind(null,n,c,!0)}else e.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=function(e){var t=document.createElement("link");return void 0===e.attrs.type&&(e.attrs.type="text/css"),e.attrs.rel="stylesheet",m(t,e.attrs),h(e,t),t}(t),r=function(e,t,n){var r=n.css,o=n.sourceMap,i=void 0===t.convertToAbsoluteUrls&&o;(t.convertToAbsoluteUrls||i)&&(r=u(r)),o&&(r+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(o))))+" */");var a=new Blob([r],{type:"text/css"}),l=e.href;e.href=URL.createObjectURL(a),l&&URL.revokeObjectURL(l)}.bind(null,n,t),o=function(){d(n),n.href&&URL.revokeObjectURL(n.href)}):(n=p(t),r=function(e,t){var n=t.css,r=t.media;if(r&&e.setAttribute("media",r),e.styleSheet)e.styleSheet.cssText=n;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}.bind(null,n),o=function(){d(n)});return r(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;r(e=t)}else o()}}e.exports=function(e,t){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");(t=t||{}).attrs="object"==typeof t.attrs?t.attrs:{},t.singleton||"boolean"==typeof t.singleton||(t.singleton=o()),t.insertInto||(t.insertInto="head"),t.insertAt||(t.insertAt="bottom");var n=f(e,t);return s(n,t),function(e){for(var o=[],i=0;i<n.length;i++){var a=n[i];(l=r[a.id]).refs--,o.push(l)}for(e&&s(f(e,t),t),i=0;i<o.length;i++){var l;if(0===(l=o[i]).refs){for(var c=0;c<l.parts.length;c++)l.parts[c]();delete r[l.id]}}}};var g=function(){var e=[];return function(t,n){return e[t]=n,e.filter(Boolean).join("\n")}}();function v(e,t,n,r){var o=n?"":r.css;if(e.styleSheet)e.styleSheet.cssText=g(t,o);else{var i=document.createTextNode(o),a=e.childNodes;a[t]&&e.removeChild(a[t]),a.length?e.insertBefore(i,a[t]):e.appendChild(i)}}},function(e,t){e.exports=function(e){var t="undefined"!=typeof window&&window.location;if(!t)throw new Error("fixUrls requires window.location");if(!e||"string"!=typeof e)return e;var n=t.protocol+"//"+t.host,r=n+t.pathname.replace(/\/[^\/]*$/,"/");return e.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi,(function(e,t){var o,i=t.trim().replace(/^"(.*)"$/,(function(e,t){return t})).replace(/^'(.*)'$/,(function(e,t){return t}));return/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/|\s*$)/i.test(i)?e:(o=0===i.indexOf("//")?i:0===i.indexOf("/")?n+i:r+i.replace(/^\.\//,""),"url("+JSON.stringify(o)+")")}))}},function(e,t,n){n.r(t);var r=n(0),o=n.n(r),i="up",a="down";function l(e){return(l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function c(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)}}function u(e){return(u=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function s(e,t){return(s=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function f(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var h=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(e,t){return!t||"object"!==l(t)&&"function"!=typeof t?f(e):t}(this,u(t).call(this))).onClick=e.onClick.bind(f(f(e))),e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&s(e,t)}(t,r.Component),function(e,t,n){t&&c(e.prototype,t),n&&c(e,n)}(t,[{key:"onClick",value:function(){(0,this.props.onClick)()}},{key:"getDefaultButtonContent",value:function(){var e=this.props.direction===i?"36px":"20px";return o.a.createElement("span",{style:{fontSize:e}},"A")}},{key:"render",value:function(){var e=this.props.direction,t=this.props,n=t.style,r=void 0===n?{}:n,i=t.customButton,a=void 0===i?this.getDefaultButtonContent():i;return o.a.createElement("div",{className:"font-size-".concat(e),style:r,onClick:this.onClick},a)}}]),t}();function d(e){return(d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function p(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)}}function m(e){return(m=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function y(e,t){return(y=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function g(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}n(1);var v=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(e,t){return!t||"object"!==d(t)&&"function"!=typeof t?g(e):t}(this,m(t).call(this))).handleChange.bind(g(g(e))),e.setChangeDirection.bind(g(g(e))),e.state={options:{stepSize:2,range:3},changeCount:0,changeDirection:null},e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&y(e,t)}(t,r.Component),function(e,t,n){t&&p(e.prototype,t),n&&p(e,n)}(t,[{key:"handleChange",value:function(e,t,n){this.props.onChange&&(0,this.props.onChange)(e,t,n)}},{key:"componentDidMount",value:function(){var e=this.props.options;this.setState({options:Object.assign({},this.state.options,e)})}},{key:"getFontSizeDetails",value:function(e){var t=parseFloat(e);return{value:t,unit:e.toString().replace(t.toString(),"")}}},{key:"applyFontSize",value:function(e){var t=this.state.options.stepSize,n=this.state.changeDirection===i?t:-1*t,r=window.getComputedStyle(e,null).getPropertyValue("font-size"),o=this.getFontSizeDetails(r).value,a=o+n;e.style.fontSize=a+"px",a!==o&&this.handleChange(e,a,o)}},{key:"iterateChildren",value:function(e){if(this.applyFontSize(e),e.children&&0!==e.children.length){var t=!0,n=!1,r=void 0;try{for(var o,i=e.children[Symbol.iterator]();!(t=(o=i.next()).done);t=!0){var a=o.value;this.iterateChildren(a)}}catch(e){n=!0,r=e}finally{try{t||null==i.return||i.return()}finally{if(n)throw r}}}}},{key:"updateChangeCount",value:function(){var e=this.state,t=e.changeCount,n=e.changeDirection===i?1:-1;this.setState({changeCount:t+n})}},{key:"iterateElementsAndApplyFontSizeChange",value:function(){var e=this.props.targets,t=!0,n=!1,r=void 0;try{for(var o,i=e[Symbol.iterator]();!(t=(o=i.next()).done);t=!0){var a=o.value,l=document.querySelectorAll(a),c=!0,u=!1,s=void 0;try{for(var f,h=l[Symbol.iterator]();!(c=(f=h.next()).done);c=!0){var d=f.value;this.iterateChildren(d)}}catch(e){u=!0,s=e}finally{try{c||null==h.return||h.return()}finally{if(u)throw s}}}}catch(e){n=!0,r=e}finally{try{t||null==i.return||i.return()}finally{if(n)throw r}}this.updateChangeCount()}},{key:"validateChangePerRange",value:function(){var e=this.state,t=e.changeCount,n=e.changeDirection,r=this.state.options.range,o=!0;return n===i&&t>=r&&(o=!1),n===a&&t<=-1*r&&(o=!1),o}},{key:"initFontSizeChange",value:function(){this.validateChangePerRange()&&this.iterateElementsAndApplyFontSizeChange()}},{key:"setChangeDirection",value:function(e,t){var n=e?i:a;this.setState({changeDirection:n},t)}},{key:"onFontSizeUp",value:function(){this.setChangeDirection(!0,this.initFontSizeChange)}},{key:"onFontSizeDown",value:function(){this.setChangeDirection(!1,this.initFontSizeChange)}},{key:"getFontSizeChangerStyle",value:function(e){var t=e.style,n=void 0===t?{}:t,r=e.verticalAlignment,o=void 0!==r&&r,i=e.buttonsMargin,a=void 0===i?4:i,l=this.getFontSizeDetails(n.width||"40px"),c=this.getFontSizeDetails(n.height||"40px");return{width:(!1===o?2*l.value+a:l.value)+l.unit,height:(!1===o?c.value:2*c.value+a)+c.unit}}},{key:"getFontSizeChangerButtonStyle",value:function(e,t){var n=t.style,r=void 0===n?{}:n,o=t.verticalAlignment,l=void 0!==o&&o,c=t.reverseOrder,u=void 0!==c&&c,s=t.buttonsMargin,f=void 0===s?4:s,h=this.getFontSizeDetails(r.width||"40px"),d=this.getFontSizeDetails(r.height||"40px"),p={width:h.value+h.unit,height:d.value+d.unit},m=f+(!1===l?h.unit:d.unit);return(e===i&&!1===u||e===a&&!0===u)&&(!1===l?p.marginRight=m:p.marginBottom=m),Object.assign({},r,p)}},{key:"render",value:function(){var e=this.props.customButtons,t=void 0===e?{}:e,n=t.up,r=t.down,l=this.getFontSizeChangerStyle(t),c=this.getFontSizeChangerButtonStyle(i,t),u=this.getFontSizeChangerButtonStyle(a,t);return o.a.createElement("div",{className:"font-size-changer",style:l},o.a.createElement("div",{className:"font-size-changer-buttons",style:l},o.a.createElement(h,{direction:i,customButton:n,onClick:this.onFontSizeUp.bind(this),style:c}),o.a.createElement(h,{direction:a,customButton:r,onClick:this.onFontSizeDown.bind(this),style:u})))}}]),t}();t.default=v}])})),ot=h(rt),it=f((function(e){!function(t){var n=function(){return{escape:function(e){return e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1")},parseExtension:e,mimeType:function(t){var n=e(t).toLowerCase();return(r="application/font-woff",o="image/jpeg",{woff:r,woff2:r,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:o,jpeg:o,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml"})[n]||"";var r,o},dataAsUrl:function(e,t){return"data:"+t+";base64,"+e},isDataUrl:function(e){return-1!==e.search(/^(data:)/)},canvasToBlob:function(e){return e.toBlob?new Promise((function(t){e.toBlob(t)})):function(e){return new Promise((function(t){for(var n=window.atob(e.toDataURL().split(",")[1]),r=n.length,o=new Uint8Array(r),i=0;i<r;i++)o[i]=n.charCodeAt(i);t(new Blob([o],{type:"image/png"}))}))}(e)},resolveUrl:function(e,t){var n=document.implementation.createHTMLDocument(),r=n.createElement("base");n.head.appendChild(r);var o=n.createElement("a");return n.body.appendChild(o),r.href=t,o.href=e,o.href},getAndEncode:function(e){var t=3e4;l.impl.options.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+(new Date).getTime());return new Promise((function(n){var r,o=new XMLHttpRequest;if(o.onreadystatechange=a,o.ontimeout=c,o.responseType="blob",o.timeout=t,o.open("GET",e,!0),o.send(),l.impl.options.imagePlaceholder){var i=l.impl.options.imagePlaceholder.split(/,/);i&&i[1]&&(r=i[1])}function a(){if(4===o.readyState)if(200===o.status){var t=new FileReader;t.onloadend=function(){var e=t.result.split(/,/)[1];n(e)},t.readAsDataURL(o.response)}else r?n(r):u("cannot fetch resource: "+e+", status: "+o.status)}function c(){r?n(r):u("timeout of "+t+"ms occured while fetching resource: "+e)}function u(e){console.error(e),n("")}}))},uid:function(){var e=0;return function(){return"u"+t()+e++;function t(){return("0000"+(Math.random()*Math.pow(36,4)<<0).toString(36)).slice(-4)}}}(),delay:function(e){return function(t){return new Promise((function(n){setTimeout((function(){n(t)}),e)}))}},asArray:function(e){for(var t=[],n=e.length,r=0;r<n;r++)t.push(e[r]);return t},escapeXhtml:function(e){return e.replace(/#/g,"%23").replace(/\n/g,"%0A")},makeImage:function(e){return new Promise((function(t,n){var r=new Image;r.onload=function(){t(r)},r.onerror=n,r.src=e}))},width:function(e){var n=t(e,"border-left-width"),r=t(e,"border-right-width");return e.scrollWidth+n+r},height:function(e){var n=t(e,"border-top-width"),r=t(e,"border-bottom-width");return e.scrollHeight+n+r}};function e(e){var t=/\.([^\.\/]*?)$/g.exec(e);return t?t[1]:""}function t(e,t){var n=window.getComputedStyle(e).getPropertyValue(t);return parseFloat(n.replace("px",""))}}(),r=function(){var e=/url\(['"]?([^'"]+?)['"]?\)/g;return{inlineAll:function(e,n,i){return a()?Promise.resolve(e):Promise.resolve(e).then(r).then((function(t){var r=Promise.resolve(e);return t.forEach((function(e){r=r.then((function(t){return o(t,e,n,i)}))})),r}));function a(){return!t(e)}},shouldProcess:t,impl:{readUrls:r,inline:o}};function t(t){return-1!==t.search(e)}function r(t){for(var r,o=[];null!==(r=e.exec(t));)o.push(r[1]);return o.filter((function(e){return!n.isDataUrl(e)}))}function o(e,t,r,o){return Promise.resolve(t).then((function(e){return r?n.resolveUrl(e,r):e})).then(o||n.getAndEncode).then((function(e){return n.dataAsUrl(e,n.mimeType(t))})).then((function(r){return e.replace(function(e){return new RegExp("(url\\(['\"]?)("+n.escape(e)+")(['\"]?\\))","g")}(t),"$1"+r+"$3")}))}}(),o=function(){return{resolveAll:function(){return e().then((function(e){return Promise.all(e.map((function(e){return e.resolve()})))})).then((function(e){return e.join("\n")}))},impl:{readAll:e}};function e(){return Promise.resolve(n.asArray(document.styleSheets)).then((function(e){var t=[];return e.forEach((function(e){try{n.asArray(e.cssRules||[]).forEach(t.push.bind(t))}catch(t){console.log("Error while reading CSS rules from "+e.href,t.toString())}})),t})).then((function(e){return e.filter((function(e){return e.type===CSSRule.FONT_FACE_RULE})).filter((function(e){return r.shouldProcess(e.style.getPropertyValue("src"))}))})).then((function(t){return t.map(e)}));function e(e){return{resolve:function(){var t=(e.parentStyleSheet||{}).href;return r.inlineAll(e.cssText,t)},src:function(){return e.style.getPropertyValue("src")}}}}}(),i=function(){return{inlineAll:function t(o){return o instanceof Element?i(o).then((function(){return o instanceof HTMLImageElement?e(o).inline():Promise.all(n.asArray(o.childNodes).map((function(e){return t(e)})))})):Promise.resolve(o);function i(e){var t=e.style.getPropertyValue("background");return t?r.inlineAll(t).then((function(t){e.style.setProperty("background",t,e.style.getPropertyPriority("background"))})).then((function(){return e})):Promise.resolve(e)}},impl:{newImage:e}};function e(e){return{inline:function(t){return n.isDataUrl(e.src)?Promise.resolve():Promise.resolve(e.src).then(t||n.getAndEncode).then((function(t){return n.dataAsUrl(t,n.mimeType(e.src))})).then((function(t){return new Promise((function(n,r){e.onload=n,e.onerror=r,e.src=t}))}))}}}}(),a={imagePlaceholder:void 0,cacheBust:!1},l={toSvg:c,toPng:function(e,t){return u(e,t||{}).then((function(e){return e.toDataURL()}))},toJpeg:function(e,t){return u(e,t=t||{}).then((function(e){return e.toDataURL("image/jpeg",t.quality||1)}))},toBlob:function(e,t){return u(e,t||{}).then(n.canvasToBlob)},toPixelData:function(e,t){return u(e,t||{}).then((function(t){return t.getContext("2d").getImageData(0,0,n.width(e),n.height(e)).data}))},impl:{fontFaces:o,images:i,util:n,inliner:r,options:{}}};function c(e,t){return function(e){void 0===e.imagePlaceholder?l.impl.options.imagePlaceholder=a.imagePlaceholder:l.impl.options.imagePlaceholder=e.imagePlaceholder;void 0===e.cacheBust?l.impl.options.cacheBust=a.cacheBust:l.impl.options.cacheBust=e.cacheBust}(t=t||{}),Promise.resolve(e).then((function(e){return s(e,t.filter,!0)})).then(f).then(h).then((function(e){t.bgcolor&&(e.style.backgroundColor=t.bgcolor);t.width&&(e.style.width=t.width+"px");t.height&&(e.style.height=t.height+"px");t.style&&Object.keys(t.style).forEach((function(n){e.style[n]=t.style[n]}));return e})).then((function(r){return function(e,t,r){return Promise.resolve(e).then((function(e){return e.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),(new XMLSerializer).serializeToString(e)})).then(n.escapeXhtml).then((function(e){return'<foreignObject x="0" y="0" width="100%" height="100%">'+e+"</foreignObject>"})).then((function(e){return'<svg xmlns="http://www.w3.org/2000/svg" width="'+t+'" height="'+r+'">'+e+"</svg>"})).then((function(e){return"data:image/svg+xml;charset=utf-8,"+e}))}(r,t.width||n.width(e),t.height||n.height(e))}))}function u(e,t){return c(e,t).then(n.makeImage).then(n.delay(100)).then((function(r){var o=function(e){var r=document.createElement("canvas");if(r.width=t.width||n.width(e),r.height=t.height||n.height(e),t.bgcolor){var o=r.getContext("2d");o.fillStyle=t.bgcolor,o.fillRect(0,0,r.width,r.height)}return r}(e);return o.getContext("2d").drawImage(r,0,0),o}))}function s(e,t,r){return r||!t||t(e)?Promise.resolve(e).then((function(e){return e instanceof HTMLCanvasElement?n.makeImage(e.toDataURL()):e.cloneNode(!1)})).then((function(r){return function(e,t,r){var o=e.childNodes;return 0===o.length?Promise.resolve(t):i(t,n.asArray(o),r).then((function(){return t}));function i(e,t,n){var r=Promise.resolve();return t.forEach((function(t){r=r.then((function(){return s(t,n)})).then((function(t){t&&e.appendChild(t)}))})),r}}(e,r,t)})).then((function(t){return function(e,t){return t instanceof Element?Promise.resolve().then(r).then(o).then(i).then(a).then((function(){return t})):t;function r(){function r(e,t){function r(e,t){n.asArray(e).forEach((function(n){t.setProperty(n,e.getPropertyValue(n),e.getPropertyPriority(n))}))}e.cssText?t.cssText=e.cssText:r(e,t)}r(window.getComputedStyle(e),t.style)}function o(){function r(r){var o=window.getComputedStyle(e,r),i=o.getPropertyValue("content");if(""!==i&&"none"!==i){var a=n.uid();t.className=t.className+" "+a;var l=document.createElement("style");l.appendChild(c(a,r,o)),t.appendChild(l)}function c(e,t,r){var o="."+e+":"+t,i=r.cssText?a(r):l(r);return document.createTextNode(o+"{"+i+"}");function a(e){var t=e.getPropertyValue("content");return e.cssText+" content: "+t+";"}function l(e){return n.asArray(e).map(t).join("; ")+";";function t(t){return t+": "+e.getPropertyValue(t)+(e.getPropertyPriority(t)?" !important":"")}}}}[":before",":after"].forEach((function(e){r(e)}))}function i(){e instanceof HTMLTextAreaElement&&(t.innerHTML=e.value),e instanceof HTMLInputElement&&t.setAttribute("value",e.value)}function a(){t instanceof SVGElement&&(t.setAttribute("xmlns","http://www.w3.org/2000/svg"),t instanceof SVGRectElement&&["width","height"].forEach((function(e){var n=t.getAttribute(e);n&&t.style.setProperty(e,n)})))}}(e,t)})):Promise.resolve()}function f(e){return o.resolveAll().then((function(t){var n=document.createElement("style");return e.appendChild(n),n.appendChild(document.createTextNode(t)),e}))}function h(e){return i.inlineAll(e).then((function(){return e}))}e.exports=l}()}));const at=require("jszip"),lt=require("react-file-download"),ct=e=>{const{nodes:t,links:n}=e,r=(n||[]).map((e=>{let{source:n,target:r}=e;return{source:t[n].name,target:t[r].name,sourceType:t[n].type,targetType:t[r].type}})),{nodeMap:o,nodesTsv:i}=(e=>{let t=1e7;const n={};let r=!1;e.forEach((e=>{let{source:o,target:i,sourceType:a,targetType:l}=e;""!==i&&""!==o&&(Object.keys(n).indexOf(o)<0?(""!==a?(r=!0,n[o]={ID:t,WEIGHT:1,NODE_TYPE:a}):n[o]={ID:t,WEIGHT:1},t+=1):n[o].WEIGHT+=1,Object.keys(n).indexOf(i)<0?(""!==l?(r=!0,n[i]={ID:t,WEIGHT:1,NODE_TYPE:l}):n[i]={ID:t,WEIGHT:1},t+=1):n[i].WEIGHT+=1)}));let o=r?"ID\tLABEL\tWEIGHT\tNODE_TYPE\r\n":"ID\tLABEL\tWEIGHT\r\n";return Object.keys(n).forEach((e=>{const t=n[e].ID,i=n[e].WEIGHT,a=r?n[e].NODE_TYPE:"";o+=r?`${t}\t${e}\t${i}\t${a}\r\n`:`${t}\t${e}\t${i}\r\n`})),{nodeMap:n,nodesTsv:o}})(r),a=((e,t)=>{let n="SOURCE\tTARGET\tWEIGHT\tTYPE\r\n";return e.forEach((e=>{let{source:r,target:o}=e;if(""===o||""===r)return;const i=t[r].ID,a=t[o].ID;n+=`${i}\t${a}\t1\tUndirected\r\n`})),n})(r,o),l=new at;l.file("Node_Table.tsv",i),l.file("Edge_Table.tsv",a),l.generateAsync({type:"blob"}).then((e=>{lt(e,"Gephi_generated_by_NMTL.zip")}))},ut=e=>{let t,{data:n,dataType:r,extType:o="xlsx"}=e;if("sna"===r)t=P(n);else t=n;N(`\ufeff${O(t)}`,`output.${o}`)};ut.chronologyConvert=e=>{const t=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";const[t,n]=e.split('<span class="tooltip">');return{before:t,after:n}};return(e||[]).map((e=>{let{start_date:{day:n,month:r,year:o},display_date:i,text:{headline:a,text:l}}=e;return{"日期":`${o||""}/${r||""}/${n||""}`,"名稱":(i||"").replace("<span>","").replace("</span>",""),"描述":(a||"").replaceAll(/(<([^>]+)>)/gi,""),"類型":t(l).before,"註(資料集名稱)":t(l).after.replaceAll("\n","").replaceAll("\t","").replace("註","").replace("資料來源:","").replaceAll(/(<([^>]+)>)/gi,"")}}))},ut.mapConvert=e=>(e||[]).map((e=>{let{title:t,author:n,publisher:r,locations:o,posX:i,posY:a}=e;return{"名稱(書名/文章名)":t||"","作者":n||"","出版者":r||"","地點(作品描述區域)":o||"","經度":i||"","緯度":a||""}})),ut.mapLgConvert=e=>(e||[]).map((e=>{let{title:t,locationOfFormation:n,workLocations:r,createPosX:o,createPosY:i,activePosX:a,activePosY:l}=e;return{"組織名稱":t||"","創立地點":n,"創立地點經度":o||"","創立地點緯度":i||"","活動地點":r||"","活動地點經度":a||"","活動地點緯度":l||""}})),ut.worksBarChart=e=>(e||[]).map((e=>{let{date:t,year:n,title:r,keywords:o,authors:i,genreName:a}=e;return{"出版年/發表年":t||n||"","名稱(書名/文章名)":r||"","作者":(i||[]).map((e=>{let{author:t}=e;return t})).join(","),"關鍵字":(o||"").replaceAll("\n",""),"文學分類":a||""}})),ut.worksSlider=e=>(e||[]).map((e=>{let{title:t,author:n,date:r}=e;return{"名稱(書名/文章名)":t||"","作者":n||"","出版日期/發表日期":r||""}}));const st=e=>{let{fill:n="#825c0d"}=e;return t.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:32,height:32,viewBox:"0 0 32 32"},t.createElement("defs",null,t.createElement("clipPath",{id:"a"},t.createElement("path",{"data-name":"Rectangle 125",style:{fill:"#fff"},d:"M0 0h32v32H0z"}))),t.createElement("g",{style:{clipPath:"url(#a)"}},t.createElement("path",{d:"M-960 600h-20v-10h4v2h-2v6h16v-6h-2v-2h4zm-5.06-12.608-1.348-1.454-2.592 2.427V580h-2v8.365l-2.544-2.427-1.362 1.454 4.948 4.671z",transform:"translate(986 -574)",style:{fill:n},"data-name":"Mask Group 42"})))},ft=t=>{let{fill:n="#825c0d"}=t;return e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:32,height:32,viewBox:"0 0 32 32"},e.createElement("defs",null,e.createElement("clipPath",{id:"clip-path"},e.createElement("path",{id:"Rectangle_128","data-name":"Rectangle 128",style:{fill:"#fff"},d:"M0 0h32v32H0z"})),e.createElement("style",null,`\n .cls-3{fill:${n}}\n `)),e.createElement("g",{id:"Mask_Group_47","data-name":"Mask Group 47",style:{clipPath:"url(#clip-path)"}},e.createElement("g",{id:"Group_3633","data-name":"Group 3633",transform:"translate(6 6)"},e.createElement("path",{id:"Path_181","data-name":"Path 181",className:"cls-3",d:"M514 371v-2h-2v2h-2v2h2v2h2v-2h2v-2z",transform:"translate(-495 -369)"}),e.createElement("g",{id:"Group_3632","data-name":"Group 3632",transform:"translate(0 2)"},e.createElement("path",{id:"Path_182","data-name":"Path 182",className:"cls-3",d:"M502.276 371h3.447L512 389h-3.164l-1.595-5.129h-6.586L499.036 389H496zm-.926 10.649h5.17l-.746-2.419c-.643-1.953-1.209-3.956-1.776-5.983h-.128a126.193 126.193 0 0 1-1.748 5.983z",transform:"translate(-496 -371)"})))))},ht=t=>{let{fill:n="#825c0d"}=t;return e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:32,height:32,viewBox:"0 0 32 32"},e.createElement("defs",null,e.createElement("clipPath",{id:"clip-path"},e.createElement("path",{id:"Rectangle_129","data-name":"Rectangle 129",style:{fill:"#fff"},d:"M0 0h32v32H0z"})),e.createElement("style",null,`\n .cls-3{fill:${n}}\n `)),e.createElement("g",{id:"Mask_Group_48","data-name":"Mask Group 48",style:{clipPath:"url(#clip-path)"}},e.createElement("g",{id:"Group_3635","data-name":"Group 3635",transform:"translate(6 8)"},e.createElement("path",{id:"Path_181","data-name":"Path 181",className:"cls-3",d:"M510 371v2h6v-2z",transform:"translate(-495 -371)"}),e.createElement("g",{id:"Group_3632","data-name":"Group 3632"},e.createElement("path",{id:"Path_182","data-name":"Path 182",className:"cls-3",d:"M502.276 371h3.447L512 389h-3.164l-1.595-5.129h-6.586L499.036 389H496zm-.926 10.649h5.17l-.746-2.419c-.643-1.953-1.209-3.956-1.776-5.983h-.128a126.193 126.193 0 0 1-1.748 5.983z",transform:"translate(-496 -371)"})))))},dt=t=>{let{fill:n="#825c0d"}=t;return e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:32,height:32,viewBox:"0 0 32 32"},e.createElement("defs",null,e.createElement("clipPath",{id:"clip-path"},e.createElement("path",{id:"Rectangle_124","data-name":"Rectangle 124",style:{fill:"#fff"},d:"M0 0h32v32H0z"})),e.createElement("style",null,`\n .cls-3{fill:${n}}\n `)),e.createElement("g",{id:"Mask_Group_46","data-name":"Mask Group 46",style:{clipPath:"url(#clip-path)"}},e.createElement("g",{id:"Group_3629","data-name":"Group 3629",transform:"translate(6 6.001)"},e.createElement("path",{id:"Path_176","data-name":"Path 176",className:"cls-3",d:"M-721 1949.376h2.5v-3.755h3.755v-2.5H-721z",transform:"translate(721.003 -1943.118)"}),e.createElement("path",{id:"Path_177","data-name":"Path 177",className:"cls-3",d:"M-721 1960.376h6.258v-2.5h-3.758v-3.755h-2.5z",transform:"translate(721.003 -1940.376)"}),e.createElement("path",{id:"Path_178","data-name":"Path 178",className:"cls-3",d:"M-703.744 1943.118H-710v2.5h3.755v3.755h2.5z",transform:"translate(723.744 -1943.118)"}),e.createElement("path",{id:"Path_179","data-name":"Path 179",className:"cls-3",d:"M-703.744 1960.376v-6.259h-2.5v3.755H-710v2.5z",transform:"translate(723.744 -1940.376)"}))))};A(".extraTools {\n width: 100%;\n display: inline-flex;\n justify-content: flex-end;\n align-items: center;\n gap: 1rem;\n padding: 0px 20px;\n padding-top: 12px; }\n .extraTools__share button {\n display: flex;\n justify-content: center;\n align-items: center; }\n .extraTools__download {\n cursor: pointer; }\n .extraTools__download-icon {\n display: flex;\n justify-content: center;\n align-items: center; }\n .extraTools__fullscreenBtn {\n cursor: pointer;\n padding-top: 0; }\n .extraTools__fullscreenBtn-icon {\n display: flex;\n justify-content: center;\n align-items: center; }\n .extraTools__fontsize {\n display: flex;\n justify-content: center;\n align-items: center; }\n .extraTools .font-size-changer,\n .extraTools .font-size-changer-buttons,\n .extraTools .font-size-up,\n .extraTools .font-size-down,\n .extraTools .tooltip {\n display: flex;\n justify-content: center;\n align-items: center; }\n .extraTools .font-size-up {\n width: 32px !important;\n cursor: pointer;\n margin-right: 16px !important; }\n .extraTools .font-size-down {\n cursor: pointer;\n width: 32px !important; }\n .extraTools .fullscreenExit {\n text-align: right;\n cursor: pointer;\n border: 0; }\n .extraTools #download-menu .MuiMenuItem-root {\n color: #4e3a16;\n width: auto;\n overflow: hidden;\n font-size: 1rem;\n box-sizing: border-box;\n min-height: 48px;\n font-weight: 400;\n line-height: 1;\n padding-top: 1rem;\n white-space: initial;\n border-bottom: 0;\n letter-spacing: 0.00938em;\n padding-bottom: 1rem; }\n");const pt=e=>{let{className:n}=e;return t.createElement("div",{className:s("extraTools__share",n)},t.createElement(tt,{url:document.location.href},t.createElement(Je,{size:32,round:!0})))};pt.defaultProps={className:void 0},pt.propTypes={className:u.string};const mt=e=>{let{className:n,intl:o,exclude:i,iconColor:a,data:l,dataType:c,domToImageId:u,DownloadExcel:f}=e;const[h,d]=r(null),p=[{key:"downloadImage",onClick:()=>(e=>{let{id:t,fileName:n="image",quality:r=.95}=e;const o=document.getElementById(t),i=document.getElementById("yaxis"),a=document.getElementById("barChart__block");i&&i.setAttribute("transform","translate(0, 0 )"),it.toPng(o,{quality:r}).then((e=>{const t=document.createElement("a");t.download=`${n}.png`,t.href=e,t.click(),i&&a&&(i.setAttribute("transform","translate(0, 0 )"),i.setAttribute("transform",`translate(${a.scrollLeft}, 0)`))})).catch((e=>{console.error("oops, something went wrong!",e)}))})({id:u}),label:o?"knowledge.writersAndWorksSNA.download.img":"下載圖片"},{key:"downloadGephi",onClick:()=>ct(l),label:o?"knowledge.writersAndWorksSNA.download.gephi":"下載Gephi"},{key:"downloadTsv",onClick:()=>ut({data:l,dataType:c,extType:"tsv"}),label:o?"knowledge.writersAndWorksSNA.download.tsv":"下載Tsv"},{key:"downloadXls",label:o?"knowledge.writersAndWorksSNA.download.xls":"下載Excel"}];return t.createElement("div",{className:s("extraTools__download",n)},t.createElement(T,{title:o?o.formatMessage({id:"knowledge.writersAndWorksSNA.download"}):"下載",placement:"bottom"},t.createElement("div",{className:"extraTools__download-icon",onClick:e=>d(e.currentTarget)},t.createElement(st,{fill:a}))),t.createElement(k,{id:"download-menu",anchorEl:h,keepMounted:!0,open:Boolean(h),onClose:()=>d(null)},p.map((e=>{let{key:n,onClick:r,label:a}=e;return c=n,!((i||[]).filter((e=>e===c)).length>0)&&((e,n)=>"downloadXls"===e&&f?t.createElement(f,{key:e,element:n,data:l}):n)(n,t.createElement(S,{key:n,onClick:r},o?o.formatMessage({id:a}):a));var c}))))};mt.defaultProps={className:void 0,intl:void 0,exclude:void 0,data:null,dataType:void 0,iconColor:"#825c0d",domToImageId:"network-graph",DownloadExcel:void 0},mt.propTypes={className:u.string,intl:u.objectOf(u.any),exclude:u.arrayOf(u.string),data:u.oneOfType([u.array,u.object]),dataType:u.string,iconColor:u.string,domToImageId:u.string,DownloadExcel:u.oneOfType([u.node,u.func])};const yt=e=>{let{className:n,intl:r,iconColor:o,fullscreenDomId:i}=e;return t.createElement("div",{className:s("extraTools__fullscreenBtn",n)},t.createElement(T,{title:r?r.formatMessage({id:"knowledge.writersAndWorksSNA.fullscreen"}):"全螢幕模式",placement:"bottom"},t.createElement("div",{className:"extraTools__fullscreenBtn-icon",onClick:()=>{nt.isEnabled&&i&&nt.request(document.getElementById(i))}},t.createElement(dt,{fill:o}))))};yt.defaultProps={className:void 0,intl:void 0,iconColor:"#825c0d",fullscreenDomId:void 0},yt.propTypes={className:u.string,intl:u.objectOf(u.any),iconColor:u.string,fullscreenDomId:u.string};const gt=e=>{let{className:n,intl:r,iconColor:o,FontSizeTargets:i,FontSizeOptions:a}=e;return t.createElement("div",{className:s("extraTools__fontsize",n)},t.createElement(ot,{targets:i,options:a,customButtons:{up:t.createElement(T,{title:r?r.formatMessage({id:"knowledge.writersAndWorksSNA.big"}):"字級放大",placement:"bottom"},t.createElement(ft,{fill:o})),down:t.createElement(T,{title:r?r.formatMessage({id:"knowledge.writersAndWorksSNA.small"}):"字級縮小",placement:"bottom"},t.createElement(ht,{fill:o})),style:{border:"none"},buttonsMargin:10}}))};gt.defaultProps={className:void 0,intl:void 0,iconColor:"#825c0d",FontSizeTargets:["#network-graph svg g text"],FontSizeOptions:{stepSize:2,range:1}},gt.propTypes={className:u.string,intl:u.objectOf(u.any),iconColor:u.string,FontSizeTargets:u.arrayOf(u.string),FontSizeOptions:u.objectOf(u.any)};const vt=e=>{let{className:n,intl:r,exclude:o,data:i,dataType:a,iconColor:l,domToImageId:c,FontSizeTargets:u,FontSizeOptions:f,DownloadExcel:h,fullscreenDomId:d}=e;const p={intl:r,exclude:o,data:i,dataType:a,iconColor:l,domToImageId:c,FontSizeTargets:u,FontSizeOptions:f,DownloadExcel:h,fullscreenDomId:d},m=[{keys:["share"],Component:pt},{keys:["downloadImage","downloadGephi","downloadTsv","downloadXls"],Component:mt},{keys:["fullscreen"],Component:yt},{keys:["fontSizeChanger"],Component:gt}];return t.createElement("div",{className:s("extraTools",n)},m.map((e=>{let{keys:n,Component:r}=e;return!(e=>(o||[]).filter((t=>e.some((e=>e===t)))).length===e.length)(n)&&t.createElement(r,E({key:n[0]},p))})))};vt.ShareButton=pt,vt.DownloadMenu=mt,vt.FullscreenBtn=yt,vt.FontSizeChanger=gt,vt.defaultProps={className:void 0,intl:void 0,exclude:["downloadGephi"],data:null,dataType:void 0,iconColor:"#825c0d",domToImageId:"network-graph",FontSizeTargets:["#network-graph svg g text"],FontSizeOptions:{stepSize:2,range:1},DownloadExcel:void 0,fullscreenDomId:void 0},vt.propTypes={className:u.string,intl:u.objectOf(u.any),exclude:u.arrayOf(u.string),data:u.oneOfType([u.array,u.object]),dataType:u.string,iconColor:u.string,domToImageId:u.string,FontSizeTargets:u.arrayOf(u.string),FontSizeOptions:u.objectOf(u.any),DownloadExcel:u.oneOfType([u.node,u.func]),fullscreenDomId:u.string};var wt=f((function(e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=j(t),o=(0,M(F).default)(r.createElement("path",{d:"M12 5V1L7 6l5 5V7c3.31 0 6 2.69 6 6s-2.69 6-6 6-6-2.69-6-6H4c0 4.42 3.58 8 8 8s8-3.58 8-8-3.58-8-8-8z"}),"Replay");n.default=o})),bt=h(wt);const xt=()=>t.createElement("div",{id:"resetBtn"},t.createElement(C,{title:"回到原來位置與大小"},t.createElement(z,null,t.createElement(bt,null))));xt.propTypes={};A(".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 .SNA #network-graph svg {\n width: 100%;\n height: 100%; }\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 _t=function(e){var l,c=e.className,u=e.intl,f=e.exclude,h=e.distance,E=e.SNAData,k=e.handleClickNodeGoto,S=e.DownloadExcel,C=e.width,z=e.height,T=e.fontColor,P=e.backgroundColor,N=e.iconColor;if(!E||0===E.nodes.length)return t.createElement("div",{className:"noData"},u?u.formatMessage({id:"common.noData"}):"暫無資料");var O=function(){var e=r(!1),t=e[0],l=e[1],c=o(null);i((function(){var e=function(){l(je.fullscreenElement===c.current)};return je.addEventListener("fullscreenchange",e),function(){return je.removeEventListener("fullscreenchange",e)}}),[]);var u=a((function(){return je.fullscreenElement?je.exitFullscreen().then((function(){return je.requestFullscreen(c.current)})):c.current?je.requestFullscreen(c.current):void 0}),[]),s=a((function(){return je.fullscreenElement===c.current?je.exitFullscreen():Promise.resolve()}),[]);return n((function(){return{active:t,enter:u,exit:s,node:c}}),[t,u,s])}(),A=n((function(){return O.active?screen.width:screen.width>1050?C:screen.width-80}),[O.active,screen.width]),j=n((function(){return O.active?screen.height:screen.width>1050?z:screen.height-300}),[O.active,screen.width]),M=function(e){return function(){var e,t,n,r,o=W,i=V,a=X,l=Y,c={},u=m("start","drag","end"),s=0,f=0;function h(e){e.on("mousedown.drag",g).filter(l).on("touchstart.drag",b).on("touchmove.drag",x).on("touchend.drag touchcancel.drag",_).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function g(){if(!r&&o.apply(this,arguments)){var a=E("mouse",i.apply(this,arguments),B,this,arguments);a&&(p(d.view).on("mousemove.drag",v,!0).on("mouseup.drag",w,!0),U(d.view),L(),n=!1,e=d.clientX,t=d.clientY,a("start"))}}function v(){if(q(),!n){var r=d.clientX-e,o=d.clientY-t;n=r*r+o*o>f}c.mouse("drag")}function w(){p(d.view).on("mousemove.drag mouseup.drag",null),G(d.view,n),q(),c.mouse("end")}function b(){if(o.apply(this,arguments)){var e,t,n=d.changedTouches,r=i.apply(this,arguments),a=n.length;for(e=0;e<a;++e)(t=E(n[e].identifier,r,R,this,arguments))&&(L(),t("start"))}}function x(){var e,t,n=d.changedTouches,r=n.length;for(e=0;e<r;++e)(t=c[n[e].identifier])&&(q(),t("drag"))}function _(){var e,t,n=d.changedTouches,o=n.length;for(r&&clearTimeout(r),r=setTimeout((function(){r=null}),500),e=0;e<o;++e)(t=c[n[e].identifier])&&(L(),t("end"))}function E(e,t,n,r,o){var i,l,f,p=n(t,e),m=u.copy();if(y(new H(h,"beforestart",i,e,s,p[0],p[1],0,0,m),(function(){return null!=(d.subject=i=a.apply(r,o))&&(l=i.x-p[0]||0,f=i.y-p[1]||0,!0)})))return function a(u){var d,g=p;switch(u){case"start":c[e]=a,d=s++;break;case"end":delete c[e],--s;case"drag":p=n(t,e),d=s}y(new H(h,u,i,e,d,p[0]+l,p[1]+f,p[0]-g[0],p[1]-g[1],m),m.apply,m,[u,r,o])}}return h.filter=function(e){return arguments.length?(o="function"==typeof e?e:$(!!e),h):o},h.container=function(e){return arguments.length?(i="function"==typeof e?e:$(e),h):i},h.subject=function(e){return arguments.length?(a="function"==typeof e?e:$(e),h):a},h.touchable=function(e){return arguments.length?(l="function"==typeof e?e:$(!!e),h):l},h.on=function(){var e=u.on.apply(u,arguments);return e===u?h:e},h.clickDistance=function(e){return arguments.length?(f=(e=+e)*e,h):Math.sqrt(f)},h}().on("start",(function(t){d.active||e.alphaTarget(.3).restart(),t.fx=t.x,t.fy=t.y})).on("drag",(function(e){e.fx=d.x>A-10||d.x<20?e.x:d.x,e.fy=d.y>j-10||d.y<20?e.y:d.y}))},F=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=_(ye),i=e.links.map((function(e){return Object.create(e)})),a=e.nodes.map((function(e){return Object.create(e)})),c=function(e){var t,n=1,r=.001,o=1-Math.pow(r,1/300),i=0,a=.6,l=g(),c=v(s),u=m("tick","end");function s(){f(),u.call("tick",t),n<r&&(c.stop(),u.call("end",t))}function f(r){var c,u,s=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)})),c=0;c<s;++c)null==(u=e[c]).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 h(){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*me;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=[]),h(),t={tick:f,restart:function(){return c.restart(s),t},stop:function(){return c.stop(),t},nodes:function(n){return arguments.length?(e=n,h(),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,c,u=0,s=e.length;for(null==r?r=1/0:r*=r,u=0;u<s;++u)(a=(o=t-(l=e[u]).x)*o+(i=n-l.y)*i)<r&&(c=l,r=a);return c},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=fe,l=function(e){return 1/Math.min(o[e.source.index],o[e.target.index])},c=Z(30),u=1;function s(r){for(var o=0,a=e.length;o<u;++o)for(var l,c,s,f,h,d,p,m=0;m<a;++m)c=(l=e[m]).source,f=(s=l.target).x+s.vx-c.x-c.vx||ee(),h=s.y+s.vy-c.y-c.vy||ee(),f*=d=((d=Math.sqrt(f*f+h*h))-n[m])/d*r*t[m],h*=d,s.vx-=f*(p=i[m]),s.vy-=h*p,c.vx+=f*(p=1-p),c.vy+=h*p}function f(){if(r){var l,c,u=r.length,s=e.length,f=g(r,a);for(l=0,o=new Array(u);l<s;++l)(c=e[l]).index=l,"object"!=typeof c.source&&(c.source=he(f,c.source)),"object"!=typeof c.target&&(c.target=he(f,c.target)),o[c.source.index]=(o[c.source.index]||0)+1,o[c.target.index]=(o[c.target.index]||0)+1;for(l=0,i=new Array(s);l<s;++l)c=e[l],i[l]=o[c.source.index]/(o[c.source.index]+o[c.target.index]);t=new Array(s),h(),n=new Array(s),d()}}function h(){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]=+c(e[t],t,e)}return null==e&&(e=[]),s.initialize=function(e){r=e,f()},s.links=function(t){return arguments.length?(e=t,f(),s):e},s.id=function(e){return arguments.length?(a=e,s):a},s.iterations=function(e){return arguments.length?(u=+e,s):u},s.strength=function(e){return arguments.length?(l="function"==typeof e?e:Z(+e),h(),s):l},s.distance=function(e){return arguments.length?(c="function"==typeof e?e:Z(+e),d(),s):c},s}(i).id((function(e){return e.index})).distance(50)).force("charge",function(){var e,t,n,r,o=Z(-30),i=1,a=1/0,l=.81;function c(r){var o,i=e.length,a=ie(e,de,pe).visitAfter(s);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 s(e){var t,n,o,i,a,l=0,c=0;if(e.length){for(o=i=a=0;a<4;++a)(t=e[a])&&(n=Math.abs(t.value))&&(l+=t.value,c+=n,o+=n*t.x,i+=n*t.y);e.x=o/c,e.y=i/c}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,c,u){if(!e.value)return!0;var s=e.x-t.x,f=e.y-t.y,h=u-o,d=s*s+f*f;if(h*h/l<d)return d<a&&(0===s&&(d+=(s=ee())*s),0===f&&(d+=(f=ee())*f),d<i&&(d=Math.sqrt(i*d)),t.vx+=s*e.value*n/d,t.vy+=f*e.value*n/d),!0;if(!(e.length||d>=a)){(e.data!==t||e.next)&&(0===s&&(d+=(s=ee())*s),0===f&&(d+=(f=ee())*f),d<i&&(d=Math.sqrt(i*d)));do{e.data!==t&&(h=r[e.data.index]*n/d,t.vx+=s*h,t.vy+=f*h)}while(e=e.next)}}return c.initialize=function(t){e=t,u()},c.strength=function(e){return arguments.length?(o="function"==typeof e?e:Z(+e),u(),c):o},c.distanceMin=function(e){return arguments.length?(i=e*e,c):Math.sqrt(i)},c.distanceMax=function(e){return arguments.length?(a=e*e,c):Math.sqrt(a)},c.theta=function(e){return arguments.length?(l=e*e,c):Math.sqrt(l)},c}().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}(A/2,j/2)).force("collide",function(e){var t,n,r=1,o=1;function i(){for(var e,i,l,c,u,s,f,h=t.length,d=0;d<o;++d)for(i=ie(t,ue,se).visitAfter(a),e=0;e<h;++e)l=t[e],s=n[l.index],f=s*s,c=l.x+l.vx,u=l.y+l.vy,i.visit(p);function p(e,t,n,o,i){var a=e.data,h=e.r,d=s+h;if(!a)return t>c+d||o<c-d||n>u+d||i<u-d;if(a.index>l.index){var p=c-a.x-a.vx,m=u-a.y-a.vy,y=p*p+m*m;y<d*d&&(0===p&&(y+=(p=ee())*p),0===m&&(y+=(m=ee())*m),y=(d-(y=Math.sqrt(y)))/y*r,l.vx+=(p*=y)*(d=(h*=h)/(f+h)),l.vy+=(m*=y)*d,a.vx-=p*(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=Z(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:Z(+t),l(),i):e},i}().radius((function(){return 13.5})).strength(1).iterations(10)).force("x",function(e){var t,n,r,o=Z(.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=Z(null==e?0:+e)),i.initialize=function(e){t=e,a()},i.strength=function(e){return arguments.length?(o="function"==typeof e?e:Z(+e),a(),i):o},i.x=function(t){return arguments.length?(e="function"==typeof t?t:Z(+t),a(),i):e},i}(A/2)).force("y",function(e){var t,n,r,o=Z(.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=Z(null==e?0:+e)),i.initialize=function(e){t=e,a()},i.strength=function(e){return arguments.length?(o="function"==typeof e?e:Z(+e),a(),i):o},i.y=function(t){return arguments.length?(e="function"==typeof t?t:Z(+t),a(),i):e},i}(j/2)).force("radial",function(e,t,n){var r,o,i,a=Z(.1);function l(e){for(var a=0,l=r.length;a<l;++a){var c=r[a],u=c.x-t||1e-6,s=c.y-n||1e-6,f=Math.sqrt(u*u+s*s),h=(i[a]-f)*o[a]*e/f;c.vx+=u*h,c.vy+=s*h}}function c(){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=Z(+e)),null==t&&(t=0),null==n&&(n=0),l.initialize=function(e){r=e,c()},l.strength=function(e){return arguments.length?(a="function"==typeof e?e:Z(+e),c(),l):a},l.radius=function(t){return arguments.length?(e="function"==typeof t?t:Z(+t),c(),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,A/1.5,j/1.5)),s=p("#sna-graph").append("svg").attr("viewBox",[0,0,A,j]).style("background-color",P);s.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=s.append("g");var f=function(){var e,t,n=xe,r=_e,o=Ce,i=ke,a=Se,l=[0,1/0],c=[[-1/0,-1/0],[1/0,1/0]],u=250,s=Q,f=m("start","zoom","end"),h=500,g=0;function v(e){e.property("__zoom",Ee).on("wheel.zoom",T).on("mousedown.zoom",P).on("dblclick.zoom",N).filter(a).on("touchstart.zoom",O).on("touchmove.zoom",A).on("touchend.zoom touchcancel.zoom",j).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function _(e,t){return(t=Math.max(l[0],Math.min(l[1],t)))===e.k?e:new w(t,e.x,e.y)}function E(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 w(e.k,r,o)}function k(e){return[(+e[0][0]+ +e[1][0])/2,(+e[0][1]+ +e[1][1])/2]}function S(e,t,n){e.on("start.zoom",(function(){C(this,arguments).start()})).on("interrupt.zoom end.zoom",(function(){C(this,arguments).end()})).tween("zoom",(function(){var e=this,o=arguments,i=C(e,o),a=r.apply(e,o),l=null==n?k(a):"function"==typeof n?n.apply(e,o):n,c=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,h=s(u.invert(l).concat(c/u.k),f.invert(l).concat(c/f.k));return function(e){if(1===e)e=f;else{var t=h(e),n=c/t[2];e=new w(n,l[0]-t[0]*n,l[1]-t[1]*n)}i.zoom(null,e)}}))}function C(e,t,n){return!n&&e.__zooming||new z(e,t)}function z(e,t){this.that=e,this.args=t,this.active=0,this.extent=r.apply(e,t),this.taps=0}function T(){if(n.apply(this,arguments)){var e=C(this,arguments),t=this.__zoom,r=Math.max(l[0],Math.min(l[1],t.k*Math.pow(2,i.apply(this,arguments)))),a=B(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)],x(this),e.start()}be(),e.wheel=setTimeout(u,150),e.zoom("mouse",o(E(_(t,r),e.mouse[0],e.mouse[1]),e.extent,c))}function u(){e.wheel=null,e.end()}}function P(){if(!t&&n.apply(this,arguments)){var e=C(this,arguments,!0),r=p(d.view).on("mousemove.zoom",u,!0).on("mouseup.zoom",s,!0),i=B(this),a=d.clientX,l=d.clientY;U(d.view),we(),e.mouse=[i,this.__zoom.invert(i)],x(this),e.start()}function u(){if(be(),!e.moved){var t=d.clientX-a,n=d.clientY-l;e.moved=t*t+n*n>g}e.zoom("mouse",o(E(e.that.__zoom,e.mouse[0]=B(e.that),e.mouse[1]),e.extent,c))}function s(){r.on("mousemove.zoom mouseup.zoom",null),G(d.view,e.moved),be(),e.end()}}function N(){if(n.apply(this,arguments)){var e=this.__zoom,t=B(this),i=e.invert(t),a=e.k*(d.shiftKey?.5:2),l=o(E(_(e,a),t,i),r.apply(this,arguments),c);be(),u>0?p(this).transition().duration(u).call(S,l,t):p(this).call(v.transform,l)}}function O(){if(n.apply(this,arguments)){var t,r,o,i,a=d.touches,l=a.length,c=C(this,arguments,d.changedTouches.length===l);for(we(),r=0;r<l;++r)i=[i=R(this,a,(o=a[r]).identifier),this.__zoom.invert(i),o.identifier],c.touch0?c.touch1||c.touch0[2]===i[2]||(c.touch1=i,c.taps=0):(c.touch0=i,t=!0,c.taps=1+!!e);e&&(e=clearTimeout(e)),t&&(c.taps<2&&(e=setTimeout((function(){e=null}),h)),x(this),c.start())}}function A(){if(this.__zooming){var t,n,r,i,a=C(this,arguments),l=d.changedTouches,u=l.length;for(be(),e&&(e=clearTimeout(e)),a.taps=0,t=0;t<u;++t)r=R(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 s=a.touch0[0],f=a.touch0[1],h=a.touch1[0],p=a.touch1[1],m=(m=h[0]-s[0])*m+(m=h[1]-s[1])*m,y=(y=p[0]-f[0])*y+(y=p[1]-f[1])*y;n=_(n,Math.sqrt(m/y)),r=[(s[0]+h[0])/2,(s[1]+h[1])/2],i=[(f[0]+p[0])/2,(f[1]+p[1])/2]}else{if(!a.touch0)return;r=a.touch0[0],i=a.touch0[1]}a.zoom("touch",o(E(n,r,i),a.extent,c))}}function j(){if(this.__zooming){var e,n,r=C(this,arguments),o=d.changedTouches,i=o.length;for(we(),t&&clearTimeout(t),t=setTimeout((function(){t=null}),h),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=p(this).on("dblclick.zoom");a&&a.apply(this,arguments)}}}return v.transform=function(e,t,n){var r=e.selection?e.selection():e;r.property("__zoom",Ee),e!==r?S(e,t,n):r.interrupt().each((function(){C(this,arguments).start().zoom(null,"function"==typeof t?t.apply(this,arguments):t).end()}))},v.scaleBy=function(e,t,n){v.scaleTo(e,(function(){return this.__zoom.k*("function"==typeof t?t.apply(this,arguments):t)}),n)},v.scaleTo=function(e,t,n){v.transform(e,(function(){var e=r.apply(this,arguments),i=this.__zoom,a=null==n?k(e):"function"==typeof n?n.apply(this,arguments):n,l=i.invert(a),u="function"==typeof t?t.apply(this,arguments):t;return o(E(_(i,u),a,l),e,c)}),n)},v.translateBy=function(e,t,n){v.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),c)}))},v.translateTo=function(e,t,n,i){v.transform(e,(function(){var e=r.apply(this,arguments),a=this.__zoom,l=null==i?k(e):"function"==typeof i?i.apply(this,arguments):i;return o(b.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,c)}),i)},z.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){y(new ve(v,e,this.that.__zoom),f.apply,f,[e,this.that,this.args])}},v.wheelDelta=function(e){return arguments.length?(i="function"==typeof e?e:ge(+e),v):i},v.filter=function(e){return arguments.length?(n="function"==typeof e?e:ge(!!e),v):n},v.touchable=function(e){return arguments.length?(a="function"==typeof e?e:ge(!!e),v):a},v.extent=function(e){return arguments.length?(r="function"==typeof e?e:ge([[+e[0][0],+e[0][1]],[+e[1][0],+e[1][1]]]),v):r},v.scaleExtent=function(e){return arguments.length?(l[0]=+e[0],l[1]=+e[1],v):[l[0],l[1]]},v.translateExtent=function(e){return arguments.length?(c[0][0]=+e[0][0],c[1][0]=+e[1][0],c[0][1]=+e[0][1],c[1][1]=+e[1][1],v):[[c[0][0],c[0][1]],[c[1][0],c[1][1]]]},v.constrain=function(e){return arguments.length?(o=e,v):o},v.duration=function(e){return arguments.length?(u=+e,v):u},v.interpolate=function(e){return arguments.length?(s=e,v):s},v.on=function(){var e=f.on.apply(f,arguments);return e===f?v:e},v.clickDistance=function(e){return arguments.length?(g=(e=+e)*e,v):Math.sqrt(g)},v}().scaleExtent([.5,20]).extent([[0,0],[A,j]]).on("zoom",(function(){l.attr("transform",d.transform)}));f(s),p("#resetBtn").on("click",(function(){p("#sna-graph").transition().duration(750).call(f.transform,b)}));var h=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})),E=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?k({name:e.name,id:e.id,type:e.type}):null})).call(M(c));E.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 S=l.append("g").selectAll("text").data(a).join("text").attr("fill",T).attr("text-anchor","middle").attr("key",(function(e){return e.type})).style("color","#fff").style("font-size","14px").text((function(e){return e.name})),C=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})),c.on("tick",(function(){a.forEach((function(e){e.x>=A-20&&(e.x=A-20),e.y>=j-20&&(e.y=j-20),e.x<=20&&(e.x=20),e.y<=20&&(e.y=20)})),h.attr("d",(function(e){return F(e.source,e.target,30)})),E.attr("cx",(function(e){return e.x})).attr("cy",(function(e){return e.y})),S.attr("x",(function(e){return e.x})).attr("y",(function(e){return e.y-t})),C.attr("d",(function(e){return F(e.source,e.target,30)}))}))};return i((function(){if(E&&E.nodes&&E.nodes.length>0){var e=document.getElementById("sna-graph");e&&e.childNodes[0]&&e.removeChild(e.childNodes[0]),D(E)}}),[E,O.active]),t.createElement("div",{className:s("SNA",{"SNA--smallSize":h<200},c),style:{contentWidth:A,contentHeight:j,backgroundColor:P}},t.createElement(vt,{intl:u,data:E,iconColor:N,domToImageId:"sna-graph",FontSizeTargets:["#sna-graph svg g text"],exclude:f,DownloadExcel:S,fullscreenDomId:"sna-graph"}),t.createElement(xt,null),t.createElement("div",{id:"sna-graph"}))};_t.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},_t.propTypes={className:u.string,intl:u.objectOf(u.any),width:u.number,height:u.number,distance:u.number,SNAData:u.objectOf(u.any),fontColor:u.string,backgroundColor:u.string,iconColor:u.string,exclude:u.arrayOf(u.string),handleClickNodeGoto:u.func,DownloadExcel:u.oneOfType([u.node,u.func])};export{_t as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function t(t,n){return t<n?-1:t>n?1:t>=n?0:NaN}var n,e,r=(1===(n=t).length&&(e=n,n=function(n,r){return t(e(n),r)}),{left:function(t,e,r,i){for(null==r&&(r=0),null==i&&(i=t.length);r<i;){var o=r+i>>>1;n(t[o],e)<0?r=o+1:i=o}return r},right:function(t,e,r,i){for(null==r&&(r=0),null==i&&(i=t.length);r<i;){var o=r+i>>>1;n(t[o],e)>0?i=o:r=o+1}return r}}).right,i={value:function(){}};function o(){for(var t,n=0,e=arguments.length,r={};n<e;++n){if(!(t=arguments[n]+"")||t in r||/[\s.]/.test(t))throw new Error("illegal type: "+t);r[t]=[]}return new u(r)}function u(t){this._=t}function a(t,n){return t.trim().split(/^|\s+/).map((function(t){var e="",r=t.indexOf(".");if(r>=0&&(e=t.slice(r+1),t=t.slice(0,r)),t&&!n.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:e}}))}function s(t,n){for(var e,r=0,i=t.length;r<i;++r)if((e=t[r]).name===n)return e.value}function l(t,n,e){for(var r=0,o=t.length;r<o;++r)if(t[r].name===n){t[r]=i,t=t.slice(0,r).concat(t.slice(r+1));break}return null!=e&&t.push({name:n,value:e}),t}u.prototype=o.prototype={constructor:u,on:function(t,n){var e,r=this._,i=a(t+"",r),o=-1,u=i.length;if(!(arguments.length<2)){if(null!=n&&"function"!=typeof n)throw new Error("invalid callback: "+n);for(;++o<u;)if(e=(t=i[o]).type)r[e]=l(r[e],t.name,n);else if(null==n)for(e in r)r[e]=l(r[e],t.name,null);return this}for(;++o<u;)if((e=(t=i[o]).type)&&(e=s(r[e],t.name)))return e},copy:function(){var t={},n=this._;for(var e in n)t[e]=n[e].slice();return new u(t)},call:function(t,n){if((e=arguments.length-2)>0)for(var e,r,i=new Array(e),o=0;o<e;++o)i[o]=arguments[o+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(o=0,e=(r=this._[t]).length;o<e;++o)r[o].value.apply(n,i)},apply:function(t,n,e){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,o=r.length;i<o;++i)r[i].value.apply(n,e)}};var c="http://www.w3.org/1999/xhtml",h={svg:"http://www.w3.org/2000/svg",xhtml:c,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function f(t){var n=t+="",e=n.indexOf(":");return e>=0&&"xmlns"!==(n=t.slice(0,e))&&(t=t.slice(e+1)),h.hasOwnProperty(n)?{space:h[n],local:t}:t}function p(t){return function(){var n=this.ownerDocument,e=this.namespaceURI;return e===c&&n.documentElement.namespaceURI===c?n.createElement(t):n.createElementNS(e,t)}}function d(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function v(t){var n=f(t);return(n.local?d:p)(n)}function y(){}function g(t){return null==t?y:function(){return this.querySelector(t)}}function m(){return[]}function _(t){return null==t?m:function(){return this.querySelectorAll(t)}}function w(t){return function(){return this.matches(t)}}function b(t){return new Array(t.length)}function x(t,n){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=n}x.prototype={constructor:x,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,n){return this._parent.insertBefore(t,n)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};function k(t,n,e,r,i,o){for(var u,a=0,s=n.length,l=o.length;a<l;++a)(u=n[a])?(u.__data__=o[a],r[a]=u):e[a]=new x(t,o[a]);for(;a<s;++a)(u=n[a])&&(i[a]=u)}function A(t,n,e,r,i,o,u){var a,s,l,c={},h=n.length,f=o.length,p=new Array(h);for(a=0;a<h;++a)(s=n[a])&&(p[a]=l="$"+u.call(s,s.__data__,a,n),l in c?i[a]=s:c[l]=s);for(a=0;a<f;++a)(s=c[l="$"+u.call(t,o[a],a,o)])?(r[a]=s,s.__data__=o[a],c[l]=null):e[a]=new x(t,o[a]);for(a=0;a<h;++a)(s=n[a])&&c[p[a]]===s&&(i[a]=s)}function N(t,n){return t<n?-1:t>n?1:t>=n?0:NaN}function E(t){return function(){this.removeAttribute(t)}}function M(t){return function(){this.removeAttributeNS(t.space,t.local)}}function S(t,n){return function(){this.setAttribute(t,n)}}function P(t,n){return function(){this.setAttributeNS(t.space,t.local,n)}}function $(t,n){return function(){var e=n.apply(this,arguments);null==e?this.removeAttribute(t):this.setAttribute(t,e)}}function q(t,n){return function(){var e=n.apply(this,arguments);null==e?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,e)}}function C(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function X(t){return function(){this.style.removeProperty(t)}}function T(t,n,e){return function(){this.style.setProperty(t,n,e)}}function O(t,n,e){return function(){var r=n.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,e)}}function R(t,n){return t.style.getPropertyValue(n)||C(t).getComputedStyle(t,null).getPropertyValue(n)}function I(t){return function(){delete this[t]}}function Y(t,n){return function(){this[t]=n}}function j(t,n){return function(){var e=n.apply(this,arguments);null==e?delete this[t]:this[t]=e}}function L(t){return t.trim().split(/^|\s+/)}function z(t){return t.classList||new D(t)}function D(t){this._node=t,this._names=L(t.getAttribute("class")||"")}function H(t,n){for(var e=z(t),r=-1,i=n.length;++r<i;)e.add(n[r])}function B(t,n){for(var e=z(t),r=-1,i=n.length;++r<i;)e.remove(n[r])}function V(t){return function(){H(this,t)}}function U(t){return function(){B(this,t)}}function F(t,n){return function(){(n.apply(this,arguments)?H:B)(this,t)}}function G(){this.textContent=""}function J(t){return function(){this.textContent=t}}function K(t){return function(){var n=t.apply(this,arguments);this.textContent=null==n?"":n}}function Q(){this.innerHTML=""}function W(t){return function(){this.innerHTML=t}}function Z(t){return function(){var n=t.apply(this,arguments);this.innerHTML=null==n?"":n}}function tt(){this.nextSibling&&this.parentNode.appendChild(this)}function nt(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function et(){return null}function rt(){var t=this.parentNode;t&&t.removeChild(this)}function it(){var t=this.cloneNode(!1),n=this.parentNode;return n?n.insertBefore(t,this.nextSibling):t}function ot(){var t=this.cloneNode(!0),n=this.parentNode;return n?n.insertBefore(t,this.nextSibling):t}D.prototype={add:function(t){this._names.indexOf(t)<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var n=this._names.indexOf(t);n>=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var ut={},at=null;"undefined"!=typeof document&&("onmouseenter"in document.documentElement||(ut={mouseenter:"mouseover",mouseleave:"mouseout"}));function st(t,n,e){return t=lt(t,n,e),function(n){var e=n.relatedTarget;e&&(e===this||8&e.compareDocumentPosition(this))||t.call(this,n)}}function lt(t,n,e){return function(r){var i=at;at=r;try{t.call(this,this.__data__,n,e)}finally{at=i}}}function ct(t){return t.trim().split(/^|\s+/).map((function(t){var n="",e=t.indexOf(".");return e>=0&&(n=t.slice(e+1),t=t.slice(0,e)),{type:t,name:n}}))}function ht(t){return function(){var n=this.__on;if(n){for(var e,r=0,i=-1,o=n.length;r<o;++r)e=n[r],t.type&&e.type!==t.type||e.name!==t.name?n[++i]=e:this.removeEventListener(e.type,e.listener,e.capture);++i?n.length=i:delete this.__on}}}function ft(t,n,e){var r=ut.hasOwnProperty(t.type)?st:lt;return function(i,o,u){var a,s=this.__on,l=r(n,o,u);if(s)for(var c=0,h=s.length;c<h;++c)if((a=s[c]).type===t.type&&a.name===t.name)return this.removeEventListener(a.type,a.listener,a.capture),this.addEventListener(a.type,a.listener=l,a.capture=e),void(a.value=n);this.addEventListener(t.type,l,e),a={type:t.type,name:t.name,value:n,listener:l,capture:e},s?s.push(a):this.__on=[a]}}function pt(t,n,e,r){var i=at;t.sourceEvent=at,at=t;try{return n.apply(e,r)}finally{at=i}}function dt(t,n,e){var r=C(t),i=r.CustomEvent;"function"==typeof i?i=new i(n,e):(i=r.document.createEvent("Event"),e?(i.initEvent(n,e.bubbles,e.cancelable),i.detail=e.detail):i.initEvent(n,!1,!1)),t.dispatchEvent(i)}function vt(t,n){return function(){return dt(this,t,n)}}function yt(t,n){return function(){return dt(this,t,n.apply(this,arguments))}}var gt=[null];function mt(t,n){this._groups=t,this._parents=n}function _t(){return new mt([[document.documentElement]],gt)}function wt(t){return"string"==typeof t?new mt([[document.querySelector(t)]],[document.documentElement]):new mt([[t]],gt)}function bt(t,n,e){t.prototype=n.prototype=e,e.constructor=t}function xt(t,n){var e=Object.create(t.prototype);for(var r in n)e[r]=n[r];return e}function kt(){}mt.prototype=_t.prototype={constructor:mt,select:function(t){"function"!=typeof t&&(t=g(t));for(var n=this._groups,e=n.length,r=new Array(e),i=0;i<e;++i)for(var o,u,a=n[i],s=a.length,l=r[i]=new Array(s),c=0;c<s;++c)(o=a[c])&&(u=t.call(o,o.__data__,c,a))&&("__data__"in o&&(u.__data__=o.__data__),l[c]=u);return new mt(r,this._parents)},selectAll:function(t){"function"!=typeof t&&(t=_(t));for(var n=this._groups,e=n.length,r=[],i=[],o=0;o<e;++o)for(var u,a=n[o],s=a.length,l=0;l<s;++l)(u=a[l])&&(r.push(t.call(u,u.__data__,l,a)),i.push(u));return new mt(r,i)},filter:function(t){"function"!=typeof t&&(t=w(t));for(var n=this._groups,e=n.length,r=new Array(e),i=0;i<e;++i)for(var o,u=n[i],a=u.length,s=r[i]=[],l=0;l<a;++l)(o=u[l])&&t.call(o,o.__data__,l,u)&&s.push(o);return new mt(r,this._parents)},data:function(t,n){if(!t)return d=new Array(this.size()),c=-1,this.each((function(t){d[++c]=t})),d;var e,r=n?A:k,i=this._parents,o=this._groups;"function"!=typeof t&&(e=t,t=function(){return e});for(var u=o.length,a=new Array(u),s=new Array(u),l=new Array(u),c=0;c<u;++c){var h=i[c],f=o[c],p=f.length,d=t.call(h,h&&h.__data__,c,i),v=d.length,y=s[c]=new Array(v),g=a[c]=new Array(v);r(h,f,y,g,l[c]=new Array(p),d,n);for(var m,_,w=0,b=0;w<v;++w)if(m=y[w]){for(w>=b&&(b=w+1);!(_=g[b])&&++b<v;);m._next=_||null}}return(a=new mt(a,i))._enter=s,a._exit=l,a},enter:function(){return new mt(this._enter||this._groups.map(b),this._parents)},exit:function(){return new mt(this._exit||this._groups.map(b),this._parents)},join:function(t,n,e){var r=this.enter(),i=this,o=this.exit();return r="function"==typeof t?t(r):r.append(t+""),null!=n&&(i=n(i)),null==e?o.remove():e(o),r&&i?r.merge(i).order():i},merge:function(t){for(var n=this._groups,e=t._groups,r=n.length,i=e.length,o=Math.min(r,i),u=new Array(r),a=0;a<o;++a)for(var s,l=n[a],c=e[a],h=l.length,f=u[a]=new Array(h),p=0;p<h;++p)(s=l[p]||c[p])&&(f[p]=s);for(;a<r;++a)u[a]=n[a];return new mt(u,this._parents)},order:function(){for(var t=this._groups,n=-1,e=t.length;++n<e;)for(var r,i=t[n],o=i.length-1,u=i[o];--o>=0;)(r=i[o])&&(u&&4^r.compareDocumentPosition(u)&&u.parentNode.insertBefore(r,u),u=r);return this},sort:function(t){function n(n,e){return n&&e?t(n.__data__,e.__data__):!n-!e}t||(t=N);for(var e=this._groups,r=e.length,i=new Array(r),o=0;o<r;++o){for(var u,a=e[o],s=a.length,l=i[o]=new Array(s),c=0;c<s;++c)(u=a[c])&&(l[c]=u);l.sort(n)}return new mt(i,this._parents).order()},call:function(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this},nodes:function(){var t=new Array(this.size()),n=-1;return this.each((function(){t[++n]=this})),t},node:function(){for(var t=this._groups,n=0,e=t.length;n<e;++n)for(var r=t[n],i=0,o=r.length;i<o;++i){var u=r[i];if(u)return u}return null},size:function(){var t=0;return this.each((function(){++t})),t},empty:function(){return!this.node()},each:function(t){for(var n=this._groups,e=0,r=n.length;e<r;++e)for(var i,o=n[e],u=0,a=o.length;u<a;++u)(i=o[u])&&t.call(i,i.__data__,u,o);return this},attr:function(t,n){var e=f(t);if(arguments.length<2){var r=this.node();return e.local?r.getAttributeNS(e.space,e.local):r.getAttribute(e)}return this.each((null==n?e.local?M:E:"function"==typeof n?e.local?q:$:e.local?P:S)(e,n))},style:function(t,n,e){return arguments.length>1?this.each((null==n?X:"function"==typeof n?O:T)(t,n,null==e?"":e)):R(this.node(),t)},property:function(t,n){return arguments.length>1?this.each((null==n?I:"function"==typeof n?j:Y)(t,n)):this.node()[t]},classed:function(t,n){var e=L(t+"");if(arguments.length<2){for(var r=z(this.node()),i=-1,o=e.length;++i<o;)if(!r.contains(e[i]))return!1;return!0}return this.each(("function"==typeof n?F:n?V:U)(e,n))},text:function(t){return arguments.length?this.each(null==t?G:("function"==typeof t?K:J)(t)):this.node().textContent},html:function(t){return arguments.length?this.each(null==t?Q:("function"==typeof t?Z:W)(t)):this.node().innerHTML},raise:function(){return this.each(tt)},lower:function(){return this.each(nt)},append:function(t){var n="function"==typeof t?t:v(t);return this.select((function(){return this.appendChild(n.apply(this,arguments))}))},insert:function(t,n){var e="function"==typeof t?t:v(t),r=null==n?et:"function"==typeof n?n:g(n);return this.select((function(){return this.insertBefore(e.apply(this,arguments),r.apply(this,arguments)||null)}))},remove:function(){return this.each(rt)},clone:function(t){return this.select(t?ot:it)},datum:function(t){return arguments.length?this.property("__data__",t):this.node().__data__},on:function(t,n,e){var r,i,o=ct(t+""),u=o.length;if(!(arguments.length<2)){for(a=n?ft:ht,null==e&&(e=!1),r=0;r<u;++r)this.each(a(o[r],n,e));return this}var a=this.node().__on;if(a)for(var s,l=0,c=a.length;l<c;++l)for(r=0,s=a[l];r<u;++r)if((i=o[r]).type===s.type&&i.name===s.name)return s.value},dispatch:function(t,n){return this.each(("function"==typeof n?yt:vt)(t,n))}};var At=1/.7,Nt="\\s*([+-]?\\d+)\\s*",Et="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",Mt="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",St=/^#([0-9a-f]{3,8})$/,Pt=new RegExp("^rgb\\("+[Nt,Nt,Nt]+"\\)$"),$t=new RegExp("^rgb\\("+[Mt,Mt,Mt]+"\\)$"),qt=new RegExp("^rgba\\("+[Nt,Nt,Nt,Et]+"\\)$"),Ct=new RegExp("^rgba\\("+[Mt,Mt,Mt,Et]+"\\)$"),Xt=new RegExp("^hsl\\("+[Et,Mt,Mt]+"\\)$"),Tt=new RegExp("^hsla\\("+[Et,Mt,Mt,Et]+"\\)$"),Ot={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function Rt(){return this.rgb().formatHex()}function It(){return this.rgb().formatRgb()}function Yt(t){var n,e;return t=(t+"").trim().toLowerCase(),(n=St.exec(t))?(e=n[1].length,n=parseInt(n[1],16),6===e?jt(n):3===e?new Ht(n>>8&15|n>>4&240,n>>4&15|240&n,(15&n)<<4|15&n,1):8===e?Lt(n>>24&255,n>>16&255,n>>8&255,(255&n)/255):4===e?Lt(n>>12&15|n>>8&240,n>>8&15|n>>4&240,n>>4&15|240&n,((15&n)<<4|15&n)/255):null):(n=Pt.exec(t))?new Ht(n[1],n[2],n[3],1):(n=$t.exec(t))?new Ht(255*n[1]/100,255*n[2]/100,255*n[3]/100,1):(n=qt.exec(t))?Lt(n[1],n[2],n[3],n[4]):(n=Ct.exec(t))?Lt(255*n[1]/100,255*n[2]/100,255*n[3]/100,n[4]):(n=Xt.exec(t))?Ft(n[1],n[2]/100,n[3]/100,1):(n=Tt.exec(t))?Ft(n[1],n[2]/100,n[3]/100,n[4]):Ot.hasOwnProperty(t)?jt(Ot[t]):"transparent"===t?new Ht(NaN,NaN,NaN,0):null}function jt(t){return new Ht(t>>16&255,t>>8&255,255&t,1)}function Lt(t,n,e,r){return r<=0&&(t=n=e=NaN),new Ht(t,n,e,r)}function zt(t){return t instanceof kt||(t=Yt(t)),t?new Ht((t=t.rgb()).r,t.g,t.b,t.opacity):new Ht}function Dt(t,n,e,r){return 1===arguments.length?zt(t):new Ht(t,n,e,null==r?1:r)}function Ht(t,n,e,r){this.r=+t,this.g=+n,this.b=+e,this.opacity=+r}function Bt(){return"#"+Ut(this.r)+Ut(this.g)+Ut(this.b)}function Vt(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}function Ut(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function Ft(t,n,e,r){return r<=0?t=n=e=NaN:e<=0||e>=1?t=n=NaN:n<=0&&(t=NaN),new Jt(t,n,e,r)}function Gt(t){if(t instanceof Jt)return new Jt(t.h,t.s,t.l,t.opacity);if(t instanceof kt||(t=Yt(t)),!t)return new Jt;if(t instanceof Jt)return t;var n=(t=t.rgb()).r/255,e=t.g/255,r=t.b/255,i=Math.min(n,e,r),o=Math.max(n,e,r),u=NaN,a=o-i,s=(o+i)/2;return a?(u=n===o?(e-r)/a+6*(e<r):e===o?(r-n)/a+2:(n-e)/a+4,a/=s<.5?o+i:2-o-i,u*=60):a=s>0&&s<1?0:u,new Jt(u,a,s,t.opacity)}function Jt(t,n,e,r){this.h=+t,this.s=+n,this.l=+e,this.opacity=+r}function Kt(t,n,e){return 255*(t<60?n+(e-n)*t/60:t<180?e:t<240?n+(e-n)*(240-t)/60:n)}function Qt(t){return function(){return t}}function Wt(t){return 1==(t=+t)?Zt:function(n,e){return e-n?function(t,n,e){return t=Math.pow(t,e),n=Math.pow(n,e)-t,e=1/e,function(r){return Math.pow(t+r*n,e)}}(n,e,t):Qt(isNaN(n)?e:n)}}function Zt(t,n){var e=n-t;return e?function(t,n){return function(e){return t+e*n}}(t,e):Qt(isNaN(t)?n:t)}bt(kt,Yt,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:Rt,formatHex:Rt,formatHsl:function(){return Gt(this).formatHsl()},formatRgb:It,toString:It}),bt(Ht,Dt,xt(kt,{brighter:function(t){return t=null==t?At:Math.pow(At,t),new Ht(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new Ht(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Bt,formatHex:Bt,formatRgb:Vt,toString:Vt})),bt(Jt,(function(t,n,e,r){return 1===arguments.length?Gt(t):new Jt(t,n,e,null==r?1:r)}),xt(kt,{brighter:function(t){return t=null==t?At:Math.pow(At,t),new Jt(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new Jt(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),n=isNaN(t)||isNaN(this.s)?0:this.s,e=this.l,r=e+(e<.5?e:1-e)*n,i=2*e-r;return new Ht(Kt(t>=240?t-240:t+120,i,r),Kt(t,i,r),Kt(t<120?t+240:t-120,i,r),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===t?")":", "+t+")")}}));var tn=function t(n){var e=Wt(n);function r(t,n){var r=e((t=Dt(t)).r,(n=Dt(n)).r),i=e(t.g,n.g),o=e(t.b,n.b),u=Zt(t.opacity,n.opacity);return function(n){return t.r=r(n),t.g=i(n),t.b=o(n),t.opacity=u(n),t+""}}return r.gamma=t,r}(1);function nn(t,n){return t=+t,n=+n,function(e){return t*(1-e)+n*e}}var en=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,rn=new RegExp(en.source,"g");function on(t,n){var e,r,i,o=en.lastIndex=rn.lastIndex=0,u=-1,a=[],s=[];for(t+="",n+="";(e=en.exec(t))&&(r=rn.exec(n));)(i=r.index)>o&&(i=n.slice(o,i),a[u]?a[u]+=i:a[++u]=i),(e=e[0])===(r=r[0])?a[u]?a[u]+=r:a[++u]=r:(a[++u]=null,s.push({i:u,x:nn(e,r)})),o=rn.lastIndex;return o<n.length&&(i=n.slice(o),a[u]?a[u]+=i:a[++u]=i),a.length<2?s[0]?function(t){return function(n){return t(n)+""}}(s[0].x):function(t){return function(){return t}}(n):(n=s.length,function(t){for(var e,r=0;r<n;++r)a[(e=s[r]).i]=e.x(t);return a.join("")})}var un,an,sn,ln,cn=180/Math.PI,hn={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function fn(t,n,e,r,i,o){var u,a,s;return(u=Math.sqrt(t*t+n*n))&&(t/=u,n/=u),(s=t*e+n*r)&&(e-=t*s,r-=n*s),(a=Math.sqrt(e*e+r*r))&&(e/=a,r/=a,s/=a),t*r<n*e&&(t=-t,n=-n,s=-s,u=-u),{translateX:i,translateY:o,rotate:Math.atan2(n,t)*cn,skewX:Math.atan(s)*cn,scaleX:u,scaleY:a}}function pn(t,n,e,r){function i(t){return t.length?t.pop()+" ":""}return function(o,u){var a=[],s=[];return o=t(o),u=t(u),function(t,r,i,o,u,a){if(t!==i||r!==o){var s=u.push("translate(",null,n,null,e);a.push({i:s-4,x:nn(t,i)},{i:s-2,x:nn(r,o)})}else(i||o)&&u.push("translate("+i+n+o+e)}(o.translateX,o.translateY,u.translateX,u.translateY,a,s),function(t,n,e,o){t!==n?(t-n>180?n+=360:n-t>180&&(t+=360),o.push({i:e.push(i(e)+"rotate(",null,r)-2,x:nn(t,n)})):n&&e.push(i(e)+"rotate("+n+r)}(o.rotate,u.rotate,a,s),function(t,n,e,o){t!==n?o.push({i:e.push(i(e)+"skewX(",null,r)-2,x:nn(t,n)}):n&&e.push(i(e)+"skewX("+n+r)}(o.skewX,u.skewX,a,s),function(t,n,e,r,o,u){if(t!==e||n!==r){var a=o.push(i(o)+"scale(",null,",",null,")");u.push({i:a-4,x:nn(t,e)},{i:a-2,x:nn(n,r)})}else 1===e&&1===r||o.push(i(o)+"scale("+e+","+r+")")}(o.scaleX,o.scaleY,u.scaleX,u.scaleY,a,s),o=u=null,function(t){for(var n,e=-1,r=s.length;++e<r;)a[(n=s[e]).i]=n.x(t);return a.join("")}}}var dn,vn,yn=pn((function(t){return"none"===t?hn:(un||(un=document.createElement("DIV"),an=document.documentElement,sn=document.defaultView),un.style.transform=t,t=sn.getComputedStyle(an.appendChild(un),null).getPropertyValue("transform"),an.removeChild(un),fn(+(t=t.slice(7,-1).split(","))[0],+t[1],+t[2],+t[3],+t[4],+t[5]))}),"px, ","px)","deg)"),gn=pn((function(t){return null==t?hn:(ln||(ln=document.createElementNS("http://www.w3.org/2000/svg","g")),ln.setAttribute("transform",t),(t=ln.transform.baseVal.consolidate())?fn((t=t.matrix).a,t.b,t.c,t.d,t.e,t.f):hn)}),", ",")",")"),mn=0,_n=0,wn=0,bn=0,xn=0,kn=0,An="object"==typeof performance&&performance.now?performance:Date,Nn="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function En(){return xn||(Nn(Mn),xn=An.now()+kn)}function Mn(){xn=0}function Sn(){this._call=this._time=this._next=null}function Pn(t,n,e){var r=new Sn;return r.restart(t,n,e),r}function $n(){xn=(bn=An.now())+kn,mn=_n=0;try{!function(){En(),++mn;for(var t,n=dn;n;)(t=xn-n._time)>=0&&n._call.call(null,t),n=n._next;--mn}()}finally{mn=0,function(){var t,n,e=dn,r=1/0;for(;e;)e._call?(r>e._time&&(r=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:dn=n);vn=t,Cn(r)}(),xn=0}}function qn(){var t=An.now(),n=t-bn;n>1e3&&(kn-=n,bn=t)}function Cn(t){mn||(_n&&(_n=clearTimeout(_n)),t-xn>24?(t<1/0&&(_n=setTimeout($n,t-An.now()-kn)),wn&&(wn=clearInterval(wn))):(wn||(bn=An.now(),wn=setInterval(qn,1e3)),mn=1,Nn($n)))}function Xn(t,n,e){var r=new Sn;return n=null==n?0:+n,r.restart((function(e){r.stop(),t(e+n)}),n,e),r}Sn.prototype=Pn.prototype={constructor:Sn,restart:function(t,n,e){if("function"!=typeof t)throw new TypeError("callback is not a function");e=(null==e?En():+e)+(null==n?0:+n),this._next||vn===this||(vn?vn._next=this:dn=this,vn=this),this._call=t,this._time=e,Cn()},stop:function(){this._call&&(this._call=null,this._time=1/0,Cn())}};var Tn=o("start","end","cancel","interrupt"),On=[];function Rn(t,n,e,r,i,o){var u=t.__transition;if(u){if(e in u)return}else t.__transition={};!function(t,n,e){var r,i=t.__transition;function o(t){e.state=1,e.timer.restart(u,e.delay,e.time),e.delay<=t&&u(t-e.delay)}function u(o){var l,c,h,f;if(1!==e.state)return s();for(l in i)if((f=i[l]).name===e.name){if(3===f.state)return Xn(u);4===f.state?(f.state=6,f.timer.stop(),f.on.call("interrupt",t,t.__data__,f.index,f.group),delete i[l]):+l<n&&(f.state=6,f.timer.stop(),f.on.call("cancel",t,t.__data__,f.index,f.group),delete i[l])}if(Xn((function(){3===e.state&&(e.state=4,e.timer.restart(a,e.delay,e.time),a(o))})),e.state=2,e.on.call("start",t,t.__data__,e.index,e.group),2===e.state){for(e.state=3,r=new Array(h=e.tween.length),l=0,c=-1;l<h;++l)(f=e.tween[l].value.call(t,t.__data__,e.index,e.group))&&(r[++c]=f);r.length=c+1}}function a(n){for(var i=n<e.duration?e.ease.call(null,n/e.duration):(e.timer.restart(s),e.state=5,1),o=-1,u=r.length;++o<u;)r[o].call(t,i);5===e.state&&(e.on.call("end",t,t.__data__,e.index,e.group),s())}function s(){for(var r in e.state=6,e.timer.stop(),delete i[n],i)return;delete t.__transition}i[n]=e,e.timer=Pn(o,0,e.time)}(t,e,{name:n,index:r,group:i,on:Tn,tween:On,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:0})}function In(t,n){var e=jn(t,n);if(e.state>0)throw new Error("too late; already scheduled");return e}function Yn(t,n){var e=jn(t,n);if(e.state>3)throw new Error("too late; already running");return e}function jn(t,n){var e=t.__transition;if(!e||!(e=e[n]))throw new Error("transition not found");return e}function Ln(t,n){var e,r,i,o=t.__transition,u=!0;if(o){for(i in n=null==n?null:n+"",o)(e=o[i]).name===n?(r=e.state>2&&e.state<5,e.state=6,e.timer.stop(),e.on.call(r?"interrupt":"cancel",t,t.__data__,e.index,e.group),delete o[i]):u=!1;u&&delete t.__transition}}function zn(t,n){var e,r;return function(){var i=Yn(this,t),o=i.tween;if(o!==e)for(var u=0,a=(r=e=o).length;u<a;++u)if(r[u].name===n){(r=r.slice()).splice(u,1);break}i.tween=r}}function Dn(t,n,e){var r,i;if("function"!=typeof e)throw new Error;return function(){var o=Yn(this,t),u=o.tween;if(u!==r){i=(r=u).slice();for(var a={name:n,value:e},s=0,l=i.length;s<l;++s)if(i[s].name===n){i[s]=a;break}s===l&&i.push(a)}o.tween=i}}function Hn(t,n,e){var r=t._id;return t.each((function(){var t=Yn(this,r);(t.value||(t.value={}))[n]=e.apply(this,arguments)})),function(t){return jn(t,r).value[n]}}function Bn(t,n){var e;return("number"==typeof n?nn:n instanceof Yt?tn:(e=Yt(n))?(n=e,tn):on)(t,n)}function Vn(t){return function(){this.removeAttribute(t)}}function Un(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Fn(t,n,e){var r,i,o=e+"";return function(){var u=this.getAttribute(t);return u===o?null:u===r?i:i=n(r=u,e)}}function Gn(t,n,e){var r,i,o=e+"";return function(){var u=this.getAttributeNS(t.space,t.local);return u===o?null:u===r?i:i=n(r=u,e)}}function Jn(t,n,e){var r,i,o;return function(){var u,a,s=e(this);if(null!=s)return(u=this.getAttribute(t))===(a=s+"")?null:u===r&&a===i?o:(i=a,o=n(r=u,s));this.removeAttribute(t)}}function Kn(t,n,e){var r,i,o;return function(){var u,a,s=e(this);if(null!=s)return(u=this.getAttributeNS(t.space,t.local))===(a=s+"")?null:u===r&&a===i?o:(i=a,o=n(r=u,s));this.removeAttributeNS(t.space,t.local)}}function Qn(t,n){return function(e){this.setAttribute(t,n.call(this,e))}}function Wn(t,n){return function(e){this.setAttributeNS(t.space,t.local,n.call(this,e))}}function Zn(t,n){var e,r;function i(){var i=n.apply(this,arguments);return i!==r&&(e=(r=i)&&Wn(t,i)),e}return i._value=n,i}function te(t,n){var e,r;function i(){var i=n.apply(this,arguments);return i!==r&&(e=(r=i)&&Qn(t,i)),e}return i._value=n,i}function ne(t,n){return function(){In(this,t).delay=+n.apply(this,arguments)}}function ee(t,n){return n=+n,function(){In(this,t).delay=n}}function re(t,n){return function(){Yn(this,t).duration=+n.apply(this,arguments)}}function ie(t,n){return n=+n,function(){Yn(this,t).duration=n}}function oe(t,n){if("function"!=typeof n)throw new Error;return function(){Yn(this,t).ease=n}}function ue(t,n,e){var r,i,o=function(t){return(t+"").trim().split(/^|\s+/).every((function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||"start"===t}))}(n)?In:Yn;return function(){var u=o(this,t),a=u.on;a!==r&&(i=(r=a).copy()).on(n,e),u.on=i}}var ae=_t.prototype.constructor;function se(t){return function(){this.style.removeProperty(t)}}function le(t,n,e){return function(r){this.style.setProperty(t,n.call(this,r),e)}}function ce(t,n,e){var r,i;function o(){var o=n.apply(this,arguments);return o!==i&&(r=(i=o)&&le(t,o,e)),r}return o._value=n,o}function he(t){return function(n){this.textContent=t.call(this,n)}}function fe(t){var n,e;function r(){var r=t.apply(this,arguments);return r!==e&&(n=(e=r)&&he(r)),n}return r._value=t,r}var pe=0;function de(t,n,e,r){this._groups=t,this._parents=n,this._name=e,this._id=r}function ve(){return++pe}var ye=_t.prototype;de.prototype={constructor:de,select:function(t){var n=this._name,e=this._id;"function"!=typeof t&&(t=g(t));for(var r=this._groups,i=r.length,o=new Array(i),u=0;u<i;++u)for(var a,s,l=r[u],c=l.length,h=o[u]=new Array(c),f=0;f<c;++f)(a=l[f])&&(s=t.call(a,a.__data__,f,l))&&("__data__"in a&&(s.__data__=a.__data__),h[f]=s,Rn(h[f],n,e,f,h,jn(a,e)));return new de(o,this._parents,n,e)},selectAll:function(t){var n=this._name,e=this._id;"function"!=typeof t&&(t=_(t));for(var r=this._groups,i=r.length,o=[],u=[],a=0;a<i;++a)for(var s,l=r[a],c=l.length,h=0;h<c;++h)if(s=l[h]){for(var f,p=t.call(s,s.__data__,h,l),d=jn(s,e),v=0,y=p.length;v<y;++v)(f=p[v])&&Rn(f,n,e,v,p,d);o.push(p),u.push(s)}return new de(o,u,n,e)},filter:function(t){"function"!=typeof t&&(t=w(t));for(var n=this._groups,e=n.length,r=new Array(e),i=0;i<e;++i)for(var o,u=n[i],a=u.length,s=r[i]=[],l=0;l<a;++l)(o=u[l])&&t.call(o,o.__data__,l,u)&&s.push(o);return new de(r,this._parents,this._name,this._id)},merge:function(t){if(t._id!==this._id)throw new Error;for(var n=this._groups,e=t._groups,r=n.length,i=e.length,o=Math.min(r,i),u=new Array(r),a=0;a<o;++a)for(var s,l=n[a],c=e[a],h=l.length,f=u[a]=new Array(h),p=0;p<h;++p)(s=l[p]||c[p])&&(f[p]=s);for(;a<r;++a)u[a]=n[a];return new de(u,this._parents,this._name,this._id)},selection:function(){return new ae(this._groups,this._parents)},transition:function(){for(var t=this._name,n=this._id,e=ve(),r=this._groups,i=r.length,o=0;o<i;++o)for(var u,a=r[o],s=a.length,l=0;l<s;++l)if(u=a[l]){var c=jn(u,n);Rn(u,t,e,l,a,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new de(r,this._parents,t,e)},call:ye.call,nodes:ye.nodes,node:ye.node,size:ye.size,empty:ye.empty,each:ye.each,on:function(t,n){var e=this._id;return arguments.length<2?jn(this.node(),e).on.on(t):this.each(ue(e,t,n))},attr:function(t,n){var e=f(t),r="transform"===e?gn:Bn;return this.attrTween(t,"function"==typeof n?(e.local?Kn:Jn)(e,r,Hn(this,"attr."+t,n)):null==n?(e.local?Un:Vn)(e):(e.local?Gn:Fn)(e,r,n))},attrTween:function(t,n){var e="attr."+t;if(arguments.length<2)return(e=this.tween(e))&&e._value;if(null==n)return this.tween(e,null);if("function"!=typeof n)throw new Error;var r=f(t);return this.tween(e,(r.local?Zn:te)(r,n))},style:function(t,n,e){var r="transform"==(t+="")?yn:Bn;return null==n?this.styleTween(t,function(t,n){var e,r,i;return function(){var o=R(this,t),u=(this.style.removeProperty(t),R(this,t));return o===u?null:o===e&&u===r?i:i=n(e=o,r=u)}}(t,r)).on("end.style."+t,se(t)):"function"==typeof n?this.styleTween(t,function(t,n,e){var r,i,o;return function(){var u=R(this,t),a=e(this),s=a+"";return null==a&&(this.style.removeProperty(t),s=a=R(this,t)),u===s?null:u===r&&s===i?o:(i=s,o=n(r=u,a))}}(t,r,Hn(this,"style."+t,n))).each(function(t,n){var e,r,i,o,u="style."+n,a="end."+u;return function(){var s=Yn(this,t),l=s.on,c=null==s.value[u]?o||(o=se(n)):void 0;l===e&&i===c||(r=(e=l).copy()).on(a,i=c),s.on=r}}(this._id,t)):this.styleTween(t,function(t,n,e){var r,i,o=e+"";return function(){var u=R(this,t);return u===o?null:u===r?i:i=n(r=u,e)}}(t,r,n),e).on("end.style."+t,null)},styleTween:function(t,n,e){var r="style."+(t+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==n)return this.tween(r,null);if("function"!=typeof n)throw new Error;return this.tween(r,ce(t,n,null==e?"":e))},text:function(t){return this.tween("text","function"==typeof t?function(t){return function(){var n=t(this);this.textContent=null==n?"":n}}(Hn(this,"text",t)):function(t){return function(){this.textContent=t}}(null==t?"":t+""))},textTween:function(t){var n="text";if(arguments.length<1)return(n=this.tween(n))&&n._value;if(null==t)return this.tween(n,null);if("function"!=typeof t)throw new Error;return this.tween(n,fe(t))},remove:function(){return this.on("end.remove",function(t){return function(){var n=this.parentNode;for(var e in this.__transition)if(+e!==t)return;n&&n.removeChild(this)}}(this._id))},tween:function(t,n){var e=this._id;if(t+="",arguments.length<2){for(var r,i=jn(this.node(),e).tween,o=0,u=i.length;o<u;++o)if((r=i[o]).name===t)return r.value;return null}return this.each((null==n?zn:Dn)(e,t,n))},delay:function(t){var n=this._id;return arguments.length?this.each(("function"==typeof t?ne:ee)(n,t)):jn(this.node(),n).delay},duration:function(t){var n=this._id;return arguments.length?this.each(("function"==typeof t?re:ie)(n,t)):jn(this.node(),n).duration},ease:function(t){var n=this._id;return arguments.length?this.each(oe(n,t)):jn(this.node(),n).ease},end:function(){var t,n,e=this,r=e._id,i=e.size();return new Promise((function(o,u){var a={value:u},s={value:function(){0==--i&&o()}};e.each((function(){var e=Yn(this,r),i=e.on;i!==t&&((n=(t=i).copy())._.cancel.push(a),n._.interrupt.push(a),n._.end.push(s)),e.on=n}))}))}};var ge={time:null,delay:0,duration:250,ease:function(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}};function me(t,n){for(var e;!(e=t.__transition)||!(e=e[n]);)if(!(t=t.parentNode))return ge.time=En(),ge;return e}_t.prototype.interrupt=function(t){return this.each((function(){Ln(this,t)}))},_t.prototype.transition=function(t){var n,e;t instanceof de?(n=t._id,t=t._name):(n=ve(),(e=ge).time=En(),t=null==t?null:t+"");for(var r=this._groups,i=r.length,o=0;o<i;++o)for(var u,a=r[o],s=a.length,l=0;l<s;++l)(u=a[l])&&Rn(u,t,n,l,a,e||me(u,n));return new de(r,this._parents,t,n)};function _e(){}function we(t,n){var e=new _e;if(t instanceof _e)t.each((function(t,n){e.set(n,t)}));else if(Array.isArray(t)){var r,i=-1,o=t.length;if(null==n)for(;++i<o;)e.set(i,t[i]);else for(;++i<o;)e.set(n(r=t[i],i,t),r)}else if(t)for(var u in t)e.set(u,t[u]);return e}function be(){}_e.prototype=we.prototype={constructor:_e,has:function(t){return"$"+t in this},get:function(t){return this["$"+t]},set:function(t,n){return this["$"+t]=n,this},remove:function(t){var n="$"+t;return n in this&&delete this[n]},clear:function(){for(var t in this)"$"===t[0]&&delete this[t]},keys:function(){var t=[];for(var n in this)"$"===n[0]&&t.push(n.slice(1));return t},values:function(){var t=[];for(var n in this)"$"===n[0]&&t.push(this[n]);return t},entries:function(){var t=[];for(var n in this)"$"===n[0]&&t.push({key:n.slice(1),value:this[n]});return t},size:function(){var t=0;for(var n in this)"$"===n[0]&&++t;return t},empty:function(){for(var t in this)if("$"===t[0])return!1;return!0},each:function(t){for(var n in this)"$"===n[0]&&t(this[n],n.slice(1),this)}};var xe=we.prototype;function ke(t,n){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(n).domain(t)}return this}be.prototype={constructor:be,has:xe.has,add:function(t){return this["$"+(t+="")]=t,this},remove:xe.remove,clear:xe.clear,values:xe.keys,size:xe.size,empty:xe.empty,each:xe.each};var Ae=Array.prototype,Ne=Ae.map,Ee=Ae.slice,Me={name:"implicit"};function Se(){var t=we(),n=[],e=[],r=Me;function i(i){var o=i+"",u=t.get(o);if(!u){if(r!==Me)return r;t.set(o,u=n.push(i))}return e[(u-1)%e.length]}return i.domain=function(e){if(!arguments.length)return n.slice();n=[],t=we();for(var r,o,u=-1,a=e.length;++u<a;)t.has(o=(r=e[u])+"")||t.set(o,n.push(r));return i},i.range=function(t){return arguments.length?(e=Ee.call(t),i):e.slice()},i.unknown=function(t){return arguments.length?(r=t,i):r},i.copy=function(){return Se(n,e).unknown(r)},ke.apply(i,arguments),i}function Pe(t,n,e){this.k=t,this.x=n,this.y=e}Pe.prototype={constructor:Pe,scale:function(t){return 1===t?this:new Pe(this.k*t,this.x,this.y)},translate:function(t,n){return 0===t&0===n?this:new Pe(this.k,this.x+this.k*t,this.y+this.k*n)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var $e=new Pe(1,0,0);export{mt as S,Pe as T,o as a,Ln as b,pt as c,wt as d,at as e,Qt as f,nn as g,Yt as h,$e as i,tn as j,on as k,ke as l,we as m,Ne as n,Se as o,r as p,gt as r,Ee as s,Pn as t};
|
|
1
|
+
function t(t,n){return t<n?-1:t>n?1:t>=n?0:NaN}var n,e,r=(1===(n=t).length&&(e=n,n=function(n,r){return t(e(n),r)}),{left:function(t,e,r,i){for(null==r&&(r=0),null==i&&(i=t.length);r<i;){var o=r+i>>>1;n(t[o],e)<0?r=o+1:i=o}return r},right:function(t,e,r,i){for(null==r&&(r=0),null==i&&(i=t.length);r<i;){var o=r+i>>>1;n(t[o],e)>0?i=o:r=o+1}return r}}).right,i={value:function(){}};function o(){for(var t,n=0,e=arguments.length,r={};n<e;++n){if(!(t=arguments[n]+"")||t in r||/[\s.]/.test(t))throw new Error("illegal type: "+t);r[t]=[]}return new u(r)}function u(t){this._=t}function a(t,n){return t.trim().split(/^|\s+/).map((function(t){var e="",r=t.indexOf(".");if(r>=0&&(e=t.slice(r+1),t=t.slice(0,r)),t&&!n.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:e}}))}function s(t,n){for(var e,r=0,i=t.length;r<i;++r)if((e=t[r]).name===n)return e.value}function l(t,n,e){for(var r=0,o=t.length;r<o;++r)if(t[r].name===n){t[r]=i,t=t.slice(0,r).concat(t.slice(r+1));break}return null!=e&&t.push({name:n,value:e}),t}u.prototype=o.prototype={constructor:u,on:function(t,n){var e,r=this._,i=a(t+"",r),o=-1,u=i.length;if(!(arguments.length<2)){if(null!=n&&"function"!=typeof n)throw new Error("invalid callback: "+n);for(;++o<u;)if(e=(t=i[o]).type)r[e]=l(r[e],t.name,n);else if(null==n)for(e in r)r[e]=l(r[e],t.name,null);return this}for(;++o<u;)if((e=(t=i[o]).type)&&(e=s(r[e],t.name)))return e},copy:function(){var t={},n=this._;for(var e in n)t[e]=n[e].slice();return new u(t)},call:function(t,n){if((e=arguments.length-2)>0)for(var e,r,i=new Array(e),o=0;o<e;++o)i[o]=arguments[o+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(o=0,e=(r=this._[t]).length;o<e;++o)r[o].value.apply(n,i)},apply:function(t,n,e){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,o=r.length;i<o;++i)r[i].value.apply(n,e)}};var c="http://www.w3.org/1999/xhtml",h={svg:"http://www.w3.org/2000/svg",xhtml:c,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function f(t){var n=t+="",e=n.indexOf(":");return e>=0&&"xmlns"!==(n=t.slice(0,e))&&(t=t.slice(e+1)),h.hasOwnProperty(n)?{space:h[n],local:t}:t}function p(t){return function(){var n=this.ownerDocument,e=this.namespaceURI;return e===c&&n.documentElement.namespaceURI===c?n.createElement(t):n.createElementNS(e,t)}}function d(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function v(t){var n=f(t);return(n.local?d:p)(n)}function y(){}function g(t){return null==t?y:function(){return this.querySelector(t)}}function m(){return[]}function _(t){return null==t?m:function(){return this.querySelectorAll(t)}}function w(t){return function(){return this.matches(t)}}function b(t){return new Array(t.length)}function x(t,n){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=n}x.prototype={constructor:x,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,n){return this._parent.insertBefore(t,n)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};function k(t,n,e,r,i,o){for(var u,a=0,s=n.length,l=o.length;a<l;++a)(u=n[a])?(u.__data__=o[a],r[a]=u):e[a]=new x(t,o[a]);for(;a<s;++a)(u=n[a])&&(i[a]=u)}function A(t,n,e,r,i,o,u){var a,s,l,c={},h=n.length,f=o.length,p=new Array(h);for(a=0;a<h;++a)(s=n[a])&&(p[a]=l="$"+u.call(s,s.__data__,a,n),l in c?i[a]=s:c[l]=s);for(a=0;a<f;++a)(s=c[l="$"+u.call(t,o[a],a,o)])?(r[a]=s,s.__data__=o[a],c[l]=null):e[a]=new x(t,o[a]);for(a=0;a<h;++a)(s=n[a])&&c[p[a]]===s&&(i[a]=s)}function N(t,n){return t<n?-1:t>n?1:t>=n?0:NaN}function E(t){return function(){this.removeAttribute(t)}}function M(t){return function(){this.removeAttributeNS(t.space,t.local)}}function S(t,n){return function(){this.setAttribute(t,n)}}function P(t,n){return function(){this.setAttributeNS(t.space,t.local,n)}}function $(t,n){return function(){var e=n.apply(this,arguments);null==e?this.removeAttribute(t):this.setAttribute(t,e)}}function q(t,n){return function(){var e=n.apply(this,arguments);null==e?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,e)}}function C(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function X(t){return function(){this.style.removeProperty(t)}}function T(t,n,e){return function(){this.style.setProperty(t,n,e)}}function O(t,n,e){return function(){var r=n.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,e)}}function R(t,n){return t.style.getPropertyValue(n)||C(t).getComputedStyle(t,null).getPropertyValue(n)}function I(t){return function(){delete this[t]}}function Y(t,n){return function(){this[t]=n}}function j(t,n){return function(){var e=n.apply(this,arguments);null==e?delete this[t]:this[t]=e}}function L(t){return t.trim().split(/^|\s+/)}function z(t){return t.classList||new D(t)}function D(t){this._node=t,this._names=L(t.getAttribute("class")||"")}function H(t,n){for(var e=z(t),r=-1,i=n.length;++r<i;)e.add(n[r])}function B(t,n){for(var e=z(t),r=-1,i=n.length;++r<i;)e.remove(n[r])}function V(t){return function(){H(this,t)}}function U(t){return function(){B(this,t)}}function F(t,n){return function(){(n.apply(this,arguments)?H:B)(this,t)}}function G(){this.textContent=""}function J(t){return function(){this.textContent=t}}function K(t){return function(){var n=t.apply(this,arguments);this.textContent=null==n?"":n}}function Q(){this.innerHTML=""}function W(t){return function(){this.innerHTML=t}}function Z(t){return function(){var n=t.apply(this,arguments);this.innerHTML=null==n?"":n}}function tt(){this.nextSibling&&this.parentNode.appendChild(this)}function nt(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function et(){return null}function rt(){var t=this.parentNode;t&&t.removeChild(this)}function it(){var t=this.cloneNode(!1),n=this.parentNode;return n?n.insertBefore(t,this.nextSibling):t}function ot(){var t=this.cloneNode(!0),n=this.parentNode;return n?n.insertBefore(t,this.nextSibling):t}D.prototype={add:function(t){this._names.indexOf(t)<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var n=this._names.indexOf(t);n>=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var ut={},at=null;"undefined"!=typeof document&&("onmouseenter"in document.documentElement||(ut={mouseenter:"mouseover",mouseleave:"mouseout"}));function st(t,n,e){return t=lt(t,n,e),function(n){var e=n.relatedTarget;e&&(e===this||8&e.compareDocumentPosition(this))||t.call(this,n)}}function lt(t,n,e){return function(r){var i=at;at=r;try{t.call(this,this.__data__,n,e)}finally{at=i}}}function ct(t){return t.trim().split(/^|\s+/).map((function(t){var n="",e=t.indexOf(".");return e>=0&&(n=t.slice(e+1),t=t.slice(0,e)),{type:t,name:n}}))}function ht(t){return function(){var n=this.__on;if(n){for(var e,r=0,i=-1,o=n.length;r<o;++r)e=n[r],t.type&&e.type!==t.type||e.name!==t.name?n[++i]=e:this.removeEventListener(e.type,e.listener,e.capture);++i?n.length=i:delete this.__on}}}function ft(t,n,e){var r=ut.hasOwnProperty(t.type)?st:lt;return function(i,o,u){var a,s=this.__on,l=r(n,o,u);if(s)for(var c=0,h=s.length;c<h;++c)if((a=s[c]).type===t.type&&a.name===t.name)return this.removeEventListener(a.type,a.listener,a.capture),this.addEventListener(a.type,a.listener=l,a.capture=e),void(a.value=n);this.addEventListener(t.type,l,e),a={type:t.type,name:t.name,value:n,listener:l,capture:e},s?s.push(a):this.__on=[a]}}function pt(t,n,e,r){var i=at;t.sourceEvent=at,at=t;try{return n.apply(e,r)}finally{at=i}}function dt(t,n,e){var r=C(t),i=r.CustomEvent;"function"==typeof i?i=new i(n,e):(i=r.document.createEvent("Event"),e?(i.initEvent(n,e.bubbles,e.cancelable),i.detail=e.detail):i.initEvent(n,!1,!1)),t.dispatchEvent(i)}function vt(t,n){return function(){return dt(this,t,n)}}function yt(t,n){return function(){return dt(this,t,n.apply(this,arguments))}}var gt=[null];function mt(t,n){this._groups=t,this._parents=n}function _t(){return new mt([[document.documentElement]],gt)}function wt(t){return"string"==typeof t?new mt([[document.querySelector(t)]],[document.documentElement]):new mt([[t]],gt)}function bt(t,n,e){t.prototype=n.prototype=e,e.constructor=t}function xt(t,n){var e=Object.create(t.prototype);for(var r in n)e[r]=n[r];return e}function kt(){}mt.prototype=_t.prototype={constructor:mt,select:function(t){"function"!=typeof t&&(t=g(t));for(var n=this._groups,e=n.length,r=new Array(e),i=0;i<e;++i)for(var o,u,a=n[i],s=a.length,l=r[i]=new Array(s),c=0;c<s;++c)(o=a[c])&&(u=t.call(o,o.__data__,c,a))&&("__data__"in o&&(u.__data__=o.__data__),l[c]=u);return new mt(r,this._parents)},selectAll:function(t){"function"!=typeof t&&(t=_(t));for(var n=this._groups,e=n.length,r=[],i=[],o=0;o<e;++o)for(var u,a=n[o],s=a.length,l=0;l<s;++l)(u=a[l])&&(r.push(t.call(u,u.__data__,l,a)),i.push(u));return new mt(r,i)},filter:function(t){"function"!=typeof t&&(t=w(t));for(var n=this._groups,e=n.length,r=new Array(e),i=0;i<e;++i)for(var o,u=n[i],a=u.length,s=r[i]=[],l=0;l<a;++l)(o=u[l])&&t.call(o,o.__data__,l,u)&&s.push(o);return new mt(r,this._parents)},data:function(t,n){if(!t)return d=new Array(this.size()),c=-1,this.each((function(t){d[++c]=t})),d;var e,r=n?A:k,i=this._parents,o=this._groups;"function"!=typeof t&&(e=t,t=function(){return e});for(var u=o.length,a=new Array(u),s=new Array(u),l=new Array(u),c=0;c<u;++c){var h=i[c],f=o[c],p=f.length,d=t.call(h,h&&h.__data__,c,i),v=d.length,y=s[c]=new Array(v),g=a[c]=new Array(v);r(h,f,y,g,l[c]=new Array(p),d,n);for(var m,_,w=0,b=0;w<v;++w)if(m=y[w]){for(w>=b&&(b=w+1);!(_=g[b])&&++b<v;);m._next=_||null}}return(a=new mt(a,i))._enter=s,a._exit=l,a},enter:function(){return new mt(this._enter||this._groups.map(b),this._parents)},exit:function(){return new mt(this._exit||this._groups.map(b),this._parents)},join:function(t,n,e){var r=this.enter(),i=this,o=this.exit();return r="function"==typeof t?t(r):r.append(t+""),null!=n&&(i=n(i)),null==e?o.remove():e(o),r&&i?r.merge(i).order():i},merge:function(t){for(var n=this._groups,e=t._groups,r=n.length,i=e.length,o=Math.min(r,i),u=new Array(r),a=0;a<o;++a)for(var s,l=n[a],c=e[a],h=l.length,f=u[a]=new Array(h),p=0;p<h;++p)(s=l[p]||c[p])&&(f[p]=s);for(;a<r;++a)u[a]=n[a];return new mt(u,this._parents)},order:function(){for(var t=this._groups,n=-1,e=t.length;++n<e;)for(var r,i=t[n],o=i.length-1,u=i[o];--o>=0;)(r=i[o])&&(u&&4^r.compareDocumentPosition(u)&&u.parentNode.insertBefore(r,u),u=r);return this},sort:function(t){function n(n,e){return n&&e?t(n.__data__,e.__data__):!n-!e}t||(t=N);for(var e=this._groups,r=e.length,i=new Array(r),o=0;o<r;++o){for(var u,a=e[o],s=a.length,l=i[o]=new Array(s),c=0;c<s;++c)(u=a[c])&&(l[c]=u);l.sort(n)}return new mt(i,this._parents).order()},call:function(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this},nodes:function(){var t=new Array(this.size()),n=-1;return this.each((function(){t[++n]=this})),t},node:function(){for(var t=this._groups,n=0,e=t.length;n<e;++n)for(var r=t[n],i=0,o=r.length;i<o;++i){var u=r[i];if(u)return u}return null},size:function(){var t=0;return this.each((function(){++t})),t},empty:function(){return!this.node()},each:function(t){for(var n=this._groups,e=0,r=n.length;e<r;++e)for(var i,o=n[e],u=0,a=o.length;u<a;++u)(i=o[u])&&t.call(i,i.__data__,u,o);return this},attr:function(t,n){var e=f(t);if(arguments.length<2){var r=this.node();return e.local?r.getAttributeNS(e.space,e.local):r.getAttribute(e)}return this.each((null==n?e.local?M:E:"function"==typeof n?e.local?q:$:e.local?P:S)(e,n))},style:function(t,n,e){return arguments.length>1?this.each((null==n?X:"function"==typeof n?O:T)(t,n,null==e?"":e)):R(this.node(),t)},property:function(t,n){return arguments.length>1?this.each((null==n?I:"function"==typeof n?j:Y)(t,n)):this.node()[t]},classed:function(t,n){var e=L(t+"");if(arguments.length<2){for(var r=z(this.node()),i=-1,o=e.length;++i<o;)if(!r.contains(e[i]))return!1;return!0}return this.each(("function"==typeof n?F:n?V:U)(e,n))},text:function(t){return arguments.length?this.each(null==t?G:("function"==typeof t?K:J)(t)):this.node().textContent},html:function(t){return arguments.length?this.each(null==t?Q:("function"==typeof t?Z:W)(t)):this.node().innerHTML},raise:function(){return this.each(tt)},lower:function(){return this.each(nt)},append:function(t){var n="function"==typeof t?t:v(t);return this.select((function(){return this.appendChild(n.apply(this,arguments))}))},insert:function(t,n){var e="function"==typeof t?t:v(t),r=null==n?et:"function"==typeof n?n:g(n);return this.select((function(){return this.insertBefore(e.apply(this,arguments),r.apply(this,arguments)||null)}))},remove:function(){return this.each(rt)},clone:function(t){return this.select(t?ot:it)},datum:function(t){return arguments.length?this.property("__data__",t):this.node().__data__},on:function(t,n,e){var r,i,o=ct(t+""),u=o.length;if(!(arguments.length<2)){for(a=n?ft:ht,null==e&&(e=!1),r=0;r<u;++r)this.each(a(o[r],n,e));return this}var a=this.node().__on;if(a)for(var s,l=0,c=a.length;l<c;++l)for(r=0,s=a[l];r<u;++r)if((i=o[r]).type===s.type&&i.name===s.name)return s.value},dispatch:function(t,n){return this.each(("function"==typeof n?yt:vt)(t,n))}};var At=1/.7,Nt="\\s*([+-]?\\d+)\\s*",Et="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",Mt="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",St=/^#([0-9a-f]{3,8})$/,Pt=new RegExp("^rgb\\("+[Nt,Nt,Nt]+"\\)$"),$t=new RegExp("^rgb\\("+[Mt,Mt,Mt]+"\\)$"),qt=new RegExp("^rgba\\("+[Nt,Nt,Nt,Et]+"\\)$"),Ct=new RegExp("^rgba\\("+[Mt,Mt,Mt,Et]+"\\)$"),Xt=new RegExp("^hsl\\("+[Et,Mt,Mt]+"\\)$"),Tt=new RegExp("^hsla\\("+[Et,Mt,Mt,Et]+"\\)$"),Ot={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function Rt(){return this.rgb().formatHex()}function It(){return this.rgb().formatRgb()}function Yt(t){var n,e;return t=(t+"").trim().toLowerCase(),(n=St.exec(t))?(e=n[1].length,n=parseInt(n[1],16),6===e?jt(n):3===e?new Ht(n>>8&15|n>>4&240,n>>4&15|240&n,(15&n)<<4|15&n,1):8===e?Lt(n>>24&255,n>>16&255,n>>8&255,(255&n)/255):4===e?Lt(n>>12&15|n>>8&240,n>>8&15|n>>4&240,n>>4&15|240&n,((15&n)<<4|15&n)/255):null):(n=Pt.exec(t))?new Ht(n[1],n[2],n[3],1):(n=$t.exec(t))?new Ht(255*n[1]/100,255*n[2]/100,255*n[3]/100,1):(n=qt.exec(t))?Lt(n[1],n[2],n[3],n[4]):(n=Ct.exec(t))?Lt(255*n[1]/100,255*n[2]/100,255*n[3]/100,n[4]):(n=Xt.exec(t))?Ft(n[1],n[2]/100,n[3]/100,1):(n=Tt.exec(t))?Ft(n[1],n[2]/100,n[3]/100,n[4]):Ot.hasOwnProperty(t)?jt(Ot[t]):"transparent"===t?new Ht(NaN,NaN,NaN,0):null}function jt(t){return new Ht(t>>16&255,t>>8&255,255&t,1)}function Lt(t,n,e,r){return r<=0&&(t=n=e=NaN),new Ht(t,n,e,r)}function zt(t){return t instanceof kt||(t=Yt(t)),t?new Ht((t=t.rgb()).r,t.g,t.b,t.opacity):new Ht}function Dt(t,n,e,r){return 1===arguments.length?zt(t):new Ht(t,n,e,null==r?1:r)}function Ht(t,n,e,r){this.r=+t,this.g=+n,this.b=+e,this.opacity=+r}function Bt(){return"#"+Ut(this.r)+Ut(this.g)+Ut(this.b)}function Vt(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}function Ut(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function Ft(t,n,e,r){return r<=0?t=n=e=NaN:e<=0||e>=1?t=n=NaN:n<=0&&(t=NaN),new Jt(t,n,e,r)}function Gt(t){if(t instanceof Jt)return new Jt(t.h,t.s,t.l,t.opacity);if(t instanceof kt||(t=Yt(t)),!t)return new Jt;if(t instanceof Jt)return t;var n=(t=t.rgb()).r/255,e=t.g/255,r=t.b/255,i=Math.min(n,e,r),o=Math.max(n,e,r),u=NaN,a=o-i,s=(o+i)/2;return a?(u=n===o?(e-r)/a+6*(e<r):e===o?(r-n)/a+2:(n-e)/a+4,a/=s<.5?o+i:2-o-i,u*=60):a=s>0&&s<1?0:u,new Jt(u,a,s,t.opacity)}function Jt(t,n,e,r){this.h=+t,this.s=+n,this.l=+e,this.opacity=+r}function Kt(t,n,e){return 255*(t<60?n+(e-n)*t/60:t<180?e:t<240?n+(e-n)*(240-t)/60:n)}function Qt(t){return function(){return t}}function Wt(t){return 1==(t=+t)?Zt:function(n,e){return e-n?function(t,n,e){return t=Math.pow(t,e),n=Math.pow(n,e)-t,e=1/e,function(r){return Math.pow(t+r*n,e)}}(n,e,t):Qt(isNaN(n)?e:n)}}function Zt(t,n){var e=n-t;return e?function(t,n){return function(e){return t+e*n}}(t,e):Qt(isNaN(t)?n:t)}bt(kt,Yt,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:Rt,formatHex:Rt,formatHsl:function(){return Gt(this).formatHsl()},formatRgb:It,toString:It}),bt(Ht,Dt,xt(kt,{brighter:function(t){return t=null==t?At:Math.pow(At,t),new Ht(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new Ht(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Bt,formatHex:Bt,formatRgb:Vt,toString:Vt})),bt(Jt,(function(t,n,e,r){return 1===arguments.length?Gt(t):new Jt(t,n,e,null==r?1:r)}),xt(kt,{brighter:function(t){return t=null==t?At:Math.pow(At,t),new Jt(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new Jt(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),n=isNaN(t)||isNaN(this.s)?0:this.s,e=this.l,r=e+(e<.5?e:1-e)*n,i=2*e-r;return new Ht(Kt(t>=240?t-240:t+120,i,r),Kt(t,i,r),Kt(t<120?t+240:t-120,i,r),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===t?")":", "+t+")")}}));var tn=function t(n){var e=Wt(n);function r(t,n){var r=e((t=Dt(t)).r,(n=Dt(n)).r),i=e(t.g,n.g),o=e(t.b,n.b),u=Zt(t.opacity,n.opacity);return function(n){return t.r=r(n),t.g=i(n),t.b=o(n),t.opacity=u(n),t+""}}return r.gamma=t,r}(1);function nn(t,n){return t=+t,n=+n,function(e){return t*(1-e)+n*e}}var en=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,rn=new RegExp(en.source,"g");function on(t,n){var e,r,i,o=en.lastIndex=rn.lastIndex=0,u=-1,a=[],s=[];for(t+="",n+="";(e=en.exec(t))&&(r=rn.exec(n));)(i=r.index)>o&&(i=n.slice(o,i),a[u]?a[u]+=i:a[++u]=i),(e=e[0])===(r=r[0])?a[u]?a[u]+=r:a[++u]=r:(a[++u]=null,s.push({i:u,x:nn(e,r)})),o=rn.lastIndex;return o<n.length&&(i=n.slice(o),a[u]?a[u]+=i:a[++u]=i),a.length<2?s[0]?function(t){return function(n){return t(n)+""}}(s[0].x):function(t){return function(){return t}}(n):(n=s.length,function(t){for(var e,r=0;r<n;++r)a[(e=s[r]).i]=e.x(t);return a.join("")})}var un,an,sn,ln,cn=180/Math.PI,hn={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function fn(t,n,e,r,i,o){var u,a,s;return(u=Math.sqrt(t*t+n*n))&&(t/=u,n/=u),(s=t*e+n*r)&&(e-=t*s,r-=n*s),(a=Math.sqrt(e*e+r*r))&&(e/=a,r/=a,s/=a),t*r<n*e&&(t=-t,n=-n,s=-s,u=-u),{translateX:i,translateY:o,rotate:Math.atan2(n,t)*cn,skewX:Math.atan(s)*cn,scaleX:u,scaleY:a}}function pn(t,n,e,r){function i(t){return t.length?t.pop()+" ":""}return function(o,u){var a=[],s=[];return o=t(o),u=t(u),function(t,r,i,o,u,a){if(t!==i||r!==o){var s=u.push("translate(",null,n,null,e);a.push({i:s-4,x:nn(t,i)},{i:s-2,x:nn(r,o)})}else(i||o)&&u.push("translate("+i+n+o+e)}(o.translateX,o.translateY,u.translateX,u.translateY,a,s),function(t,n,e,o){t!==n?(t-n>180?n+=360:n-t>180&&(t+=360),o.push({i:e.push(i(e)+"rotate(",null,r)-2,x:nn(t,n)})):n&&e.push(i(e)+"rotate("+n+r)}(o.rotate,u.rotate,a,s),function(t,n,e,o){t!==n?o.push({i:e.push(i(e)+"skewX(",null,r)-2,x:nn(t,n)}):n&&e.push(i(e)+"skewX("+n+r)}(o.skewX,u.skewX,a,s),function(t,n,e,r,o,u){if(t!==e||n!==r){var a=o.push(i(o)+"scale(",null,",",null,")");u.push({i:a-4,x:nn(t,e)},{i:a-2,x:nn(n,r)})}else 1===e&&1===r||o.push(i(o)+"scale("+e+","+r+")")}(o.scaleX,o.scaleY,u.scaleX,u.scaleY,a,s),o=u=null,function(t){for(var n,e=-1,r=s.length;++e<r;)a[(n=s[e]).i]=n.x(t);return a.join("")}}}var dn,vn,yn=pn((function(t){return"none"===t?hn:(un||(un=document.createElement("DIV"),an=document.documentElement,sn=document.defaultView),un.style.transform=t,t=sn.getComputedStyle(an.appendChild(un),null).getPropertyValue("transform"),an.removeChild(un),fn(+(t=t.slice(7,-1).split(","))[0],+t[1],+t[2],+t[3],+t[4],+t[5]))}),"px, ","px)","deg)"),gn=pn((function(t){return null==t?hn:(ln||(ln=document.createElementNS("http://www.w3.org/2000/svg","g")),ln.setAttribute("transform",t),(t=ln.transform.baseVal.consolidate())?fn((t=t.matrix).a,t.b,t.c,t.d,t.e,t.f):hn)}),", ",")",")"),mn=0,_n=0,wn=0,bn=0,xn=0,kn=0,An="object"==typeof performance&&performance.now?performance:Date,Nn="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function En(){return xn||(Nn(Mn),xn=An.now()+kn)}function Mn(){xn=0}function Sn(){this._call=this._time=this._next=null}function Pn(t,n,e){var r=new Sn;return r.restart(t,n,e),r}function $n(){xn=(bn=An.now())+kn,mn=_n=0;try{!function(){En(),++mn;for(var t,n=dn;n;)(t=xn-n._time)>=0&&n._call.call(null,t),n=n._next;--mn}()}finally{mn=0,function(){var t,n,e=dn,r=1/0;for(;e;)e._call?(r>e._time&&(r=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:dn=n);vn=t,Cn(r)}(),xn=0}}function qn(){var t=An.now(),n=t-bn;n>1e3&&(kn-=n,bn=t)}function Cn(t){mn||(_n&&(_n=clearTimeout(_n)),t-xn>24?(t<1/0&&(_n=setTimeout($n,t-An.now()-kn)),wn&&(wn=clearInterval(wn))):(wn||(bn=An.now(),wn=setInterval(qn,1e3)),mn=1,Nn($n)))}function Xn(t,n,e){var r=new Sn;return n=null==n?0:+n,r.restart((function(e){r.stop(),t(e+n)}),n,e),r}Sn.prototype=Pn.prototype={constructor:Sn,restart:function(t,n,e){if("function"!=typeof t)throw new TypeError("callback is not a function");e=(null==e?En():+e)+(null==n?0:+n),this._next||vn===this||(vn?vn._next=this:dn=this,vn=this),this._call=t,this._time=e,Cn()},stop:function(){this._call&&(this._call=null,this._time=1/0,Cn())}};var Tn=o("start","end","cancel","interrupt"),On=[];function Rn(t,n,e,r,i,o){var u=t.__transition;if(u){if(e in u)return}else t.__transition={};!function(t,n,e){var r,i=t.__transition;function o(t){e.state=1,e.timer.restart(u,e.delay,e.time),e.delay<=t&&u(t-e.delay)}function u(o){var l,c,h,f;if(1!==e.state)return s();for(l in i)if((f=i[l]).name===e.name){if(3===f.state)return Xn(u);4===f.state?(f.state=6,f.timer.stop(),f.on.call("interrupt",t,t.__data__,f.index,f.group),delete i[l]):+l<n&&(f.state=6,f.timer.stop(),f.on.call("cancel",t,t.__data__,f.index,f.group),delete i[l])}if(Xn((function(){3===e.state&&(e.state=4,e.timer.restart(a,e.delay,e.time),a(o))})),e.state=2,e.on.call("start",t,t.__data__,e.index,e.group),2===e.state){for(e.state=3,r=new Array(h=e.tween.length),l=0,c=-1;l<h;++l)(f=e.tween[l].value.call(t,t.__data__,e.index,e.group))&&(r[++c]=f);r.length=c+1}}function a(n){for(var i=n<e.duration?e.ease.call(null,n/e.duration):(e.timer.restart(s),e.state=5,1),o=-1,u=r.length;++o<u;)r[o].call(t,i);5===e.state&&(e.on.call("end",t,t.__data__,e.index,e.group),s())}function s(){for(var r in e.state=6,e.timer.stop(),delete i[n],i)return;delete t.__transition}i[n]=e,e.timer=Pn(o,0,e.time)}(t,e,{name:n,index:r,group:i,on:Tn,tween:On,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:0})}function In(t,n){var e=jn(t,n);if(e.state>0)throw new Error("too late; already scheduled");return e}function Yn(t,n){var e=jn(t,n);if(e.state>3)throw new Error("too late; already running");return e}function jn(t,n){var e=t.__transition;if(!e||!(e=e[n]))throw new Error("transition not found");return e}function Ln(t,n){var e,r,i,o=t.__transition,u=!0;if(o){for(i in n=null==n?null:n+"",o)(e=o[i]).name===n?(r=e.state>2&&e.state<5,e.state=6,e.timer.stop(),e.on.call(r?"interrupt":"cancel",t,t.__data__,e.index,e.group),delete o[i]):u=!1;u&&delete t.__transition}}function zn(t,n){var e,r;return function(){var i=Yn(this,t),o=i.tween;if(o!==e)for(var u=0,a=(r=e=o).length;u<a;++u)if(r[u].name===n){(r=r.slice()).splice(u,1);break}i.tween=r}}function Dn(t,n,e){var r,i;if("function"!=typeof e)throw new Error;return function(){var o=Yn(this,t),u=o.tween;if(u!==r){i=(r=u).slice();for(var a={name:n,value:e},s=0,l=i.length;s<l;++s)if(i[s].name===n){i[s]=a;break}s===l&&i.push(a)}o.tween=i}}function Hn(t,n,e){var r=t._id;return t.each((function(){var t=Yn(this,r);(t.value||(t.value={}))[n]=e.apply(this,arguments)})),function(t){return jn(t,r).value[n]}}function Bn(t,n){var e;return("number"==typeof n?nn:n instanceof Yt?tn:(e=Yt(n))?(n=e,tn):on)(t,n)}function Vn(t){return function(){this.removeAttribute(t)}}function Un(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Fn(t,n,e){var r,i,o=e+"";return function(){var u=this.getAttribute(t);return u===o?null:u===r?i:i=n(r=u,e)}}function Gn(t,n,e){var r,i,o=e+"";return function(){var u=this.getAttributeNS(t.space,t.local);return u===o?null:u===r?i:i=n(r=u,e)}}function Jn(t,n,e){var r,i,o;return function(){var u,a,s=e(this);if(null!=s)return(u=this.getAttribute(t))===(a=s+"")?null:u===r&&a===i?o:(i=a,o=n(r=u,s));this.removeAttribute(t)}}function Kn(t,n,e){var r,i,o;return function(){var u,a,s=e(this);if(null!=s)return(u=this.getAttributeNS(t.space,t.local))===(a=s+"")?null:u===r&&a===i?o:(i=a,o=n(r=u,s));this.removeAttributeNS(t.space,t.local)}}function Qn(t,n){return function(e){this.setAttribute(t,n.call(this,e))}}function Wn(t,n){return function(e){this.setAttributeNS(t.space,t.local,n.call(this,e))}}function Zn(t,n){var e,r;function i(){var i=n.apply(this,arguments);return i!==r&&(e=(r=i)&&Wn(t,i)),e}return i._value=n,i}function te(t,n){var e,r;function i(){var i=n.apply(this,arguments);return i!==r&&(e=(r=i)&&Qn(t,i)),e}return i._value=n,i}function ne(t,n){return function(){In(this,t).delay=+n.apply(this,arguments)}}function ee(t,n){return n=+n,function(){In(this,t).delay=n}}function re(t,n){return function(){Yn(this,t).duration=+n.apply(this,arguments)}}function ie(t,n){return n=+n,function(){Yn(this,t).duration=n}}function oe(t,n){if("function"!=typeof n)throw new Error;return function(){Yn(this,t).ease=n}}function ue(t,n,e){var r,i,o=function(t){return(t+"").trim().split(/^|\s+/).every((function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||"start"===t}))}(n)?In:Yn;return function(){var u=o(this,t),a=u.on;a!==r&&(i=(r=a).copy()).on(n,e),u.on=i}}var ae=_t.prototype.constructor;function se(t){return function(){this.style.removeProperty(t)}}function le(t,n,e){return function(r){this.style.setProperty(t,n.call(this,r),e)}}function ce(t,n,e){var r,i;function o(){var o=n.apply(this,arguments);return o!==i&&(r=(i=o)&&le(t,o,e)),r}return o._value=n,o}function he(t){return function(n){this.textContent=t.call(this,n)}}function fe(t){var n,e;function r(){var r=t.apply(this,arguments);return r!==e&&(n=(e=r)&&he(r)),n}return r._value=t,r}var pe=0;function de(t,n,e,r){this._groups=t,this._parents=n,this._name=e,this._id=r}function ve(){return++pe}var ye=_t.prototype;de.prototype={constructor:de,select:function(t){var n=this._name,e=this._id;"function"!=typeof t&&(t=g(t));for(var r=this._groups,i=r.length,o=new Array(i),u=0;u<i;++u)for(var a,s,l=r[u],c=l.length,h=o[u]=new Array(c),f=0;f<c;++f)(a=l[f])&&(s=t.call(a,a.__data__,f,l))&&("__data__"in a&&(s.__data__=a.__data__),h[f]=s,Rn(h[f],n,e,f,h,jn(a,e)));return new de(o,this._parents,n,e)},selectAll:function(t){var n=this._name,e=this._id;"function"!=typeof t&&(t=_(t));for(var r=this._groups,i=r.length,o=[],u=[],a=0;a<i;++a)for(var s,l=r[a],c=l.length,h=0;h<c;++h)if(s=l[h]){for(var f,p=t.call(s,s.__data__,h,l),d=jn(s,e),v=0,y=p.length;v<y;++v)(f=p[v])&&Rn(f,n,e,v,p,d);o.push(p),u.push(s)}return new de(o,u,n,e)},filter:function(t){"function"!=typeof t&&(t=w(t));for(var n=this._groups,e=n.length,r=new Array(e),i=0;i<e;++i)for(var o,u=n[i],a=u.length,s=r[i]=[],l=0;l<a;++l)(o=u[l])&&t.call(o,o.__data__,l,u)&&s.push(o);return new de(r,this._parents,this._name,this._id)},merge:function(t){if(t._id!==this._id)throw new Error;for(var n=this._groups,e=t._groups,r=n.length,i=e.length,o=Math.min(r,i),u=new Array(r),a=0;a<o;++a)for(var s,l=n[a],c=e[a],h=l.length,f=u[a]=new Array(h),p=0;p<h;++p)(s=l[p]||c[p])&&(f[p]=s);for(;a<r;++a)u[a]=n[a];return new de(u,this._parents,this._name,this._id)},selection:function(){return new ae(this._groups,this._parents)},transition:function(){for(var t=this._name,n=this._id,e=ve(),r=this._groups,i=r.length,o=0;o<i;++o)for(var u,a=r[o],s=a.length,l=0;l<s;++l)if(u=a[l]){var c=jn(u,n);Rn(u,t,e,l,a,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new de(r,this._parents,t,e)},call:ye.call,nodes:ye.nodes,node:ye.node,size:ye.size,empty:ye.empty,each:ye.each,on:function(t,n){var e=this._id;return arguments.length<2?jn(this.node(),e).on.on(t):this.each(ue(e,t,n))},attr:function(t,n){var e=f(t),r="transform"===e?gn:Bn;return this.attrTween(t,"function"==typeof n?(e.local?Kn:Jn)(e,r,Hn(this,"attr."+t,n)):null==n?(e.local?Un:Vn)(e):(e.local?Gn:Fn)(e,r,n))},attrTween:function(t,n){var e="attr."+t;if(arguments.length<2)return(e=this.tween(e))&&e._value;if(null==n)return this.tween(e,null);if("function"!=typeof n)throw new Error;var r=f(t);return this.tween(e,(r.local?Zn:te)(r,n))},style:function(t,n,e){var r="transform"==(t+="")?yn:Bn;return null==n?this.styleTween(t,function(t,n){var e,r,i;return function(){var o=R(this,t),u=(this.style.removeProperty(t),R(this,t));return o===u?null:o===e&&u===r?i:i=n(e=o,r=u)}}(t,r)).on("end.style."+t,se(t)):"function"==typeof n?this.styleTween(t,function(t,n,e){var r,i,o;return function(){var u=R(this,t),a=e(this),s=a+"";return null==a&&(this.style.removeProperty(t),s=a=R(this,t)),u===s?null:u===r&&s===i?o:(i=s,o=n(r=u,a))}}(t,r,Hn(this,"style."+t,n))).each(function(t,n){var e,r,i,o,u="style."+n,a="end."+u;return function(){var s=Yn(this,t),l=s.on,c=null==s.value[u]?o||(o=se(n)):void 0;l===e&&i===c||(r=(e=l).copy()).on(a,i=c),s.on=r}}(this._id,t)):this.styleTween(t,function(t,n,e){var r,i,o=e+"";return function(){var u=R(this,t);return u===o?null:u===r?i:i=n(r=u,e)}}(t,r,n),e).on("end.style."+t,null)},styleTween:function(t,n,e){var r="style."+(t+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==n)return this.tween(r,null);if("function"!=typeof n)throw new Error;return this.tween(r,ce(t,n,null==e?"":e))},text:function(t){return this.tween("text","function"==typeof t?function(t){return function(){var n=t(this);this.textContent=null==n?"":n}}(Hn(this,"text",t)):function(t){return function(){this.textContent=t}}(null==t?"":t+""))},textTween:function(t){var n="text";if(arguments.length<1)return(n=this.tween(n))&&n._value;if(null==t)return this.tween(n,null);if("function"!=typeof t)throw new Error;return this.tween(n,fe(t))},remove:function(){return this.on("end.remove",function(t){return function(){var n=this.parentNode;for(var e in this.__transition)if(+e!==t)return;n&&n.removeChild(this)}}(this._id))},tween:function(t,n){var e=this._id;if(t+="",arguments.length<2){for(var r,i=jn(this.node(),e).tween,o=0,u=i.length;o<u;++o)if((r=i[o]).name===t)return r.value;return null}return this.each((null==n?zn:Dn)(e,t,n))},delay:function(t){var n=this._id;return arguments.length?this.each(("function"==typeof t?ne:ee)(n,t)):jn(this.node(),n).delay},duration:function(t){var n=this._id;return arguments.length?this.each(("function"==typeof t?re:ie)(n,t)):jn(this.node(),n).duration},ease:function(t){var n=this._id;return arguments.length?this.each(oe(n,t)):jn(this.node(),n).ease},end:function(){var t,n,e=this,r=e._id,i=e.size();return new Promise((function(o,u){var a={value:u},s={value:function(){0==--i&&o()}};e.each((function(){var e=Yn(this,r),i=e.on;i!==t&&((n=(t=i).copy())._.cancel.push(a),n._.interrupt.push(a),n._.end.push(s)),e.on=n}))}))}};var ge={time:null,delay:0,duration:250,ease:function(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}};function me(t,n){for(var e;!(e=t.__transition)||!(e=e[n]);)if(!(t=t.parentNode))return ge.time=En(),ge;return e}_t.prototype.interrupt=function(t){return this.each((function(){Ln(this,t)}))},_t.prototype.transition=function(t){var n,e;t instanceof de?(n=t._id,t=t._name):(n=ve(),(e=ge).time=En(),t=null==t?null:t+"");for(var r=this._groups,i=r.length,o=0;o<i;++o)for(var u,a=r[o],s=a.length,l=0;l<s;++l)(u=a[l])&&Rn(u,t,n,l,a,e||me(u,n));return new de(r,this._parents,t,n)};function _e(){}function we(t,n){var e=new _e;if(t instanceof _e)t.each((function(t,n){e.set(n,t)}));else if(Array.isArray(t)){var r,i=-1,o=t.length;if(null==n)for(;++i<o;)e.set(i,t[i]);else for(;++i<o;)e.set(n(r=t[i],i,t),r)}else if(t)for(var u in t)e.set(u,t[u]);return e}function be(){}_e.prototype=we.prototype={constructor:_e,has:function(t){return"$"+t in this},get:function(t){return this["$"+t]},set:function(t,n){return this["$"+t]=n,this},remove:function(t){var n="$"+t;return n in this&&delete this[n]},clear:function(){for(var t in this)"$"===t[0]&&delete this[t]},keys:function(){var t=[];for(var n in this)"$"===n[0]&&t.push(n.slice(1));return t},values:function(){var t=[];for(var n in this)"$"===n[0]&&t.push(this[n]);return t},entries:function(){var t=[];for(var n in this)"$"===n[0]&&t.push({key:n.slice(1),value:this[n]});return t},size:function(){var t=0;for(var n in this)"$"===n[0]&&++t;return t},empty:function(){for(var t in this)if("$"===t[0])return!1;return!0},each:function(t){for(var n in this)"$"===n[0]&&t(this[n],n.slice(1),this)}};var xe=we.prototype;function ke(t,n){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(n).domain(t)}return this}be.prototype={constructor:be,has:xe.has,add:function(t){return this["$"+(t+="")]=t,this},remove:xe.remove,clear:xe.clear,values:xe.keys,size:xe.size,empty:xe.empty,each:xe.each};var Ae=Array.prototype,Ne=Ae.map,Ee=Ae.slice,Me={name:"implicit"};function Se(){var t=we(),n=[],e=[],r=Me;function i(i){var o=i+"",u=t.get(o);if(!u){if(r!==Me)return r;t.set(o,u=n.push(i))}return e[(u-1)%e.length]}return i.domain=function(e){if(!arguments.length)return n.slice();n=[],t=we();for(var r,o,u=-1,a=e.length;++u<a;)t.has(o=(r=e[u])+"")||t.set(o,n.push(r));return i},i.range=function(t){return arguments.length?(e=Ee.call(t),i):e.slice()},i.unknown=function(t){return arguments.length?(r=t,i):r},i.copy=function(){return Se(n,e).unknown(r)},ke.apply(i,arguments),i}function Pe(t,n,e){this.k=t,this.x=n,this.y=e}Pe.prototype={constructor:Pe,scale:function(t){return 1===t?this:new Pe(this.k*t,this.x,this.y)},translate:function(t,n){return 0===t&0===n?this:new Pe(this.k,this.x+this.k*t,this.y+this.k*n)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var $e=new Pe(1,0,0);export{Pe as T,o as a,Ln as b,pt as c,wt as d,at as e,Qt as f,nn as g,Yt as h,$e as i,tn as j,on as k,ke as l,we as m,Ne as n,Se as o,r as p,Ee as s,Pn as t};
|
package/package.json
CHANGED