UNPKG

markdown-flow-ui

Version:

A React UI library for rendering markdown with interactive flow components, typewriter effects, and plugin support

3 lines (2 loc) 5.89 kB
"use strict";const m=require("./index-CbHAb2u0.js"),j=require("./init-CHZsXQcr.js"),g=require("./defaultLocale-DIVzfLaQ.js");function p(n,r){return n==null||r==null?NaN:n<r?-1:n>r?1:n>=r?0:NaN}function D(n,r){return n==null||r==null?NaN:r<n?-1:r>n?1:r>=n?0:NaN}function d(n){let r,t,e;n.length!==2?(r=p,t=(a,f)=>p(n(a),f),e=(a,f)=>n(a)-f):(r=n===p||n===D?n:F,t=n,e=n);function u(a,f,i=0,s=a.length){if(i<s){if(r(f,f)!==0)return s;do{const l=i+s>>>1;t(a[l],f)<0?i=l+1:s=l}while(i<s)}return i}function c(a,f,i=0,s=a.length){if(i<s){if(r(f,f)!==0)return s;do{const l=i+s>>>1;t(a[l],f)<=0?i=l+1:s=l}while(i<s)}return i}function o(a,f,i=0,s=a.length){const l=u(a,f,i,s-1);return l>i&&e(a[l-1],f)>-e(a[l],f)?l-1:l}return{left:u,center:o,right:c}}function F(){return 0}function $(n){return n===null?NaN:+n}const z=d(p),B=z.right;d($).center;const I=Math.sqrt(50),P=Math.sqrt(10),V=Math.sqrt(2);function v(n,r,t){const e=(r-n)/Math.max(0,t),u=Math.floor(Math.log10(e)),c=e/Math.pow(10,u),o=c>=I?10:c>=P?5:c>=V?2:1;let a,f,i;return u<0?(i=Math.pow(10,-u)/o,a=Math.round(n*i),f=Math.round(r*i),a/i<n&&++a,f/i>r&&--f,i=-i):(i=Math.pow(10,u)*o,a=Math.round(n/i),f=Math.round(r/i),a*i<n&&++a,f*i>r&&--f),f<a&&.5<=t&&t<2?v(n,r,t*2):[a,f,i]}function L(n,r,t){if(r=+r,n=+n,t=+t,!(t>0))return[];if(n===r)return[n];const e=r<n,[u,c,o]=e?v(r,n,t):v(n,r,t);if(!(c>=u))return[];const a=c-u+1,f=new Array(a);if(e)if(o<0)for(let i=0;i<a;++i)f[i]=(c-i)/-o;else for(let i=0;i<a;++i)f[i]=(c-i)*o;else if(o<0)for(let i=0;i<a;++i)f[i]=(u+i)/-o;else for(let i=0;i<a;++i)f[i]=(u+i)*o;return f}function y(n,r,t){return r=+r,n=+n,t=+t,v(n,r,t)[2]}function A(n,r,t){r=+r,n=+n,t=+t;const e=r<n,u=e?y(r,n,t):y(n,r,t);return(e?-1:1)*(u<0?1/-u:u)}function O(n,r){r||(r=[]);var t=n?Math.min(r.length,n.length):0,e=r.slice(),u;return function(c){for(u=0;u<t;++u)e[u]=n[u]*(1-c)+r[u]*c;return e}}function T(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}function C(n,r){var t=r?r.length:0,e=n?Math.min(t,n.length):0,u=new Array(e),c=new Array(t),o;for(o=0;o<e;++o)u[o]=w(n[o],r[o]);for(;o<t;++o)c[o]=r[o];return function(a){for(o=0;o<e;++o)c[o]=u[o](a);return c}}function E(n,r){var t=new Date;return n=+n,r=+r,function(e){return t.setTime(n*(1-e)+r*e),t}}function G(n,r){var t={},e={},u;(n===null||typeof n!="object")&&(n={}),(r===null||typeof r!="object")&&(r={});for(u in r)u in n?t[u]=w(n[u],r[u]):e[u]=r[u];return function(c){for(u in t)e[u]=t[u](c);return e}}function w(n,r){var t=typeof r,e;return r==null||t==="boolean"?m.constant$2(r):(t==="number"?m.interpolateNumber:t==="string"?(e=m.color(r))?(r=e,m.interpolateRgb):m.interpolateString:r instanceof m.color?m.interpolateRgb:r instanceof Date?E:T(r)?O:Array.isArray(r)?C:typeof r.valueOf!="function"&&typeof r.toString!="function"||isNaN(r)?G:m.interpolateNumber)(n,r)}function H(n,r){return n=+n,r=+r,function(t){return Math.round(n*(1-t)+r*t)}}function J(n){return Math.max(0,-g.exponent(Math.abs(n)))}function K(n,r){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(g.exponent(r)/3)))*3-g.exponent(Math.abs(n)))}function Q(n,r){return n=Math.abs(n),r=Math.abs(r)-n,Math.max(0,g.exponent(r)-g.exponent(n))+1}function U(n){return function(){return n}}function W(n){return+n}var k=[0,1];function M(n){return n}function N(n,r){return(r-=n=+n)?function(t){return(t-n)/r}:U(isNaN(r)?NaN:.5)}function X(n,r){var t;return n>r&&(t=n,n=r,r=t),function(e){return Math.max(n,Math.min(r,e))}}function Y(n,r,t){var e=n[0],u=n[1],c=r[0],o=r[1];return u<e?(e=N(u,e),c=t(o,c)):(e=N(e,u),c=t(c,o)),function(a){return c(e(a))}}function Z(n,r,t){var e=Math.min(n.length,r.length)-1,u=new Array(e),c=new Array(e),o=-1;for(n[e]<n[0]&&(n=n.slice().reverse(),r=r.slice().reverse());++o<e;)u[o]=N(n[o],n[o+1]),c[o]=t(r[o],r[o+1]);return function(a){var f=B(n,a,1,e)-1;return c[f](u[f](a))}}function R(n,r){return r.domain(n.domain()).range(n.range()).interpolate(n.interpolate()).clamp(n.clamp()).unknown(n.unknown())}function _(){var n=k,r=k,t=w,e,u,c,o=M,a,f,i;function s(){var h=Math.min(n.length,r.length);return o!==M&&(o=X(n[0],n[h-1])),a=h>2?Z:Y,f=i=null,l}function l(h){return h==null||isNaN(h=+h)?c:(f||(f=a(n.map(e),r,t)))(e(o(h)))}return l.invert=function(h){return o(u((i||(i=a(r,n.map(e),m.interpolateNumber)))(h)))},l.domain=function(h){return arguments.length?(n=Array.from(h,W),s()):n.slice()},l.range=function(h){return arguments.length?(r=Array.from(h),s()):r.slice()},l.rangeRound=function(h){return r=Array.from(h),t=H,s()},l.clamp=function(h){return arguments.length?(o=h?!0:M,s()):o!==M},l.interpolate=function(h){return arguments.length?(t=h,s()):t},l.unknown=function(h){return arguments.length?(c=h,l):c},function(h,x){return e=h,u=x,s()}}function q(){return _()(M,M)}function b(n,r,t,e){var u=A(n,r,t),c;switch(e=g.formatSpecifier(e??",f"),e.type){case"s":{var o=Math.max(Math.abs(n),Math.abs(r));return e.precision==null&&!isNaN(c=K(u,o))&&(e.precision=c),g.formatPrefix(e,o)}case"":case"e":case"g":case"p":case"r":{e.precision==null&&!isNaN(c=Q(u,Math.max(Math.abs(n),Math.abs(r))))&&(e.precision=c-(e.type==="e"));break}case"f":case"%":{e.precision==null&&!isNaN(c=J(u))&&(e.precision=c-(e.type==="%")*2);break}}return g.format(e)}function nn(n){var r=n.domain;return n.ticks=function(t){var e=r();return L(e[0],e[e.length-1],t??10)},n.tickFormat=function(t,e){var u=r();return b(u[0],u[u.length-1],t??10,e)},n.nice=function(t){t==null&&(t=10);var e=r(),u=0,c=e.length-1,o=e[u],a=e[c],f,i,s=10;for(a<o&&(i=o,o=a,a=i,i=u,u=c,c=i);s-- >0;){if(i=y(o,a,t),i===f)return e[u]=o,e[c]=a,r(e);if(i>0)o=Math.floor(o/i)*i,a=Math.ceil(a/i)*i;else if(i<0)o=Math.ceil(o*i)/i,a=Math.floor(a*i)/i;else break;f=i}return n},n}function S(){var n=q();return n.copy=function(){return R(n,S())},j.initRange.apply(n,arguments),nn(n)}exports.bisector=d;exports.continuous=q;exports.copy=R;exports.linear=S;exports.tickStep=A; //# sourceMappingURL=linear-DpjffQGn.js.map