3 lines
154 KiB
JavaScript
3 lines
154 KiB
JavaScript
|
(function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):(e=e||self,t(e.canvg={}))})(this,function(e){'use strict';var ce=Math.tan,pe=Math.atan2,ye=Math.PI,he=Math.round,fe=String.prototype,me=Math.max,xe=Math.min,be=Math.ceil,ve=Math.sin,ke=Math.cos,Se=Math.floor,Pe=Math.sqrt,Ae=Math.pow;function t(e,t){return t={exports:{}},e(t,t.exports),t.exports}function n(e,t){return RegExp(e,t)}function a(e){return e.replace(/(?!\u3000)\s+/gm," ")}function r(e){return e.replace(/^[\n \t]+/,"")}function l(e){return e.replace(/[\n \t]+$/,"")}function o(e){var t=(e||"").match(/-?(\d+(?:\.\d*(?:[eE][+-]?\d+)?)?|\.\d+)(?=\D|$)/gm)||[];return t.map(parseFloat)}function s(e){return ua.test(e)?e.toLowerCase():e}function d(e){var t=e.match(/url\(('([^']+)'|"([^"]+)"|([^'"\)]+))\)/)||[];return t[2]||t[3]||t[4]}function u(e,t){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)){var n=[],a=!0,r=!1,i=void 0;try{for(var l=e[Symbol.iterator](),o;!(a=(o=l.next()).done)&&(n.push(o.value),!(t&&n.length===t));a=!0);}catch(e){r=!0,i=e}finally{try{a||null==l["return"]||l["return"]()}finally{if(r)throw i}}return n}}function g(e,t){return ha(e)||fa(e,t)||ma()}function p(e,t){var n=e.match(t);return n?[e.replace(t," "),n.length]:[e,0]}function y(e){var t=[0,0,0],n=e.replace(/:not\(([^\)]*)\)/g," $1 ").replace(/{[\s\S]*/gm," "),a=0,r=p(n,ba),i=xa(r,2);n=i[0],a=i[1],t[1]+=a;var l=p(n,va),o=xa(l,2);n=o[0],a=o[1],t[0]+=a;var s=p(n,ka),d=xa(s,2);n=d[0],a=d[1],t[1]+=a;var u=p(n,Sa),g=xa(u,2);n=g[0],a=g[1],t[2]+=a;var c=p(n,Pa),y=xa(c,2);n=y[0],a=y[1],t[1]+=a;var h=p(n,Aa),f=xa(h,2);n=f[0],a=f[1],t[1]+=a,n=n.replace(/[\*\s\+>~]/g," ").replace(/[#\.]/g," ");var m=p(n,Ea),x=xa(m,2);return n=x[0],a=x[1],t[2]+=a,t.join("")}function h(e){return Pe(Ae(e[0],2)+Ae(e[1],2))}function x(e,t){return(e[0]*t[0]+e[1]*t[1])/(h(e)*h(t))}function b(e,t){var n=Math.acos;return(e[0]*t[1]<e[1]*t[0]?-1:1)*n(x(e,t))}function v(e){return e*e*e}function k(e){return 3*e*e*(1-e)}function S(e){return 3*e*(1-e)*(1-e)}function P(e){return(1-e)*(1-e)*(1-e)}function A(e){return e*e}function E(e){return 2*e*(1-e)}function T(e){return(1-e)*(1-e)}function C(e,t,n,a,r,i,l){try{var o=e[i](l),s=o.value}catch(e){return void n(e)}o.done?t(s):Promise.resolve(s).then(a,r)}function w(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function O(e,t){for(var n=0,a;n<t.length;n++)a=t[n],a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}function V(){throw new Error("setTimeout has not been defined")}function R(){throw new Error("clearTimeout has not been defined")}function L(t){if(co===setTimeout)return setTimeout(t,0);if((co===V||!co)&&setTimeout)return co=setTimeout,setTimeout(t,0);try{return co(t,0)}catch(n){try{return co.call(null,t,0)}catch(n){return co.call(this,t,0)}}}function I(t){if(po===clearTimeout)return clearTimeout(t);if((po===R||!po)&&clearTimeout)return po=clearTimeout,clearTimeout(t);try{return po(t)}catch(n){try{return po.call(null,t)}catch(n){return po.call(this,t)}}}function D(){ho&&mo&&(ho=!1,mo.length?yo=mo.concat(yo):fo=-1,yo.length&&N())}function N(){if(!ho){var e=L(D);ho=!0;for(var t=yo.length;t;){for(mo=yo,yo=[];++fo<t;)mo&&mo[fo].run();fo=-1,t=yo.length}mo=null,ho=!1,I(e)}}function M(e){var t=Array(arguments.length-1);if(1<arguments.length)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];yo.push(new z(e,t)),1!==yo.length||ho||L(N)}function z(e,t){this.fun=e,this.array=t}function B(){}function _(){throw new Error("process.binding is not supported")}function F(){return"/"}function G(){throw new Error("process.chdir is not supported")}function H(){return 0}function Y(e){var t=1e-3*Ao.call(Po),n=Se(t),a=Se(1e9*(t%1));return e&&(n-=e[0],a-=e[1],0>a&&(n--,a+=1e9)),[n,a]}function $(){var e=new Date;return(e-Eo)/1e3}function U(e){var t=e.trim();return /^('|")/.test(t)?t:"\"".concat(t,"\"")}function W(e){return"undefined"==typeof process?e:e.t
|
||
|
//# sourceMappingURL=umd.js.map
|