UNPKG

franken-ui

Version:

Franken UI is an HTML-first, open-source library of UI components based on the utility-first Tailwind CSS with UIkit 3 compatibility. The design is based on shadcn/ui ported to be framework-agnostic.

4 lines 574 kB
var FRANKENUICHART=function(De,Ne,Ni){"use strict";function Wi(o){if(o.startsWith("{"))try{return JSON.parse(o)}catch{return console.error("Error parsing",o),{}}if(o.includes(":"))try{const e={};return o.replace(/[;\s]+$/,"").split(";").forEach(t=>{const i=t.trim().split(/:(.*)/);e[i[0].trim()]=i[1].trim()}),e}catch{return console.error("Error parsing",o),{}}return o}var ts=Object.defineProperty,Lt=(o,e,t,i)=>{for(var a=void 0,s=o.length-1,r;s>=0;s--)(r=o[s])&&(a=r(e,t,a)||a);return a&&ts(e,t,a),a};class ht extends Ni.LitElement{constructor(){super(...arguments),this["cls-custom"]="",this.i18n="",this.$i18n={},this.$cls={}}get $locales(){const e={};return Object.keys(this.$i18n).forEach(t=>{e[t]=this.$i18n[t].includes(",")?this.$i18n[t].split(",").map(i=>i.trim()):this.$i18n[t]}),e}initializeCls(){if(this["cls-custom"]){const e=Wi(this["cls-custom"]);typeof e=="string"?this.$cls[this["cls-default-element"]]=e:Object.keys(this.$cls).forEach(t=>{const i=t;e[i]&&(this.$cls[i]=e[i])})}}initializeI18n(){if(this.i18n){const e=Wi(this.i18n);typeof e=="object"&&(this.$i18n=Object.assign(this.$i18n,e))}}connectedCallback(){super.connectedCallback(),this.initializeCls(),this.initializeI18n()}createRenderRoot(){return this}}Lt([Ne.property({type:String})],ht.prototype,"cls-custom"),Lt([Ne.property({type:String})],ht.prototype,"i18n"),Lt([Ne.state()],ht.prototype,"$i18n"),Lt([Ne.state()],ht.prototype,"$cls");function _t(o,e){(e==null||e>o.length)&&(e=o.length);for(var t=0,i=Array(e);t<e;t++)i[t]=o[t];return i}function _i(o){if(o===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return o}function O(o,e){if(!(o instanceof e))throw new TypeError("Cannot call a class as a function")}function Bi(o,e){for(var t=0;t<e.length;t++){var i=e[t];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(o,Ui(i.key),i)}}function F(o,e,t){return e&&Bi(o.prototype,e),t&&Bi(o,t),Object.defineProperty(o,"prototype",{writable:!1}),o}function ct(o,e){var t=typeof Symbol<"u"&&o[Symbol.iterator]||o["@@iterator"];if(!t){if(Array.isArray(o)||(t=Gt(o))||e){t&&(o=t);var i=0,a=function(){};return{s:a,n:function(){return i>=o.length?{done:!0}:{done:!1,value:o[i++]}},e:function(l){throw l},f:a}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var s,r=!0,n=!1;return{s:function(){t=t.call(o)},n:function(){var l=t.next();return r=l.done,l},e:function(l){n=!0,s=l},f:function(){try{r||t.return==null||t.return()}finally{if(n)throw s}}}}function dt(o){var e=Gi();return function(){var t,i=Pt(o);if(e){var a=Pt(this).constructor;t=Reflect.construct(i,arguments,a)}else t=i.apply(this,arguments);return function(s,r){if(r&&(typeof r=="object"||typeof r=="function"))return r;if(r!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return _i(s)}(this,t)}}function Mt(o,e,t){return(e=Ui(e))in o?Object.defineProperty(o,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):o[e]=t,o}function Pt(o){return Pt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Pt(o)}function ut(o,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");o.prototype=Object.create(e&&e.prototype,{constructor:{value:o,writable:!0,configurable:!0}}),Object.defineProperty(o,"prototype",{writable:!1}),e&&Bt(o,e)}function Gi(){try{var o=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Gi=function(){return!!o})()}function ji(o,e){var t=Object.keys(o);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(o);e&&(i=i.filter(function(a){return Object.getOwnPropertyDescriptor(o,a).enumerable})),t.push.apply(t,i)}return t}function E(o){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ji(Object(t),!0).forEach(function(i){Mt(o,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(t)):ji(Object(t)).forEach(function(i){Object.defineProperty(o,i,Object.getOwnPropertyDescriptor(t,i))})}return o}function Bt(o,e){return Bt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,i){return t.__proto__=i,t},Bt(o,e)}function Vi(o,e){return function(t){if(Array.isArray(t))return t}(o)||function(t,i){var a=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(a!=null){var s,r,n,l,h=[],c=!0,d=!1;try{if(n=(a=a.call(t)).next,i===0){if(Object(a)!==a)return;c=!1}else for(;!(c=(s=n.call(a)).done)&&(h.push(s.value),h.length!==i);c=!0);}catch(u){d=!0,r=u}finally{try{if(!c&&a.return!=null&&(l=a.return(),Object(l)!==l))return}finally{if(d)throw r}}return h}}(o,e)||Gt(o,e)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function ge(o){return function(e){if(Array.isArray(e))return _t(e)}(o)||function(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}(o)||Gt(o)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function Ui(o){var e=function(t,i){if(typeof t!="object"||!t)return t;var a=t[Symbol.toPrimitive];if(a!==void 0){var s=a.call(t,i||"default");if(typeof s!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(i==="string"?String:Number)(t)}(o,"string");return typeof e=="symbol"?e:e+""}function Je(o){return Je=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Je(o)}function Gt(o,e){if(o){if(typeof o=="string")return _t(o,e);var t={}.toString.call(o).slice(8,-1);return t==="Object"&&o.constructor&&(t=o.constructor.name),t==="Map"||t==="Set"?Array.from(o):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_t(o,e):void 0}}var L=function(){function o(){O(this,o)}return F(o,[{key:"shadeRGBColor",value:function(e,t){var i=t.split(","),a=e<0?0:255,s=e<0?-1*e:e,r=parseInt(i[0].slice(4),10),n=parseInt(i[1],10),l=parseInt(i[2],10);return"rgb("+(Math.round((a-r)*s)+r)+","+(Math.round((a-n)*s)+n)+","+(Math.round((a-l)*s)+l)+")"}},{key:"shadeHexColor",value:function(e,t){var i=parseInt(t.slice(1),16),a=e<0?0:255,s=e<0?-1*e:e,r=i>>16,n=i>>8&255,l=255&i;return"#"+(16777216+65536*(Math.round((a-r)*s)+r)+256*(Math.round((a-n)*s)+n)+(Math.round((a-l)*s)+l)).toString(16).slice(1)}},{key:"shadeColor",value:function(e,t){return o.isColorHex(t)?this.shadeHexColor(e,t):this.shadeRGBColor(e,t)}}],[{key:"bind",value:function(e,t){return function(){return e.apply(t,arguments)}}},{key:"isObject",value:function(e){return e&&Je(e)==="object"&&!Array.isArray(e)&&e!=null}},{key:"is",value:function(e,t){return Object.prototype.toString.call(t)==="[object "+e+"]"}},{key:"listToArray",value:function(e){var t,i=[];for(t=0;t<e.length;t++)i[t]=e[t];return i}},{key:"extend",value:function(e,t){var i=this;typeof Object.assign!="function"&&(Object.assign=function(s){if(s==null)throw new TypeError("Cannot convert undefined or null to object");for(var r=Object(s),n=1;n<arguments.length;n++){var l=arguments[n];if(l!=null)for(var h in l)l.hasOwnProperty(h)&&(r[h]=l[h])}return r});var a=Object.assign({},e);return this.isObject(e)&&this.isObject(t)&&Object.keys(t).forEach(function(s){i.isObject(t[s])&&s in e?a[s]=i.extend(e[s],t[s]):Object.assign(a,Mt({},s,t[s]))}),a}},{key:"extendArray",value:function(e,t){var i=[];return e.map(function(a){i.push(o.extend(t,a))}),e=i}},{key:"monthMod",value:function(e){return e%12}},{key:"clone",value:function(e){var t,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:new WeakMap;if(e===null||Je(e)!=="object")return e;if(i.has(e))return i.get(e);if(Array.isArray(e)){t=[],i.set(e,t);for(var a=0;a<e.length;a++)t[a]=this.clone(e[a],i)}else if(e instanceof Date)t=new Date(e.getTime());else for(var s in t={},i.set(e,t),e)e.hasOwnProperty(s)&&(t[s]=this.clone(e[s],i));return t}},{key:"log10",value:function(e){return Math.log(e)/Math.LN10}},{key:"roundToBase10",value:function(e){return Math.pow(10,Math.floor(Math.log10(e)))}},{key:"roundToBase",value:function(e,t){return Math.pow(t,Math.floor(Math.log(e)/Math.log(t)))}},{key:"parseNumber",value:function(e){return e===null?e:parseFloat(e)}},{key:"stripNumber",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2;return Number.isInteger(e)?e:parseFloat(e.toPrecision(t))}},{key:"randomId",value:function(){return(Math.random()+1).toString(36).substring(4)}},{key:"noExponents",value:function(e){return e.toString().includes("e")?Math.round(e):e}},{key:"elementExists",value:function(e){return!(!e||!e.isConnected)}},{key:"getDimensions",value:function(e){var t=getComputedStyle(e,null),i=e.clientHeight,a=e.clientWidth;return i-=parseFloat(t.paddingTop)+parseFloat(t.paddingBottom),[a-=parseFloat(t.paddingLeft)+parseFloat(t.paddingRight),i]}},{key:"getBoundingClientRect",value:function(e){var t=e.getBoundingClientRect();return{top:t.top,right:t.right,bottom:t.bottom,left:t.left,width:e.clientWidth,height:e.clientHeight,x:t.left,y:t.top}}},{key:"getLargestStringFromArr",value:function(e){return e.reduce(function(t,i){return Array.isArray(i)&&(i=i.reduce(function(a,s){return a.length>s.length?a:s})),t.length>i.length?t:i},0)}},{key:"hexToRgba",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"#999999",t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:.6;e.substring(0,1)!=="#"&&(e="#999999");var i=e.replace("#","");i=i.match(new RegExp("(.{"+i.length/3+"})","g"));for(var a=0;a<i.length;a++)i[a]=parseInt(i[a].length===1?i[a]+i[a]:i[a],16);return t!==void 0&&i.push(t),"rgba("+i.join(",")+")"}},{key:"getOpacityFromRGBA",value:function(e){return parseFloat(e.replace(/^.*,(.+)\)/,"$1"))}},{key:"rgb2hex",value:function(e){return(e=e.match(/^rgba?[\s+]?\([\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?/i))&&e.length===4?"#"+("0"+parseInt(e[1],10).toString(16)).slice(-2)+("0"+parseInt(e[2],10).toString(16)).slice(-2)+("0"+parseInt(e[3],10).toString(16)).slice(-2):""}},{key:"isColorHex",value:function(e){return/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)|(^#[0-9A-F]{8}$)/i.test(e)}},{key:"getPolygonPos",value:function(e,t){for(var i=[],a=2*Math.PI/t,s=0;s<t;s++){var r={};r.x=e*Math.sin(s*a),r.y=-e*Math.cos(s*a),i.push(r)}return i}},{key:"polarToCartesian",value:function(e,t,i,a){var s=(a-90)*Math.PI/180;return{x:e+i*Math.cos(s),y:t+i*Math.sin(s)}}},{key:"escapeString",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"x",i=e.toString().slice();return i=i.replace(/[` ~!@#$%^&*()|+\=?;:'",.<>{}[\]\\/]/gi,t)}},{key:"negToZero",value:function(e){return e<0?0:e}},{key:"moveIndexInArray",value:function(e,t,i){if(i>=e.length)for(var a=i-e.length+1;a--;)e.push(void 0);return e.splice(i,0,e.splice(t,1)[0]),e}},{key:"extractNumber",value:function(e){return parseFloat(e.replace(/[^\d.]*/g,""))}},{key:"findAncestor",value:function(e,t){for(;(e=e.parentElement)&&!e.classList.contains(t););return e}},{key:"setELstyles",value:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e.style.key=t[i])}},{key:"preciseAddition",value:function(e,t){var i=(String(e).split(".")[1]||"").length,a=(String(t).split(".")[1]||"").length,s=Math.pow(10,Math.max(i,a));return(Math.round(e*s)+Math.round(t*s))/s}},{key:"isNumber",value:function(e){return!isNaN(e)&&parseFloat(Number(e))===e&&!isNaN(parseInt(e,10))}},{key:"isFloat",value:function(e){return Number(e)===e&&e%1!=0}},{key:"isMsEdge",value:function(){var e=window.navigator.userAgent,t=e.indexOf("Edge/");return t>0&&parseInt(e.substring(t+5,e.indexOf(".",t)),10)}},{key:"getGCD",value:function(e,t){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:7,a=Math.pow(10,i-Math.floor(Math.log10(Math.max(e,t))));for(e=Math.round(Math.abs(e)*a),t=Math.round(Math.abs(t)*a);t;){var s=t;t=e%t,e=s}return e/a}},{key:"getPrimeFactors",value:function(e){for(var t=[],i=2;e>=2;)e%i==0?(t.push(i),e/=i):i++;return t}},{key:"mod",value:function(e,t){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:7,a=Math.pow(10,i-Math.floor(Math.log10(Math.max(e,t))));return(e=Math.round(Math.abs(e)*a))%(t=Math.round(Math.abs(t)*a))/a}}]),o}(),Ke=function(){function o(e){O(this,o),this.ctx=e,this.w=e.w}return F(o,[{key:"animateLine",value:function(e,t,i,a){e.attr(t).animate(a).attr(i)}},{key:"animateMarker",value:function(e,t,i,a){e.attr({opacity:0}).animate(t).attr({opacity:1}).after(function(){a()})}},{key:"animateRect",value:function(e,t,i,a,s){e.attr(t).animate(a).attr(i).after(function(){return s()})}},{key:"animatePathsGradually",value:function(e){var t=e.el,i=e.realIndex,a=e.j,s=e.fill,r=e.pathFrom,n=e.pathTo,l=e.speed,h=e.delay,c=this.w,d=0;c.config.chart.animations.animateGradually.enabled&&(d=c.config.chart.animations.animateGradually.delay),c.config.chart.animations.dynamicAnimation.enabled&&c.globals.dataChanged&&c.config.chart.type!=="bar"&&(d=0),this.morphSVG(t,i,a,c.config.chart.type!=="line"||c.globals.comboCharts?s:"stroke",r,n,l,h*d)}},{key:"showDelayedElements",value:function(){this.w.globals.delayedElements.forEach(function(e){var t=e.el;t.classList.remove("apexcharts-element-hidden"),t.classList.add("apexcharts-hidden-element-shown")})}},{key:"animationCompleted",value:function(e){var t=this.w;t.globals.animationEnded||(t.globals.animationEnded=!0,this.showDelayedElements(),typeof t.config.chart.events.animationEnd=="function"&&t.config.chart.events.animationEnd(this.ctx,{el:e,w:t}))}},{key:"morphSVG",value:function(e,t,i,a,s,r,n,l){var h=this,c=this.w;s||(s=e.attr("pathFrom")),r||(r=e.attr("pathTo"));var d=function(u){return c.config.chart.type==="radar"&&(n=1),"M 0 ".concat(c.globals.gridHeight)};(!s||s.indexOf("undefined")>-1||s.indexOf("NaN")>-1)&&(s=d()),(!r.trim()||r.indexOf("undefined")>-1||r.indexOf("NaN")>-1)&&(r=d()),c.globals.shouldAnimate||(n=1),e.plot(s).animate(1,l).plot(s).animate(n,l).plot(r).after(function(){L.isNumber(i)?i===c.globals.series[c.globals.maxValsInArrayIndex].length-2&&c.globals.shouldAnimate&&h.animationCompleted(e):a!=="none"&&c.globals.shouldAnimate&&(!c.globals.comboCharts&&t===c.globals.series.length-1||c.globals.comboCharts)&&h.animationCompleted(e),h.showDelayedElements()})}}]),o}();const jt={},qi=[];function U(o,e){if(Array.isArray(o))for(const t of o)U(t,e);else if(typeof o!="object")Zi(Object.getOwnPropertyNames(e)),jt[o]=Object.assign(jt[o]||{},e);else for(const t in o)U(t,o[t])}function we(o){return jt[o]||{}}function Zi(o){qi.push(...o)}function Vt(o,e){let t;const i=o.length,a=[];for(t=0;t<i;t++)a.push(e(o[t]));return a}function Ut(o){return o%360*Math.PI/180}function Qe(o){return o.charAt(0).toUpperCase()+o.slice(1)}function et(o,e,t,i){return e!=null&&t!=null||(i=i||o.bbox(),e==null?e=i.width/i.height*t:t==null&&(t=i.height/i.width*e)),{width:e,height:t}}function qt(o,e){const t=o.origin;let i=o.ox!=null?o.ox:o.originX!=null?o.originX:"center",a=o.oy!=null?o.oy:o.originY!=null?o.originY:"center";t!=null&&([i,a]=Array.isArray(t)?t:typeof t=="object"?[t.x,t.y]:[t,t]);const s=typeof i=="string",r=typeof a=="string";if(s||r){const{height:n,width:l,x:h,y:c}=e.bbox();s&&(i=i.includes("left")?h:i.includes("right")?h+l:h+l/2),r&&(a=a.includes("top")?c:a.includes("bottom")?c+n:c+n/2)}return[i,a]}const is=new Set(["desc","metadata","title"]),Zt=o=>is.has(o.nodeName),$i=(o,e,t={})=>{const i={...e};for(const a in i)i[a].valueOf()===t[a]&&delete i[a];Object.keys(i).length?o.node.setAttribute("data-svgjs",JSON.stringify(i)):(o.node.removeAttribute("data-svgjs"),o.node.removeAttribute("svgjs:data"))},$t="http://www.w3.org/2000/svg",Jt="http://www.w3.org/2000/xmlns/",tt="http://www.w3.org/1999/xlink",J={window:typeof window>"u"?null:window,document:typeof document>"u"?null:document};function gt(){return J.window}let Kt=class{};const We={},Qt="___SYMBOL___ROOT___";function pt(o,e=$t){return J.document.createElementNS(e,o)}function me(o,e=!1){if(o instanceof Kt)return o;if(typeof o=="object")return ei(o);if(o==null)return new We[Qt];if(typeof o=="string"&&o.charAt(0)!=="<")return ei(J.document.querySelector(o));const t=e?J.document.createElement("div"):pt("svg");return t.innerHTML=o,o=ei(t.firstChild),t.removeChild(t.firstChild),o}function se(o,e){return e&&(e instanceof J.window.Node||e.ownerDocument&&e instanceof e.ownerDocument.defaultView.Node)?e:pt(o)}function Ce(o){if(!o)return null;if(o.instance instanceof Kt)return o.instance;if(o.nodeName==="#document-fragment")return new We.Fragment(o);let e=Qe(o.nodeName||"Dom");return e==="LinearGradient"||e==="RadialGradient"?e="Gradient":We[e]||(e="Dom"),new We[e](o)}let ei=Ce;function K(o,e=o.name,t=!1){return We[e]=o,t&&(We[Qt]=o),Zi(Object.getOwnPropertyNames(o.prototype)),o}let as=1e3;function Ji(o){return"Svgjs"+Qe(o)+as++}function Ki(o){for(let e=o.children.length-1;e>=0;e--)Ki(o.children[e]);return o.id&&(o.id=Ji(o.nodeName)),o}function B(o,e){let t,i;for(i=(o=Array.isArray(o)?o:[o]).length-1;i>=0;i--)for(t in e)o[i].prototype[t]=e[t]}function re(o){return function(...e){const t=e[e.length-1];return!t||t.constructor!==Object||t instanceof Array?o.apply(this,e):o.apply(this,e.slice(0,-1)).attr(t)}}U("Dom",{siblings:function(){return this.parent().children()},position:function(){return this.parent().index(this)},next:function(){return this.siblings()[this.position()+1]},prev:function(){return this.siblings()[this.position()-1]},forward:function(){const o=this.position();return this.parent().add(this.remove(),o+1),this},backward:function(){const o=this.position();return this.parent().add(this.remove(),o?o-1:0),this},front:function(){return this.parent().add(this.remove()),this},back:function(){return this.parent().add(this.remove(),0),this},before:function(o){(o=me(o)).remove();const e=this.position();return this.parent().add(o,e),this},after:function(o){(o=me(o)).remove();const e=this.position();return this.parent().add(o,e+1),this},insertBefore:function(o){return(o=me(o)).before(this),this},insertAfter:function(o){return(o=me(o)).after(this),this}});const Qi=/^([+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?)([a-z%]*)$/i,ss=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,rs=/rgb\((\d+),(\d+),(\d+)\)/,ns=/(#[a-z_][a-z0-9\-_]*)/i,os=/\)\s*,?\s*/,ls=/\s/g,ea=/^#[a-f0-9]{3}$|^#[a-f0-9]{6}$/i,ta=/^rgb\(/,ia=/^(\s+)?$/,aa=/^[+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,hs=/\.(jpg|jpeg|png|gif|svg)(\?[^=]+.*)?/i,ze=/[\s,]+/,ti=/[MLHVCSQTAZ]/i;function cs(o){const e=Math.round(o),t=Math.max(0,Math.min(255,e)).toString(16);return t.length===1?"0"+t:t}function it(o,e){for(let t=e.length;t--;)if(o[e[t]]==null)return!1;return!0}function ii(o,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<.16666666666666666?o+6*(e-o)*t:t<.5?e:t<.6666666666666666?o+(e-o)*(.6666666666666666-t)*6:o}U("Dom",{classes:function(){const o=this.attr("class");return o==null?[]:o.trim().split(ze)},hasClass:function(o){return this.classes().indexOf(o)!==-1},addClass:function(o){if(!this.hasClass(o)){const e=this.classes();e.push(o),this.attr("class",e.join(" "))}return this},removeClass:function(o){return this.hasClass(o)&&this.attr("class",this.classes().filter(function(e){return e!==o}).join(" ")),this},toggleClass:function(o){return this.hasClass(o)?this.removeClass(o):this.addClass(o)}}),U("Dom",{css:function(o,e){const t={};if(arguments.length===0)return this.node.style.cssText.split(/\s*;\s*/).filter(function(i){return!!i.length}).forEach(function(i){const a=i.split(/\s*:\s*/);t[a[0]]=a[1]}),t;if(arguments.length<2){if(Array.isArray(o)){for(const i of o){const a=i;t[i]=this.node.style.getPropertyValue(a)}return t}if(typeof o=="string")return this.node.style.getPropertyValue(o);if(typeof o=="object")for(const i in o)this.node.style.setProperty(i,o[i]==null||ia.test(o[i])?"":o[i])}return arguments.length===2&&this.node.style.setProperty(o,e==null||ia.test(e)?"":e),this},show:function(){return this.css("display","")},hide:function(){return this.css("display","none")},visible:function(){return this.css("display")!=="none"}}),U("Dom",{data:function(o,e,t){if(o==null)return this.data(Vt(function(i,a){let s;const r=i.length,n=[];for(s=0;s<r;s++)a(i[s])&&n.push(i[s]);return n}(this.node.attributes,i=>i.nodeName.indexOf("data-")===0),i=>i.nodeName.slice(5)));if(o instanceof Array){const i={};for(const a of o)i[a]=this.data(a);return i}if(typeof o=="object")for(e in o)this.data(e,o[e]);else if(arguments.length<2)try{return JSON.parse(this.attr("data-"+o))}catch{return this.attr("data-"+o)}else this.attr("data-"+o,e===null?null:t===!0||typeof e=="string"||typeof e=="number"?e:JSON.stringify(e));return this}}),U("Dom",{remember:function(o,e){if(typeof arguments[0]=="object")for(const t in o)this.remember(t,o[t]);else{if(arguments.length===1)return this.memory()[o];this.memory()[o]=e}return this},forget:function(){if(arguments.length===0)this._memory={};else for(let o=arguments.length-1;o>=0;o--)delete this.memory()[arguments[o]];return this},memory:function(){return this._memory=this._memory||{}}});class ae{constructor(...e){this.init(...e)}static isColor(e){return e&&(e instanceof ae||this.isRgb(e)||this.test(e))}static isRgb(e){return e&&typeof e.r=="number"&&typeof e.g=="number"&&typeof e.b=="number"}static random(e="vibrant",t){const{random:i,round:a,sin:s,PI:r}=Math;if(e==="vibrant"){const n=24*i()+57,l=38*i()+45,h=360*i();return new ae(n,l,h,"lch")}if(e==="sine"){const n=a(80*s(2*r*(t=t??i())/.5+.01)+150),l=a(50*s(2*r*t/.5+4.6)+200),h=a(100*s(2*r*t/.5+2.3)+150);return new ae(n,l,h)}if(e==="pastel"){const n=8*i()+86,l=17*i()+9,h=360*i();return new ae(n,l,h,"lch")}if(e==="dark"){const n=10+10*i(),l=50*i()+86,h=360*i();return new ae(n,l,h,"lch")}if(e==="rgb"){const n=255*i(),l=255*i(),h=255*i();return new ae(n,l,h)}if(e==="lab"){const n=100*i(),l=256*i()-128,h=256*i()-128;return new ae(n,l,h,"lab")}if(e==="grey"){const n=255*i();return new ae(n,n,n)}throw new Error("Unsupported random color mode")}static test(e){return typeof e=="string"&&(ea.test(e)||ta.test(e))}cmyk(){const{_a:e,_b:t,_c:i}=this.rgb(),[a,s,r]=[e,t,i].map(l=>l/255),n=Math.min(1-a,1-s,1-r);return n===1?new ae(0,0,0,1,"cmyk"):new ae((1-a-n)/(1-n),(1-s-n)/(1-n),(1-r-n)/(1-n),n,"cmyk")}hsl(){const{_a:e,_b:t,_c:i}=this.rgb(),[a,s,r]=[e,t,i].map(u=>u/255),n=Math.max(a,s,r),l=Math.min(a,s,r),h=(n+l)/2,c=n===l,d=n-l;return new ae(360*(c?0:n===a?((s-r)/d+(s<r?6:0))/6:n===s?((r-a)/d+2)/6:n===r?((a-s)/d+4)/6:0),100*(c?0:h>.5?d/(2-n-l):d/(n+l)),100*h,"hsl")}init(e=0,t=0,i=0,a=0,s="rgb"){if(e=e||0,this.space)for(const d in this.space)delete this[this.space[d]];if(typeof e=="number")s=typeof a=="string"?a:s,a=typeof a=="string"?0:a,Object.assign(this,{_a:e,_b:t,_c:i,_d:a,space:s});else if(e instanceof Array)this.space=t||(typeof e[3]=="string"?e[3]:e[4])||"rgb",Object.assign(this,{_a:e[0],_b:e[1],_c:e[2],_d:e[3]||0});else if(e instanceof Object){const d=function(u,g){const f=it(u,"rgb")?{_a:u.r,_b:u.g,_c:u.b,_d:0,space:"rgb"}:it(u,"xyz")?{_a:u.x,_b:u.y,_c:u.z,_d:0,space:"xyz"}:it(u,"hsl")?{_a:u.h,_b:u.s,_c:u.l,_d:0,space:"hsl"}:it(u,"lab")?{_a:u.l,_b:u.a,_c:u.b,_d:0,space:"lab"}:it(u,"lch")?{_a:u.l,_b:u.c,_c:u.h,_d:0,space:"lch"}:it(u,"cmyk")?{_a:u.c,_b:u.m,_c:u.y,_d:u.k,space:"cmyk"}:{_a:0,_b:0,_c:0,space:"rgb"};return f.space=g||f.space,f}(e,t);Object.assign(this,d)}else if(typeof e=="string")if(ta.test(e)){const d=e.replace(ls,""),[u,g,f]=rs.exec(d).slice(1,4).map(p=>parseInt(p));Object.assign(this,{_a:u,_b:g,_c:f,_d:0,space:"rgb"})}else{if(!ea.test(e))throw Error("Unsupported string format, can't construct Color");{const d=p=>parseInt(p,16),[,u,g,f]=ss.exec(function(p){return p.length===4?["#",p.substring(1,2),p.substring(1,2),p.substring(2,3),p.substring(2,3),p.substring(3,4),p.substring(3,4)].join(""):p}(e)).map(d);Object.assign(this,{_a:u,_b:g,_c:f,_d:0,space:"rgb"})}}const{_a:r,_b:n,_c:l,_d:h}=this,c=this.space==="rgb"?{r,g:n,b:l}:this.space==="xyz"?{x:r,y:n,z:l}:this.space==="hsl"?{h:r,s:n,l}:this.space==="lab"?{l:r,a:n,b:l}:this.space==="lch"?{l:r,c:n,h:l}:this.space==="cmyk"?{c:r,m:n,y:l,k:h}:{};Object.assign(this,c)}lab(){const{x:e,y:t,z:i}=this.xyz();return new ae(116*t-16,500*(e-t),200*(t-i),"lab")}lch(){const{l:e,a:t,b:i}=this.lab(),a=Math.sqrt(t**2+i**2);let s=180*Math.atan2(i,t)/Math.PI;return s<0&&(s*=-1,s=360-s),new ae(e,a,s,"lch")}rgb(){if(this.space==="rgb")return this;if((e=this.space)==="lab"||e==="xyz"||e==="lch"){let{x:t,y:i,z:a}=this;if(this.space==="lab"||this.space==="lch"){let{l:g,a:f,b:p}=this;if(this.space==="lch"){const{c:C,h:w}=this,A=Math.PI/180;f=C*Math.cos(A*w),p=C*Math.sin(A*w)}const x=(g+16)/116,b=f/500+x,m=x-p/200,v=16/116,k=.008856,y=7.787;t=.95047*(b**3>k?b**3:(b-v)/y),i=1*(x**3>k?x**3:(x-v)/y),a=1.08883*(m**3>k?m**3:(m-v)/y)}const s=3.2406*t+-1.5372*i+-.4986*a,r=-.9689*t+1.8758*i+.0415*a,n=.0557*t+-.204*i+1.057*a,l=Math.pow,h=.0031308,c=s>h?1.055*l(s,1/2.4)-.055:12.92*s,d=r>h?1.055*l(r,1/2.4)-.055:12.92*r,u=n>h?1.055*l(n,1/2.4)-.055:12.92*n;return new ae(255*c,255*d,255*u)}if(this.space==="hsl"){let{h:t,s:i,l:a}=this;if(t/=360,i/=100,a/=100,i===0)return a*=255,new ae(a,a,a);const s=a<.5?a*(1+i):a+i-a*i,r=2*a-s,n=255*ii(r,s,t+1/3),l=255*ii(r,s,t),h=255*ii(r,s,t-1/3);return new ae(n,l,h)}if(this.space==="cmyk"){const{c:t,m:i,y:a,k:s}=this,r=255*(1-Math.min(1,t*(1-s)+s)),n=255*(1-Math.min(1,i*(1-s)+s)),l=255*(1-Math.min(1,a*(1-s)+s));return new ae(r,n,l)}return this;var e}toArray(){const{_a:e,_b:t,_c:i,_d:a,space:s}=this;return[e,t,i,a,s]}toHex(){const[e,t,i]=this._clamped().map(cs);return`#${e}${t}${i}`}toRgb(){const[e,t,i]=this._clamped();return`rgb(${e},${t},${i})`}toString(){return this.toHex()}xyz(){const{_a:e,_b:t,_c:i}=this.rgb(),[a,s,r]=[e,t,i].map(x=>x/255),n=a>.04045?Math.pow((a+.055)/1.055,2.4):a/12.92,l=s>.04045?Math.pow((s+.055)/1.055,2.4):s/12.92,h=r>.04045?Math.pow((r+.055)/1.055,2.4):r/12.92,c=(.4124*n+.3576*l+.1805*h)/.95047,d=(.2126*n+.7152*l+.0722*h)/1,u=(.0193*n+.1192*l+.9505*h)/1.08883,g=c>.008856?Math.pow(c,1/3):7.787*c+16/116,f=d>.008856?Math.pow(d,1/3):7.787*d+16/116,p=u>.008856?Math.pow(u,1/3):7.787*u+16/116;return new ae(g,f,p,"xyz")}_clamped(){const{_a:e,_b:t,_c:i}=this.rgb(),{max:a,min:s,round:r}=Math;return[e,t,i].map(n=>a(0,s(r(n),255)))}}class te{constructor(...e){this.init(...e)}clone(){return new te(this)}init(e,t){const s=Array.isArray(e)?{x:e[0],y:e[1]}:typeof e=="object"?{x:e.x,y:e.y}:{x:e,y:t};return this.x=s.x==null?0:s.x,this.y=s.y==null?0:s.y,this}toArray(){return[this.x,this.y]}transform(e){return this.clone().transformO(e)}transformO(e){W.isMatrixLike(e)||(e=new W(e));const{x:t,y:i}=this;return this.x=e.a*t+e.c*i+e.e,this.y=e.b*t+e.d*i+e.f,this}}function at(o,e,t){return Math.abs(e-o)<1e-6}class W{constructor(...e){this.init(...e)}static formatTransforms(e){const t=e.flip==="both"||e.flip===!0,i=e.flip&&(t||e.flip==="x")?-1:1,a=e.flip&&(t||e.flip==="y")?-1:1,s=e.skew&&e.skew.length?e.skew[0]:isFinite(e.skew)?e.skew:isFinite(e.skewX)?e.skewX:0,r=e.skew&&e.skew.length?e.skew[1]:isFinite(e.skew)?e.skew:isFinite(e.skewY)?e.skewY:0,n=e.scale&&e.scale.length?e.scale[0]*i:isFinite(e.scale)?e.scale*i:isFinite(e.scaleX)?e.scaleX*i:i,l=e.scale&&e.scale.length?e.scale[1]*a:isFinite(e.scale)?e.scale*a:isFinite(e.scaleY)?e.scaleY*a:a,h=e.shear||0,c=e.rotate||e.theta||0,d=new te(e.origin||e.around||e.ox||e.originX,e.oy||e.originY),u=d.x,g=d.y,f=new te(e.position||e.px||e.positionX||NaN,e.py||e.positionY||NaN),p=f.x,x=f.y,b=new te(e.translate||e.tx||e.translateX,e.ty||e.translateY),m=b.x,v=b.y,k=new te(e.relative||e.rx||e.relativeX,e.ry||e.relativeY);return{scaleX:n,scaleY:l,skewX:s,skewY:r,shear:h,theta:c,rx:k.x,ry:k.y,tx:m,ty:v,ox:u,oy:g,px:p,py:x}}static fromArray(e){return{a:e[0],b:e[1],c:e[2],d:e[3],e:e[4],f:e[5]}}static isMatrixLike(e){return e.a!=null||e.b!=null||e.c!=null||e.d!=null||e.e!=null||e.f!=null}static matrixMultiply(e,t,i){const a=e.a*t.a+e.c*t.b,s=e.b*t.a+e.d*t.b,r=e.a*t.c+e.c*t.d,n=e.b*t.c+e.d*t.d,l=e.e+e.a*t.e+e.c*t.f,h=e.f+e.b*t.e+e.d*t.f;return i.a=a,i.b=s,i.c=r,i.d=n,i.e=l,i.f=h,i}around(e,t,i){return this.clone().aroundO(e,t,i)}aroundO(e,t,i){const a=e||0,s=t||0;return this.translateO(-a,-s).lmultiplyO(i).translateO(a,s)}clone(){return new W(this)}decompose(e=0,t=0){const i=this.a,a=this.b,s=this.c,r=this.d,n=this.e,l=this.f,h=i*r-a*s,c=h>0?1:-1,d=c*Math.sqrt(i*i+a*a),u=Math.atan2(c*a,c*i),g=180/Math.PI*u,f=Math.cos(u),p=Math.sin(u),x=(i*s+a*r)/h,b=s*d/(x*i-a)||r*d/(x*a+i);return{scaleX:d,scaleY:b,shear:x,rotate:g,translateX:n-e+e*f*d+t*(x*f*d-p*b),translateY:l-t+e*p*d+t*(x*p*d+f*b),originX:e,originY:t,a:this.a,b:this.b,c:this.c,d:this.d,e:this.e,f:this.f}}equals(e){if(e===this)return!0;const t=new W(e);return at(this.a,t.a)&&at(this.b,t.b)&&at(this.c,t.c)&&at(this.d,t.d)&&at(this.e,t.e)&&at(this.f,t.f)}flip(e,t){return this.clone().flipO(e,t)}flipO(e,t){return e==="x"?this.scaleO(-1,1,t,0):e==="y"?this.scaleO(1,-1,0,t):this.scaleO(-1,-1,e,t||e)}init(e){const t=W.fromArray([1,0,0,1,0,0]);return e=e instanceof pe?e.matrixify():typeof e=="string"?W.fromArray(e.split(ze).map(parseFloat)):Array.isArray(e)?W.fromArray(e):typeof e=="object"&&W.isMatrixLike(e)?e:typeof e=="object"?new W().transform(e):arguments.length===6?W.fromArray([].slice.call(arguments)):t,this.a=e.a!=null?e.a:t.a,this.b=e.b!=null?e.b:t.b,this.c=e.c!=null?e.c:t.c,this.d=e.d!=null?e.d:t.d,this.e=e.e!=null?e.e:t.e,this.f=e.f!=null?e.f:t.f,this}inverse(){return this.clone().inverseO()}inverseO(){const e=this.a,t=this.b,i=this.c,a=this.d,s=this.e,r=this.f,n=e*a-t*i;if(!n)throw new Error("Cannot invert "+this);const l=a/n,h=-t/n,c=-i/n,d=e/n,u=-(l*s+c*r),g=-(h*s+d*r);return this.a=l,this.b=h,this.c=c,this.d=d,this.e=u,this.f=g,this}lmultiply(e){return this.clone().lmultiplyO(e)}lmultiplyO(e){const t=e instanceof W?e:new W(e);return W.matrixMultiply(t,this,this)}multiply(e){return this.clone().multiplyO(e)}multiplyO(e){const t=e instanceof W?e:new W(e);return W.matrixMultiply(this,t,this)}rotate(e,t,i){return this.clone().rotateO(e,t,i)}rotateO(e,t=0,i=0){e=Ut(e);const a=Math.cos(e),s=Math.sin(e),{a:r,b:n,c:l,d:h,e:c,f:d}=this;return this.a=r*a-n*s,this.b=n*a+r*s,this.c=l*a-h*s,this.d=h*a+l*s,this.e=c*a-d*s+i*s-t*a+t,this.f=d*a+c*s-t*s-i*a+i,this}scale(){return this.clone().scaleO(...arguments)}scaleO(e,t=e,i=0,a=0){arguments.length===3&&(a=i,i=t,t=e);const{a:s,b:r,c:n,d:l,e:h,f:c}=this;return this.a=s*e,this.b=r*t,this.c=n*e,this.d=l*t,this.e=h*e-i*e+i,this.f=c*t-a*t+a,this}shear(e,t,i){return this.clone().shearO(e,t,i)}shearO(e,t=0,i=0){const{a,b:s,c:r,d:n,e:l,f:h}=this;return this.a=a+s*e,this.c=r+n*e,this.e=l+h*e-i*e,this}skew(){return this.clone().skewO(...arguments)}skewO(e,t=e,i=0,a=0){arguments.length===3&&(a=i,i=t,t=e),e=Ut(e),t=Ut(t);const s=Math.tan(e),r=Math.tan(t),{a:n,b:l,c:h,d:c,e:d,f:u}=this;return this.a=n+l*s,this.b=l+n*r,this.c=h+c*s,this.d=c+h*r,this.e=d+u*s-a*s,this.f=u+d*r-i*r,this}skewX(e,t,i){return this.skew(e,0,t,i)}skewY(e,t,i){return this.skew(0,e,t,i)}toArray(){return[this.a,this.b,this.c,this.d,this.e,this.f]}toString(){return"matrix("+this.a+","+this.b+","+this.c+","+this.d+","+this.e+","+this.f+")"}transform(e){if(W.isMatrixLike(e))return new W(e).multiplyO(this);const t=W.formatTransforms(e),{x:i,y:a}=new te(t.ox,t.oy).transform(this),s=new W().translateO(t.rx,t.ry).lmultiplyO(this).translateO(-i,-a).scaleO(t.scaleX,t.scaleY).skewO(t.skewX,t.skewY).shearO(t.shear).rotateO(t.theta).translateO(i,a);if(isFinite(t.px)||isFinite(t.py)){const r=new te(i,a).transform(s),n=isFinite(t.px)?t.px-r.x:0,l=isFinite(t.py)?t.py-r.y:0;s.translateO(n,l)}return s.translateO(t.tx,t.ty),s}translate(e,t){return this.clone().translateO(e,t)}translateO(e,t){return this.e+=e||0,this.f+=t||0,this}valueOf(){return{a:this.a,b:this.b,c:this.c,d:this.d,e:this.e,f:this.f}}}function Ee(){if(!Ee.nodes){const o=me().size(2,0);o.node.style.cssText=["opacity: 0","position: absolute","left: -100%","top: -100%","overflow: hidden"].join(";"),o.attr("focusable","false"),o.attr("aria-hidden","true");const e=o.path().node;Ee.nodes={svg:o,path:e}}if(!Ee.nodes.svg.node.parentNode){const o=J.document.body||J.document.documentElement;Ee.nodes.svg.addTo(o)}return Ee.nodes}function sa(o){return!(o.width||o.height||o.x||o.y)}K(W,"Matrix");class le{constructor(...e){this.init(...e)}addOffset(){return this.x+=J.window.pageXOffset,this.y+=J.window.pageYOffset,new le(this)}init(e){return e=typeof e=="string"?e.split(ze).map(parseFloat):Array.isArray(e)?e:typeof e=="object"?[e.left!=null?e.left:e.x,e.top!=null?e.top:e.y,e.width,e.height]:arguments.length===4?[].slice.call(arguments):[0,0,0,0],this.x=e[0]||0,this.y=e[1]||0,this.width=this.w=e[2]||0,this.height=this.h=e[3]||0,this.x2=this.x+this.w,this.y2=this.y+this.h,this.cx=this.x+this.w/2,this.cy=this.y+this.h/2,this}isNulled(){return sa(this)}merge(e){const t=Math.min(this.x,e.x),i=Math.min(this.y,e.y),a=Math.max(this.x+this.width,e.x+e.width)-t,s=Math.max(this.y+this.height,e.y+e.height)-i;return new le(t,i,a,s)}toArray(){return[this.x,this.y,this.width,this.height]}toString(){return this.x+" "+this.y+" "+this.width+" "+this.height}transform(e){e instanceof W||(e=new W(e));let t=1/0,i=-1/0,a=1/0,s=-1/0;return[new te(this.x,this.y),new te(this.x2,this.y),new te(this.x,this.y2),new te(this.x2,this.y2)].forEach(function(r){r=r.transform(e),t=Math.min(t,r.x),i=Math.max(i,r.x),a=Math.min(a,r.y),s=Math.max(s,r.y)}),new le(t,a,i-t,s-a)}}function ra(o,e,t){let i;try{if(i=e(o.node),sa(i)&&(a=o.node)!==J.document&&!(J.document.documentElement.contains||function(s){for(;s.parentNode;)s=s.parentNode;return s===J.document}).call(J.document.documentElement,a))throw new Error("Element not in the dom")}catch{i=t(o)}var a;return i}U({viewbox:{viewbox(o,e,t,i){return o==null?new le(this.attr("viewBox")):this.attr("viewBox",new le(o,e,t,i))},zoom(o,e){let{width:t,height:i}=this.attr(["width","height"]);if((t||i)&&typeof t!="string"&&typeof i!="string"||(t=this.node.clientWidth,i=this.node.clientHeight),!t||!i)throw new Error("Impossible to get absolute width and height. Please provide an absolute width and height attribute on the zooming element");const a=this.viewbox(),s=t/a.width,r=i/a.height,n=Math.min(s,r);if(o==null)return n;let l=n/o;l===1/0&&(l=Number.MAX_SAFE_INTEGER/100),e=e||new te(t/2/s+a.x,i/2/r+a.y);const h=new le(a).transform(new W({scale:l,origin:e}));return this.viewbox(h)}}}),K(le,"Box");class _e extends Array{constructor(e=[],...t){if(super(e,...t),typeof e=="number")return this;this.length=0,this.push(...e)}}B([_e],{each(o,...e){return typeof o=="function"?this.map((t,i,a)=>o.call(t,t,i,a)):this.map(t=>t[o](...e))},toArray(){return Array.prototype.concat.apply([],this)}});const ds=["toArray","constructor","each"];function Be(o,e){return new _e(Vt((e||J.document).querySelectorAll(o),function(t){return Ce(t)}))}_e.extend=function(o){o=o.reduce((e,t)=>(ds.includes(t)||t[0]==="_"||(t in Array.prototype&&(e["$"+t]=Array.prototype[t]),e[t]=function(...i){return this.each(t,...i)}),e),{}),B([_e],o)};let us=0;const na={};function oa(o){let e=o.getEventHolder();return e===J.window&&(e=na),e.events||(e.events={}),e.events}function ai(o){return o.getEventTarget()}function Xe(o,e,t,i,a){const s=t.bind(i||o),r=me(o),n=oa(r),l=ai(r);e=Array.isArray(e)?e:e.split(ze),t._svgjsListenerId||(t._svgjsListenerId=++us),e.forEach(function(h){const c=h.split(".")[0],d=h.split(".")[1]||"*";n[c]=n[c]||{},n[c][d]=n[c][d]||{},n[c][d][t._svgjsListenerId]=s,l.addEventListener(c,s,a||!1)})}function Se(o,e,t,i){const a=me(o),s=oa(a),r=ai(a);(typeof t!="function"||(t=t._svgjsListenerId))&&(e=Array.isArray(e)?e:(e||"").split(ze)).forEach(function(n){const l=n&&n.split(".")[0],h=n&&n.split(".")[1];let c,d;if(t)s[l]&&s[l][h||"*"]&&(r.removeEventListener(l,s[l][h||"*"][t],i||!1),delete s[l][h||"*"][t]);else if(l&&h){if(s[l]&&s[l][h]){for(d in s[l][h])Se(r,[l,h].join("."),d);delete s[l][h]}}else if(h)for(n in s)for(c in s[n])h===c&&Se(r,[n,h].join("."));else if(l){if(s[l]){for(c in s[l])Se(r,[l,c].join("."));delete s[l]}}else{for(n in s)Se(r,n);(function(u){let g=u.getEventHolder();g===J.window&&(g=na),g.events&&(g.events={})})(a)}})}class ft extends Kt{addEventListener(){}dispatch(e,t,i){return function(a,s,r,n){const l=ai(a);return s instanceof J.window.Event||(s=new J.window.CustomEvent(s,{detail:r,cancelable:!0,...n})),l.dispatchEvent(s),s}(this,e,t,i)}dispatchEvent(e){const t=this.getEventHolder().events;if(!t)return!0;const i=t[e.type];for(const a in i)for(const s in i[a])i[a][s](e);return!e.defaultPrevented}fire(e,t,i){return this.dispatch(e,t,i),this}getEventHolder(){return this}getEventTarget(){return this}off(e,t,i){return Se(this,e,t,i),this}on(e,t,i,a){return Xe(this,e,t,i,a),this}removeEventListener(){}}function la(){}K(ft,"EventTarget");const si=400,gs=">",ps=0,fs={"fill-opacity":1,"stroke-opacity":1,"stroke-width":0,"stroke-linejoin":"miter","stroke-linecap":"butt",fill:"#000000",stroke:"#000000",opacity:1,x:0,y:0,cx:0,cy:0,width:0,height:0,r:0,rx:0,ry:0,offset:0,"stop-opacity":1,"stop-color":"#000000","text-anchor":"start"};class Ge extends Array{constructor(...e){super(...e),this.init(...e)}clone(){return new this.constructor(this)}init(e){return typeof e=="number"||(this.length=0,this.push(...this.parse(e))),this}parse(e=[]){return e instanceof Array?e:e.trim().split(ze).map(parseFloat)}toArray(){return Array.prototype.concat.apply([],this)}toSet(){return new Set(this)}toString(){return this.join(" ")}valueOf(){const e=[];return e.push(...this),e}}class V{constructor(...e){this.init(...e)}convert(e){return new V(this.value,e)}divide(e){return e=new V(e),new V(this/e,this.unit||e.unit)}init(e,t){return t=Array.isArray(e)?e[1]:t,e=Array.isArray(e)?e[0]:e,this.value=0,this.unit=t||"",typeof e=="number"?this.value=isNaN(e)?0:isFinite(e)?e:e<0?-34e37:34e37:typeof e=="string"?(t=e.match(Qi))&&(this.value=parseFloat(t[1]),t[5]==="%"?this.value/=100:t[5]==="s"&&(this.value*=1e3),this.unit=t[5]):e instanceof V&&(this.value=e.valueOf(),this.unit=e.unit),this}minus(e){return e=new V(e),new V(this-e,this.unit||e.unit)}plus(e){return e=new V(e),new V(this+e,this.unit||e.unit)}times(e){return e=new V(e),new V(this*e,this.unit||e.unit)}toArray(){return[this.value,this.unit]}toJSON(){return this.toString()}toString(){return(this.unit==="%"?~~(1e8*this.value)/1e6:this.unit==="s"?this.value/1e3:this.value)+this.unit}valueOf(){return this.value}}const xs=new Set(["fill","stroke","color","bgcolor","stop-color","flood-color","lighting-color"]),ha=[];class He extends ft{constructor(e,t){super(),this.node=e,this.type=e.nodeName,t&&e!==t&&this.attr(t)}add(e,t){return(e=me(e)).removeNamespace&&this.node instanceof J.window.SVGElement&&e.removeNamespace(),t==null?this.node.appendChild(e.node):e.node!==this.node.childNodes[t]&&this.node.insertBefore(e.node,this.node.childNodes[t]),this}addTo(e,t){return me(e).put(this,t)}children(){return new _e(Vt(this.node.children,function(e){return Ce(e)}))}clear(){for(;this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);return this}clone(e=!0,t=!0){this.writeDataToDom();let i=this.node.cloneNode(e);return t&&(i=Ki(i)),new this.constructor(i)}each(e,t){const i=this.children();let a,s;for(a=0,s=i.length;a<s;a++)e.apply(i[a],[a,i]),t&&i[a].each(e,t);return this}element(e,t){return this.put(new He(pt(e),t))}first(){return Ce(this.node.firstChild)}get(e){return Ce(this.node.childNodes[e])}getEventHolder(){return this.node}getEventTarget(){return this.node}has(e){return this.index(e)>=0}html(e,t){return this.xml(e,t,"http://www.w3.org/1999/xhtml")}id(e){return e!==void 0||this.node.id||(this.node.id=Ji(this.type)),this.attr("id",e)}index(e){return[].slice.call(this.node.childNodes).indexOf(e.node)}last(){return Ce(this.node.lastChild)}matches(e){const t=this.node,i=t.matches||t.matchesSelector||t.msMatchesSelector||t.mozMatchesSelector||t.webkitMatchesSelector||t.oMatchesSelector||null;return i&&i.call(t,e)}parent(e){let t=this;if(!t.node.parentNode)return null;if(t=Ce(t.node.parentNode),!e)return t;do if(typeof e=="string"?t.matches(e):t instanceof e)return t;while(t=Ce(t.node.parentNode));return t}put(e,t){return e=me(e),this.add(e,t),e}putIn(e,t){return me(e).add(this,t)}remove(){return this.parent()&&this.parent().removeElement(this),this}removeElement(e){return this.node.removeChild(e.node),this}replace(e){return e=me(e),this.node.parentNode&&this.node.parentNode.replaceChild(e.node,this.node),e}round(e=2,t=null){const i=10**e,a=this.attr(t);for(const s in a)typeof a[s]=="number"&&(a[s]=Math.round(a[s]*i)/i);return this.attr(a),this}svg(e,t){return this.xml(e,t,$t)}toString(){return this.id()}words(e){return this.node.textContent=e,this}wrap(e){const t=this.parent();if(!t)return this.addTo(e);const i=t.index(this);return t.put(e,i).put(this)}writeDataToDom(){return this.each(function(){this.writeDataToDom()}),this}xml(e,t,i){if(typeof e=="boolean"&&(i=t,t=e,e=null),e==null||typeof e=="function"){t=t==null||t,this.writeDataToDom();let n=this;if(e!=null){if(n=Ce(n.node.cloneNode(!0)),t){const l=e(n);if(n=l||n,l===!1)return""}n.each(function(){const l=e(this),h=l||this;l===!1?this.remove():l&&this!==h&&this.replace(h)},!0)}return t?n.node.outerHTML:n.node.innerHTML}t=t!=null&&t;const a=pt("wrapper",i),s=J.document.createDocumentFragment();a.innerHTML=e;for(let n=a.children.length;n--;)s.appendChild(a.firstElementChild);const r=this.parent();return t?this.replace(s)&&r:this.add(s)}}B(He,{attr:function(o,e,t){if(o==null){o={},e=this.node.attributes;for(const i of e)o[i.nodeName]=aa.test(i.nodeValue)?parseFloat(i.nodeValue):i.nodeValue;return o}if(o instanceof Array)return o.reduce((i,a)=>(i[a]=this.attr(a),i),{});if(typeof o=="object"&&o.constructor===Object)for(e in o)this.attr(e,o[e]);else if(e===null)this.node.removeAttribute(o);else{if(e==null)return(e=this.node.getAttribute(o))==null?fs[o]:aa.test(e)?parseFloat(e):e;typeof(e=ha.reduce((i,a)=>a(o,i,this),e))=="number"?e=new V(e):xs.has(o)&&ae.isColor(e)?e=new ae(e):e.constructor===Array&&(e=new Ge(e)),o==="leading"?this.leading&&this.leading(e):typeof t=="string"?this.node.setAttributeNS(t,o,e.toString()):this.node.setAttribute(o,e.toString()),!this.rebuild||o!=="font-size"&&o!=="x"||this.rebuild()}return this},find:function(o){return Be(o,this.node)},findOne:function(o){return Ce(this.node.querySelector(o))}}),K(He,"Dom");let pe=class extends He{constructor(o,e){super(o,e),this.dom={},this.node.instance=this,(o.hasAttribute("data-svgjs")||o.hasAttribute("svgjs:data"))&&this.setData(JSON.parse(o.getAttribute("data-svgjs"))??JSON.parse(o.getAttribute("svgjs:data"))??{})}center(o,e){return this.cx(o).cy(e)}cx(o){return o==null?this.x()+this.width()/2:this.x(o-this.width()/2)}cy(o){return o==null?this.y()+this.height()/2:this.y(o-this.height()/2)}defs(){const o=this.root();return o&&o.defs()}dmove(o,e){return this.dx(o).dy(e)}dx(o=0){return this.x(new V(o).plus(this.x()))}dy(o=0){return this.y(new V(o).plus(this.y()))}getEventHolder(){return this}height(o){return this.attr("height",o)}move(o,e){return this.x(o).y(e)}parents(o=this.root()){const e=typeof o=="string";e||(o=me(o));const t=new _e;let i=this;for(;(i=i.parent())&&i.node!==J.document&&i.nodeName!=="#document-fragment"&&(t.push(i),e||i.node!==o.node)&&(!e||!i.matches(o));)if(i.node===this.root().node)return null;return t}reference(o){if(!(o=this.attr(o)))return null;const e=(o+"").match(ns);return e?me(e[1]):null}root(){const o=this.parent(function(e){return We[e]}(Qt));return o&&o.root()}setData(o){return this.dom=o,this}size(o,e){const t=et(this,o,e);return this.width(new V(t.width)).height(new V(t.height))}width(o){return this.attr("width",o)}writeDataToDom(){return $i(this,this.dom),super.writeDataToDom()}x(o){return this.attr("x",o)}y(o){return this.attr("y",o)}};B(pe,{bbox:function(){const o=ra(this,e=>e.getBBox(),e=>{try{const t=e.clone().addTo(Ee().svg).show(),i=t.node.getBBox();return t.remove(),i}catch(t){throw new Error(`Getting bbox of element "${e.node.nodeName}" is not possible: ${t.toString()}`)}});return new le(o)},rbox:function(o){const e=ra(this,i=>i.getBoundingClientRect(),i=>{throw new Error(`Getting rbox of element "${i.node.nodeName}" is not possible`)}),t=new le(e);return o?t.transform(o.screenCTM().inverseO()):t.addOffset()},inside:function(o,e){const t=this.bbox();return o>t.x&&e>t.y&&o<t.x+t.width&&e<t.y+t.height},point:function(o,e){return new te(o,e).transformO(this.screenCTM().inverseO())},ctm:function(){return new W(this.node.getCTM())},screenCTM:function(){try{if(typeof this.isRoot=="function"&&!this.isRoot()){const o=this.rect(1,1),e=o.node.getScreenCTM();return o.remove(),new W(e)}return new W(this.node.getScreenCTM())}catch{return console.warn(`Cannot get CTM from SVG node ${this.node.nodeName}. Is the element rendered?`),new W}}}),K(pe,"Element");const xt={stroke:["color","width","opacity","linecap","linejoin","miterlimit","dasharray","dashoffset"],fill:["color","opacity","rule"],prefix:function(o,e){return e==="color"?o:o+"-"+e}};["fill","stroke"].forEach(function(o){const e={};let t;e[o]=function(i){if(i===void 0)return this.attr(o);if(typeof i=="string"||i instanceof ae||ae.isRgb(i)||i instanceof pe)this.attr(o,i);else for(t=xt[o].length-1;t>=0;t--)i[xt[o][t]]!=null&&this.attr(xt.prefix(o,xt[o][t]),i[xt[o][t]]);return this},U(["Element","Runner"],e)}),U(["Element","Runner"],{matrix:function(o,e,t,i,a,s){return o==null?new W(this):this.attr("transform",new W(o,e,t,i,a,s))},rotate:function(o,e,t){return this.transform({rotate:o,ox:e,oy:t},!0)},skew:function(o,e,t,i){return arguments.length===1||arguments.length===3?this.transform({skew:o,ox:e,oy:t},!0):this.transform({skew:[o,e],ox:t,oy:i},!0)},shear:function(o,e,t){return this.transform({shear:o,ox:e,oy:t},!0)},scale:function(o,e,t,i){return arguments.length===1||arguments.length===3?this.transform({scale:o,ox:e,oy:t},!0):this.transform({scale:[o,e],ox:t,oy:i},!0)},translate:function(o,e){return this.transform({translate:[o,e]},!0)},relative:function(o,e){return this.transform({relative:[o,e]},!0)},flip:function(o="both",e="center"){return"xybothtrue".indexOf(o)===-1&&(e=o,o="both"),this.transform({flip:o,origin:e},!0)},opacity:function(o){return this.attr("opacity",o)}}),U("radius",{radius:function(o,e=o){return(this._element||this).type==="radialGradient"?this.attr("r",new V(o)):this.rx(o).ry(e)}}),U("Path",{length:function(){return this.node.getTotalLength()},pointAt:function(o){return new te(this.node.getPointAtLength(o))}}),U(["Element","Runner"],{font:function(o,e){if(typeof o=="object"){for(e in o)this.font(e,o[e]);return this}return o==="leading"?this.leading(e):o==="anchor"?this.attr("text-anchor",e):o==="size"||o==="family"||o==="weight"||o==="stretch"||o==="variant"||o==="style"?this.attr("font-"+o,e):this.attr(o,e)}}),U("Element",["click","dblclick","mousedown","mouseup","mouseover","mouseout","mousemove","mouseenter","mouseleave","touchstart","touchmove","touchleave","touchend","touchcancel","contextmenu","wheel","pointerdown","pointermove","pointerup","pointerleave","pointercancel"].reduce(function(o,e){return o[e]=function(t){return t===null?this.off(e):this.on(e,t),this},o},{})),U("Element",{untransform:function(){return this.attr("transform",null)},matrixify:function(){return(this.attr("transform")||"").split(os).slice(0,-1).map(function(e){const t=e.trim().split("(");return[t[0],t[1].split(ze).map(function(i){return parseFloat(i)})]}).reverse().reduce(function(e,t){return t[0]==="matrix"?e.lmultiply(W.fromArray(t[1])):e[t[0]].apply(e,t[1])},new W)},toParent:function(o,e){if(this===o)return this;if(Zt(this.node))return this.addTo(o,e);const t=this.screenCTM(),i=o.screenCTM().inverse();return this.addTo(o,e).untransform().transform(i.multiply(t)),this},toRoot:function(o){return this.toParent(this.root(),o)},transform:function(o,e){if(o==null||typeof o=="string"){const i=new W(this).decompose();return o==null?i:i[o]}W.isMatrixLike(o)||(o={...o,origin:qt(o,this)});const t=new W(e===!0?this:e||!1).transform(o);return this.attr("transform",t)}});class ve extends pe{flatten(){return this.each(function(){if(this instanceof ve)return this.flatten().ungroup()}),this}ungroup(e=this.parent(),t=e.index(this)){return t=t===-1?e.children().length:t,this.each(function(i,a){return a[a.length-i-1].toParent(e,t)}),this.remove()}}K(ve,"Container");class It extends ve{constructor(e,t=e){super(se("defs",e),t)}flatten(){return this}ungroup(){return this}}K(It,"Defs");class ke extends pe{}function ri(o){return this.attr("rx",o)}function ni(o){return this.attr("ry",o)}function ca(o){return o==null?this.cx()-this.rx():this.cx(o+this.rx())}function da(o){return o==null?this.cy()-this.ry():this.cy(o+this.ry())}function ua(o){return this.attr("cx",o)}function ga(o){return this.attr("cy",o)}function pa(o){return o==null?2*this.rx():this.rx(new V(o).divide(2))}function fa(o){return o==null?2*this.ry():this.ry(new V(o).divide(2))}K(ke,"Shape");var bs=Object.freeze({__proto__:null,cx:ua,cy:ga,height:fa,rx:ri,ry:ni,width:pa,x:ca,y:da});class Tt extends ke{constructor(e,t=e){super(se("ellipse",e),t)}size(e,t){const i=et(this,e,t);return this.rx(new V(i.width).divide(2)).ry(new V(i.height).divide(2))}}B(Tt,bs),U("Container",{ellipse:re(function(o=0,e=o){return this.put(new Tt).size(o,e).move(0,0)})}),K(Tt,"Ellipse");class xa extends He{constructor(e=J.document.createDocumentFragment()){super(e)}xml(e,t,i){if(typeof e=="boolean"&&(i=t,t=e,e=null),e==null||typeof e=="function"){const a=new He(pt("wrapper",i));return a.add(this.node.cloneNode(!0)),a.xml(!1,i)}return super.xml(e,!1,i)}}function ba(o,e){return(this._element||this).type==="radialGradient"?this.attr({fx:new V(o),fy:new V(e)}):this.attr({x1:new V(o),y1:new V(e)})}function ma(o,e){return(this._element||this).type==="radialGradient"?this.attr({cx:new V