inline-style-editor 1.0.1 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -54,6 +54,7 @@ new InlineStyleEditor({
54
54
  | ------------- |:-------------:| -----:|
55
55
  | listenOnClick | Boolean | Default to false. If true, click events will be listened on the `<body>` element, and the editor opened where clicked |
56
56
  | getAdditionalElems | Function | A function called everytime the editor is opened. Should return a *list* of HTMLElement, that will be editable as well |
57
+ | onStyleChanged | Function | A function called everytime a style is modified. The first argument is the current target element, the second the edited CSS rule, or 'inline' if inline, the third the CSS prop name, the fourth the prop value |
57
58
 
58
59
  ### Suported css properties
59
60
 
@@ -1,8 +1,9 @@
1
- !function(t,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):(t="undefined"!=typeof globalThis?globalThis:t||self).InlineStyleEditor=n()}(this,(function(){"use strict";function t(){}function n(t){return t()}function e(){return Object.create(null)}function r(t){t.forEach(n)}function o(t){return"function"==typeof t}function i(t,n){return t!=t?n==n:t!==n||t&&"object"==typeof t||"function"==typeof t}function l(t,n){t.appendChild(n)}function a(t,n,e){t.insertBefore(n,e||null)}function s(t){t.parentNode.removeChild(t)}function u(t,n){for(let e=0;e<t.length;e+=1)t[e]&&t[e].d(n)}function c(t){return document.createElement(t)}function f(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function h(t){return document.createTextNode(t)}function d(){return h(" ")}function p(t,n,e,r){return t.addEventListener(n,e,r),()=>t.removeEventListener(n,e,r)}function g(t,n,e){null==e?t.removeAttribute(n):t.getAttribute(n)!==e&&t.setAttribute(n,e)}function v(t,n){n=""+n,t.wholeText!==n&&(t.data=n)}function m(t,n,e){t.classList[e?"add":"remove"](n)}let y;function b(t){y=t}function _(){if(!y)throw new Error("Function called outside component initialization");return y}function w(t){_().$$.on_mount.push(t)}function S(t){_().$$.on_destroy.push(t)}const k=[],x=[],E=[],$=[],M=Promise.resolve();let C=!1;function L(t){E.push(t)}const T=new Set;let A=0;function N(){const t=y;do{for(;A<k.length;){const t=k[A];A++,b(t),O(t.$$)}for(b(null),k.length=0,A=0;x.length;)x.pop()();for(let t=0;t<E.length;t+=1){const n=E[t];T.has(n)||(T.add(n),n())}E.length=0}while(k.length);for(;$.length;)$.pop()();C=!1,T.clear(),b(t)}function O(t){if(null!==t.fragment){t.update(),r(t.before_update);const n=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,n),t.after_update.forEach(L)}}const j=new Set;let H;function D(){H={r:0,c:[],p:H}}function P(){H.r||r(H.c),H=H.p}function R(t,n){t&&t.i&&(j.delete(t),t.i(n))}function B(t,n,e,r){if(t&&t.o){if(j.has(t))return;j.add(t),H.c.push((()=>{j.delete(t),r&&(e&&t.d(1),r())})),t.o(n)}else r&&r()}function I(t,e,i,l){const{fragment:a,on_mount:s,on_destroy:u,after_update:c}=t.$$;a&&a.m(e,i),l||L((()=>{const e=s.map(n).filter(o);u?u.push(...e):r(e),t.$$.on_mount=[]})),c.forEach(L)}function F(t,n){const e=t.$$;null!==e.fragment&&(r(e.on_destroy),e.fragment&&e.fragment.d(n),e.on_destroy=e.fragment=null,e.ctx=[])}function z(t,n){-1===t.$$.dirty[0]&&(k.push(t),C||(C=!0,M.then(N)),t.$$.dirty.fill(0)),t.$$.dirty[n/31|0]|=1<<n%31}function q(n,o,i,l,a,u,c,f=[-1]){const h=y;b(n);const d=n.$$={fragment:null,ctx:null,props:u,update:t,not_equal:a,bound:e(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(o.context||(h?h.$$.context:[])),callbacks:e(),dirty:f,skip_bound:!1,root:o.target||h.$$.root};c&&c(d.root);let p=!1;if(d.ctx=i?i(n,o.props||{},((t,e,...r)=>{const o=r.length?r[0]:e;return d.ctx&&a(d.ctx[t],d.ctx[t]=o)&&(!d.skip_bound&&d.bound[t]&&d.bound[t](o),p&&z(n,t)),e})):[],d.update(),p=!0,r(d.before_update),d.fragment=!!l&&l(d.ctx),o.target){if(o.hydrate){const t=function(t){return Array.from(t.childNodes)}(o.target);d.fragment&&d.fragment.l(t),t.forEach(s)}else d.fragment&&d.fragment.c();o.intro&&R(n.$$.fragment),I(n,o.target,o.anchor,o.customElement),N()}b(h)}class G{$destroy(){F(this,1),this.$destroy=t}$on(t,n){const e=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return e.push(n),()=>{const t=e.indexOf(n);-1!==t&&e.splice(t,1)}}$set(t){var n;this.$$set&&(n=t,0!==Object.keys(n).length)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}var U="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},W=9007199254740991,Y="[object Arguments]",X="[object Function]",V="[object GeneratorFunction]",J="[object Symbol]",Z="object"==typeof U&&U&&U.Object===Object&&U,K="object"==typeof self&&self&&self.Object===Object&&self,Q=Z||K||Function("return this")();function tt(t,n,e){switch(e.length){case 0:return t.call(n);case 1:return t.call(n,e[0]);case 2:return t.call(n,e[0],e[1]);case 3:return t.call(n,e[0],e[1],e[2])}return t.apply(n,e)}function nt(t,n){for(var e=-1,r=n.length,o=t.length;++e<r;)t[o+e]=n[e];return t}var et=Object.prototype,rt=et.hasOwnProperty,ot=et.toString,it=Q.Symbol,lt=et.propertyIsEnumerable,at=it?it.isConcatSpreadable:void 0,st=Math.max;function ut(t,n,e,r,o){var i=-1,l=t.length;for(e||(e=ct),o||(o=[]);++i<l;){var a=t[i];n>0&&e(a)?n>1?ut(a,n-1,e,r,o):nt(o,a):r||(o[o.length]=a)}return o}function ct(t){return ht(t)||function(t){return function(t){return dt(t)&&function(t){return null!=t&&function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=W}(t.length)&&!function(t){var n=function(t){var n=typeof t;return!!t&&("object"==n||"function"==n)}(t)?ot.call(t):"";return n==X||n==V}(t)}(t)}(t)&&rt.call(t,"callee")&&(!lt.call(t,"callee")||ot.call(t)==Y)}(t)||!!(at&&t&&t[at])}function ft(t){if("string"==typeof t||function(t){return"symbol"==typeof t||dt(t)&&ot.call(t)==J}(t))return t;var n=t+"";return"0"==n&&1/t==-Infinity?"-0":n}var ht=Array.isArray;function dt(t){return!!t&&"object"==typeof t}var pt,gt,vt=(pt=function(t,n){return null==t?{}:function(t,n){return function(t,n,e){for(var r=-1,o=n.length,i={};++r<o;){var l=n[r],a=t[l];e(a,l)&&(i[l]=a)}return i}(t=Object(t),n,(function(n,e){return e in t}))}(t,function(t,n){for(var e=-1,r=t?t.length:0,o=Array(r);++e<r;)o[e]=n(t[e],e,t);return o}(ut(n,1),ft))},gt=st(void 0===gt?pt.length-1:gt,0),function(){for(var t=arguments,n=-1,e=st(t.length-gt,0),r=Array(e);++n<e;)r[n]=t[gt+n];n=-1;for(var o=Array(gt+1);++n<gt;)o[n]=t[n];return o[gt]=r,tt(pt,this,o)}),mt=vt,yt=/^\s+|\s+$/g,bt=/^[-+]0x[0-9a-f]+$/i,_t=/^0b[01]+$/i,wt=/^0o[0-7]+$/i,St=parseInt,kt="object"==typeof U&&U&&U.Object===Object&&U,xt="object"==typeof self&&self&&self.Object===Object&&self,Et=kt||xt||Function("return this")(),$t=Object.prototype.toString,Mt=Math.max,Ct=Math.min,Lt=function(){return Et.Date.now()};function Tt(t){var n=typeof t;return!!t&&("object"==n||"function"==n)}function At(t){if("number"==typeof t)return t;if(function(t){return"symbol"==typeof t||function(t){return!!t&&"object"==typeof t}(t)&&"[object Symbol]"==$t.call(t)}(t))return NaN;if(Tt(t)){var n="function"==typeof t.valueOf?t.valueOf():t;t=Tt(n)?n+"":n}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(yt,"");var e=_t.test(t);return e||wt.test(t)?St(t.slice(2),e?2:8):bt.test(t)?NaN:+t}var Nt=function(t,n,e){var r,o,i,l,a,s,u=0,c=!1,f=!1,h=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function d(n){var e=r,i=o;return r=o=void 0,u=n,l=t.apply(i,e)}function p(t){return u=t,a=setTimeout(v,n),c?d(t):l}function g(t){var e=t-s;return void 0===s||e>=n||e<0||f&&t-u>=i}function v(){var t=Lt();if(g(t))return m(t);a=setTimeout(v,function(t){var e=n-(t-s);return f?Ct(e,i-(t-u)):e}(t))}function m(t){return a=void 0,h&&r?d(t):(r=o=void 0,l)}function y(){var t=Lt(),e=g(t);if(r=arguments,o=this,s=t,e){if(void 0===a)return p(s);if(f)return a=setTimeout(v,n),d(s)}return void 0===a&&(a=setTimeout(v,n)),l}return n=At(n)||0,Tt(e)&&(c=!!e.leading,i=(f="maxWait"in e)?Mt(At(e.maxWait)||0,n):i,h="trailing"in e?!!e.trailing:h),y.cancel=function(){void 0!==a&&clearTimeout(a),u=0,r=s=o=a=void 0},y.flush=function(){return void 0===a?l:m(Lt())},y};function Ot(t,n){return null==t||null==n?NaN:t<n?-1:t>n?1:t>=n?0:NaN}function jt(t,n){return null==t||null==n?NaN:n<t?-1:n>t?1:n>=t?0:NaN}function Ht(t){let n,e,r;function o(t,r,o=0,i=t.length){if(o<i){if(0!==n(r,r))return i;do{const n=o+i>>>1;e(t[n],r)<0?o=n+1:i=n}while(o<i)}return o}return 2!==t.length?(n=Ot,e=(n,e)=>Ot(t(n),e),r=(n,e)=>t(n)-e):(n=t===Ot||t===jt?t:Dt,e=t,r=t),{left:o,center:function(t,n,e=0,i=t.length){const l=o(t,n,e,i-1);return l>e&&r(t[l-1],n)>-r(t[l],n)?l-1:l},right:function(t,r,o=0,i=t.length){if(o<i){if(0!==n(r,r))return i;do{const n=o+i>>>1;e(t[n],r)<=0?o=n+1:i=n}while(o<i)}return o}}}function Dt(){return 0}Ht(Ot),Ht((function(t){return null===t?NaN:+t})).center;class Pt{constructor(){this._partials=new Float64Array(32),this._n=0}add(t){const n=this._partials;let e=0;for(let r=0;r<this._n&&r<32;r++){const o=n[r],i=t+o,l=Math.abs(t)<Math.abs(o)?t-(i-o):o-(i-t);l&&(n[e++]=l),t=i}return n[e]=t,this._n=e+1,this}valueOf(){const t=this._partials;let n,e,r,o=this._n,i=0;if(o>0){for(i=t[--o];o>0&&(n=i,e=t[--o],i=n+e,r=e-(i-n),!r););o>0&&(r<0&&t[o-1]<0||r>0&&t[o-1]>0)&&(e=2*r,n=i+e,e==n-i&&(i=n))}return i}}var Rt=Math.sqrt(50),Bt=Math.sqrt(10),It=Math.sqrt(2);function Ft(t,n,e){var r,o,i,l,a=-1;if(e=+e,(t=+t)===(n=+n)&&e>0)return[t];if((r=n<t)&&(o=t,t=n,n=o),0===(l=function(t,n,e){var r=(n-t)/Math.max(0,e),o=Math.floor(Math.log(r)/Math.LN10),i=r/Math.pow(10,o);return o>=0?(i>=Rt?10:i>=Bt?5:i>=It?2:1)*Math.pow(10,o):-Math.pow(10,-o)/(i>=Rt?10:i>=Bt?5:i>=It?2:1)}(t,n,e))||!isFinite(l))return[];if(l>0){let e=Math.round(t/l),r=Math.round(n/l);for(e*l<t&&++e,r*l>n&&--r,i=new Array(o=r-e+1);++a<o;)i[a]=(e+a)*l}else{l=-l;let e=Math.round(t*l),r=Math.round(n*l);for(e/l<t&&++e,r/l>n&&--r,i=new Array(o=r-e+1);++a<o;)i[a]=(e+a)/l}return r&&i.reverse(),i}function zt(t){return Math.ceil(Math.log(function(t,n){let e=0;if(void 0===n)for(let n of t)null!=n&&(n=+n)>=n&&++e;else{let r=-1;for(let o of t)null!=(o=n(o,++r,t))&&(o=+o)>=o&&++e}return e}(t))/Math.LN2)+1}var qt=Array.prototype.slice;function Gt(t,n){return t-n}var Ut=t=>()=>t;function Wt(t,n){for(var e,r=-1,o=n.length;++r<o;)if(e=Yt(t,n[r]))return e;return 0}function Yt(t,n){for(var e=n[0],r=n[1],o=-1,i=0,l=t.length,a=l-1;i<l;a=i++){var s=t[i],u=s[0],c=s[1],f=t[a],h=f[0],d=f[1];if(Xt(s,f,n))return 0;c>r!=d>r&&e<(h-u)*(r-c)/(d-c)+u&&(o=-o)}return o}function Xt(t,n,e){var r,o,i,l;return function(t,n,e){return(n[0]-t[0])*(e[1]-t[1])==(e[0]-t[0])*(n[1]-t[1])}(t,n,e)&&(o=t[r=+(t[0]===n[0])],i=e[r],l=n[r],o<=i&&i<=l||l<=i&&i<=o)}function Vt(){}var Jt=[[],[[[1,1.5],[.5,1]]],[[[1.5,1],[1,1.5]]],[[[1.5,1],[.5,1]]],[[[1,.5],[1.5,1]]],[[[1,1.5],[.5,1]],[[1,.5],[1.5,1]]],[[[1,.5],[1,1.5]]],[[[1,.5],[.5,1]]],[[[.5,1],[1,.5]]],[[[1,1.5],[1,.5]]],[[[.5,1],[1,.5]],[[1.5,1],[1,1.5]]],[[[1.5,1],[1,.5]]],[[[.5,1],[1.5,1]]],[[[1,1.5],[1.5,1]]],[[[.5,1],[1,1.5]]],[]];function Zt(){var t=1,n=1,e=zt,r=a;function o(t){var n=e(t);if(Array.isArray(n))n=n.slice().sort(Gt);else{const e=function(t,n){let e,r;if(void 0===n)for(const n of t)null!=n&&(void 0===e?n>=n&&(e=r=n):(e>n&&(e=n),r<n&&(r=n)));else{let o=-1;for(let i of t)null!=(i=n(i,++o,t))&&(void 0===e?i>=i&&(e=r=i):(e>i&&(e=i),r<i&&(r=i)))}return[e,r]}(t),r=function(t,n,e){var r=Math.abs(n-t)/Math.max(0,e),o=Math.pow(10,Math.floor(Math.log(r)/Math.LN10)),i=r/o;return i>=Rt?o*=10:i>=Bt?o*=5:i>=It&&(o*=2),n<t?-o:o}(e[0],e[1],n);n=Ft(Math.floor(e[0]/r)*r,Math.floor(e[1]/r-1)*r,n)}return n.map((n=>i(t,n)))}function i(e,o){var i=[],a=[];return function(e,r,o){var i,a,s,u,c,f,h=new Array,d=new Array;i=a=-1,u=e[0]>=r,Jt[u<<1].forEach(p);for(;++i<t-1;)s=u,u=e[i+1]>=r,Jt[s|u<<1].forEach(p);Jt[u<<0].forEach(p);for(;++a<n-1;){for(i=-1,u=e[a*t+t]>=r,c=e[a*t]>=r,Jt[u<<1|c<<2].forEach(p);++i<t-1;)s=u,u=e[a*t+t+i+1]>=r,f=c,c=e[a*t+i+1]>=r,Jt[s|u<<1|c<<2|f<<3].forEach(p);Jt[u|c<<3].forEach(p)}i=-1,c=e[a*t]>=r,Jt[c<<2].forEach(p);for(;++i<t-1;)f=c,c=e[a*t+i+1]>=r,Jt[c<<2|f<<3].forEach(p);function p(t){var n,e,r=[t[0][0]+i,t[0][1]+a],s=[t[1][0]+i,t[1][1]+a],u=l(r),c=l(s);(n=d[u])?(e=h[c])?(delete d[n.end],delete h[e.start],n===e?(n.ring.push(s),o(n.ring)):h[n.start]=d[e.end]={start:n.start,end:e.end,ring:n.ring.concat(e.ring)}):(delete d[n.end],n.ring.push(s),d[n.end=c]=n):(n=h[c])?(e=d[u])?(delete h[n.start],delete d[e.end],n===e?(n.ring.push(s),o(n.ring)):h[e.start]=d[n.end]={start:e.start,end:n.end,ring:e.ring.concat(n.ring)}):(delete h[n.start],n.ring.unshift(r),h[n.start=u]=n):h[u]=d[c]={start:u,end:c,ring:[r,s]}}Jt[c<<3].forEach(p)}(e,o,(function(t){r(t,e,o),function(t){for(var n=0,e=t.length,r=t[e-1][1]*t[0][0]-t[e-1][0]*t[0][1];++n<e;)r+=t[n-1][1]*t[n][0]-t[n-1][0]*t[n][1];return r}(t)>0?i.push([t]):a.push(t)})),a.forEach((function(t){for(var n,e=0,r=i.length;e<r;++e)if(-1!==Wt((n=i[e])[0],t))return void n.push(t)})),{type:"MultiPolygon",value:o,coordinates:i}}function l(n){return 2*n[0]+n[1]*(t+1)*4}function a(e,r,o){e.forEach((function(e){var i,l=e[0],a=e[1],s=0|l,u=0|a,c=r[u*t+s];l>0&&l<t&&s===l&&(i=r[u*t+s-1],e[0]=l+(o-i)/(c-i)-.5),a>0&&a<n&&u===a&&(i=r[(u-1)*t+s],e[1]=a+(o-i)/(c-i)-.5)}))}return o.contour=i,o.size=function(e){if(!arguments.length)return[t,n];var r=Math.floor(e[0]),i=Math.floor(e[1]);if(!(r>=0&&i>=0))throw new Error("invalid size");return t=r,n=i,o},o.thresholds=function(t){return arguments.length?(e="function"==typeof t?t:Array.isArray(t)?Ut(qt.call(t)):Ut(t),o):e},o.smooth=function(t){return arguments.length?(r=t?a:Vt,o):r===a},o}var Kt=1e-6,Qt=Math.PI,tn=2*Qt,nn=180/Qt,en=Qt/180,rn=Math.abs,on=Math.cos,ln=Math.sin,an=Math.sqrt;function sn(){}function un(t,n){t&&fn.hasOwnProperty(t.type)&&fn[t.type](t,n)}var cn={Feature:function(t,n){un(t.geometry,n)},FeatureCollection:function(t,n){for(var e=t.features,r=-1,o=e.length;++r<o;)un(e[r].geometry,n)}},fn={Sphere:function(t,n){n.sphere()},Point:function(t,n){t=t.coordinates,n.point(t[0],t[1],t[2])},MultiPoint:function(t,n){for(var e=t.coordinates,r=-1,o=e.length;++r<o;)t=e[r],n.point(t[0],t[1],t[2])},LineString:function(t,n){hn(t.coordinates,n,0)},MultiLineString:function(t,n){for(var e=t.coordinates,r=-1,o=e.length;++r<o;)hn(e[r],n,0)},Polygon:function(t,n){dn(t.coordinates,n)},MultiPolygon:function(t,n){for(var e=t.coordinates,r=-1,o=e.length;++r<o;)dn(e[r],n)},GeometryCollection:function(t,n){for(var e=t.geometries,r=-1,o=e.length;++r<o;)un(e[r],n)}};function hn(t,n,e){var r,o=-1,i=t.length-e;for(n.lineStart();++o<i;)r=t[o],n.point(r[0],r[1],r[2]);n.lineEnd()}function dn(t,n){var e=-1,r=t.length;for(n.polygonStart();++e<r;)hn(t[e],n,1);n.polygonEnd()}function pn(t,n){t&&cn.hasOwnProperty(t.type)?cn[t.type](t,n):un(t,n)}function gn(t,n){return[rn(t)>Qt?t+Math.round(-t/tn)*tn:t,n]}function vn(t,n,e,r){this.x=t,this.z=n,this.o=e,this.e=r,this.v=!1,this.n=this.p=null}function mn(t,n,e,r,o){var i,l,a=[],s=[];if(t.forEach((function(t){if(!((n=t.length-1)<=0)){var n,e,r,l,u=t[0],c=t[n];if(l=c,rn((r=u)[0]-l[0])<Kt&&rn(r[1]-l[1])<Kt){if(!u[2]&&!c[2]){for(o.lineStart(),i=0;i<n;++i)o.point((u=t[i])[0],u[1]);return void o.lineEnd()}c[0]+=2e-6}a.push(e=new vn(u,t,null,!0)),s.push(e.o=new vn(u,null,e,!1)),a.push(e=new vn(c,t,null,!1)),s.push(e.o=new vn(c,null,e,!0))}})),a.length){for(s.sort(n),yn(a),yn(s),i=0,l=s.length;i<l;++i)s[i].e=e=!e;for(var u,c,f=a[0];;){for(var h=f,d=!0;h.v;)if((h=h.n)===f)return;u=h.z,o.lineStart();do{if(h.v=h.o.v=!0,h.e){if(d)for(i=0,l=u.length;i<l;++i)o.point((c=u[i])[0],c[1]);else r(h.x,h.n.x,1,o);h=h.n}else{if(d)for(u=h.p.z,i=u.length-1;i>=0;--i)o.point((c=u[i])[0],c[1]);else r(h.x,h.p.x,-1,o);h=h.p}u=(h=h.o).z,d=!d}while(!h.v);o.lineEnd()}}}function yn(t){if(n=t.length){for(var n,e,r=0,o=t[0];++r<n;)o.n=e=t[r],e.p=o,o=e;o.n=e=t[0],e.p=o}}new Pt,new Pt,gn.invert=gn;var bn=1e9,_n=-bn;function wn(t,n,e,r){function o(o,i){return t<=o&&o<=e&&n<=i&&i<=r}function i(o,i,a,u){var c=0,f=0;if(null==o||(c=l(o,a))!==(f=l(i,a))||s(o,i)<0^a>0)do{u.point(0===c||3===c?t:e,c>1?r:n)}while((c=(c+a+4)%4)!==f);else u.point(i[0],i[1])}function l(r,o){return rn(r[0]-t)<Kt?o>0?0:3:rn(r[0]-e)<Kt?o>0?2:1:rn(r[1]-n)<Kt?o>0?1:0:o>0?3:2}function a(t,n){return s(t.x,n.x)}function s(t,n){var e=l(t,1),r=l(n,1);return e!==r?e-r:0===e?n[1]-t[1]:1===e?t[0]-n[0]:2===e?t[1]-n[1]:n[0]-t[0]}return function(l){var s,u,c,f,h,d,p,g,v,m,y,b,_,w=l,S=(_=[],{point:function(t,n,e){b.push([t,n,e])},lineStart:function(){_.push(b=[])},lineEnd:sn,rejoin:function(){_.length>1&&_.push(_.pop().concat(_.shift()))},result:function(){var t=_;return _=[],b=null,t}}),k={point:x,lineStart:function(){k.point=E,u&&u.push(c=[]);m=!0,v=!1,p=g=NaN},lineEnd:function(){s&&(E(f,h),d&&v&&S.rejoin(),s.push(S.result()));k.point=x,v&&w.lineEnd()},polygonStart:function(){w=S,s=[],u=[],y=!0},polygonEnd:function(){var n=function(){for(var n=0,e=0,o=u.length;e<o;++e)for(var i,l,a=u[e],s=1,c=a.length,f=a[0],h=f[0],d=f[1];s<c;++s)i=h,l=d,h=(f=a[s])[0],d=f[1],l<=r?d>r&&(h-i)*(r-l)>(d-l)*(t-i)&&++n:d<=r&&(h-i)*(r-l)<(d-l)*(t-i)&&--n;return n}(),e=y&&n,o=(f=s,s=Array.from(function*(t){for(const n of t)yield*n}(f))).length;var f;(e||o)&&(l.polygonStart(),e&&(l.lineStart(),i(null,null,1,l),l.lineEnd()),o&&mn(s,a,n,i,l),l.polygonEnd());w=l,s=u=c=null}};function x(t,n){o(t,n)&&w.point(t,n)}function E(i,l){var a=o(i,l);if(u&&c.push([i,l]),m)f=i,h=l,d=a,m=!1,a&&(w.lineStart(),w.point(i,l));else if(a&&v)w.point(i,l);else{var s=[p=Math.max(_n,Math.min(bn,p)),g=Math.max(_n,Math.min(bn,g))],b=[i=Math.max(_n,Math.min(bn,i)),l=Math.max(_n,Math.min(bn,l))];!function(t,n,e,r,o,i){var l,a=t[0],s=t[1],u=0,c=1,f=n[0]-a,h=n[1]-s;if(l=e-a,f||!(l>0)){if(l/=f,f<0){if(l<u)return;l<c&&(c=l)}else if(f>0){if(l>c)return;l>u&&(u=l)}if(l=o-a,f||!(l<0)){if(l/=f,f<0){if(l>c)return;l>u&&(u=l)}else if(f>0){if(l<u)return;l<c&&(c=l)}if(l=r-s,h||!(l>0)){if(l/=h,h<0){if(l<u)return;l<c&&(c=l)}else if(h>0){if(l>c)return;l>u&&(u=l)}if(l=i-s,h||!(l<0)){if(l/=h,h<0){if(l>c)return;l>u&&(u=l)}else if(h>0){if(l<u)return;l<c&&(c=l)}return u>0&&(t[0]=a+u*f,t[1]=s+u*h),c<1&&(n[0]=a+c*f,n[1]=s+c*h),!0}}}}}(s,b,t,n,e,r)?a&&(w.lineStart(),w.point(i,l),y=!1):(v||(w.lineStart(),w.point(s[0],s[1])),w.point(b[0],b[1]),a||w.lineEnd(),y=!1)}p=i,g=l,v=a}return k}}var Sn,kn,xn,En,$n=t=>t,Mn=new Pt,Cn=new Pt,Ln={point:sn,lineStart:sn,lineEnd:sn,polygonStart:function(){Ln.lineStart=Tn,Ln.lineEnd=On},polygonEnd:function(){Ln.lineStart=Ln.lineEnd=Ln.point=sn,Mn.add(rn(Cn)),Cn=new Pt},result:function(){var t=Mn/2;return Mn=new Pt,t}};function Tn(){Ln.point=An}function An(t,n){Ln.point=Nn,Sn=xn=t,kn=En=n}function Nn(t,n){Cn.add(En*t-xn*n),xn=t,En=n}function On(){Nn(Sn,kn)}var jn=1/0,Hn=jn,Dn=-jn,Pn=Dn,Rn={point:function(t,n){t<jn&&(jn=t);t>Dn&&(Dn=t);n<Hn&&(Hn=n);n>Pn&&(Pn=n)},lineStart:sn,lineEnd:sn,polygonStart:sn,polygonEnd:sn,result:function(){var t=[[jn,Hn],[Dn,Pn]];return Dn=Pn=-(Hn=jn=1/0),t}};var Bn,In,Fn,zn,qn=0,Gn=0,Un=0,Wn=0,Yn=0,Xn=0,Vn=0,Jn=0,Zn=0,Kn={point:Qn,lineStart:te,lineEnd:re,polygonStart:function(){Kn.lineStart=oe,Kn.lineEnd=ie},polygonEnd:function(){Kn.point=Qn,Kn.lineStart=te,Kn.lineEnd=re},result:function(){var t=Zn?[Vn/Zn,Jn/Zn]:Xn?[Wn/Xn,Yn/Xn]:Un?[qn/Un,Gn/Un]:[NaN,NaN];return qn=Gn=Un=Wn=Yn=Xn=Vn=Jn=Zn=0,t}};function Qn(t,n){qn+=t,Gn+=n,++Un}function te(){Kn.point=ne}function ne(t,n){Kn.point=ee,Qn(Fn=t,zn=n)}function ee(t,n){var e=t-Fn,r=n-zn,o=an(e*e+r*r);Wn+=o*(Fn+t)/2,Yn+=o*(zn+n)/2,Xn+=o,Qn(Fn=t,zn=n)}function re(){Kn.point=Qn}function oe(){Kn.point=le}function ie(){ae(Bn,In)}function le(t,n){Kn.point=ae,Qn(Bn=Fn=t,In=zn=n)}function ae(t,n){var e=t-Fn,r=n-zn,o=an(e*e+r*r);Wn+=o*(Fn+t)/2,Yn+=o*(zn+n)/2,Xn+=o,Vn+=(o=zn*t-Fn*n)*(Fn+t),Jn+=o*(zn+n),Zn+=3*o,Qn(Fn=t,zn=n)}function se(t){this._context=t}se.prototype={_radius:4.5,pointRadius:function(t){return this._radius=t,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._context.closePath(),this._point=NaN},point:function(t,n){switch(this._point){case 0:this._context.moveTo(t,n),this._point=1;break;case 1:this._context.lineTo(t,n);break;default:this._context.moveTo(t+this._radius,n),this._context.arc(t,n,this._radius,0,tn)}},result:sn};var ue,ce,fe,he,de,pe=new Pt,ge={point:sn,lineStart:function(){ge.point=ve},lineEnd:function(){ue&&me(ce,fe),ge.point=sn},polygonStart:function(){ue=!0},polygonEnd:function(){ue=null},result:function(){var t=+pe;return pe=new Pt,t}};function ve(t,n){ge.point=me,ce=he=t,fe=de=n}function me(t,n){he-=t,de-=n,pe.add(an(he*he+de*de)),he=t,de=n}function ye(){this._string=[]}function be(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}function _e(){}function we(t,n,e){var r=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),null!=r&&t.clipExtent(null),pn(e,t.stream(Rn)),n(Rn.result()),null!=r&&t.clipExtent(r),t}function Se(t,n,e){return we(t,(function(e){var r=n[1][0]-n[0][0],o=n[1][1]-n[0][1],i=Math.min(r/(e[1][0]-e[0][0]),o/(e[1][1]-e[0][1])),l=+n[0][0]+(r-i*(e[1][0]+e[0][0]))/2,a=+n[0][1]+(o-i*(e[1][1]+e[0][1]))/2;t.scale(150*i).translate([l,a])}),e)}function ke(t,n){return[t,n]}function xe(){var t,n,e,r,o,i,l,a,s=1,u=0,c=0,f=1,h=1,d=0,p=null,g=1,v=1,m=(a={point:function(t,n){var e=_([t,n]);this.stream.point(e[0],e[1])}},function(t){var n=new _e;for(var e in a)n[e]=a[e];return n.stream=t,n}),y=$n;function b(){return g=s*f,v=s*h,i=l=null,_}function _(e){var r=e[0]*g,o=e[1]*v;if(d){var i=o*t-r*n;r=r*t+o*n,o=i}return[r+u,o+c]}return _.invert=function(e){var r=e[0]-u,o=e[1]-c;if(d){var i=o*t+r*n;r=r*t-o*n,o=i}return[r/g,o/v]},_.stream=function(t){return i&&l===t?i:i=m(y(l=t))},_.postclip=function(t){return arguments.length?(y=t,p=e=r=o=null,b()):y},_.clipExtent=function(t){return arguments.length?(y=null==t?(p=e=r=o=null,$n):wn(p=+t[0][0],e=+t[0][1],r=+t[1][0],o=+t[1][1]),b()):null==p?null:[[p,e],[r,o]]},_.scale=function(t){return arguments.length?(s=+t,b()):s},_.translate=function(t){return arguments.length?(u=+t[0],c=+t[1],b()):[u,c]},_.angle=function(e){return arguments.length?(n=ln(d=e%360*en),t=on(d),b()):d*nn},_.reflectX=function(t){return arguments.length?(f=t?-1:1,b()):f<0},_.reflectY=function(t){return arguments.length?(h=t?-1:1,b()):h<0},_.fitExtent=function(t,n){return Se(_,t,n)},_.fitSize=function(t,n){return function(t,n,e){return Se(t,[[0,0],n],e)}(_,t,n)},_.fitWidth=function(t,n){return function(t,n,e){return we(t,(function(e){var r=+n,o=r/(e[1][0]-e[0][0]),i=(r-o*(e[1][0]+e[0][0]))/2,l=-o*e[0][1];t.scale(150*o).translate([i,l])}),e)}(_,t,n)},_.fitHeight=function(t,n){return function(t,n,e){return we(t,(function(e){var r=+n,o=r/(e[1][1]-e[0][1]),i=-o*e[0][0],l=(r-o*(e[1][1]+e[0][1]))/2;t.scale(150*o).translate([i,l])}),e)}(_,t,n)},_}ye.prototype={_radius:4.5,_circle:be(4.5),pointRadius:function(t){return(t=+t)!==this._radius&&(this._radius=t,this._circle=null),this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._string.push("Z"),this._point=NaN},point:function(t,n){switch(this._point){case 0:this._string.push("M",t,",",n),this._point=1;break;case 1:this._string.push("L",t,",",n);break;default:null==this._circle&&(this._circle=be(this._radius)),this._string.push("M",t,",",n,this._circle)}},result:function(){if(this._string.length){var t=this._string.join("");return this._string=[],t}return null}},_e.prototype={constructor:_e,point:function(t,n){this.stream.point(t,n)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}},ke.invert=ke;var Ee=function(t){var n=[];return t.replace(Me,(function(t,e,r){var o=e.toLowerCase();for(r=function(t){var n=t.match(Ce);return n?n.map(Number):[]}(r),"m"==o&&r.length>2&&(n.push([e].concat(r.splice(0,2))),o="l",e="m"==e?"l":"L");;){if(r.length==$e[o])return r.unshift(e),n.push(r);if(r.length<$e[o])throw new Error("malformed path data");n.push([e].concat(r.splice(0,$e[o])))}})),n},$e={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},Me=/([astvzqmhlc])([^astvzqmhlc]*)/gi;var Ce=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi;function Le(t){const n=Ee(t).map((t=>t.map(((t,n)=>n>0?Math.round(t):t)))),e=[];for(let t=0;t<n.length-1;++t){const r=n[t];let o=n[t+1];e.push(r);let i=r[1]===o[1],l=r[2]===o[2];if(i){for(;i;)t+=1,o=n[t+1],i="L"===o[0]&&r[1]===o[1];t-=1}if(l){for(;l;)t+=1,o=n[t+1],l="L"===o[0]&&r[2]===o[2];t-=1}}return e.push(n[n.length-1]),function(t){let n="";return t.forEach((t=>{for(let e=0;e<t.length;++e){let r=t[e];e>0&&(r=Math.round(r)),n+=r+(e===t.length-1?"":" ")}})),n}(e)}function Te(t,n){return!(t.x<n.left||t.x>n.right||t.y>n.bottom||t.y<n.top)}function Ae(t,n){for(const e of n)if(Te(t,e))return!0;return!1}function Ne({width:t,height:n,top:e=0,left:r=0}){return`M${r} ${e} h${t} v${n} h-${t}z`}function Oe(t,n){let e=function({width:t,height:n,top:e=0,left:r=0}){return`M${r} ${e} v${n} h${t} v-${n}z`}({width:n.width,height:n.height});if(t.length<10&&!function(t){for(let r=0;r<t.length-1;++r){const o=t[r];for(let i=r+1;i<t.length;++i)if(n=o,e=t[i],n.right>=e.left&&e.right>=n.left&&n.bottom>=e.top&&e.bottom>=n.top)return!0}var n,e;return!1}(t)){for(const n of t)e=`${e} ${Ne(n)}`;return e}const r=Math.min(...t.map((t=>t.left))),o=Math.min(...t.map((t=>t.top))),i=t.map((t=>(t.left=t.left-r,t.right=t.right-r,t.top=t.top-o,t.bottom=t.bottom-o,t)));i.sort(((t,n)=>t.left>n.left?1:t.left<n.left?-1:0));const l=Math.ceil(Math.max(...i.map((t=>t.right)))),a=Math.ceil(Math.max(...i.map((t=>t.bottom)))),s=l*a/2e4,u=Math.ceil(l/s),c=Math.ceil(a/s),f=new Array(u*c);for(let t=0,n=0;t<c;++t)for(let e=0;e<u;++e,++n)f[n]=Ae({x:e*s,y:t*s},i)?1:0;const h=Zt().size([u,c]).thresholds([1])(f),d=xe().fitExtent([[r,o],[r+l,o+a]],h[0]),p=function(t,n){var e,r,o=4.5;function i(t){return t&&("function"==typeof o&&r.pointRadius(+o.apply(this,arguments)),pn(t,e(r))),r.result()}return i.area=function(t){return pn(t,e(Ln)),Ln.result()},i.measure=function(t){return pn(t,e(ge)),ge.result()},i.bounds=function(t){return pn(t,e(Rn)),Rn.result()},i.centroid=function(t){return pn(t,e(Kn)),Kn.result()},i.projection=function(n){return arguments.length?(e=null==n?(t=null,$n):(t=n).stream,i):t},i.context=function(t){return arguments.length?(r=null==t?(n=null,new ye):new se(n=t),"function"!=typeof o&&r.pointRadius(o),i):n},i.pointRadius=function(t){return arguments.length?(o="function"==typeof t?t:(r.pointRadius(+t),+t),i):o},i.projection(t).context(n)}().projection(d);return`${e} ${Le(p(h[0]))}`}
1
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).InlineStyleEditor=e()}(this,(function(){"use strict";function t(){}function e(t){return t()}function n(){return Object.create(null)}function r(t){t.forEach(e)}function o(t){return"function"==typeof t}function i(t,e){return t!=t?e==e:t!==e||t&&"object"==typeof t||"function"==typeof t}function l(t,e){t.appendChild(e)}function a(t,e,n){t.insertBefore(e,n||null)}function s(t){t.parentNode.removeChild(t)}function c(t,e){for(let n=0;n<t.length;n+=1)t[n]&&t[n].d(e)}function u(t){return document.createElement(t)}function f(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function h(t){return document.createTextNode(t)}function d(){return h(" ")}function p(t,e,n,r){return t.addEventListener(e,n,r),()=>t.removeEventListener(e,n,r)}function g(t,e,n){null==n?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function m(t,e){e=""+e,t.wholeText!==e&&(t.data=e)}function v(t,e,n){t.classList[n?"add":"remove"](e)}let y;function b(t){y=t}function w(){if(!y)throw new Error("Function called outside component initialization");return y}function _(t){w().$$.on_mount.push(t)}function k(t){w().$$.on_destroy.push(t)}const $=[],S=[],x=[],C=[],M=Promise.resolve();let E=!1;function L(t){x.push(t)}const T=new Set;let A=0;function O(){const t=y;do{for(;A<$.length;){const t=$[A];A++,b(t),N(t.$$)}for(b(null),$.length=0,A=0;S.length;)S.pop()();for(let t=0;t<x.length;t+=1){const e=x[t];T.has(e)||(T.add(e),e())}x.length=0}while($.length);for(;C.length;)C.pop()();E=!1,T.clear(),b(t)}function N(t){if(null!==t.fragment){t.update(),r(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(L)}}const H=new Set;let j;function D(){j={r:0,c:[],p:j}}function I(){j.r||r(j.c),j=j.p}function P(t,e){t&&t.i&&(H.delete(t),t.i(e))}function R(t,e,n,r){if(t&&t.o){if(H.has(t))return;H.add(t),j.c.push((()=>{H.delete(t),r&&(n&&t.d(1),r())})),t.o(e)}else r&&r()}function B(t,n,i,l){const{fragment:a,on_mount:s,on_destroy:c,after_update:u}=t.$$;a&&a.m(n,i),l||L((()=>{const n=s.map(e).filter(o);c?c.push(...n):r(n),t.$$.on_mount=[]})),u.forEach(L)}function F(t,e){const n=t.$$;null!==n.fragment&&(r(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function G(t,e){-1===t.$$.dirty[0]&&($.push(t),E||(E=!0,M.then(O)),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function q(e,o,i,l,a,c,u,f=[-1]){const h=y;b(e);const d=e.$$={fragment:null,ctx:null,props:c,update:t,not_equal:a,bound:n(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(o.context||(h?h.$$.context:[])),callbacks:n(),dirty:f,skip_bound:!1,root:o.target||h.$$.root};u&&u(d.root);let p=!1;if(d.ctx=i?i(e,o.props||{},((t,n,...r)=>{const o=r.length?r[0]:n;return d.ctx&&a(d.ctx[t],d.ctx[t]=o)&&(!d.skip_bound&&d.bound[t]&&d.bound[t](o),p&&G(e,t)),n})):[],d.update(),p=!0,r(d.before_update),d.fragment=!!l&&l(d.ctx),o.target){if(o.hydrate){const t=function(t){return Array.from(t.childNodes)}(o.target);d.fragment&&d.fragment.l(t),t.forEach(s)}else d.fragment&&d.fragment.c();o.intro&&P(e.$$.fragment),B(e,o.target,o.anchor,o.customElement),O()}b(h)}class U{$destroy(){F(this,1),this.$destroy=t}$on(t,e){const n=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return n.push(e),()=>{const t=n.indexOf(e);-1!==t&&n.splice(t,1)}}$set(t){var e;this.$$set&&(e=t,0!==Object.keys(e).length)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}var z="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},W=9007199254740991,Y="[object Arguments]",X="[object Function]",V="[object GeneratorFunction]",J="[object Symbol]",Z="object"==typeof z&&z&&z.Object===Object&&z,K="object"==typeof self&&self&&self.Object===Object&&self,Q=Z||K||Function("return this")();function tt(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function et(t,e){for(var n=-1,r=e.length,o=t.length;++n<r;)t[o+n]=e[n];return t}var nt=Object.prototype,rt=nt.hasOwnProperty,ot=nt.toString,it=Q.Symbol,lt=nt.propertyIsEnumerable,at=it?it.isConcatSpreadable:void 0,st=Math.max;function ct(t,e,n,r,o){var i=-1,l=t.length;for(n||(n=ut),o||(o=[]);++i<l;){var a=t[i];e>0&&n(a)?e>1?ct(a,e-1,n,r,o):et(o,a):r||(o[o.length]=a)}return o}function ut(t){return ht(t)||function(t){return function(t){return dt(t)&&function(t){return null!=t&&function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=W}(t.length)&&!function(t){var e=function(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}(t)?ot.call(t):"";return e==X||e==V}(t)}(t)}(t)&&rt.call(t,"callee")&&(!lt.call(t,"callee")||ot.call(t)==Y)}(t)||!!(at&&t&&t[at])}function ft(t){if("string"==typeof t||function(t){return"symbol"==typeof t||dt(t)&&ot.call(t)==J}(t))return t;var e=t+"";return"0"==e&&1/t==-Infinity?"-0":e}var ht=Array.isArray;function dt(t){return!!t&&"object"==typeof t}var pt,gt,mt=(pt=function(t,e){return null==t?{}:function(t,e){return function(t,e,n){for(var r=-1,o=e.length,i={};++r<o;){var l=e[r],a=t[l];n(a,l)&&(i[l]=a)}return i}(t=Object(t),e,(function(e,n){return n in t}))}(t,function(t,e){for(var n=-1,r=t?t.length:0,o=Array(r);++n<r;)o[n]=e(t[n],n,t);return o}(ct(e,1),ft))},gt=st(void 0===gt?pt.length-1:gt,0),function(){for(var t=arguments,e=-1,n=st(t.length-gt,0),r=Array(n);++e<n;)r[e]=t[gt+e];e=-1;for(var o=Array(gt+1);++e<gt;)o[e]=t[e];return o[gt]=r,tt(pt,this,o)}),vt=mt,yt=/^\s+|\s+$/g,bt=/^[-+]0x[0-9a-f]+$/i,wt=/^0b[01]+$/i,_t=/^0o[0-7]+$/i,kt=parseInt,$t="object"==typeof z&&z&&z.Object===Object&&z,St="object"==typeof self&&self&&self.Object===Object&&self,xt=$t||St||Function("return this")(),Ct=Object.prototype.toString,Mt=Math.max,Et=Math.min,Lt=function(){return xt.Date.now()};function Tt(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function At(t){if("number"==typeof t)return t;if(function(t){return"symbol"==typeof t||function(t){return!!t&&"object"==typeof t}(t)&&"[object Symbol]"==Ct.call(t)}(t))return NaN;if(Tt(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=Tt(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(yt,"");var n=wt.test(t);return n||_t.test(t)?kt(t.slice(2),n?2:8):bt.test(t)?NaN:+t}var Ot=function(t,e,n){var r,o,i,l,a,s,c=0,u=!1,f=!1,h=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function d(e){var n=r,i=o;return r=o=void 0,c=e,l=t.apply(i,n)}function p(t){return c=t,a=setTimeout(m,e),u?d(t):l}function g(t){var n=t-s;return void 0===s||n>=e||n<0||f&&t-c>=i}function m(){var t=Lt();if(g(t))return v(t);a=setTimeout(m,function(t){var n=e-(t-s);return f?Et(n,i-(t-c)):n}(t))}function v(t){return a=void 0,h&&r?d(t):(r=o=void 0,l)}function y(){var t=Lt(),n=g(t);if(r=arguments,o=this,s=t,n){if(void 0===a)return p(s);if(f)return a=setTimeout(m,e),d(s)}return void 0===a&&(a=setTimeout(m,e)),l}return e=At(e)||0,Tt(n)&&(u=!!n.leading,i=(f="maxWait"in n)?Mt(At(n.maxWait)||0,e):i,h="trailing"in n?!!n.trailing:h),y.cancel=function(){void 0!==a&&clearTimeout(a),c=0,r=s=o=a=void 0},y.flush=function(){return void 0===a?l:v(Lt())},y};function Nt(t,e){return null==t||null==e?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function Ht(t,e){return null==t||null==e?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function jt(t){let e,n,r;function o(t,r,o=0,i=t.length){if(o<i){if(0!==e(r,r))return i;do{const e=o+i>>>1;n(t[e],r)<0?o=e+1:i=e}while(o<i)}return o}return 2!==t.length?(e=Nt,n=(e,n)=>Nt(t(e),n),r=(e,n)=>t(e)-n):(e=t===Nt||t===Ht?t:Dt,n=t,r=t),{left:o,center:function(t,e,n=0,i=t.length){const l=o(t,e,n,i-1);return l>n&&r(t[l-1],e)>-r(t[l],e)?l-1:l},right:function(t,r,o=0,i=t.length){if(o<i){if(0!==e(r,r))return i;do{const e=o+i>>>1;n(t[e],r)<=0?o=e+1:i=e}while(o<i)}return o}}}function Dt(){return 0}jt(Nt),jt((function(t){return null===t?NaN:+t})).center;var It=Math.sqrt(50),Pt=Math.sqrt(10),Rt=Math.sqrt(2);function Bt(t,e,n){var r,o,i,l,a=-1;if(n=+n,(t=+t)===(e=+e)&&n>0)return[t];if((r=e<t)&&(o=t,t=e,e=o),0===(l=function(t,e,n){var r=(e-t)/Math.max(0,n),o=Math.floor(Math.log(r)/Math.LN10),i=r/Math.pow(10,o);return o>=0?(i>=It?10:i>=Pt?5:i>=Rt?2:1)*Math.pow(10,o):-Math.pow(10,-o)/(i>=It?10:i>=Pt?5:i>=Rt?2:1)}(t,e,n))||!isFinite(l))return[];if(l>0){let n=Math.round(t/l),r=Math.round(e/l);for(n*l<t&&++n,r*l>e&&--r,i=new Array(o=r-n+1);++a<o;)i[a]=(n+a)*l}else{l=-l;let n=Math.round(t*l),r=Math.round(e*l);for(n/l<t&&++n,r/l>e&&--r,i=new Array(o=r-n+1);++a<o;)i[a]=(n+a)/l}return r&&i.reverse(),i}function Ft(t){return Math.ceil(Math.log(function(t,e){let n=0;if(void 0===e)for(let e of t)null!=e&&(e=+e)>=e&&++n;else{let r=-1;for(let o of t)null!=(o=e(o,++r,t))&&(o=+o)>=o&&++n}return n}(t))/Math.LN2)+1}var Gt=Array.prototype.slice;function qt(t,e){return t-e}var Ut=t=>()=>t;function zt(t,e){for(var n,r=-1,o=e.length;++r<o;)if(n=Wt(t,e[r]))return n;return 0}function Wt(t,e){for(var n=e[0],r=e[1],o=-1,i=0,l=t.length,a=l-1;i<l;a=i++){var s=t[i],c=s[0],u=s[1],f=t[a],h=f[0],d=f[1];if(Yt(s,f,e))return 0;u>r!=d>r&&n<(h-c)*(r-u)/(d-u)+c&&(o=-o)}return o}function Yt(t,e,n){var r,o,i,l;return function(t,e,n){return(e[0]-t[0])*(n[1]-t[1])==(n[0]-t[0])*(e[1]-t[1])}(t,e,n)&&(o=t[r=+(t[0]===e[0])],i=n[r],l=e[r],o<=i&&i<=l||l<=i&&i<=o)}function Xt(){}var Vt=[[],[[[1,1.5],[.5,1]]],[[[1.5,1],[1,1.5]]],[[[1.5,1],[.5,1]]],[[[1,.5],[1.5,1]]],[[[1,1.5],[.5,1]],[[1,.5],[1.5,1]]],[[[1,.5],[1,1.5]]],[[[1,.5],[.5,1]]],[[[.5,1],[1,.5]]],[[[1,1.5],[1,.5]]],[[[.5,1],[1,.5]],[[1.5,1],[1,1.5]]],[[[1.5,1],[1,.5]]],[[[.5,1],[1.5,1]]],[[[1,1.5],[1.5,1]]],[[[.5,1],[1,1.5]]],[]];function Jt(){var t=1,e=1,n=Ft,r=a;function o(t){var e=n(t);if(Array.isArray(e))e=e.slice().sort(qt);else{const n=function(t,e){let n,r;if(void 0===e)for(const e of t)null!=e&&(void 0===n?e>=e&&(n=r=e):(n>e&&(n=e),r<e&&(r=e)));else{let o=-1;for(let i of t)null!=(i=e(i,++o,t))&&(void 0===n?i>=i&&(n=r=i):(n>i&&(n=i),r<i&&(r=i)))}return[n,r]}(t),r=function(t,e,n){var r=Math.abs(e-t)/Math.max(0,n),o=Math.pow(10,Math.floor(Math.log(r)/Math.LN10)),i=r/o;return i>=It?o*=10:i>=Pt?o*=5:i>=Rt&&(o*=2),e<t?-o:o}(n[0],n[1],e);e=Bt(Math.floor(n[0]/r)*r,Math.floor(n[1]/r-1)*r,e)}return e.map((e=>i(t,e)))}function i(n,o){var i=[],a=[];return function(n,r,o){var i,a,s,c,u,f,h=new Array,d=new Array;i=a=-1,c=n[0]>=r,Vt[c<<1].forEach(p);for(;++i<t-1;)s=c,c=n[i+1]>=r,Vt[s|c<<1].forEach(p);Vt[c<<0].forEach(p);for(;++a<e-1;){for(i=-1,c=n[a*t+t]>=r,u=n[a*t]>=r,Vt[c<<1|u<<2].forEach(p);++i<t-1;)s=c,c=n[a*t+t+i+1]>=r,f=u,u=n[a*t+i+1]>=r,Vt[s|c<<1|u<<2|f<<3].forEach(p);Vt[c|u<<3].forEach(p)}i=-1,u=n[a*t]>=r,Vt[u<<2].forEach(p);for(;++i<t-1;)f=u,u=n[a*t+i+1]>=r,Vt[u<<2|f<<3].forEach(p);function p(t){var e,n,r=[t[0][0]+i,t[0][1]+a],s=[t[1][0]+i,t[1][1]+a],c=l(r),u=l(s);(e=d[c])?(n=h[u])?(delete d[e.end],delete h[n.start],e===n?(e.ring.push(s),o(e.ring)):h[e.start]=d[n.end]={start:e.start,end:n.end,ring:e.ring.concat(n.ring)}):(delete d[e.end],e.ring.push(s),d[e.end=u]=e):(e=h[u])?(n=d[c])?(delete h[e.start],delete d[n.end],e===n?(e.ring.push(s),o(e.ring)):h[n.start]=d[e.end]={start:n.start,end:e.end,ring:n.ring.concat(e.ring)}):(delete h[e.start],e.ring.unshift(r),h[e.start=c]=e):h[c]=d[u]={start:c,end:u,ring:[r,s]}}Vt[u<<3].forEach(p)}(n,o,(function(t){r(t,n,o),function(t){for(var e=0,n=t.length,r=t[n-1][1]*t[0][0]-t[n-1][0]*t[0][1];++e<n;)r+=t[e-1][1]*t[e][0]-t[e-1][0]*t[e][1];return r}(t)>0?i.push([t]):a.push(t)})),a.forEach((function(t){for(var e,n=0,r=i.length;n<r;++n)if(-1!==zt((e=i[n])[0],t))return void e.push(t)})),{type:"MultiPolygon",value:o,coordinates:i}}function l(e){return 2*e[0]+e[1]*(t+1)*4}function a(n,r,o){n.forEach((function(n){var i,l=n[0],a=n[1],s=0|l,c=0|a,u=r[c*t+s];l>0&&l<t&&s===l&&(i=r[c*t+s-1],n[0]=l+(o-i)/(u-i)-.5),a>0&&a<e&&c===a&&(i=r[(c-1)*t+s],n[1]=a+(o-i)/(u-i)-.5)}))}return o.contour=i,o.size=function(n){if(!arguments.length)return[t,e];var r=Math.floor(n[0]),i=Math.floor(n[1]);if(!(r>=0&&i>=0))throw new Error("invalid size");return t=r,e=i,o},o.thresholds=function(t){return arguments.length?(n="function"==typeof t?t:Array.isArray(t)?Ut(Gt.call(t)):Ut(t),o):n},o.smooth=function(t){return arguments.length?(r=t?a:Xt,o):r===a},o}function Zt(t,e){return!(t.x<e.left||t.x>e.right||t.y>e.bottom||t.y<e.top)}function Kt(t,e){for(const n of e)if(Zt(t,n))return!0;return!1}function Qt({width:t,height:e,top:n=0,left:r=0}){return`M${r} ${n} h${t} v${e} h-${t}z`}
2
2
  /*!
3
3
  * vanilla-picker v2.12.1
4
4
  * https://vanilla-picker.js.org
5
5
  *
6
6
  * Copyright 2017-2021 Andreas Borgen (https://github.com/Sphinxxxx), Adam Brooks (https://github.com/dissimulate)
7
7
  * Released under the ISC license.
8
- */var je=function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")},He=function(){function t(t,n){for(var e=0;e<n.length;e++){var r=n[e];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(n,e,r){return e&&t(n.prototype,e),r&&t(n,r),n}}(),De=function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,n){var e=[],r=!0,o=!1,i=void 0;try{for(var l,a=t[Symbol.iterator]();!(r=(l=a.next()).done)&&(e.push(l.value),!n||e.length!==n);r=!0);}catch(t){o=!0,i=t}finally{try{!r&&a.return&&a.return()}finally{if(o)throw i}}return e}(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")};String.prototype.startsWith=String.prototype.startsWith||function(t){return 0===this.indexOf(t)},String.prototype.padStart=String.prototype.padStart||function(t,n){for(var e=this;e.length<t;)e=n+e;return e};var Pe={cb:"0f8ff",tqw:"aebd7",q:"-ffff",qmrn:"7fffd4",zr:"0ffff",bg:"5f5dc",bsq:"e4c4",bck:"---",nch:"ebcd",b:"--ff",bvt:"8a2be2",brwn:"a52a2a",brw:"deb887",ctb:"5f9ea0",hrt:"7fff-",chcT:"d2691e",cr:"7f50",rnw:"6495ed",crns:"8dc",crms:"dc143c",cn:"-ffff",Db:"--8b",Dcn:"-8b8b",Dgnr:"b8860b",Dgr:"a9a9a9",Dgrn:"-64-",Dkhk:"bdb76b",Dmgn:"8b-8b",Dvgr:"556b2f",Drng:"8c-",Drch:"9932cc",Dr:"8b--",Dsmn:"e9967a",Dsgr:"8fbc8f",DsTb:"483d8b",DsTg:"2f4f4f",Dtrq:"-ced1",Dvt:"94-d3",ppnk:"1493",pskb:"-bfff",mgr:"696969",grb:"1e90ff",rbrc:"b22222",rwht:"af0",stg:"228b22",chs:"-ff",gnsb:"dcdcdc",st:"8f8ff",g:"d7-",gnr:"daa520",gr:"808080",grn:"-8-0",grnw:"adff2f",hnw:"0fff0",htpn:"69b4",nnr:"cd5c5c",ng:"4b-82",vr:"0",khk:"0e68c",vnr:"e6e6fa",nrb:"0f5",wngr:"7cfc-",mnch:"acd",Lb:"add8e6",Lcr:"08080",Lcn:"e0ffff",Lgnr:"afad2",Lgr:"d3d3d3",Lgrn:"90ee90",Lpnk:"b6c1",Lsmn:"a07a",Lsgr:"20b2aa",Lskb:"87cefa",LsTg:"778899",Lstb:"b0c4de",Lw:"e0",m:"-ff-",mgrn:"32cd32",nn:"af0e6",mgnt:"-ff",mrn:"8--0",mqm:"66cdaa",mmb:"--cd",mmrc:"ba55d3",mmpr:"9370db",msg:"3cb371",mmsT:"7b68ee","":"-fa9a",mtr:"48d1cc",mmvt:"c71585",mnLb:"191970",ntc:"5fffa",mstr:"e4e1",mccs:"e4b5",vjw:"dead",nv:"--80",c:"df5e6",v:"808-0",vrb:"6b8e23",rng:"a5-",rngr:"45-",rch:"da70d6",pgnr:"eee8aa",pgrn:"98fb98",ptrq:"afeeee",pvtr:"db7093",ppwh:"efd5",pchp:"dab9",pr:"cd853f",pnk:"c0cb",pm:"dda0dd",pwrb:"b0e0e6",prp:"8-080",cc:"663399",r:"--",sbr:"bc8f8f",rb:"4169e1",sbrw:"8b4513",smn:"a8072",nbr:"4a460",sgrn:"2e8b57",ssh:"5ee",snn:"a0522d",svr:"c0c0c0",skb:"87ceeb",sTb:"6a5acd",sTgr:"708090",snw:"afa",n:"-ff7f",stb:"4682b4",tn:"d2b48c",t:"-8080",thst:"d8bfd8",tmT:"6347",trqs:"40e0d0",vt:"ee82ee",whT:"5deb3",wht:"",hts:"5f5f5",w:"-",wgrn:"9acd32"};function Re(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,e=n>0?t.toFixed(n).replace(/0+$/,"").replace(/\.$/,""):t.toString();return e||"0"}var Be=function(){function t(n,e,r,o){je(this,t);var i=this;if(void 0===n);else if(Array.isArray(n))this.rgba=n;else if(void 0===r){var l=n&&""+n;l&&function(n){if(n.startsWith("hsl")){var e=n.match(/([\-\d\.e]+)/g).map(Number),r=De(e,4),o=r[0],l=r[1],a=r[2],s=r[3];void 0===s&&(s=1),o/=360,l/=100,a/=100,i.hsla=[o,l,a,s]}else if(n.startsWith("rgb")){var u=n.match(/([\-\d\.e]+)/g).map(Number),c=De(u,4),f=c[0],h=c[1],d=c[2],p=c[3];void 0===p&&(p=1),i.rgba=[f,h,d,p]}else n.startsWith("#")?i.rgba=t.hexToRgb(n):i.rgba=t.nameToRgb(n)||t.hexToRgb(n)}(l.toLowerCase())}else this.rgba=[n,e,r,void 0===o?1:o]}return He(t,[{key:"printRGB",value:function(t){var n=(t?this.rgba:this.rgba.slice(0,3)).map((function(t,n){return Re(t,3===n?3:0)}));return t?"rgba("+n+")":"rgb("+n+")"}},{key:"printHSL",value:function(t){var n=[360,100,100,1],e=["","%","%",""],r=(t?this.hsla:this.hsla.slice(0,3)).map((function(t,r){return Re(t*n[r],3===r?3:1)+e[r]}));return t?"hsla("+r+")":"hsl("+r+")"}},{key:"printHex",value:function(t){var n=this.hex;return t?n:n.substring(0,7)}},{key:"rgba",get:function(){if(this._rgba)return this._rgba;if(!this._hsla)throw new Error("No color is set");return this._rgba=t.hslToRgb(this._hsla)},set:function(t){3===t.length&&(t[3]=1),this._rgba=t,this._hsla=null}},{key:"rgbString",get:function(){return this.printRGB()}},{key:"rgbaString",get:function(){return this.printRGB(!0)}},{key:"hsla",get:function(){if(this._hsla)return this._hsla;if(!this._rgba)throw new Error("No color is set");return this._hsla=t.rgbToHsl(this._rgba)},set:function(t){3===t.length&&(t[3]=1),this._hsla=t,this._rgba=null}},{key:"hslString",get:function(){return this.printHSL()}},{key:"hslaString",get:function(){return this.printHSL(!0)}},{key:"hex",get:function(){return"#"+this.rgba.map((function(t,n){return n<3?t.toString(16):Math.round(255*t).toString(16)})).map((function(t){return t.padStart(2,"0")})).join("")},set:function(n){this.rgba=t.hexToRgb(n)}}],[{key:"hexToRgb",value:function(t){var n=(t.startsWith("#")?t.slice(1):t).replace(/^(\w{3})$/,"$1F").replace(/^(\w)(\w)(\w)(\w)$/,"$1$1$2$2$3$3$4$4").replace(/^(\w{6})$/,"$1FF");if(!n.match(/^([0-9a-fA-F]{8})$/))throw new Error("Unknown hex color; "+t);var e=n.match(/^(\w\w)(\w\w)(\w\w)(\w\w)$/).slice(1).map((function(t){return parseInt(t,16)}));return e[3]=e[3]/255,e}},{key:"nameToRgb",value:function(n){var e=n.toLowerCase().replace("at","T").replace(/[aeiouyldf]/g,"").replace("ght","L").replace("rk","D").slice(-5,4),r=Pe[e];return void 0===r?r:t.hexToRgb(r.replace(/\-/g,"00").padStart(6,"f"))}},{key:"rgbToHsl",value:function(t){var n=De(t,4),e=n[0],r=n[1],o=n[2],i=n[3];e/=255,r/=255,o/=255;var l=Math.max(e,r,o),a=Math.min(e,r,o),s=void 0,u=void 0,c=(l+a)/2;if(l===a)s=u=0;else{var f=l-a;switch(u=c>.5?f/(2-l-a):f/(l+a),l){case e:s=(r-o)/f+(r<o?6:0);break;case r:s=(o-e)/f+2;break;case o:s=(e-r)/f+4}s/=6}return[s,u,c,i]}},{key:"hslToRgb",value:function(t){var n=De(t,4),e=n[0],r=n[1],o=n[2],i=n[3],l=void 0,a=void 0,s=void 0;if(0===r)l=a=s=o;else{var u=function(t,n,e){return e<0&&(e+=1),e>1&&(e-=1),e<1/6?t+6*(n-t)*e:e<.5?n:e<2/3?t+(n-t)*(2/3-e)*6:t},c=o<.5?o*(1+r):o+r-o*r,f=2*o-c;l=u(f,c,e+1/3),a=u(f,c,e),s=u(f,c,e-1/3)}var h=[255*l,255*a,255*s].map(Math.round);return h[3]=i,h}}]),t}(),Ie=function(){function t(){je(this,t),this._events=[]}return He(t,[{key:"add",value:function(t,n,e){t.addEventListener(n,e,!1),this._events.push({target:t,type:n,handler:e})}},{key:"remove",value:function(n,e,r){this._events=this._events.filter((function(o){var i=!0;return n&&n!==o.target&&(i=!1),e&&e!==o.type&&(i=!1),r&&r!==o.handler&&(i=!1),i&&t._doRemove(o.target,o.type,o.handler),!i}))}},{key:"destroy",value:function(){this._events.forEach((function(n){return t._doRemove(n.target,n.type,n.handler)})),this._events=[]}}],[{key:"_doRemove",value:function(t,n,e){t.removeEventListener(n,e,!1)}}]),t}();function Fe(t,n,e){var r=!1;function o(t,n,e){return Math.max(n,Math.min(t,e))}function i(t,i,l){if(l&&(r=!0),r){t.preventDefault();var a=n.getBoundingClientRect(),s=a.width,u=a.height,c=i.clientX,f=i.clientY,h=o(c-a.left,0,s),d=o(f-a.top,0,u);e(h/s,d/u)}}function l(t,n){1===(void 0===t.buttons?t.which:t.buttons)?i(t,t,n):r=!1}function a(t,n){1===t.touches.length?i(t,t.touches[0],n):r=!1}t.add(n,"mousedown",(function(t){l(t,!0)})),t.add(n,"touchstart",(function(t){a(t,!0)})),t.add(window,"mousemove",l),t.add(n,"touchmove",a),t.add(window,"mouseup",(function(t){r=!1})),t.add(n,"touchend",(function(t){r=!1})),t.add(n,"touchcancel",(function(t){r=!1}))}var ze="keydown",qe="mousedown",Ge="focusin";function Ue(t,n){return(n||document).querySelector(t)}function We(t){t.preventDefault(),t.stopPropagation()}function Ye(t,n,e,r,o){t.add(n,ze,(function(t){e.indexOf(t.key)>=0&&(o&&We(t),r(t))}))}var Xe=function(){function t(n){je(this,t),this.settings={popup:"right",layout:"default",alpha:!0,editor:!0,editorFormat:"hex",cancelButton:!1,defaultColor:"#0cf"},this._events=new Ie,this.onChange=null,this.onDone=null,this.onOpen=null,this.onClose=null,this.setOptions(n)}return He(t,[{key:"setOptions",value:function(t){var n=this;if(t){var e=this.settings;if(t instanceof HTMLElement)e.parent=t;else{e.parent&&t.parent&&e.parent!==t.parent&&(this._events.remove(e.parent),this._popupInited=!1),function(t,n,e){for(var r in t)e&&e.indexOf(r)>=0||(n[r]=t[r])}(t,e),t.onChange&&(this.onChange=t.onChange),t.onDone&&(this.onDone=t.onDone),t.onOpen&&(this.onOpen=t.onOpen),t.onClose&&(this.onClose=t.onClose);var r=t.color||t.colour;r&&this._setColor(r)}var o=e.parent;if(o&&e.popup&&!this._popupInited){var i=function(t){return n.openHandler(t)};this._events.add(o,"click",i),Ye(this._events,o,[" ","Spacebar","Enter"],i),this._popupInited=!0}else t.parent&&!e.popup&&this.show()}}},{key:"openHandler",value:function(t){if(this.show()){t&&t.preventDefault(),this.settings.parent.style.pointerEvents="none";var n=t&&t.type===ze?this._domEdit:this.domElement;setTimeout((function(){return n.focus()}),100),this.onOpen&&this.onOpen(this.colour)}}},{key:"closeHandler",value:function(t){var n=t&&t.type,e=!1;if(t)if(n===qe||n===Ge){var r=(this.__containedEvent||0)+100;t.timeStamp>r&&(e=!0)}else We(t),e=!0;else e=!0;e&&this.hide()&&(this.settings.parent.style.pointerEvents="",n!==qe&&this.settings.parent.focus(),this.onClose&&this.onClose(this.colour))}},{key:"movePopup",value:function(t,n){this.closeHandler(),this.setOptions(t),n&&this.openHandler()}},{key:"setColor",value:function(t,n){this._setColor(t,{silent:n})}},{key:"_setColor",value:function(t,n){if("string"==typeof t&&(t=t.trim()),t){n=n||{};var e=void 0;try{e=new Be(t)}catch(t){if(n.failSilently)return;throw t}if(!this.settings.alpha){var r=e.hsla;r[3]=1,e.hsla=r}this.colour=this.color=e,this._setHSLA(null,null,null,null,n)}}},{key:"setColour",value:function(t,n){this.setColor(t,n)}},{key:"show",value:function(){if(!this.settings.parent)return!1;if(this.domElement){var t=this._toggleDOM(!0);return this._setPosition(),t}var n,e,r=this.settings.template||'<div class="picker_wrapper" tabindex="-1"><div class="picker_arrow"></div><div class="picker_hue picker_slider"><div class="picker_selector"></div></div><div class="picker_sl"><div class="picker_selector"></div></div><div class="picker_alpha picker_slider"><div class="picker_selector"></div></div><div class="picker_editor"><input aria-label="Type a color name or hex value"/></div><div class="picker_sample"></div><div class="picker_done"><button>Ok</button></div><div class="picker_cancel"><button>Cancel</button></div></div>',o=(n=r,(e=document.createElement("div")).innerHTML=n,e.firstElementChild);return this.domElement=o,this._domH=Ue(".picker_hue",o),this._domSL=Ue(".picker_sl",o),this._domA=Ue(".picker_alpha",o),this._domEdit=Ue(".picker_editor input",o),this._domSample=Ue(".picker_sample",o),this._domOkay=Ue(".picker_done button",o),this._domCancel=Ue(".picker_cancel button",o),o.classList.add("layout_"+this.settings.layout),this.settings.alpha||o.classList.add("no_alpha"),this.settings.editor||o.classList.add("no_editor"),this.settings.cancelButton||o.classList.add("no_cancel"),this._ifPopup((function(){return o.classList.add("popup")})),this._setPosition(),this.colour?this._updateUI():this._setColor(this.settings.defaultColor),this._bindEvents(),!0}},{key:"hide",value:function(){return this._toggleDOM(!1)}},{key:"destroy",value:function(){this._events.destroy(),this.domElement&&this.settings.parent.removeChild(this.domElement)}},{key:"_bindEvents",value:function(){var t=this,n=this,e=this.domElement,r=this._events;function o(t,n,e){r.add(t,n,e)}o(e,"click",(function(t){return t.preventDefault()})),Fe(r,this._domH,(function(t,e){return n._setHSLA(t)})),Fe(r,this._domSL,(function(t,e){return n._setHSLA(null,t,1-e)})),this.settings.alpha&&Fe(r,this._domA,(function(t,e){return n._setHSLA(null,null,null,1-e)}));var i=this._domEdit;o(i,"input",(function(t){n._setColor(this.value,{fromEditor:!0,failSilently:!0})})),o(i,"focus",(function(t){var n=this;n.selectionStart===n.selectionEnd&&n.select()})),this._ifPopup((function(){var n=function(n){return t.closeHandler(n)};o(window,qe,n),o(window,Ge,n),Ye(r,e,["Esc","Escape"],n);var i=function(n){t.__containedEvent=n.timeStamp};o(e,qe,i),o(e,Ge,i),o(t._domCancel,"click",n)}));var l=function(n){t._ifPopup((function(){return t.closeHandler(n)})),t.onDone&&t.onDone(t.colour)};o(this._domOkay,"click",l),Ye(r,e,["Enter"],l)}},{key:"_setPosition",value:function(){var t=this.settings.parent,n=this.domElement;t!==n.parentNode&&t.appendChild(n),this._ifPopup((function(e){"static"===getComputedStyle(t).position&&(t.style.position="relative");var r=!0===e?"popup_right":"popup_"+e;["popup_top","popup_bottom","popup_left","popup_right"].forEach((function(t){t===r?n.classList.add(t):n.classList.remove(t)})),n.classList.add(r)}))}},{key:"_setHSLA",value:function(t,n,e,r,o){o=o||{};var i=this.colour,l=i.hsla;[t,n,e,r].forEach((function(t,n){(t||0===t)&&(l[n]=t)})),i.hsla=l,this._updateUI(o),this.onChange&&!o.silent&&this.onChange(i)}},{key:"_updateUI",value:function(t){if(this.domElement){t=t||{};var n=this.colour,e=n.hsla,r="hsl("+360*e[0]+", 100%, 50%)",o=n.hslString,i=n.hslaString,l=this._domH,a=this._domSL,s=this._domA,u=Ue(".picker_selector",l),c=Ue(".picker_selector",a),f=Ue(".picker_selector",s);y(0,u,e[0]),this._domSL.style.backgroundColor=this._domH.style.color=r,y(0,c,e[1]),b(0,c,1-e[2]),a.style.color=o,b(0,f,1-e[3]);var h=o,d=h.replace("hsl","hsla").replace(")",", 0)"),p="linear-gradient("+[h,d]+")";if(this._domA.style.background=p+", linear-gradient(45deg, lightgrey 25%, transparent 25%, transparent 75%, lightgrey 75%) 0 0 / 2em 2em,\n linear-gradient(45deg, lightgrey 25%, white 25%, white 75%, lightgrey 75%) 1em 1em / 2em 2em",!t.fromEditor){var g=this.settings.editorFormat,v=this.settings.alpha,m=void 0;switch(g){case"rgb":m=n.printRGB(v);break;case"hsl":m=n.printHSL(v);break;default:m=n.printHex(v)}this._domEdit.value=m}this._domSample.style.color=i}function y(t,n,e){n.style.left=100*e+"%"}function b(t,n,e){n.style.top=100*e+"%"}}},{key:"_ifPopup",value:function(t,n){this.settings.parent&&this.settings.popup?t&&t(this.settings.popup):n&&n()}},{key:"_toggleDOM",value:function(t){var n=this.domElement;if(!n)return!1;var e=t?"":"none",r=n.style.display!==e;return r&&(n.style.display=e),r}}]),t}();function Ve(n){let e;return{c(){e=c("div")},m(t,r){a(t,e,r),n[6](e)},p:t,i:t,o:t,d(t){t&&s(e),n[6](null)}}}function Je(t,n,e){let r,o,{value:i="#AAAAAAFF"}=n,{options:l={}}=n,{onChange:a=(()=>{})}=n;function s(t){var n;(n=t.rgbaString)!==i&&(a(n,i),e(1,i=n))}return w((()=>{!function(t){if(!r)return;o&&o.destroy();t.onChange=s,e(5,o=new Xe({parent:r,color:i,popup:!1,...t})),o.show(),o.openHandler()}(l)})),S((()=>{o.destroy()})),t.$$set=t=>{"value"in t&&e(1,i=t.value),"options"in t&&e(2,l=t.options),"onChange"in t&&e(3,a=t.onChange)},t.$$.update=()=>{34&t.$$.dirty&&o&&o.setColor(i)},[r,i,l,a,function(t){o.setColor(t)},o,function(t){x[t?"unshift":"push"]((()=>{r=t,e(0,r)}))}]}var Ze=class extends G{constructor(t){super(),q(this,t,Je,Ve,i,{value:1,options:2,onChange:3,setColor:4})}get setColor(){return this.$$.ctx[4]}};const Ke=new Set(["Arial","Arial Black","Bahnschrift","Calibri","Cambria","Cambria Math","Candara","Comic Sans MS","Consolas","Constantia","Corbel","Courier New","Ebrima","Franklin Gothic Medium","Gabriola","Gadugi","Georgia","HoloLens MDL2 Assets","Impact","Ink Free","Javanese Text","Leelawadee UI","Lucida Console","Lucida Sans Unicode","Malgun Gothic","Marlett","Microsoft Himalaya","Microsoft JhengHei","Microsoft New Tai Lue","Microsoft PhagsPa","Microsoft Sans Serif","Microsoft Tai Le","Microsoft YaHei","Microsoft Yi Baiti","MingLiU-ExtB","Mongolian Baiti","MS Gothic","MV Boli","Myanmar Text","Nirmala UI","Palatino Linotype","Segoe MDL2 Assets","Segoe Print","Segoe Script","Segoe UI","Segoe UI Historic","Segoe UI Emoji","Segoe UI Symbol","SimSun","Sitka","Sylfaen","Symbol","Tahoma","Times New Roman","Trebuchet MS","Verdana","Webdings","Wingdings","Yu Gothic","American Typewriter","Andale Mono","Arial","Arial Black","Arial Narrow","Arial Rounded MT Bold","Arial Unicode MS","Avenir","Avenir Next","Avenir Next Condensed","Baskerville","Big Caslon","Bodoni 72","Bodoni 72 Oldstyle","Bodoni 72 Smallcaps","Bradley Hand","Brush Script MT","Chalkboard","Chalkboard SE","Chalkduster","Charter","Cochin","Comic Sans MS","Copperplate","Courier","Courier New","Didot","DIN Alternate","DIN Condensed","Futura","Geneva","Georgia","Gill Sans","Helvetica","Helvetica Neue","Herculanum","Hoefler Text","Impact","Lucida Grande","Luminari","Marker Felt","Menlo","Microsoft Sans Serif","Monaco","Noteworthy","Optima","Palatino","Papyrus","Phosphate","Rockwell","Savoye LET","SignPainter","Skia","Snell Roundhand","Tahoma","Times","Times New Roman","Trattatello","Trebuchet MS","Verdana","Zapfino"].sort());function Qe(t,n,e){const r=t.slice();r[53]=n[e][0],r[54]=n[e][1],r[56]=n,r[57]=e;const o=r[54].props[r[54].selected];return r[55]=o,r}function tr(t,n,e){const r=t.slice();return r[58]=n[e],r}function nr(t,n,e){const r=t.slice();return r[61]=n[e],r[63]=e,r}function er(t,n,e){const r=t.slice();return r[64]=n[e],r[66]=e,r}function rr(t,n,e){const r=t.slice();return r[67]=n[e],r[69]=e,r}function or(t,n,e){const r=t.slice();return r[70]=n[e],r[72]=e,r}function ir(t){let n,e,r,o=t[1],i=[];for(let n=0;n<o.length;n+=1)i[n]=lr(or(t,o,n));return{c(){n=c("div"),e=c("b"),e.textContent="Elem",r=d();for(let t=0;t<i.length;t+=1)i[t].c();g(n,"class","select-tab")},m(t,o){a(t,n,o),l(n,e),l(n,r);for(let t=0;t<i.length;t+=1)i[t].m(n,null)},p(t,e){if(50&e[0]){let r;for(o=t[1],r=0;r<o.length;r+=1){const l=or(t,o,r);i[r]?i[r].p(l,e):(i[r]=lr(l),i[r].c(),i[r].m(n,null))}for(;r<i.length;r+=1)i[r].d(1);i.length=o.length}},d(t){t&&s(n),u(i,t)}}}function lr(t){let n,e,r,o,i,u;function f(){return t[27](t[72])}return{c(){n=c("span"),e=h("Elem "),r=h(t[72]),o=d(),m(n,"selected",t[4]===t[72])},m(t,s){a(t,n,s),l(n,e),l(n,r),l(n,o),i||(u=p(n,"click",f),i=!0)},p(e,r){t=e,16&r[0]&&m(n,"selected",t[4]===t[72])},d(t){t&&s(n),i=!1,u()}}}function ar(t){let n,e,r,o,i,u=t[67]+"";function f(){return t[28](t[69])}return{c(){n=c("span"),e=h(u),g(n,"title",r=t[67]),m(n,"selected",t[5]===t[69])},m(t,r){a(t,n,r),l(n,e),o||(i=p(n,"click",f),o=!0)},p(o,i){t=o,20&i[0]&&u!==(u=t[67]+"")&&v(e,u),20&i[0]&&r!==(r=t[67])&&g(n,"title",r),32&i[0]&&m(n,"selected",t[5]===t[69])},d(t){t&&s(n),o=!1,i()}}}function sr(t){let n,e,r,o,i,u=t[64]+"";function f(){return t[29](t[66])}return{c(){n=c("span"),e=h(u),r=d(),m(n,"selected",t[6]===t[66])},m(t,s){a(t,n,s),l(n,e),l(n,r),o||(i=p(n,"click",f),o=!0)},p(r,o){t=r,24&o[0]&&u!==(u=t[64]+"")&&v(e,u),64&o[0]&&m(n,"selected",t[6]===t[66])},d(t){t&&s(n),o=!1,i()}}}function ur(t){let n,e,r,o=Object.entries(t[13]),i=[];for(let n=0;n<o.length;n+=1)i[n]=mr(Qe(t,o,n));const f=t=>B(i[t],1,1,(()=>{i[t]=null}));let h="inline"===t[7]&&null!==t[15][t[4]]&&yr(t);return{c(){n=c("div");for(let t=0;t<i.length;t+=1)i[t].c();e=d(),h&&h.c(),g(n,"class","editor")},m(t,o){a(t,n,o);for(let t=0;t<i.length;t+=1)i[t].m(n,null);l(n,e),h&&h.m(n,null),r=!0},p(t,r){if(155648&r[0]){let l;for(o=Object.entries(t[13]),l=0;l<o.length;l+=1){const a=Qe(t,o,l);i[l]?(i[l].p(a,r),R(i[l],1)):(i[l]=mr(a),i[l].c(),R(i[l],1),i[l].m(n,e))}for(D(),l=o.length;l<i.length;l+=1)f(l);P()}"inline"===t[7]&&null!==t[15][t[4]]?h?h.p(t,r):(h=yr(t),h.c(),h.m(n,null)):h&&(h.d(1),h=null)},i(t){if(!r){for(let t=0;t<o.length;t+=1)R(i[t]);r=!0}},o(t){i=i.filter(Boolean);for(let t=0;t<i.length;t+=1)B(i[t]);r=!1},d(t){t&&s(n),u(i,t),h&&h.d()}}}function cr(t){let n,e,r=t[55]+"";return{c(){n=c("span"),e=h(r)},m(t,r){a(t,n,r),l(n,e)},p(t,n){8192&n[0]&&r!==(r=t[55]+"")&&v(e,r)},d(t){t&&s(n)}}}function fr(t){let n,e,r,o,i=t[54].props,f=[];for(let n=0;n<i.length;n+=1)f[n]=hr(nr(t,i,n));function h(...n){return t[30](t[54],t[56],t[57],...n)}return{c(){n=c("div"),e=c("select");for(let t=0;t<f.length;t+=1)f[t].c()},m(t,i){a(t,n,i),l(n,e);for(let t=0;t<f.length;t+=1)f[t].m(e,null);r||(o=p(e,"change",h),r=!0)},p(n,r){if(t=n,8192&r[0]){let n;for(i=t[54].props,n=0;n<i.length;n+=1){const o=nr(t,i,n);f[n]?f[n].p(o,r):(f[n]=hr(o),f[n].c(),f[n].m(e,null))}for(;n<f.length;n+=1)f[n].d(1);f.length=i.length}},d(t){t&&s(n),u(f,t),r=!1,o()}}}function hr(t){let n,e,r,o,i=t[61]+"";return{c(){n=c("option"),e=h(i),r=d(),n.selected=o=t[63]===t[54].selected,n.__value=t[63],n.value=n.__value},m(t,o){a(t,n,o),l(n,e),l(n,r)},p(t,r){8192&r[0]&&i!==(i=t[61]+"")&&v(e,i),8192&r[0]&&o!==(o=t[63]===t[54].selected)&&(n.selected=o)},d(t){t&&s(n)}}}function dr(t){let n,e;function r(...n){return t[33](t[55],...n)}return n=new Ze({props:{value:t[14][t[55]].value,onChange:r}}),{c(){var t;(t=n.$$.fragment)&&t.c()},m(t,r){I(n,t,r),e=!0},p(e,o){t=e;const i={};24576&o[0]&&(i.value=t[14][t[55]].value),8192&o[0]&&(i.onChange=r),n.$set(i)},i(t){e||(R(n.$$.fragment,t),e=!0)},o(t){B(n.$$.fragment,t),e=!1},d(t){F(n,t)}}}function pr(n){let e,r,o,i=n[14][n[55]].choices(),l=[];for(let t=0;t<i.length;t+=1)l[t]=vr(tr(n,i,t));function f(...t){return n[32](n[55],...t)}return{c(){e=c("select");for(let t=0;t<l.length;t+=1)l[t].c()},m(t,n){a(t,e,n);for(let t=0;t<l.length;t+=1)l[t].m(e,null);r||(o=p(e,"change",f),r=!0)},p(t,r){if(n=t,24576&r[0]){let t;for(i=n[14][n[55]].choices(),t=0;t<i.length;t+=1){const o=tr(n,i,t);l[t]?l[t].p(o,r):(l[t]=vr(o),l[t].c(),l[t].m(e,null))}for(;t<l.length;t+=1)l[t].d(1);l.length=i.length}},i:t,o:t,d(t){t&&s(e),u(l,t),r=!1,o()}}}function gr(n){let e,r,o,i,u,f,m,y,b,_=n[14][n[55]].displayed+"";function w(...t){return n[31](n[55],...t)}return{c(){e=c("input"),u=d(),f=c("span"),m=h(_),g(e,"type","range"),e.value=r=n[14][n[55]].value,g(e,"min",o=n[14][n[55]].min),g(e,"max",i=n[14][n[55]].max),g(f,"class","current-value")},m(t,n){a(t,e,n),a(t,u,n),a(t,f,n),l(f,m),y||(b=p(e,"change",w),y=!0)},p(t,l){n=t,24576&l[0]&&r!==(r=n[14][n[55]].value)&&(e.value=r),24576&l[0]&&o!==(o=n[14][n[55]].min)&&g(e,"min",o),24576&l[0]&&i!==(i=n[14][n[55]].max)&&g(e,"max",i),24576&l[0]&&_!==(_=n[14][n[55]].displayed+"")&&v(m,_)},i:t,o:t,d(t){t&&s(e),t&&s(u),t&&s(f),y=!1,b()}}}function vr(t){let n,e,r,o,i=t[58]+"";return{c(){n=c("option"),e=h(i),n.selected=r=t[58]==t[14][t[55]].value||null,n.__value=o=" "+t[58]+" ",n.value=n.__value},m(t,r){a(t,n,r),l(n,e)},p(t,l){24576&l[0]&&i!==(i=t[58]+"")&&v(e,i),24576&l[0]&&r!==(r=t[58]==t[14][t[55]].value||null)&&(n.selected=r),24576&l[0]&&o!==(o=" "+t[58]+" ")&&(n.__value=o,n.value=n.__value)},d(t){t&&s(n)}}}function mr(t){let n,e,r,o,i;function u(t,n){return t[54].props.length>1?fr:cr}let f=u(t),h=f(t);const p=[gr,pr,dr],v=[];function m(t,n){return"slider"===t[53]?0:"select"==t[53]?1:"color"==t[53]?2:-1}return~(r=m(t))&&(o=v[r]=p[r](t)),{c(){n=c("div"),h.c(),e=d(),o&&o.c(),g(n,"class","prop-section")},m(t,o){a(t,n,o),h.m(n,null),l(n,e),~r&&v[r].m(n,null),i=!0},p(t,i){f===(f=u(t))&&h?h.p(t,i):(h.d(1),h=f(t),h&&(h.c(),h.m(n,e)));let l=r;r=m(t),r===l?~r&&v[r].p(t,i):(o&&(D(),B(v[l],1,1,(()=>{v[l]=null})),P()),~r?(o=v[r],o?o.p(t,i):(o=v[r]=p[r](t),o.c()),R(o,1),o.m(n,null)):o=null)},i(t){i||(R(o),i=!0)},o(t){B(o),i=!1},d(t){t&&s(n),h.d(),~r&&v[r].d()}}}function yr(t){let n,e,r;return{c(){n=c("div"),n.textContent="Bring to front",g(n,"class","btn"),m(n,"active",!0===t[15][t[4]])},m(o,i){a(o,n,i),e||(r=p(n,"click",t[18]),e=!0)},p(t,e){32784&e[0]&&m(n,"active",!0===t[15][t[4]])},d(t){t&&s(n),e=!1,r()}}}function br(t){let n,e,o,i,h,v,m,y,b,_,w,S,k,x,E,$,M,C,L,T,A,N,O,j,H=t[1].length>1&&ir(t),I=xr(t[2][t[4]]),F=[];for(let n=0;n<I.length;n+=1)F[n]=ar(rr(t,I,n));let z=t[3][t[4]]||[],q=[];for(let n=0;n<z.length;n+=1)q[n]=sr(er(t,z,n));let G=t[3][t[4]]&&ur(t);return{c(){n=c("div"),e=d(),o=f("svg"),i=f("clipPath"),h=f("path"),v=f("rect"),b=d(),_=c("div"),w=c("div"),w.textContent="x",S=d(),H&&H.c(),k=d(),x=c("div"),E=c("b"),E.textContent="Rule:",$=d();for(let t=0;t<F.length;t+=1)F[t].c();M=d(),C=c("div"),L=c("b"),L.textContent="Property type:",T=d();for(let t=0;t<q.length;t+=1)q[t].c();var r,l,a,s;A=d(),G&&G.c(),r=n,l="position",null===(a="absolute")?r.style.removeProperty(l):r.style.setProperty(l,a,s?"important":""),g(h,"d",t[11]),g(i,"id","overlay-clip"),g(i,"clip-rule","evenodd"),g(v,"y","0"),g(v,"x","0"),g(v,"height","100%"),g(v,"width","100%"),g(v,"class","overlay-over"),g(o,"class","ise-helper-wrapper"),g(o,"version","1.1"),g(o,"xmlns","http://www.w3.org/2000/svg"),g(o,"xmlns:xlink","http://www.w3.org/1999/xlink"),g(o,"width",m=t[12].width),g(o,"height",y=t[12].height),g(w,"class","close-button"),g(x,"class","select-tab"),g(C,"class","select-tab"),g(_,"class","ise")},m(r,s){a(r,n,s),t[25](n),a(r,e,s),a(r,o,s),l(o,i),l(i,h),l(o,v),t[26](o),a(r,b,s),a(r,_,s),l(_,w),l(_,S),H&&H.m(_,null),l(_,k),l(_,x),l(x,E),l(x,$);for(let t=0;t<F.length;t+=1)F[t].m(x,null);l(_,M),l(_,C),l(C,L),l(C,T);for(let t=0;t<q.length;t+=1)q[t].m(C,null);l(_,A),G&&G.m(_,null),t[34](_),N=!0,O||(j=[p(o,"click",t[16]),p(w,"click",t[0])],O=!0)},p(t,n){if((!N||2048&n[0])&&g(h,"d",t[11]),(!N||4096&n[0]&&m!==(m=t[12].width))&&g(o,"width",m),(!N||4096&n[0]&&y!==(y=t[12].height))&&g(o,"height",y),t[1].length>1?H?H.p(t,n):(H=ir(t),H.c(),H.m(_,k)):H&&(H.d(1),H=null),52&n[0]){let e;for(I=xr(t[2][t[4]]),e=0;e<I.length;e+=1){const r=rr(t,I,e);F[e]?F[e].p(r,n):(F[e]=ar(r),F[e].c(),F[e].m(x,null))}for(;e<F.length;e+=1)F[e].d(1);F.length=I.length}if(88&n[0]){let e;for(z=t[3][t[4]]||[],e=0;e<z.length;e+=1){const r=er(t,z,e);q[e]?q[e].p(r,n):(q[e]=sr(r),q[e].c(),q[e].m(C,null))}for(;e<q.length;e+=1)q[e].d(1);q.length=z.length}t[3][t[4]]?G?(G.p(t,n),24&n[0]&&R(G,1)):(G=ur(t),G.c(),R(G,1),G.m(_,null)):G&&(D(),B(G,1,1,(()=>{G=null})),P())},i(t){N||(R(G),N=!0)},o(t){B(G),N=!1},d(i){i&&s(n),t[25](null),i&&s(e),i&&s(o),t[26](null),i&&s(b),i&&s(_),H&&H.d(),u(F,i),u(q,i),G&&G.d(),t[34](null),O=!1,r(j)}}}const _r="text",wr="border",Sr="stroke",kr="background";function xr(t){return t?t.map(((t,n)=>{if("inline"===t)return"inline";const e=t.selectorText;return`${t.parentStyleSheet.title||`${n}`}: ${e}`})):[]}function Er(t,n=0){const e=t.getBoundingClientRect();return{left:e.left+window.scrollX-n,top:e.top+window.scrollY-n,width:e.width+2*n,height:e.height+2*n,right:e.left+window.scrollX+e.width+n,bottom:e.top+window.scrollY+e.height+n}}function $r(t,n="number"){return"raw"==n?t:"number"==n&&/[0-9]+(px)|(em)|(rem)/.test(t)?parseInt(t):"rgb"!=n||!t.includes("rgb")&&"#"!=t[0]?t:function(t){const n=t.match(/[0-9\.]+/g).map((t=>parseFloat(t)));return 3===n.length&&n.push(1),n.reduce(((t,n,e)=>t+(3===e?Math.round(255*n).toString(16).padStart(2,"0"):n.toString(16).padStart(2,"0"))),"#")}(t)}function Mr(t,n,e){let r,o;const i=["altGlyph","circle","ellipse","line","path","polygon","polyline","rect","text","textPath","tref","tspan"],l={"border-radius":{type:"slider",min:0,max:30,suffix:"px"},"border-width":{type:"slider",min:0,max:30,suffix:"px"},"border-style":{type:"select",choices:()=>["none","dotted","dashed","solid","double","groove","ridge","inset","outset"]},"border-color":{type:"color"},"font-family":{type:"select",choices:function(){return function(){const t=new Set;for(const n of Ke.values())document.fonts.check(`12px "${n}"`)&&t.add(n);return[...t.values()]}()}},"font-size":{type:"slider",min:0,max:30,suffix:"px"},"font-weight":{type:"slider",min:0,max:500},color:{type:"color"},"stroke-width":{type:"slider",min:0,max:30,suffix:"px"},stroke:{type:"color"},fill:{type:"color"},"stroke-dasharray":{type:"slider",min:0,max:30,suffix:"px"},"background-color":{type:"color"}},a={[_r]:["font-family","font-size","font-weight","color"],[wr]:["border-radius","border-width","border-color","border-style"],[Sr]:["stroke-width","stroke","stroke-dasharray","fill"],[kr]:["background-color"]};let s,u,c,f,h,{getAdditionalElems:d=(()=>[])}=n,{listenOnClick:p=!1}=n,g=null,v="",m={width:0,height:0},y=[],b=[],_=[],k=0,E=0,$=0,M={},C=[];w((()=>{N(),e(22,g=u.parentNode),document.body.appendChild(u),document.body.appendChild(c),document.body.appendChild(s),D(),window.addEventListener("resize",D)})),S((()=>{window.removeEventListener("resize",D),p&&g.removeEventListener("click",getTargetsAndRules)}));let L=new Set;function T(t){A(t.target,t.pageX,t.pageY)}function A(t,n,r){if(t.classList.contains("overlay-over"))return O();if(!u.contains(t))if(e(4,k=0),e(5,E=0),e(6,$=0),e(15,C=[]),e(3,_=[]),e(2,b=[]),e(1,y=[t,...d(t)]),e(3,_=y.reduce(((t,n)=>{const e=[];n.firstChild&&3===n.firstChild.nodeType&&e.push(_r);const r=n.tagName.toLowerCase();let o=!1;return i.includes(r)?(e.push(Sr),"g"===n.parentElement.tagName.toLowerCase()&&n.previousElementSibling&&n.previousElementSibling.tagName.toLowerCase()==r&&(o=!0)):(e.push(wr),e.push(kr)),o?C.push(!0):C.push(null),t.push(e),t}),[])),e(2,b=function(t){const n=document.styleSheets;return t.reduce(((t,e)=>{const r=["inline"];for(let t in n)try{const o=n[t].cssRules;for(let t in o){const n=o[t].selectorText;!n||o[t].selectorText.length>50||n.split(",").some((t=>"*"===t))||e.matches(n)&&r.push(o[t])}}catch(e){L.has(t)||(console.log("Style editor: Not able to access",n[t].ownerNode,"sheet. Try CORS loading the sheet if you want to edit it."),L.add(t))}return t.push(r),t}),[])}(y)),n&&r)j(n,r);else{const n=Er(t,15);j(n.left,n.top)}}function N(){e(9,u.style.display="none",u),e(10,c.style.display="none",c)}function O(){N()}function j(t,n){t=t+260>m.width?m.width-300:t+10,n=n+410>m.height?m.height-450:n+10,e(9,u.style.left=t+"px",u),e(9,u.style.top=n+"px",u),e(10,c.style.display="block",c),e(9,u.style.display="block",u)}const H=Nt((function(t,n,i){const l=i?n+i:n;if("inline"===o){r.style[t]=l}else o.style.setProperty(t,l);e(14,M[t].value=n,M),e(14,M[t].displayed=l,M),function(){if(!o)return;let t;if("inline"===o)t=[r];else{const n=o.selectorText.replace(/(:hover)|:focus/g,"");t=Array.from(document.querySelectorAll(n))}const n=t.map((t=>Er(t,10)));e(11,v=Oe(n,m))}()}),100);function D(){e(12,m={width:document.body.scrollWidth,height:document.body.scrollHeight})}function P(t,n,e="number"){let r=o?.style?.[n];if(!r){r=getComputedStyle(t)[n]}return $r(r,e)}return t.$$set=t=>{"getAdditionalElems"in t&&e(19,d=t.getAdditionalElems),"listenOnClick"in t&&e(20,p=t.listenOnClick)},t.$$.update=()=>{if(4194304&t.$$.dirty[0]&&null!==g&&p&&g.addEventListener("click",T),18&t.$$.dirty[0]&&e(24,r=y[k]),52&t.$$.dirty[0]&&e(7,o=b[k]?.[E]),8388696&t.$$.dirty[0]&&_[k]?.[$]!==h&&e(23,h=_[k]?.[$]),25165952&t.$$.dirty[0]&&h&&o){const t=mt(l,a[h]);Object.keys(t).forEach((n=>{t[n].displayed=P(r,n,"raw");const e=t[n].type;let o="number";"color"===e?o="rgb":"select"===e&&(o="raw"),t[n].value=P(r,n,o)})),e(13,f=Object.entries(t).reduce(((t,[n,e])=>{const r=e.type;return r in t?t[r].props.push(n):t[r]={selected:0,props:[n]},t}),{})),e(14,M=t)}},[N,y,b,_,k,E,$,o,s,u,c,v,m,f,M,C,O,H,function(){e(15,C[k]=!1,C),r.parentNode.appendChild(r)},d,p,A,g,h,r,function(t){x[t?"unshift":"push"]((()=>{s=t,e(8,s)}))},function(t){x[t?"unshift":"push"]((()=>{c=t,e(10,c)}))},t=>{e(4,k=t),e(5,E=0)},t=>{e(5,E=t)},t=>{e(6,$=t)},(t,n,r,o)=>e(13,n[r][1].selected=o.target.value,f),(t,n)=>H(t,n.target.value,M[t].suffix,n.target),(t,n)=>H(t,n.target.value),(t,n)=>H(t,n),function(t){x[t?"unshift":"push"]((()=>{u=t,e(9,u)}))}]}var Cr=class extends G{constructor(t){super(),q(this,t,Mr,br,i,{getAdditionalElems:19,listenOnClick:20,open:21,close:0},null,[-1,-1,-1])}get open(){return this.$$.ctx[21]}get close(){return this.$$.ctx[0]}};return class{constructor(t){return new Cr({target:document.body,props:t})}}}));
8
+ */
9
+ var te=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},ee=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),ne=function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var n=[],r=!0,o=!1,i=void 0;try{for(var l,a=t[Symbol.iterator]();!(r=(l=a.next()).done)&&(n.push(l.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{!r&&a.return&&a.return()}finally{if(o)throw i}}return n}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")};String.prototype.startsWith=String.prototype.startsWith||function(t){return 0===this.indexOf(t)},String.prototype.padStart=String.prototype.padStart||function(t,e){for(var n=this;n.length<t;)n=e+n;return n};var re={cb:"0f8ff",tqw:"aebd7",q:"-ffff",qmrn:"7fffd4",zr:"0ffff",bg:"5f5dc",bsq:"e4c4",bck:"---",nch:"ebcd",b:"--ff",bvt:"8a2be2",brwn:"a52a2a",brw:"deb887",ctb:"5f9ea0",hrt:"7fff-",chcT:"d2691e",cr:"7f50",rnw:"6495ed",crns:"8dc",crms:"dc143c",cn:"-ffff",Db:"--8b",Dcn:"-8b8b",Dgnr:"b8860b",Dgr:"a9a9a9",Dgrn:"-64-",Dkhk:"bdb76b",Dmgn:"8b-8b",Dvgr:"556b2f",Drng:"8c-",Drch:"9932cc",Dr:"8b--",Dsmn:"e9967a",Dsgr:"8fbc8f",DsTb:"483d8b",DsTg:"2f4f4f",Dtrq:"-ced1",Dvt:"94-d3",ppnk:"1493",pskb:"-bfff",mgr:"696969",grb:"1e90ff",rbrc:"b22222",rwht:"af0",stg:"228b22",chs:"-ff",gnsb:"dcdcdc",st:"8f8ff",g:"d7-",gnr:"daa520",gr:"808080",grn:"-8-0",grnw:"adff2f",hnw:"0fff0",htpn:"69b4",nnr:"cd5c5c",ng:"4b-82",vr:"0",khk:"0e68c",vnr:"e6e6fa",nrb:"0f5",wngr:"7cfc-",mnch:"acd",Lb:"add8e6",Lcr:"08080",Lcn:"e0ffff",Lgnr:"afad2",Lgr:"d3d3d3",Lgrn:"90ee90",Lpnk:"b6c1",Lsmn:"a07a",Lsgr:"20b2aa",Lskb:"87cefa",LsTg:"778899",Lstb:"b0c4de",Lw:"e0",m:"-ff-",mgrn:"32cd32",nn:"af0e6",mgnt:"-ff",mrn:"8--0",mqm:"66cdaa",mmb:"--cd",mmrc:"ba55d3",mmpr:"9370db",msg:"3cb371",mmsT:"7b68ee","":"-fa9a",mtr:"48d1cc",mmvt:"c71585",mnLb:"191970",ntc:"5fffa",mstr:"e4e1",mccs:"e4b5",vjw:"dead",nv:"--80",c:"df5e6",v:"808-0",vrb:"6b8e23",rng:"a5-",rngr:"45-",rch:"da70d6",pgnr:"eee8aa",pgrn:"98fb98",ptrq:"afeeee",pvtr:"db7093",ppwh:"efd5",pchp:"dab9",pr:"cd853f",pnk:"c0cb",pm:"dda0dd",pwrb:"b0e0e6",prp:"8-080",cc:"663399",r:"--",sbr:"bc8f8f",rb:"4169e1",sbrw:"8b4513",smn:"a8072",nbr:"4a460",sgrn:"2e8b57",ssh:"5ee",snn:"a0522d",svr:"c0c0c0",skb:"87ceeb",sTb:"6a5acd",sTgr:"708090",snw:"afa",n:"-ff7f",stb:"4682b4",tn:"d2b48c",t:"-8080",thst:"d8bfd8",tmT:"6347",trqs:"40e0d0",vt:"ee82ee",whT:"5deb3",wht:"",hts:"5f5f5",w:"-",wgrn:"9acd32"};function oe(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=e>0?t.toFixed(e).replace(/0+$/,"").replace(/\.$/,""):t.toString();return n||"0"}var ie=function(){function t(e,n,r,o){te(this,t);var i=this;if(void 0===e);else if(Array.isArray(e))this.rgba=e;else if(void 0===r){var l=e&&""+e;l&&function(e){if(e.startsWith("hsl")){var n=e.match(/([\-\d\.e]+)/g).map(Number),r=ne(n,4),o=r[0],l=r[1],a=r[2],s=r[3];void 0===s&&(s=1),o/=360,l/=100,a/=100,i.hsla=[o,l,a,s]}else if(e.startsWith("rgb")){var c=e.match(/([\-\d\.e]+)/g).map(Number),u=ne(c,4),f=u[0],h=u[1],d=u[2],p=u[3];void 0===p&&(p=1),i.rgba=[f,h,d,p]}else e.startsWith("#")?i.rgba=t.hexToRgb(e):i.rgba=t.nameToRgb(e)||t.hexToRgb(e)}(l.toLowerCase())}else this.rgba=[e,n,r,void 0===o?1:o]}return ee(t,[{key:"printRGB",value:function(t){var e=(t?this.rgba:this.rgba.slice(0,3)).map((function(t,e){return oe(t,3===e?3:0)}));return t?"rgba("+e+")":"rgb("+e+")"}},{key:"printHSL",value:function(t){var e=[360,100,100,1],n=["","%","%",""],r=(t?this.hsla:this.hsla.slice(0,3)).map((function(t,r){return oe(t*e[r],3===r?3:1)+n[r]}));return t?"hsla("+r+")":"hsl("+r+")"}},{key:"printHex",value:function(t){var e=this.hex;return t?e:e.substring(0,7)}},{key:"rgba",get:function(){if(this._rgba)return this._rgba;if(!this._hsla)throw new Error("No color is set");return this._rgba=t.hslToRgb(this._hsla)},set:function(t){3===t.length&&(t[3]=1),this._rgba=t,this._hsla=null}},{key:"rgbString",get:function(){return this.printRGB()}},{key:"rgbaString",get:function(){return this.printRGB(!0)}},{key:"hsla",get:function(){if(this._hsla)return this._hsla;if(!this._rgba)throw new Error("No color is set");return this._hsla=t.rgbToHsl(this._rgba)},set:function(t){3===t.length&&(t[3]=1),this._hsla=t,this._rgba=null}},{key:"hslString",get:function(){return this.printHSL()}},{key:"hslaString",get:function(){return this.printHSL(!0)}},{key:"hex",get:function(){return"#"+this.rgba.map((function(t,e){return e<3?t.toString(16):Math.round(255*t).toString(16)})).map((function(t){return t.padStart(2,"0")})).join("")},set:function(e){this.rgba=t.hexToRgb(e)}}],[{key:"hexToRgb",value:function(t){var e=(t.startsWith("#")?t.slice(1):t).replace(/^(\w{3})$/,"$1F").replace(/^(\w)(\w)(\w)(\w)$/,"$1$1$2$2$3$3$4$4").replace(/^(\w{6})$/,"$1FF");if(!e.match(/^([0-9a-fA-F]{8})$/))throw new Error("Unknown hex color; "+t);var n=e.match(/^(\w\w)(\w\w)(\w\w)(\w\w)$/).slice(1).map((function(t){return parseInt(t,16)}));return n[3]=n[3]/255,n}},{key:"nameToRgb",value:function(e){var n=e.toLowerCase().replace("at","T").replace(/[aeiouyldf]/g,"").replace("ght","L").replace("rk","D").slice(-5,4),r=re[n];return void 0===r?r:t.hexToRgb(r.replace(/\-/g,"00").padStart(6,"f"))}},{key:"rgbToHsl",value:function(t){var e=ne(t,4),n=e[0],r=e[1],o=e[2],i=e[3];n/=255,r/=255,o/=255;var l=Math.max(n,r,o),a=Math.min(n,r,o),s=void 0,c=void 0,u=(l+a)/2;if(l===a)s=c=0;else{var f=l-a;switch(c=u>.5?f/(2-l-a):f/(l+a),l){case n:s=(r-o)/f+(r<o?6:0);break;case r:s=(o-n)/f+2;break;case o:s=(n-r)/f+4}s/=6}return[s,c,u,i]}},{key:"hslToRgb",value:function(t){var e=ne(t,4),n=e[0],r=e[1],o=e[2],i=e[3],l=void 0,a=void 0,s=void 0;if(0===r)l=a=s=o;else{var c=function(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t},u=o<.5?o*(1+r):o+r-o*r,f=2*o-u;l=c(f,u,n+1/3),a=c(f,u,n),s=c(f,u,n-1/3)}var h=[255*l,255*a,255*s].map(Math.round);return h[3]=i,h}}]),t}(),le=function(){function t(){te(this,t),this._events=[]}return ee(t,[{key:"add",value:function(t,e,n){t.addEventListener(e,n,!1),this._events.push({target:t,type:e,handler:n})}},{key:"remove",value:function(e,n,r){this._events=this._events.filter((function(o){var i=!0;return e&&e!==o.target&&(i=!1),n&&n!==o.type&&(i=!1),r&&r!==o.handler&&(i=!1),i&&t._doRemove(o.target,o.type,o.handler),!i}))}},{key:"destroy",value:function(){this._events.forEach((function(e){return t._doRemove(e.target,e.type,e.handler)})),this._events=[]}}],[{key:"_doRemove",value:function(t,e,n){t.removeEventListener(e,n,!1)}}]),t}();function ae(t,e,n){var r=!1;function o(t,e,n){return Math.max(e,Math.min(t,n))}function i(t,i,l){if(l&&(r=!0),r){t.preventDefault();var a=e.getBoundingClientRect(),s=a.width,c=a.height,u=i.clientX,f=i.clientY,h=o(u-a.left,0,s),d=o(f-a.top,0,c);n(h/s,d/c)}}function l(t,e){1===(void 0===t.buttons?t.which:t.buttons)?i(t,t,e):r=!1}function a(t,e){1===t.touches.length?i(t,t.touches[0],e):r=!1}t.add(e,"mousedown",(function(t){l(t,!0)})),t.add(e,"touchstart",(function(t){a(t,!0)})),t.add(window,"mousemove",l),t.add(e,"touchmove",a),t.add(window,"mouseup",(function(t){r=!1})),t.add(e,"touchend",(function(t){r=!1})),t.add(e,"touchcancel",(function(t){r=!1}))}var se="keydown",ce="mousedown",ue="focusin";function fe(t,e){return(e||document).querySelector(t)}function he(t){t.preventDefault(),t.stopPropagation()}function de(t,e,n,r,o){t.add(e,se,(function(t){n.indexOf(t.key)>=0&&(o&&he(t),r(t))}))}var pe=function(){function t(e){te(this,t),this.settings={popup:"right",layout:"default",alpha:!0,editor:!0,editorFormat:"hex",cancelButton:!1,defaultColor:"#0cf"},this._events=new le,this.onChange=null,this.onDone=null,this.onOpen=null,this.onClose=null,this.setOptions(e)}return ee(t,[{key:"setOptions",value:function(t){var e=this;if(t){var n=this.settings;if(t instanceof HTMLElement)n.parent=t;else{n.parent&&t.parent&&n.parent!==t.parent&&(this._events.remove(n.parent),this._popupInited=!1),function(t,e,n){for(var r in t)n&&n.indexOf(r)>=0||(e[r]=t[r])}(t,n),t.onChange&&(this.onChange=t.onChange),t.onDone&&(this.onDone=t.onDone),t.onOpen&&(this.onOpen=t.onOpen),t.onClose&&(this.onClose=t.onClose);var r=t.color||t.colour;r&&this._setColor(r)}var o=n.parent;if(o&&n.popup&&!this._popupInited){var i=function(t){return e.openHandler(t)};this._events.add(o,"click",i),de(this._events,o,[" ","Spacebar","Enter"],i),this._popupInited=!0}else t.parent&&!n.popup&&this.show()}}},{key:"openHandler",value:function(t){if(this.show()){t&&t.preventDefault(),this.settings.parent.style.pointerEvents="none";var e=t&&t.type===se?this._domEdit:this.domElement;setTimeout((function(){return e.focus()}),100),this.onOpen&&this.onOpen(this.colour)}}},{key:"closeHandler",value:function(t){var e=t&&t.type,n=!1;if(t)if(e===ce||e===ue){var r=(this.__containedEvent||0)+100;t.timeStamp>r&&(n=!0)}else he(t),n=!0;else n=!0;n&&this.hide()&&(this.settings.parent.style.pointerEvents="",e!==ce&&this.settings.parent.focus(),this.onClose&&this.onClose(this.colour))}},{key:"movePopup",value:function(t,e){this.closeHandler(),this.setOptions(t),e&&this.openHandler()}},{key:"setColor",value:function(t,e){this._setColor(t,{silent:e})}},{key:"_setColor",value:function(t,e){if("string"==typeof t&&(t=t.trim()),t){e=e||{};var n=void 0;try{n=new ie(t)}catch(t){if(e.failSilently)return;throw t}if(!this.settings.alpha){var r=n.hsla;r[3]=1,n.hsla=r}this.colour=this.color=n,this._setHSLA(null,null,null,null,e)}}},{key:"setColour",value:function(t,e){this.setColor(t,e)}},{key:"show",value:function(){if(!this.settings.parent)return!1;if(this.domElement){var t=this._toggleDOM(!0);return this._setPosition(),t}var e,n,r=this.settings.template||'<div class="picker_wrapper" tabindex="-1"><div class="picker_arrow"></div><div class="picker_hue picker_slider"><div class="picker_selector"></div></div><div class="picker_sl"><div class="picker_selector"></div></div><div class="picker_alpha picker_slider"><div class="picker_selector"></div></div><div class="picker_editor"><input aria-label="Type a color name or hex value"/></div><div class="picker_sample"></div><div class="picker_done"><button>Ok</button></div><div class="picker_cancel"><button>Cancel</button></div></div>',o=(e=r,(n=document.createElement("div")).innerHTML=e,n.firstElementChild);return this.domElement=o,this._domH=fe(".picker_hue",o),this._domSL=fe(".picker_sl",o),this._domA=fe(".picker_alpha",o),this._domEdit=fe(".picker_editor input",o),this._domSample=fe(".picker_sample",o),this._domOkay=fe(".picker_done button",o),this._domCancel=fe(".picker_cancel button",o),o.classList.add("layout_"+this.settings.layout),this.settings.alpha||o.classList.add("no_alpha"),this.settings.editor||o.classList.add("no_editor"),this.settings.cancelButton||o.classList.add("no_cancel"),this._ifPopup((function(){return o.classList.add("popup")})),this._setPosition(),this.colour?this._updateUI():this._setColor(this.settings.defaultColor),this._bindEvents(),!0}},{key:"hide",value:function(){return this._toggleDOM(!1)}},{key:"destroy",value:function(){this._events.destroy(),this.domElement&&this.settings.parent.removeChild(this.domElement)}},{key:"_bindEvents",value:function(){var t=this,e=this,n=this.domElement,r=this._events;function o(t,e,n){r.add(t,e,n)}o(n,"click",(function(t){return t.preventDefault()})),ae(r,this._domH,(function(t,n){return e._setHSLA(t)})),ae(r,this._domSL,(function(t,n){return e._setHSLA(null,t,1-n)})),this.settings.alpha&&ae(r,this._domA,(function(t,n){return e._setHSLA(null,null,null,1-n)}));var i=this._domEdit;o(i,"input",(function(t){e._setColor(this.value,{fromEditor:!0,failSilently:!0})})),o(i,"focus",(function(t){var e=this;e.selectionStart===e.selectionEnd&&e.select()})),this._ifPopup((function(){var e=function(e){return t.closeHandler(e)};o(window,ce,e),o(window,ue,e),de(r,n,["Esc","Escape"],e);var i=function(e){t.__containedEvent=e.timeStamp};o(n,ce,i),o(n,ue,i),o(t._domCancel,"click",e)}));var l=function(e){t._ifPopup((function(){return t.closeHandler(e)})),t.onDone&&t.onDone(t.colour)};o(this._domOkay,"click",l),de(r,n,["Enter"],l)}},{key:"_setPosition",value:function(){var t=this.settings.parent,e=this.domElement;t!==e.parentNode&&t.appendChild(e),this._ifPopup((function(n){"static"===getComputedStyle(t).position&&(t.style.position="relative");var r=!0===n?"popup_right":"popup_"+n;["popup_top","popup_bottom","popup_left","popup_right"].forEach((function(t){t===r?e.classList.add(t):e.classList.remove(t)})),e.classList.add(r)}))}},{key:"_setHSLA",value:function(t,e,n,r,o){o=o||{};var i=this.colour,l=i.hsla;[t,e,n,r].forEach((function(t,e){(t||0===t)&&(l[e]=t)})),i.hsla=l,this._updateUI(o),this.onChange&&!o.silent&&this.onChange(i)}},{key:"_updateUI",value:function(t){if(this.domElement){t=t||{};var e=this.colour,n=e.hsla,r="hsl("+360*n[0]+", 100%, 50%)",o=e.hslString,i=e.hslaString,l=this._domH,a=this._domSL,s=this._domA,c=fe(".picker_selector",l),u=fe(".picker_selector",a),f=fe(".picker_selector",s);y(0,c,n[0]),this._domSL.style.backgroundColor=this._domH.style.color=r,y(0,u,n[1]),b(0,u,1-n[2]),a.style.color=o,b(0,f,1-n[3]);var h=o,d=h.replace("hsl","hsla").replace(")",", 0)"),p="linear-gradient("+[h,d]+")";if(this._domA.style.background=p+", linear-gradient(45deg, lightgrey 25%, transparent 25%, transparent 75%, lightgrey 75%) 0 0 / 2em 2em,\n linear-gradient(45deg, lightgrey 25%, white 25%, white 75%, lightgrey 75%) 1em 1em / 2em 2em",!t.fromEditor){var g=this.settings.editorFormat,m=this.settings.alpha,v=void 0;switch(g){case"rgb":v=e.printRGB(m);break;case"hsl":v=e.printHSL(m);break;default:v=e.printHex(m)}this._domEdit.value=v}this._domSample.style.color=i}function y(t,e,n){e.style.left=100*n+"%"}function b(t,e,n){e.style.top=100*n+"%"}}},{key:"_ifPopup",value:function(t,e){this.settings.parent&&this.settings.popup?t&&t(this.settings.popup):e&&e()}},{key:"_toggleDOM",value:function(t){var e=this.domElement;if(!e)return!1;var n=t?"":"none",r=e.style.display!==n;return r&&(e.style.display=n),r}}]),t}();function ge(e){let n;return{c(){n=u("div")},m(t,r){a(t,n,r),e[6](n)},p:t,i:t,o:t,d(t){t&&s(n),e[6](null)}}}function me(t,e,n){let r,o,{value:i="#AAAAAAFF"}=e,{options:l={}}=e,{onChange:a=(()=>{})}=e;function s(t){var e;(e=t.rgbaString)!==i&&(a(e,i),n(1,i=e))}return _((()=>{!function(t){if(!r)return;o&&o.destroy();t.onChange=s,n(5,o=new pe({parent:r,color:i,popup:!1,...t})),o.show(),o.openHandler()}(l)})),k((()=>{o.destroy()})),t.$$set=t=>{"value"in t&&n(1,i=t.value),"options"in t&&n(2,l=t.options),"onChange"in t&&n(3,a=t.onChange)},t.$$.update=()=>{34&t.$$.dirty&&o&&o.setColor(i)},[r,i,l,a,function(t){o.setColor(t)},o,function(t){S[t?"unshift":"push"]((()=>{r=t,n(0,r)}))}]}var ve=class extends U{constructor(t){super(),q(this,t,me,ge,i,{value:1,options:2,onChange:3,setColor:4})}get setColor(){return this.$$.ctx[4]}};const ye=new Set(["Arial","Arial Black","Bahnschrift","Calibri","Cambria","Cambria Math","Candara","Comic Sans MS","Consolas","Constantia","Corbel","Courier New","Ebrima","Franklin Gothic Medium","Gabriola","Gadugi","Georgia","HoloLens MDL2 Assets","Impact","Ink Free","Javanese Text","Leelawadee UI","Lucida Console","Lucida Sans Unicode","Malgun Gothic","Marlett","Microsoft Himalaya","Microsoft JhengHei","Microsoft New Tai Lue","Microsoft PhagsPa","Microsoft Sans Serif","Microsoft Tai Le","Microsoft YaHei","Microsoft Yi Baiti","MingLiU-ExtB","Mongolian Baiti","MS Gothic","MV Boli","Myanmar Text","Nirmala UI","Palatino Linotype","Segoe MDL2 Assets","Segoe Print","Segoe Script","Segoe UI","Segoe UI Historic","Segoe UI Emoji","Segoe UI Symbol","SimSun","Sitka","Sylfaen","Symbol","Tahoma","Times New Roman","Trebuchet MS","Verdana","Webdings","Wingdings","Yu Gothic","American Typewriter","Andale Mono","Arial","Arial Black","Arial Narrow","Arial Rounded MT Bold","Arial Unicode MS","Avenir","Avenir Next","Avenir Next Condensed","Baskerville","Big Caslon","Bodoni 72","Bodoni 72 Oldstyle","Bodoni 72 Smallcaps","Bradley Hand","Brush Script MT","Chalkboard","Chalkboard SE","Chalkduster","Charter","Cochin","Comic Sans MS","Copperplate","Courier","Courier New","Didot","DIN Alternate","DIN Condensed","Futura","Geneva","Georgia","Gill Sans","Helvetica","Helvetica Neue","Herculanum","Hoefler Text","Impact","Lucida Grande","Luminari","Marker Felt","Menlo","Microsoft Sans Serif","Monaco","Noteworthy","Optima","Palatino","Papyrus","Phosphate","Rockwell","Savoye LET","SignPainter","Skia","Snell Roundhand","Tahoma","Times","Times New Roman","Trattatello","Trebuchet MS","Verdana","Zapfino"].sort());function be(t,e,n){const r=t.slice();r[54]=e[n][0],r[55]=e[n][1],r[57]=e,r[58]=n;const o=r[55].props[r[55].selected];return r[56]=o,r}function we(t,e,n){const r=t.slice();return r[59]=e[n],r}function _e(t,e,n){const r=t.slice();return r[62]=e[n],r[64]=n,r}function ke(t,e,n){const r=t.slice();return r[65]=e[n],r[67]=n,r}function $e(t,e,n){const r=t.slice();return r[68]=e[n],r[70]=n,r}function Se(t,e,n){const r=t.slice();return r[71]=e[n],r[73]=n,r}function xe(t){let e,n,r,o=t[1],i=[];for(let e=0;e<o.length;e+=1)i[e]=Ce(Se(t,o,e));return{c(){e=u("div"),n=u("b"),n.textContent="Elem",r=d();for(let t=0;t<i.length;t+=1)i[t].c();g(e,"class","select-tab")},m(t,o){a(t,e,o),l(e,n),l(e,r);for(let t=0;t<i.length;t+=1)i[t].m(e,null)},p(t,n){if(50&n[0]){let r;for(o=t[1],r=0;r<o.length;r+=1){const l=Se(t,o,r);i[r]?i[r].p(l,n):(i[r]=Ce(l),i[r].c(),i[r].m(e,null))}for(;r<i.length;r+=1)i[r].d(1);i.length=o.length}},d(t){t&&s(e),c(i,t)}}}function Ce(t){let e,n,r,o,i,c;function f(){return t[28](t[73])}return{c(){e=u("span"),n=h("Elem "),r=h(t[73]),o=d(),v(e,"selected",t[4]===t[73])},m(t,s){a(t,e,s),l(e,n),l(e,r),l(e,o),i||(c=p(e,"click",f),i=!0)},p(n,r){t=n,16&r[0]&&v(e,"selected",t[4]===t[73])},d(t){t&&s(e),i=!1,c()}}}function Me(t){let e,n,r,o,i,c=t[68]+"";function f(){return t[29](t[70])}return{c(){e=u("span"),n=h(c),g(e,"title",r=t[68]),v(e,"selected",t[5]===t[70])},m(t,r){a(t,e,r),l(e,n),o||(i=p(e,"click",f),o=!0)},p(o,i){t=o,20&i[0]&&c!==(c=t[68]+"")&&m(n,c),20&i[0]&&r!==(r=t[68])&&g(e,"title",r),32&i[0]&&v(e,"selected",t[5]===t[70])},d(t){t&&s(e),o=!1,i()}}}function Ee(t){let e,n,r,o,i,c=t[65]+"";function f(){return t[30](t[67])}return{c(){e=u("span"),n=h(c),r=d(),v(e,"selected",t[6]===t[67])},m(t,s){a(t,e,s),l(e,n),l(e,r),o||(i=p(e,"click",f),o=!0)},p(r,o){t=r,24&o[0]&&c!==(c=t[65]+"")&&m(n,c),64&o[0]&&v(e,"selected",t[6]===t[67])},d(t){t&&s(e),o=!1,i()}}}function Le(t){let e,n,r,o=Object.entries(t[13]),i=[];for(let e=0;e<o.length;e+=1)i[e]=Ie(be(t,o,e));const f=t=>R(i[t],1,1,(()=>{i[t]=null}));let h="inline"===t[7]&&null!==t[15][t[4]]&&Pe(t);return{c(){e=u("div");for(let t=0;t<i.length;t+=1)i[t].c();n=d(),h&&h.c(),g(e,"class","editor")},m(t,o){a(t,e,o);for(let t=0;t<i.length;t+=1)i[t].m(e,null);l(e,n),h&&h.m(e,null),r=!0},p(t,r){if(155648&r[0]){let l;for(o=Object.entries(t[13]),l=0;l<o.length;l+=1){const a=be(t,o,l);i[l]?(i[l].p(a,r),P(i[l],1)):(i[l]=Ie(a),i[l].c(),P(i[l],1),i[l].m(e,n))}for(D(),l=o.length;l<i.length;l+=1)f(l);I()}"inline"===t[7]&&null!==t[15][t[4]]?h?h.p(t,r):(h=Pe(t),h.c(),h.m(e,null)):h&&(h.d(1),h=null)},i(t){if(!r){for(let t=0;t<o.length;t+=1)P(i[t]);r=!0}},o(t){i=i.filter(Boolean);for(let t=0;t<i.length;t+=1)R(i[t]);r=!1},d(t){t&&s(e),c(i,t),h&&h.d()}}}function Te(t){let e,n,r=t[56]+"";return{c(){e=u("span"),n=h(r)},m(t,r){a(t,e,r),l(e,n)},p(t,e){8192&e[0]&&r!==(r=t[56]+"")&&m(n,r)},d(t){t&&s(e)}}}function Ae(t){let e,n,r,o,i=t[55].props,f=[];for(let e=0;e<i.length;e+=1)f[e]=Oe(_e(t,i,e));function h(...e){return t[31](t[55],t[57],t[58],...e)}return{c(){e=u("div"),n=u("select");for(let t=0;t<f.length;t+=1)f[t].c()},m(t,i){a(t,e,i),l(e,n);for(let t=0;t<f.length;t+=1)f[t].m(n,null);r||(o=p(n,"change",h),r=!0)},p(e,r){if(t=e,8192&r[0]){let e;for(i=t[55].props,e=0;e<i.length;e+=1){const o=_e(t,i,e);f[e]?f[e].p(o,r):(f[e]=Oe(o),f[e].c(),f[e].m(n,null))}for(;e<f.length;e+=1)f[e].d(1);f.length=i.length}},d(t){t&&s(e),c(f,t),r=!1,o()}}}function Oe(t){let e,n,r,o,i=t[62]+"";return{c(){e=u("option"),n=h(i),r=d(),e.selected=o=t[64]===t[55].selected,e.__value=t[64],e.value=e.__value},m(t,o){a(t,e,o),l(e,n),l(e,r)},p(t,r){8192&r[0]&&i!==(i=t[62]+"")&&m(n,i),8192&r[0]&&o!==(o=t[64]===t[55].selected)&&(e.selected=o)},d(t){t&&s(e)}}}function Ne(t){let e,n;function r(...e){return t[34](t[56],...e)}return e=new ve({props:{value:t[14][t[56]].value,onChange:r}}),{c(){var t;(t=e.$$.fragment)&&t.c()},m(t,r){B(e,t,r),n=!0},p(n,o){t=n;const i={};24576&o[0]&&(i.value=t[14][t[56]].value),8192&o[0]&&(i.onChange=r),e.$set(i)},i(t){n||(P(e.$$.fragment,t),n=!0)},o(t){R(e.$$.fragment,t),n=!1},d(t){F(e,t)}}}function He(e){let n,r,o,i=e[14][e[56]].choices(),l=[];for(let t=0;t<i.length;t+=1)l[t]=De(we(e,i,t));function f(...t){return e[33](e[56],...t)}return{c(){n=u("select");for(let t=0;t<l.length;t+=1)l[t].c()},m(t,e){a(t,n,e);for(let t=0;t<l.length;t+=1)l[t].m(n,null);r||(o=p(n,"change",f),r=!0)},p(t,r){if(e=t,24576&r[0]){let t;for(i=e[14][e[56]].choices(),t=0;t<i.length;t+=1){const o=we(e,i,t);l[t]?l[t].p(o,r):(l[t]=De(o),l[t].c(),l[t].m(n,null))}for(;t<l.length;t+=1)l[t].d(1);l.length=i.length}},i:t,o:t,d(t){t&&s(n),c(l,t),r=!1,o()}}}function je(e){let n,r,o,i,c,f,v,y,b,w=e[14][e[56]].displayed+"";function _(...t){return e[32](e[56],...t)}return{c(){n=u("input"),c=d(),f=u("span"),v=h(w),g(n,"type","range"),n.value=r=e[14][e[56]].value,g(n,"min",o=e[14][e[56]].min),g(n,"max",i=e[14][e[56]].max),g(f,"class","current-value")},m(t,e){a(t,n,e),a(t,c,e),a(t,f,e),l(f,v),y||(b=p(n,"change",_),y=!0)},p(t,l){e=t,24576&l[0]&&r!==(r=e[14][e[56]].value)&&(n.value=r),24576&l[0]&&o!==(o=e[14][e[56]].min)&&g(n,"min",o),24576&l[0]&&i!==(i=e[14][e[56]].max)&&g(n,"max",i),24576&l[0]&&w!==(w=e[14][e[56]].displayed+"")&&m(v,w)},i:t,o:t,d(t){t&&s(n),t&&s(c),t&&s(f),y=!1,b()}}}function De(t){let e,n,r,o,i=t[59]+"";return{c(){e=u("option"),n=h(i),e.selected=r=t[59]==t[14][t[56]].value||null,e.__value=o=" "+t[59]+" ",e.value=e.__value},m(t,r){a(t,e,r),l(e,n)},p(t,l){24576&l[0]&&i!==(i=t[59]+"")&&m(n,i),24576&l[0]&&r!==(r=t[59]==t[14][t[56]].value||null)&&(e.selected=r),24576&l[0]&&o!==(o=" "+t[59]+" ")&&(e.__value=o,e.value=e.__value)},d(t){t&&s(e)}}}function Ie(t){let e,n,r,o,i;function c(t,e){return t[55].props.length>1?Ae:Te}let f=c(t),h=f(t);const p=[je,He,Ne],m=[];function v(t,e){return"slider"===t[54]?0:"select"==t[54]?1:"color"==t[54]?2:-1}return~(r=v(t))&&(o=m[r]=p[r](t)),{c(){e=u("div"),h.c(),n=d(),o&&o.c(),g(e,"class","prop-section")},m(t,o){a(t,e,o),h.m(e,null),l(e,n),~r&&m[r].m(e,null),i=!0},p(t,i){f===(f=c(t))&&h?h.p(t,i):(h.d(1),h=f(t),h&&(h.c(),h.m(e,n)));let l=r;r=v(t),r===l?~r&&m[r].p(t,i):(o&&(D(),R(m[l],1,1,(()=>{m[l]=null})),I()),~r?(o=m[r],o?o.p(t,i):(o=m[r]=p[r](t),o.c()),P(o,1),o.m(e,null)):o=null)},i(t){i||(P(o),i=!0)},o(t){R(o),i=!1},d(t){t&&s(e),h.d(),~r&&m[r].d()}}}function Pe(t){let e,n,r;return{c(){e=u("div"),e.textContent="Bring to front",g(e,"class","btn"),v(e,"active",!0===t[15][t[4]])},m(o,i){a(o,e,i),n||(r=p(e,"click",t[18]),n=!0)},p(t,n){32784&n[0]&&v(e,"active",!0===t[15][t[4]])},d(t){t&&s(e),n=!1,r()}}}function Re(t){let e,n,o,i,h,m,v,y,b,w,_,k,$,S,x,C,M,E,L,T,A,O,N,H,j=t[1].length>1&&xe(t),B=Ue(t[2][t[4]]),F=[];for(let e=0;e<B.length;e+=1)F[e]=Me($e(t,B,e));let G=t[3][t[4]]||[],q=[];for(let e=0;e<G.length;e+=1)q[e]=Ee(ke(t,G,e));let U=t[3][t[4]]&&Le(t);return{c(){e=u("div"),n=d(),o=f("svg"),i=f("clipPath"),h=f("path"),m=f("rect"),b=d(),w=u("div"),_=u("div"),_.textContent="x",k=d(),j&&j.c(),$=d(),S=u("div"),x=u("b"),x.textContent="Rule:",C=d();for(let t=0;t<F.length;t+=1)F[t].c();M=d(),E=u("div"),L=u("b"),L.textContent="Property type:",T=d();for(let t=0;t<q.length;t+=1)q[t].c();var r,l,a,s;A=d(),U&&U.c(),r=e,l="position",null===(a="absolute")?r.style.removeProperty(l):r.style.setProperty(l,a,s?"important":""),g(h,"d",t[11]),g(i,"id","overlay-clip"),g(i,"clip-rule","evenodd"),g(m,"y","0"),g(m,"x","0"),g(m,"height","100%"),g(m,"width","100%"),g(m,"class","overlay-over"),g(o,"class","ise-helper-wrapper"),g(o,"version","1.1"),g(o,"xmlns","http://www.w3.org/2000/svg"),g(o,"xmlns:xlink","http://www.w3.org/1999/xlink"),g(o,"width",v=t[12].width),g(o,"height",y=t[12].height),g(_,"class","close-button"),g(S,"class","select-tab"),g(E,"class","select-tab"),g(w,"class","ise")},m(r,s){a(r,e,s),t[26](e),a(r,n,s),a(r,o,s),l(o,i),l(i,h),l(o,m),t[27](o),a(r,b,s),a(r,w,s),l(w,_),l(w,k),j&&j.m(w,null),l(w,$),l(w,S),l(S,x),l(S,C);for(let t=0;t<F.length;t+=1)F[t].m(S,null);l(w,M),l(w,E),l(E,L),l(E,T);for(let t=0;t<q.length;t+=1)q[t].m(E,null);l(w,A),U&&U.m(w,null),t[35](w),O=!0,N||(H=[p(o,"click",t[16]),p(_,"click",t[0])],N=!0)},p(t,e){if((!O||2048&e[0])&&g(h,"d",t[11]),(!O||4096&e[0]&&v!==(v=t[12].width))&&g(o,"width",v),(!O||4096&e[0]&&y!==(y=t[12].height))&&g(o,"height",y),t[1].length>1?j?j.p(t,e):(j=xe(t),j.c(),j.m(w,$)):j&&(j.d(1),j=null),52&e[0]){let n;for(B=Ue(t[2][t[4]]),n=0;n<B.length;n+=1){const r=$e(t,B,n);F[n]?F[n].p(r,e):(F[n]=Me(r),F[n].c(),F[n].m(S,null))}for(;n<F.length;n+=1)F[n].d(1);F.length=B.length}if(88&e[0]){let n;for(G=t[3][t[4]]||[],n=0;n<G.length;n+=1){const r=ke(t,G,n);q[n]?q[n].p(r,e):(q[n]=Ee(r),q[n].c(),q[n].m(E,null))}for(;n<q.length;n+=1)q[n].d(1);q.length=G.length}t[3][t[4]]?U?(U.p(t,e),24&e[0]&&P(U,1)):(U=Le(t),U.c(),P(U,1),U.m(w,null)):U&&(D(),R(U,1,1,(()=>{U=null})),I())},i(t){O||(P(U),O=!0)},o(t){R(U),O=!1},d(i){i&&s(e),t[26](null),i&&s(n),i&&s(o),t[27](null),i&&s(b),i&&s(w),j&&j.d(),c(F,i),c(q,i),U&&U.d(),t[35](null),N=!1,r(H)}}}const Be="text",Fe="border",Ge="stroke",qe="background";function Ue(t){return t?t.map(((t,e)=>{if("inline"===t)return"inline";const n=t.selectorText;return`${t.parentStyleSheet.title||`${e}`}: ${n}`})):[]}function ze(t,e=0){const n=t.getBoundingClientRect();return{left:n.left+window.scrollX-e,top:n.top+window.scrollY-e,width:n.width+2*e,height:n.height+2*e,right:n.left+window.scrollX+n.width+e,bottom:n.top+window.scrollY+n.height+e}}function We(t,e="number"){return"raw"==e?t:"number"==e&&/[0-9]+(px)|(em)|(rem)/.test(t)?parseInt(t):"rgb"!=e||!t.includes("rgb")&&"#"!=t[0]?t:function(t){const e=t.match(/[0-9\.]+/g).map((t=>parseFloat(t)));return 3===e.length&&e.push(1),e.reduce(((t,e,n)=>t+(3===n?Math.round(255*e).toString(16).padStart(2,"0"):e.toString(16).padStart(2,"0"))),"#")}(t)}function Ye(t,e,n){let r,o;const i=["altGlyph","circle","ellipse","line","path","polygon","polyline","rect","text","textPath","tref","tspan"],l={"border-radius":{type:"slider",min:0,max:30,suffix:"px"},"border-width":{type:"slider",min:0,max:30,suffix:"px"},"border-style":{type:"select",choices:()=>["none","dotted","dashed","solid","double","groove","ridge","inset","outset"]},"border-color":{type:"color"},"font-family":{type:"select",choices:function(){return function(){const t=new Set;for(const e of ye.values())document.fonts.check(`12px "${e}"`)&&t.add(e);return[...t.values()]}()}},"font-size":{type:"slider",min:0,max:30,suffix:"px"},"font-weight":{type:"slider",min:0,max:500},color:{type:"color"},"stroke-width":{type:"slider",min:0,max:30,suffix:"px"},stroke:{type:"color"},fill:{type:"color"},"stroke-dasharray":{type:"slider",min:0,max:30,suffix:"px"},"background-color":{type:"color"}},a={[Be]:["font-family","font-size","font-weight","color"],[Fe]:["border-radius","border-width","border-color","border-style"],[Ge]:["stroke-width","stroke","stroke-dasharray","fill"],[qe]:["background-color"]};let s,c,u,f,h,{getAdditionalElems:d=(()=>[])}=e,{listenOnClick:p=!1}=e,{onStyleChanged:g=(()=>{})}=e,m=null,v="",y={width:0,height:0},b=[],w=[],$=[],x=0,C=0,M=0,E={},L=[];_((()=>{N(),n(23,m=c.parentNode),document.body.appendChild(c),document.body.appendChild(u),document.body.appendChild(s),P(),setTimeout((()=>{P()}),1e3),window.addEventListener("resize",P)})),k((()=>{window.removeEventListener("resize",P),p&&m.removeEventListener("click",getTargetsAndRules)}));let T=new Set;function A(t){O(t.target,t.pageX,t.pageY)}function O(t,e,r){if(t.classList.contains("overlay-over"))return H();if(!c.contains(t))if(n(4,x=0),n(5,C=0),n(6,M=0),n(15,L=[]),n(3,$=[]),n(2,w=[]),n(1,b=[t,...d(t)]),n(3,$=b.reduce(((t,e)=>{const n=[];e.firstChild&&3===e.firstChild.nodeType&&n.push(Be);const r=e.tagName.toLowerCase();let o=!1;return i.includes(r)?(n.push(Ge),"g"===e.parentElement.tagName.toLowerCase()&&e.previousElementSibling&&e.previousElementSibling.tagName.toLowerCase()==r&&(o=!0)):(n.push(Fe),n.push(qe)),o?L.push(!0):L.push(null),t.push(n),t}),[])),n(2,w=function(t){const e=document.styleSheets;return t.reduce(((t,n)=>{const r=["inline"];for(let t in e)try{const o=e[t].cssRules;for(let t in o){const e=o[t].selectorText;!e||o[t].selectorText.length>50||e.split(",").some((t=>"*"===t))||n.matches(e)&&r.push(o[t])}}catch(n){T.has(t)||(console.log("Style editor: Not able to access",e[t].ownerNode,"sheet. Try CORS loading the sheet if you want to edit it."),T.add(t))}return t.push(r),t}),[])}(b)),e&&r)j(e,r);else{const e=ze(t,15);j(e.left,e.top)}}function N(){n(9,c.style.display="none",c),n(10,u.style.display="none",u),n(11,v="")}function H(){N()}function j(t,e){t=t+260>y.width?y.width-300:t+10,e=e+410>y.height?y.height-450:e+10,n(9,c.style.left=t+"px",c),n(9,c.style.top=e+"px",c),n(10,u.style.display="block",u),n(9,c.style.display="block",c)}function D(){if(!o)return;let t;if("inline"===o)t=[r];else{const e=o.selectorText.replace(/(:hover)|:focus/g,"");t=Array.from(document.querySelectorAll(e))}const e=t.map((t=>ze(t,10)));n(11,v=function(t,e){let n=function({width:t,height:e,top:n=0,left:r=0}){return`M${r} ${n} v${e} h${t} v-${e}z`}({width:e.width,height:e.height});if(t.length<10&&!function(t){for(let r=0;r<t.length-1;++r){const o=t[r];for(let i=r+1;i<t.length;++i)if(e=o,n=t[i],e.right>=n.left&&n.right>=e.left&&e.bottom>=n.top&&n.bottom>=e.top)return!0}var e,n;return!1}(t)){for(const e of t)n=`${n} ${Qt(e)}`;return n}const r=Math.min(...t.map((t=>t.left))),o=Math.min(...t.map((t=>t.top))),i=t.map((t=>(t.left=t.left-r,t.right=t.right-r,t.top=t.top-o,t.bottom=t.bottom-o,t)));i.sort(((t,e)=>t.left>e.left?1:t.left<e.left?-1:0));const l=Math.ceil(Math.max(...i.map((t=>t.right)))),a=Math.ceil(Math.max(...i.map((t=>t.bottom)))),s=l*a/2e4,c=Math.ceil(l/s),u=Math.ceil(a/s),f=l/c,h=a/u,d=new Array(c*u);for(let t=0,e=0;t<u;++t)for(let n=0;n<c;++n,++e)d[e]=Kt({x:n*s,y:t*s},i)?1:0;const p=Jt().size([c,u]).thresholds([1])(d)[0];let g="";for(let t of p.coordinates)for(let e of t){for(let t=0;t<e.length;++t){const n=e[t],i=n[0]*f+r,l=n[1]*h+o;g+=t?`L ${i} ${l}`:`M${i} ${l}`}g+="Z"}return`${n} ${g}`}(e,y))}const I=Ot((function(t,e,i){const l=i?e+i:e;if("inline"===o){r.style[t]=l}else o.style.setProperty(t,l);n(14,E[t].value=e,E),n(14,E[t].displayed=l,E),g(r,o,t,l),D()}),100);function P(){const t=getComputedStyle(document.body),e=parseInt(t.marginLeft),r=parseInt(t.marginRight),o=parseInt(t.marginTop),i=parseInt(t.marginBottom);n(12,y={width:document.body.offsetWidth+e+r,height:document.body.offsetHeight+o+i})}function R(t,e,n="number"){let r=o?.style?.[e];if(!r){r=getComputedStyle(t)[e]}return We(r,n)}return t.$$set=t=>{"getAdditionalElems"in t&&n(19,d=t.getAdditionalElems),"listenOnClick"in t&&n(20,p=t.listenOnClick),"onStyleChanged"in t&&n(21,g=t.onStyleChanged)},t.$$.update=()=>{if(8388608&t.$$.dirty[0]&&null!==m&&p&&m.addEventListener("click",A),18&t.$$.dirty[0]&&n(25,r=b[x]),52&t.$$.dirty[0]&&n(7,o=w[x]?.[C]),16777304&t.$$.dirty[0]&&$[x]?.[M]!==h&&n(24,h=$[x]?.[M]),50331776&t.$$.dirty[0]&&h&&o){const t=vt(l,a[h]);Object.keys(t).forEach((e=>{t[e].displayed=R(r,e,"raw");const n=t[e].type;let o="number";"color"===n?o="rgb":"select"===n&&(o="raw"),t[e].value=R(r,e,o)})),n(13,f=Object.entries(t).reduce(((t,[e,n])=>{const r=n.type;return r in t?t[r].props.push(e):t[r]={selected:0,props:[e]},t}),{})),n(14,E=t)}},[N,b,w,$,x,C,M,o,s,c,u,v,y,f,E,L,H,I,function(){n(15,L[x]=!1,L),r.parentNode.appendChild(r)},d,p,g,O,m,h,r,function(t){S[t?"unshift":"push"]((()=>{s=t,n(8,s)}))},function(t){S[t?"unshift":"push"]((()=>{u=t,n(10,u)}))},t=>{n(4,x=t),n(5,C=0)},t=>{n(5,C=t)},t=>{n(6,M=t)},(t,e,r,o)=>n(13,e[r][1].selected=o.target.value,f),(t,e)=>I(t,e.target.value,E[t].suffix,e.target),(t,e)=>I(t,e.target.value),(t,e)=>I(t,e),function(t){S[t?"unshift":"push"]((()=>{c=t,n(9,c)}))}]}var Xe=class extends U{constructor(t){super(),q(this,t,Ye,Re,i,{getAdditionalElems:19,listenOnClick:20,onStyleChanged:21,open:22,close:0},null,[-1,-1,-1])}get open(){return this.$$.ctx[22]}get close(){return this.$$.ctx[0]}};return class{constructor(t){return new Xe({target:document.body,props:t})}}}));