modern-idoc 0.8.5 → 0.8.6

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/dist/index.cjs CHANGED
@@ -988,6 +988,7 @@ function normalizeBackground(background) {
988
988
  }
989
989
 
990
990
  const propertiesSymbol = Symbol("properties");
991
+ const defaultValueInitedSymbol = Symbol("defaultValueInited");
991
992
  function getDeclarations(constructor) {
992
993
  let declarations;
993
994
  if (Object.hasOwn(constructor, propertiesSymbol)) {
@@ -1013,7 +1014,6 @@ function getPropertyDescriptor(key, declaration = {}) {
1013
1014
  const getFallbackValue = () => {
1014
1015
  return typeof fallback === "function" ? fallback() : fallback;
1015
1016
  };
1016
- let isFirst = true;
1017
1017
  function get() {
1018
1018
  let result;
1019
1019
  if (alias && alias !== key) {
@@ -1026,8 +1026,8 @@ function getPropertyDescriptor(key, declaration = {}) {
1026
1026
  }
1027
1027
  }
1028
1028
  result = result ?? getFallbackValue();
1029
- if (result === void 0 && isFirst) {
1030
- isFirst = false;
1029
+ if (result === void 0 && _default !== void 0 && !this[defaultValueInitedSymbol]) {
1030
+ this[defaultValueInitedSymbol] = true;
1031
1031
  const defaultValue = getDefaultValue();
1032
1032
  if (defaultValue !== void 0) {
1033
1033
  set.call(this, defaultValue);
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- (function(o,G){typeof exports=="object"&&typeof module<"u"?G(exports):typeof define=="function"&&define.amd?define(["exports"],G):(o=typeof globalThis<"u"?globalThis:o||self,G(o.modernIdoc={}))})(this,function(o){"use strict";function G(t){return typeof t=="string"?{src:t}:t}var me={grad:.9,turn:360,rad:360/(2*Math.PI)},N=function(t){return typeof t=="string"?t.length>0:typeof t=="number"},b=function(t,e,n){return e===void 0&&(e=0),n===void 0&&(n=Math.pow(10,e)),Math.round(n*t)/n+0},F=function(t,e,n){return e===void 0&&(e=0),n===void 0&&(n=1),t>n?n:t>e?t:e},ht=function(t){return(t=isFinite(t)?t%360:0)>0?t:t+360},vt=function(t){return{r:F(t.r,0,255),g:F(t.g,0,255),b:F(t.b,0,255),a:F(t.a)}},et=function(t){return{r:b(t.r),g:b(t.g),b:b(t.b),a:b(t.a,3)}},ye=/^#([0-9a-f]{3,8})$/i,B=function(t){var e=t.toString(16);return e.length<2?"0"+e:e},pt=function(t){var e=t.r,n=t.g,r=t.b,i=t.a,a=Math.max(e,n,r),u=a-Math.min(e,n,r),s=u?a===e?(n-r)/u:a===n?2+(r-e)/u:4+(e-n)/u:0;return{h:60*(s<0?s+6:s),s:a?u/a*100:0,v:a/255*100,a:i}},mt=function(t){var e=t.h,n=t.s,r=t.v,i=t.a;e=e/360*6,n/=100,r/=100;var a=Math.floor(e),u=r*(1-n),s=r*(1-(e-a)*n),d=r*(1-(1-e+a)*n),v=a%6;return{r:255*[r,s,u,u,d,r][v],g:255*[d,r,r,s,u,u][v],b:255*[u,u,d,r,r,s][v],a:i}},yt=function(t){return{h:ht(t.h),s:F(t.s,0,100),l:F(t.l,0,100),a:F(t.a)}},bt=function(t){return{h:b(t.h),s:b(t.s),l:b(t.l),a:b(t.a,3)}},St=function(t){return mt((n=(e=t).s,{h:e.h,s:(n*=((r=e.l)<50?r:100-r)/100)>0?2*n/(r+n)*100:0,v:r+n,a:e.a}));var e,n,r},j=function(t){return{h:(e=pt(t)).h,s:(i=(200-(n=e.s))*(r=e.v)/100)>0&&i<200?n*r/100/(i<=100?i:200-i)*100:0,l:i/2,a:e.a};var e,n,r,i},be=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Se=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Ce=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,we=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Ct={string:[[function(t){var e=ye.exec(t);return e?(t=e[1]).length<=4?{r:parseInt(t[0]+t[0],16),g:parseInt(t[1]+t[1],16),b:parseInt(t[2]+t[2],16),a:t.length===4?b(parseInt(t[3]+t[3],16)/255,2):1}:t.length===6||t.length===8?{r:parseInt(t.substr(0,2),16),g:parseInt(t.substr(2,2),16),b:parseInt(t.substr(4,2),16),a:t.length===8?b(parseInt(t.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(t){var e=Ce.exec(t)||we.exec(t);return e?e[2]!==e[4]||e[4]!==e[6]?null:vt({r:Number(e[1])/(e[2]?100/255:1),g:Number(e[3])/(e[4]?100/255:1),b:Number(e[5])/(e[6]?100/255:1),a:e[7]===void 0?1:Number(e[7])/(e[8]?100:1)}):null},"rgb"],[function(t){var e=be.exec(t)||Se.exec(t);if(!e)return null;var n,r,i=yt({h:(n=e[1],r=e[2],r===void 0&&(r="deg"),Number(n)*(me[r]||1)),s:Number(e[3]),l:Number(e[4]),a:e[5]===void 0?1:Number(e[5])/(e[6]?100:1)});return St(i)},"hsl"]],object:[[function(t){var e=t.r,n=t.g,r=t.b,i=t.a,a=i===void 0?1:i;return N(e)&&N(n)&&N(r)?vt({r:Number(e),g:Number(n),b:Number(r),a:Number(a)}):null},"rgb"],[function(t){var e=t.h,n=t.s,r=t.l,i=t.a,a=i===void 0?1:i;if(!N(e)||!N(n)||!N(r))return null;var u=yt({h:Number(e),s:Number(n),l:Number(r),a:Number(a)});return St(u)},"hsl"],[function(t){var e=t.h,n=t.s,r=t.v,i=t.a,a=i===void 0?1:i;if(!N(e)||!N(n)||!N(r))return null;var u=function(s){return{h:ht(s.h),s:F(s.s,0,100),v:F(s.v,0,100),a:F(s.a)}}({h:Number(e),s:Number(n),v:Number(r),a:Number(a)});return mt(u)},"hsv"]]},wt=function(t,e){for(var n=0;n<e.length;n++){var r=e[n][0](t);if(r)return[r,e[n][1]]}return[null,void 0]},_e=function(t){return typeof t=="string"?wt(t.trim(),Ct.string):typeof t=="object"&&t!==null?wt(t,Ct.object):[null,void 0]},nt=function(t,e){var n=j(t);return{h:n.h,s:F(n.s+100*e,0,100),l:n.l,a:n.a}},rt=function(t){return(299*t.r+587*t.g+114*t.b)/1e3/255},_t=function(t,e){var n=j(t);return{h:n.h,s:n.s,l:F(n.l+100*e,0,100),a:n.a}},zt=function(){function t(e){this.parsed=_e(e)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return t.prototype.isValid=function(){return this.parsed!==null},t.prototype.brightness=function(){return b(rt(this.rgba),2)},t.prototype.isDark=function(){return rt(this.rgba)<.5},t.prototype.isLight=function(){return rt(this.rgba)>=.5},t.prototype.toHex=function(){return e=et(this.rgba),n=e.r,r=e.g,i=e.b,u=(a=e.a)<1?B(b(255*a)):"","#"+B(n)+B(r)+B(i)+u;var e,n,r,i,a,u},t.prototype.toRgb=function(){return et(this.rgba)},t.prototype.toRgbString=function(){return e=et(this.rgba),n=e.r,r=e.g,i=e.b,(a=e.a)<1?"rgba("+n+", "+r+", "+i+", "+a+")":"rgb("+n+", "+r+", "+i+")";var e,n,r,i,a},t.prototype.toHsl=function(){return bt(j(this.rgba))},t.prototype.toHslString=function(){return e=bt(j(this.rgba)),n=e.h,r=e.s,i=e.l,(a=e.a)<1?"hsla("+n+", "+r+"%, "+i+"%, "+a+")":"hsl("+n+", "+r+"%, "+i+"%)";var e,n,r,i,a},t.prototype.toHsv=function(){return e=pt(this.rgba),{h:b(e.h),s:b(e.s),v:b(e.v),a:b(e.a,3)};var e},t.prototype.invert=function(){return D({r:255-(e=this.rgba).r,g:255-e.g,b:255-e.b,a:e.a});var e},t.prototype.saturate=function(e){return e===void 0&&(e=.1),D(nt(this.rgba,e))},t.prototype.desaturate=function(e){return e===void 0&&(e=.1),D(nt(this.rgba,-e))},t.prototype.grayscale=function(){return D(nt(this.rgba,-1))},t.prototype.lighten=function(e){return e===void 0&&(e=.1),D(_t(this.rgba,e))},t.prototype.darken=function(e){return e===void 0&&(e=.1),D(_t(this.rgba,-e))},t.prototype.rotate=function(e){return e===void 0&&(e=15),this.hue(this.hue()+e)},t.prototype.alpha=function(e){return typeof e=="number"?D({r:(n=this.rgba).r,g:n.g,b:n.b,a:e}):b(this.rgba.a,3);var n},t.prototype.hue=function(e){var n=j(this.rgba);return typeof e=="number"?D({h:e,s:n.s,l:n.l,a:n.a}):b(n.h)},t.prototype.isEqual=function(e){return this.toHex()===D(e).toHex()},t}(),D=function(t){return t instanceof zt?t:new zt(t)};class ze{eventListeners=new Map;addEventListener(e,n,r){const i={value:n,options:r},a=this.eventListeners.get(e);return a?Array.isArray(a)?a.push(i):this.eventListeners.set(e,[a,i]):this.eventListeners.set(e,i),this}removeEventListener(e,n,r){if(!n)return this.eventListeners.delete(e),this;const i=this.eventListeners.get(e);if(!i)return this;if(Array.isArray(i)){const a=[];for(let u=0,s=i.length;u<s;u++){const d=i[u];(d.value!==n||typeof r=="object"&&r?.once&&(typeof d.options=="boolean"||!d.options?.once))&&a.push(d)}a.length?this.eventListeners.set(e,a.length===1?a[0]:a):this.eventListeners.delete(e)}else i.value===n&&(typeof r=="boolean"||!r?.once||typeof i.options=="boolean"||i.options?.once)&&this.eventListeners.delete(e);return this}removeAllListeners(){return this.eventListeners.clear(),this}hasEventListener(e){return this.eventListeners.has(e)}dispatchEvent(e,...n){const r=this.eventListeners.get(e);if(r){if(Array.isArray(r))for(let i=r.length,a=0;a<i;a++){const u=r[a];typeof u.options=="object"&&u.options?.once&&this.off(e,u.value,u.options),u.value.apply(this,n)}else typeof r.options=="object"&&r.options?.once&&this.off(e,r.value,r.options),r.value.apply(this,n);return!0}else return!1}on(e,n,r){return this.addEventListener(e,n,r)}once(e,n){return this.addEventListener(e,n,{once:!0})}off(e,n,r){return this.removeEventListener(e,n,r)}emit(e,...n){this.dispatchEvent(e,...n)}}function h(t){return t==null||t==="none"}function R(t,e=0,n=10**e){return Math.round(n*t)/n+0}function w(t,e=!1){if(typeof t!="object"||!t)return t;if(Array.isArray(t))return e?t.map(r=>w(r,e)):t;const n={};for(const r in t){const i=t[r];i!=null&&(e?n[r]=w(i,e):n[r]=i)}return n}function K(t,e){const n={};return e.forEach(r=>{r in t&&(n[r]=t[r])}),n}function x(t,e){if(t===e)return!0;if(t&&e&&typeof t=="object"&&typeof e=="object"){const n=Array.from(new Set([...Object.keys(t),...Object.keys(e)]));return!n.length||n.every(r=>t[r]===e[r])}return!1}function Ft(t,e,n){const r=e.length-1;if(r<0)return t===void 0?n:t;for(let i=0;i<r;i++){if(t==null)return n;t=t[e[i]]}return t==null||t[e[r]]===void 0?n:t[e[r]]}function Et(t,e,n){const r=e.length-1;for(let i=0;i<r;i++)typeof t[e[i]]!="object"&&(t[e[i]]={}),t=t[e[i]];t[e[r]]=n}function Lt(t,e,n){return t==null||!e||typeof e!="string"?n:t[e]!==void 0?t[e]:(e=e.replace(/\[(\w+)\]/g,".$1"),e=e.replace(/^\./,""),Ft(t,e.split("."),n))}function Ot(t,e,n){if(!(typeof t!="object"||!e))return e=e.replace(/\[(\w+)\]/g,".$1"),e=e.replace(/^\./,""),Et(t,e.split("."),n)}class Fe{_map=new WeakMap;_toRaw(e){if(e&&typeof e=="object"){const n=e.__v_raw;n&&(e=this._toRaw(n))}return e}delete(e){return this._map.delete(this._toRaw(e))}get(e){return this._map.get(this._toRaw(e))}has(e){return this._map.has(this._toRaw(e))}set(e,n){return this._map.set(this._toRaw(e),this._toRaw(n)),this}}function it(t){let e;return typeof t=="number"?e={r:t>>24&255,g:t>>16&255,b:t>>8&255,a:(t&255)/255}:e=t,D(e)}function Ee(t){return{r:R(t.r),g:R(t.g),b:R(t.b),a:R(t.a,3)}}function U(t){const e=t.toString(16);return e.length<2?`0${e}`:e}const T="#000000FF";function Dt(t){return it(t).isValid()}function C(t,e=!1){const n=it(t);if(!n.isValid()){if(typeof t=="string")return t;const s=`Failed to normalizeColor ${t}`;if(e)throw new Error(s);return console.warn(s),T}const{r,g:i,b:a,a:u}=Ee(n.rgba);return`#${U(r)}${U(i)}${U(a)}${U(R(u*255))}`}var X=X||{};X.parse=function(){const t={linearGradient:/^(-(webkit|o|ms|moz)-)?(linear-gradient)/i,repeatingLinearGradient:/^(-(webkit|o|ms|moz)-)?(repeating-linear-gradient)/i,radialGradient:/^(-(webkit|o|ms|moz)-)?(radial-gradient)/i,repeatingRadialGradient:/^(-(webkit|o|ms|moz)-)?(repeating-radial-gradient)/i,sideOrCorner:/^to (left (top|bottom)|right (top|bottom)|top (left|right)|bottom (left|right)|left|right|top|bottom)/i,extentKeywords:/^(closest-side|closest-corner|farthest-side|farthest-corner|contain|cover)/,positionKeywords:/^(left|center|right|top|bottom)/i,pixelValue:/^(-?((\d*\.\d+)|(\d+\.?)))px/,percentageValue:/^(-?((\d*\.\d+)|(\d+\.?)))%/,emValue:/^(-?((\d*\.\d+)|(\d+\.?)))em/,angleValue:/^(-?((\d*\.\d+)|(\d+\.?)))deg/,radianValue:/^(-?((\d*\.\d+)|(\d+\.?)))rad/,startCall:/^\(/,endCall:/^\)/,comma:/^,/,hexColor:/^#([0-9a-f]+)/i,literalColor:/^([a-z]+)/i,rgbColor:/^rgb/i,rgbaColor:/^rgba/i,varColor:/^var/i,calcValue:/^calc/i,variableName:/^(--[a-z0-9-,\s#]+)/i,number:/^((\d*\.\d+)|(\d+\.?))/,hslColor:/^hsl/i,hslaColor:/^hsla/i};let e="";function n(l){const c=new Error(`${e}: ${l}`);throw c.source=e,c}function r(){const l=i();return e.length>0&&n("Invalid input not EOF"),l}function i(){return V(a)}function a(){return u("linear-gradient",t.linearGradient,d)||u("repeating-linear-gradient",t.repeatingLinearGradient,d)||u("radial-gradient",t.radialGradient,m)||u("repeating-radial-gradient",t.repeatingRadialGradient,m)}function u(l,c,f){return s(c,S=>{const A=f();return A&&(y(t.comma)||n("Missing comma before color stops")),{type:l,orientation:A,colorStops:V(dt)}})}function s(l,c){const f=y(l);if(f){y(t.startCall)||n("Missing (");const S=c(f);return y(t.endCall)||n("Missing )"),S}}function d(){const l=v();if(l)return l;const c=z("position-keyword",t.positionKeywords,1);return c?{type:"directional",value:c.value}:p()}function v(){return z("directional",t.sideOrCorner,1)}function p(){return z("angular",t.angleValue,1)||z("angular",t.radianValue,1)}function m(){let l,c=g(),f;return c&&(l=[],l.push(c),f=e,y(t.comma)&&(c=g(),c?l.push(c):e=f)),l}function g(){let l=_()||k();if(l)l.at=O();else{const c=E();if(c){l=c;const f=O();f&&(l.at=f)}else{const f=O();if(f)l={type:"default-radial",at:f};else{const S=I();S&&(l={type:"default-radial",at:S})}}}return l}function _(){const l=z("shape",/^(circle)/i,0);return l&&(l.style=pe()||E()),l}function k(){const l=z("shape",/^(ellipse)/i,0);return l&&(l.style=I()||tt()||E()),l}function E(){return z("extent-keyword",t.extentKeywords,1)}function O(){if(z("position",/^at/,0)){const l=I();return l||n("Missing positioning value"),l}}function I(){const l=H();if(l.x||l.y)return{type:"position",value:l}}function H(){return{x:tt(),y:tt()}}function V(l){let c=l();const f=[];if(c)for(f.push(c);y(t.comma);)c=l(),c?f.push(c):n("One extra comma");return f}function dt(){const l=$e();return l||n("Expected color definition"),l.length=tt(),l}function $e(){return We()||Xe()||Ue()||Ke()||Be()||xe()||He()}function He(){return z("literal",t.literalColor,0)}function We(){return z("hex",t.hexColor,1)}function Be(){return s(t.rgbColor,()=>({type:"rgb",value:V(W)}))}function Ke(){return s(t.rgbaColor,()=>({type:"rgba",value:V(W)}))}function xe(){return s(t.varColor,()=>({type:"var",value:Ye()}))}function Ue(){return s(t.hslColor,()=>{y(t.percentageValue)&&n("HSL hue value must be a number in degrees (0-360) or normalized (-360 to 360), not a percentage");const c=W();y(t.comma);let f=y(t.percentageValue);const S=f?f[1]:null;y(t.comma),f=y(t.percentageValue);const A=f?f[1]:null;return(!S||!A)&&n("Expected percentage value for saturation and lightness in HSL"),{type:"hsl",value:[c,S,A]}})}function Xe(){return s(t.hslaColor,()=>{const l=W();y(t.comma);let c=y(t.percentageValue);const f=c?c[1]:null;y(t.comma),c=y(t.percentageValue);const S=c?c[1]:null;y(t.comma);const A=W();return(!f||!S)&&n("Expected percentage value for saturation and lightness in HSLA"),{type:"hsla",value:[l,f,S,A]}})}function Ye(){return y(t.variableName)[1]}function W(){return y(t.number)[1]}function tt(){return z("%",t.percentageValue,1)||qe()||Ze()||pe()}function qe(){return z("position-keyword",t.positionKeywords,1)}function Ze(){return s(t.calcValue,()=>{let l=1,c=0;for(;l>0&&c<e.length;){const S=e.charAt(c);S==="("?l++:S===")"&&l--,c++}l>0&&n("Missing closing parenthesis in calc() expression");const f=e.substring(0,c-1);return gt(c-1),{type:"calc",value:f}})}function pe(){return z("px",t.pixelValue,1)||z("em",t.emValue,1)}function z(l,c,f){const S=y(c);if(S)return{type:l,value:S[f]}}function y(l){let c,f;return f=/^\s+/.exec(e),f&&gt(f[0].length),c=l.exec(e),c&&gt(c[0].length),c}function gt(l){e=e.substr(l)}return function(l){return e=l.toString().trim(),e.endsWith(";")&&(e=e.slice(0,-1)),r()}}();const Nt=X.parse.bind(X);var Y=Y||{};Y.stringify=function(){var t={"visit_linear-gradient":function(e){return t.visit_gradient(e)},"visit_repeating-linear-gradient":function(e){return t.visit_gradient(e)},"visit_radial-gradient":function(e){return t.visit_gradient(e)},"visit_repeating-radial-gradient":function(e){return t.visit_gradient(e)},visit_gradient:function(e){var n=t.visit(e.orientation);return n&&(n+=", "),e.type+"("+n+t.visit(e.colorStops)+")"},visit_shape:function(e){var n=e.value,r=t.visit(e.at),i=t.visit(e.style);return i&&(n+=" "+i),r&&(n+=" at "+r),n},"visit_default-radial":function(e){var n="",r=t.visit(e.at);return r&&(n+=r),n},"visit_extent-keyword":function(e){var n=e.value,r=t.visit(e.at);return r&&(n+=" at "+r),n},"visit_position-keyword":function(e){return e.value},visit_position:function(e){return t.visit(e.value.x)+" "+t.visit(e.value.y)},"visit_%":function(e){return e.value+"%"},visit_em:function(e){return e.value+"em"},visit_px:function(e){return e.value+"px"},visit_calc:function(e){return"calc("+e.value+")"},visit_literal:function(e){return t.visit_color(e.value,e)},visit_hex:function(e){return t.visit_color("#"+e.value,e)},visit_rgb:function(e){return t.visit_color("rgb("+e.value.join(", ")+")",e)},visit_rgba:function(e){return t.visit_color("rgba("+e.value.join(", ")+")",e)},visit_hsl:function(e){return t.visit_color("hsl("+e.value[0]+", "+e.value[1]+"%, "+e.value[2]+"%)",e)},visit_hsla:function(e){return t.visit_color("hsla("+e.value[0]+", "+e.value[1]+"%, "+e.value[2]+"%, "+e.value[3]+")",e)},visit_var:function(e){return t.visit_color("var("+e.value+")",e)},visit_color:function(e,n){var r=e,i=t.visit(n.length);return i&&(r+=" "+i),r},visit_angular:function(e){return e.value+"deg"},visit_directional:function(e){return"to "+e.value},visit_array:function(e){var n="",r=e.length;return e.forEach(function(i,a){n+=t.visit(i),a<r-1&&(n+=", ")}),n},visit_object:function(e){return e.width&&e.height?t.visit(e.width)+" "+t.visit(e.height):""},visit:function(e){if(!e)return"";if(e instanceof Array)return t.visit_array(e);if(typeof e=="object"&&!e.type)return t.visit_object(e);if(e.type){var n=t["visit_"+e.type];if(n)return n(e);throw Error("Missing visitor visit_"+e.type)}else throw Error("Invalid node.")}};return function(e){return t.visit(e)}}();const Le=Y.stringify.bind(Y);function Rt(t){const e=t.length-1;return t.map((n,r)=>{const i=n.value;let a=R(r/e,3),u="#00000000";switch(n.type){case"rgb":u=C({r:Number(i[0]??0),g:Number(i[1]??0),b:Number(i[2]??0)});break;case"rgba":u=C({r:Number(i[0]??0),g:Number(i[1]??0),b:Number(i[2]??0),a:Number(i[3]??0)});break;case"literal":u=C(n.value);break;case"hex":u=C(`#${n.value}`);break}switch(n.length?.type){case"%":a=Number(n.length.value)/100;break}return{offset:a,color:u}})}function kt(t){let e=0;switch(t.orientation?.type){case"angular":e=Number(t.orientation.value);break}return{type:"linear-gradient",angle:e,stops:Rt(t.colorStops)}}function It(t){return t.orientation?.map(e=>{switch(e?.type){case"shape":case"default-radial":case"extent-keyword":default:return null}}),{type:"radial-gradient",stops:Rt(t.colorStops)}}function M(t){return t.startsWith("linear-gradient(")||t.startsWith("radial-gradient(")}function At(t){return Nt(t).map(e=>{switch(e?.type){case"linear-gradient":return kt(e);case"repeating-linear-gradient":return{...kt(e),repeat:!0};case"radial-gradient":return It(e);case"repeating-radial-gradient":return{...It(e),repeat:!0};default:return}}).filter(Boolean)}function Gt(t){let e;return typeof t=="string"?e={color:t}:e=t,{color:C(e.color)}}function Pt(t){let e;if(typeof t=="string"?e={image:t}:e=t,e.image){const{type:n,...r}=At(e.image)[0]??{};switch(n){case"radial-gradient":return{radialGradient:r};case"linear-gradient":return{linearGradient:r}}}return e}function Vt(t){let e;return typeof t=="string"?e={image:t}:e=t,e}function jt(t){let e;return typeof t=="string"?e={preset:t}:e=t,{preset:e.preset,foregroundColor:h(e.foregroundColor)?void 0:C(e.foregroundColor),backgroundColor:h(e.backgroundColor)?void 0:C(e.backgroundColor)}}function Tt(t){return!h(t.color)}function Mt(t){return typeof t=="string"?Dt(t):Tt(t)}function $t(t){return!h(t.image)&&M(t.image)||!!t.linearGradient||!!t.radialGradient}function Ht(t){return typeof t=="string"?M(t):$t(t)}function Wt(t){return!h(t.image)&&!M(t.image)}function Bt(t){return typeof t=="string"?!M(t):Wt(t)}function Kt(t){return!h(t.preset)}function xt(t){return typeof t=="string"?!1:Kt(t)}function L(t){const e=t&&typeof t=="object"?t.enabled:void 0;return Mt(t)?w({enabled:e,...Gt(t)}):Ht(t)?w({enabled:e,...Pt(t)}):Bt(t)?w({enabled:e,...Vt(t)}):xt(t)?w({enabled:e,...jt(t)}):{}}function Ut(t){return typeof t=="string"?{...L(t)}:{...L(t),...K(t,["fillWithShape"])}}const ot=Symbol("properties");function q(t){let e;if(Object.hasOwn(t,ot))e=t[ot];else{const n=Object.getPrototypeOf(t);e=new Map(n?q(n):void 0),t[ot]=e}return e}function at(t,e={}){const n=Symbol.for(t),{default:r,fallback:i,alias:a}=e,u={declaration:e,internalKey:n},s=()=>typeof r=="function"?r():r,d=()=>typeof i=="function"?i():i;let v=!0;function p(){let g;if(a&&a!==t?g=Lt(this,a):typeof this.getter<"u"?g=this.getter(t,u):g=this[n],g=g??d(),g===void 0&&v){v=!1;const _=s();_!==void 0&&(m.call(this,_),g=_)}return g}function m(g){a&&a!==t?Ot(this,a,g):typeof this.setter<"u"?this.setter(t,g,u):this[n]=g}return{get:p,set:m}}function Xt(t,e,n={}){q(t).set(e,n);const r=at(e,n);Object.defineProperty(t.prototype,e,{get(){return r.get.call(this)},set(i){const a=r.get.call(this);r.set.call(this,i),this.onUpdateProperty?.(e,i,a,n)},configurable:!0,enumerable:!0})}function Oe(t){return function(e,n){if(typeof n!="string")throw new TypeError("Failed to @property decorator, prop name cannot be a symbol");Xt(e.constructor,n,t)}}function De(t={}){return function(e,n){const r=n.name;if(typeof r!="string")throw new TypeError("Failed to @property decorator, prop name cannot be a symbol");const i=at(r,t);return{init(a){return q(this.constructor).set(r,t),i.set.call(this,a),a},get(){return i.get.call(this)},set(a){const u=i.get?.call(this);i.set.call(this,a),this.onUpdateProperty?.(r,a,u,t)}}}}function lt(){return{color:T,offsetX:0,offsetY:0,blurRadius:1}}function ut(t){return{...lt(),...w({...t,color:h(t.color)?T:C(t.color)})}}function Yt(){return{...lt(),scaleX:1,scaleY:1}}function qt(t){return{...Yt(),...ut(t)}}function Ne(t){return t}function Zt(t){return w({...t,softEdge:h(t.softEdge)?void 0:t.softEdge,outerShadow:h(t.outerShadow)?void 0:qt(t.outerShadow),innerShadow:h(t.innerShadow)?void 0:ut(t.innerShadow)})}function Jt(t){return typeof t=="string"?{...L(t)}:{...L(t),...K(t,["fillWithShape"])}}const Re="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let ke=(t=21)=>{let e="",n=crypto.getRandomValues(new Uint8Array(t|=0));for(;t--;)e+=Re[n[t]&63];return e};const Qt=()=>ke(10),te=Qt;function $(t){return typeof t=="string"?{...L(t)}:{...L(t),...K(t,["width","style","headEnd","tailEnd"])}}function ee(t){return typeof t=="string"?{color:C(t)}:{...t,color:h(t.color)?T:C(t.color)}}function ne(){return{boxShadow:"none"}}function re(t){return typeof t=="string"?t.startsWith("<svg")?{svg:t}:{paths:[{data:t}]}:Array.isArray(t)?{paths:t.map(e=>typeof e=="string"?{data:e}:e)}:t}function ie(){return{overflow:"visible",direction:void 0,display:void 0,boxSizing:void 0,width:void 0,height:void 0,maxHeight:void 0,maxWidth:void 0,minHeight:void 0,minWidth:void 0,position:void 0,left:0,top:0,right:void 0,bottom:void 0,borderTop:void 0,borderLeft:void 0,borderRight:void 0,borderBottom:void 0,borderWidth:0,border:void 0,flex:void 0,flexBasis:void 0,flexDirection:void 0,flexGrow:void 0,flexShrink:void 0,flexWrap:void 0,justifyContent:void 0,gap:void 0,alignContent:void 0,alignItems:void 0,alignSelf:void 0,marginTop:void 0,marginLeft:void 0,marginRight:void 0,marginBottom:void 0,margin:void 0,paddingTop:void 0,paddingLeft:void 0,paddingRight:void 0,paddingBottom:void 0,padding:void 0}}function oe(){return{rotate:0,scaleX:1,scaleY:1,skewX:0,skewY:0,translateX:0,translateY:0,transform:"none",transformOrigin:"center"}}function ae(){return{...ie(),...oe(),...ne(),backgroundImage:"none",backgroundSize:"auto, auto",backgroundColor:"none",backgroundColormap:"none",borderRadius:0,borderColor:"none",borderStyle:"solid",outlineWidth:0,outlineOffset:0,outlineColor:"rgb(0, 0, 0)",outlineStyle:"none",visibility:"visible",filter:"none",opacity:1,pointerEvents:"auto",maskImage:"none"}}function le(){return{highlight:{},highlightImage:"none",highlightReferImage:"none",highlightColormap:"none",highlightLine:"none",highlightSize:"cover",highlightThickness:"100%"}}function ue(){return{listStyle:{},listStyleType:"none",listStyleImage:"none",listStyleColormap:"none",listStyleSize:"cover",listStylePosition:"outside"}}function se(){return{...le(),color:"rgb(0, 0, 0)",verticalAlign:"baseline",letterSpacing:0,wordSpacing:0,fontSize:14,fontWeight:"normal",fontFamily:"",fontStyle:"normal",fontKerning:"normal",textTransform:"none",textOrientation:"mixed",textDecoration:"none"}}function ce(){return{...ue(),writingMode:"horizontal-tb",textWrap:"wrap",textAlign:"start",textIndent:0,lineHeight:1.2}}function fe(){return{...ce(),...se(),textStrokeWidth:0,textStrokeColor:"rgb(0, 0, 0)"}}function P(t){return w({...t,color:h(t.color)?void 0:C(t.color),backgroundColor:h(t.backgroundColor)?void 0:C(t.backgroundColor),borderColor:h(t.borderColor)?void 0:C(t.borderColor),outlineColor:h(t.outlineColor)?void 0:C(t.outlineColor),shadowColor:h(t.shadowColor)?void 0:C(t.shadowColor)})}function Ie(){return{...ae(),...fe()}}const st=/\r\n|\n\r|\n|\r/,Ae=new RegExp(`${st.source}|<br\\/>`,"g"),Ge=new RegExp(`^(${st.source})$`),Z=`
2
- `;function Pe(t){return st.test(t)}function ct(t){return Ge.test(t)}function de(t){return t.replace(Ae,Z)}function J(t){const e=[];function n(){return e[e.length-1]}function r(s,d,v){const p=s?P(s):{},m=d?L(d):void 0,g=v?$(v):void 0,_=w({...p,fill:m,outline:g,fragments:[]});return e[e.length-1]?.fragments.length===0?e[e.length-1]=_:e.push(_),_}function i(s="",d,v,p){const m=d?P(d):{},g=v?L(v):void 0,_=p?$(p):void 0;Array.from(s).forEach(k=>{if(ct(k)){const{fragments:E,fill:O,outline:I,...H}=n()||r();E.length||E.push(w({...m,fill:g,outline:_,content:Z})),r(H,O,I)}else{const E=n()||r(),O=E.fragments[E.fragments.length-1];if(O){const{content:I,fill:H,outline:V,...dt}=O;if(x(g,H)&&x(_,V)&&x(m,dt)){O.content=`${I}${k}`;return}}E.fragments.push(w({...m,fill:g,outline:_,content:k}))}})}(Array.isArray(t)?t:[t]).forEach(s=>{if(typeof s=="string")r(),i(s);else if(ft(s)){const{content:d,fill:v,outline:p,...m}=s;r(m,v,p),i(d)}else if(ge(s)){const{fragments:d,fill:v,outline:p,...m}=s;r(m,v,p),d.forEach(g=>{const{content:_,fill:k,outline:E,...O}=g;i(_,O,k,E)})}else Array.isArray(s)?(r(),s.forEach(d=>{if(typeof d=="string")i(d);else if(ft(d)){const{content:v,fill:p,outline:m,...g}=d;i(v,g,p,m)}})):console.warn("Failed to parse text content",s)});const u=n();return u&&!u.fragments.length&&u.fragments.push({content:Z}),e}function ge(t){return t&&typeof t=="object"&&"fragments"in t&&Array.isArray(t.fragments)}function ft(t){return t&&typeof t=="object"&&"content"in t&&typeof t.content=="string"}function he(t){return typeof t=="string"||Array.isArray(t)?{content:J(t)}:w({...t,content:J(t.content??""),style:t.style?P(t.style):void 0,effects:t.effects?t.effects.map(e=>P(e)):void 0,measureDom:t.measureDom,fonts:t.fonts,fill:t.fill?L(t.fill):void 0,outline:t.outline?$(t.outline):void 0})}function Ve(t){return J(t).map(e=>{const n=de(e.fragments.flatMap(r=>r.content).join(""));return ct(n)?"":n}).join(Z)}function ve(t){return typeof t=="string"?{src:t}:t}function Q(t){return w({...t,id:t.id??te(),style:h(t.style)?void 0:P(t.style),text:h(t.text)?void 0:he(t.text),background:h(t.background)?void 0:Ut(t.background),shape:h(t.shape)?void 0:re(t.shape),fill:h(t.fill)?void 0:L(t.fill),outline:h(t.outline)?void 0:$(t.outline),foreground:h(t.foreground)?void 0:Jt(t.foreground),shadow:h(t.shadow)?void 0:ee(t.shadow),video:h(t.video)?void 0:ve(t.video),audio:h(t.audio)?void 0:G(t.audio),effect:h(t.effect)?void 0:Zt(t.effect),children:t.children?.map(e=>Q(e))})}function je(t){return Q(t)}function Te(t){const e={};for(const n in t.children){const r=Q(t.children[n]);delete r.children,e[n]=r}return{...t,children:e}}function Me(t){const{children:e,...n}=t;function r(s){const{parentId:d,childrenIds:v,...p}=s;return{...p,children:[]}}const i={},a=[],u={...n,children:a};for(const s in e){if(i[s])continue;const d=e[s],v=r(d);i[s]=v;const p=d.parentId;if(p){const m=e[p];let g=i[p];g||e[p]&&(g=r(e[p]),i[p]=g),m?.childrenIds&&g?.children&&g.children.splice(m.childrenIds.indexOf(s),0,v)}else a.push(v)}return u}o.EventEmitter=ze,o.RawWeakMap=Fe,o.clearUndef=w,o.defaultColor=T,o.defineProperty=Xt,o.flatDocumentToDocument=Me,o.getDeclarations=q,o.getDefaultElementStyle=ae,o.getDefaultHighlightStyle=le,o.getDefaultInnerShadow=lt,o.getDefaultLayoutStyle=ie,o.getDefaultListStyleStyle=ue,o.getDefaultOuterShadow=Yt,o.getDefaultShadowStyle=ne,o.getDefaultStyle=Ie,o.getDefaultTextInlineStyle=se,o.getDefaultTextLineStyle=ce,o.getDefaultTextStyle=fe,o.getDefaultTransformStyle=oe,o.getNestedValue=Ft,o.getObjectValueByPath=Lt,o.getPropertyDescriptor=at,o.hasCRLF=Pe,o.idGenerator=te,o.isCRLF=ct,o.isColor=Dt,o.isColorFill=Mt,o.isColorFillObject=Tt,o.isEqualObject=x,o.isFragmentObject=ft,o.isGradient=M,o.isGradientFill=Ht,o.isGradientFillObject=$t,o.isImageFill=Bt,o.isImageFillObject=Wt,o.isNone=h,o.isParagraphObject=ge,o.isPresetFill=xt,o.isPresetFillObject=Kt,o.nanoid=Qt,o.normalizeAudio=G,o.normalizeBackground=Ut,o.normalizeCRLF=de,o.normalizeColor=C,o.normalizeColorFill=Gt,o.normalizeDocument=je,o.normalizeEffect=Zt,o.normalizeElement=Q,o.normalizeFill=L,o.normalizeFlatDocument=Te,o.normalizeForeground=Jt,o.normalizeGradient=At,o.normalizeGradientFill=Pt,o.normalizeImageFill=Vt,o.normalizeInnerShadow=ut,o.normalizeOuterShadow=qt,o.normalizeOutline=$,o.normalizePresetFill=jt,o.normalizeShadow=ee,o.normalizeShape=re,o.normalizeSoftEdge=Ne,o.normalizeStyle=P,o.normalizeText=he,o.normalizeTextContent=J,o.normalizeVideo=ve,o.parseColor=it,o.parseGradient=Nt,o.pick=K,o.property=Oe,o.property2=De,o.round=R,o.setNestedValue=Et,o.setObjectValueByPath=Ot,o.stringifyGradient=Le,o.textContentToString=Ve,Object.defineProperty(o,Symbol.toStringTag,{value:"Module"})});
1
+ (function(o,G){typeof exports=="object"&&typeof module<"u"?G(exports):typeof define=="function"&&define.amd?define(["exports"],G):(o=typeof globalThis<"u"?globalThis:o||self,G(o.modernIdoc={}))})(this,function(o){"use strict";function G(t){return typeof t=="string"?{src:t}:t}var ye={grad:.9,turn:360,rad:360/(2*Math.PI)},N=function(t){return typeof t=="string"?t.length>0:typeof t=="number"},b=function(t,e,n){return e===void 0&&(e=0),n===void 0&&(n=Math.pow(10,e)),Math.round(n*t)/n+0},z=function(t,e,n){return e===void 0&&(e=0),n===void 0&&(n=1),t>n?n:t>e?t:e},ht=function(t){return(t=isFinite(t)?t%360:0)>0?t:t+360},vt=function(t){return{r:z(t.r,0,255),g:z(t.g,0,255),b:z(t.b,0,255),a:z(t.a)}},et=function(t){return{r:b(t.r),g:b(t.g),b:b(t.b),a:b(t.a,3)}},be=/^#([0-9a-f]{3,8})$/i,B=function(t){var e=t.toString(16);return e.length<2?"0"+e:e},pt=function(t){var e=t.r,n=t.g,r=t.b,i=t.a,a=Math.max(e,n,r),u=a-Math.min(e,n,r),s=u?a===e?(n-r)/u:a===n?2+(r-e)/u:4+(e-n)/u:0;return{h:60*(s<0?s+6:s),s:a?u/a*100:0,v:a/255*100,a:i}},mt=function(t){var e=t.h,n=t.s,r=t.v,i=t.a;e=e/360*6,n/=100,r/=100;var a=Math.floor(e),u=r*(1-n),s=r*(1-(e-a)*n),d=r*(1-(1-e+a)*n),v=a%6;return{r:255*[r,s,u,u,d,r][v],g:255*[d,r,r,s,u,u][v],b:255*[u,u,d,r,r,s][v],a:i}},yt=function(t){return{h:ht(t.h),s:z(t.s,0,100),l:z(t.l,0,100),a:z(t.a)}},bt=function(t){return{h:b(t.h),s:b(t.s),l:b(t.l),a:b(t.a,3)}},St=function(t){return mt((n=(e=t).s,{h:e.h,s:(n*=((r=e.l)<50?r:100-r)/100)>0?2*n/(r+n)*100:0,v:r+n,a:e.a}));var e,n,r},j=function(t){return{h:(e=pt(t)).h,s:(i=(200-(n=e.s))*(r=e.v)/100)>0&&i<200?n*r/100/(i<=100?i:200-i)*100:0,l:i/2,a:e.a};var e,n,r,i},Se=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Ce=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,we=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,_e=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Ct={string:[[function(t){var e=be.exec(t);return e?(t=e[1]).length<=4?{r:parseInt(t[0]+t[0],16),g:parseInt(t[1]+t[1],16),b:parseInt(t[2]+t[2],16),a:t.length===4?b(parseInt(t[3]+t[3],16)/255,2):1}:t.length===6||t.length===8?{r:parseInt(t.substr(0,2),16),g:parseInt(t.substr(2,2),16),b:parseInt(t.substr(4,2),16),a:t.length===8?b(parseInt(t.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(t){var e=we.exec(t)||_e.exec(t);return e?e[2]!==e[4]||e[4]!==e[6]?null:vt({r:Number(e[1])/(e[2]?100/255:1),g:Number(e[3])/(e[4]?100/255:1),b:Number(e[5])/(e[6]?100/255:1),a:e[7]===void 0?1:Number(e[7])/(e[8]?100:1)}):null},"rgb"],[function(t){var e=Se.exec(t)||Ce.exec(t);if(!e)return null;var n,r,i=yt({h:(n=e[1],r=e[2],r===void 0&&(r="deg"),Number(n)*(ye[r]||1)),s:Number(e[3]),l:Number(e[4]),a:e[5]===void 0?1:Number(e[5])/(e[6]?100:1)});return St(i)},"hsl"]],object:[[function(t){var e=t.r,n=t.g,r=t.b,i=t.a,a=i===void 0?1:i;return N(e)&&N(n)&&N(r)?vt({r:Number(e),g:Number(n),b:Number(r),a:Number(a)}):null},"rgb"],[function(t){var e=t.h,n=t.s,r=t.l,i=t.a,a=i===void 0?1:i;if(!N(e)||!N(n)||!N(r))return null;var u=yt({h:Number(e),s:Number(n),l:Number(r),a:Number(a)});return St(u)},"hsl"],[function(t){var e=t.h,n=t.s,r=t.v,i=t.a,a=i===void 0?1:i;if(!N(e)||!N(n)||!N(r))return null;var u=function(s){return{h:ht(s.h),s:z(s.s,0,100),v:z(s.v,0,100),a:z(s.a)}}({h:Number(e),s:Number(n),v:Number(r),a:Number(a)});return mt(u)},"hsv"]]},wt=function(t,e){for(var n=0;n<e.length;n++){var r=e[n][0](t);if(r)return[r,e[n][1]]}return[null,void 0]},ze=function(t){return typeof t=="string"?wt(t.trim(),Ct.string):typeof t=="object"&&t!==null?wt(t,Ct.object):[null,void 0]},nt=function(t,e){var n=j(t);return{h:n.h,s:z(n.s+100*e,0,100),l:n.l,a:n.a}},rt=function(t){return(299*t.r+587*t.g+114*t.b)/1e3/255},_t=function(t,e){var n=j(t);return{h:n.h,s:n.s,l:z(n.l+100*e,0,100),a:n.a}},zt=function(){function t(e){this.parsed=ze(e)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return t.prototype.isValid=function(){return this.parsed!==null},t.prototype.brightness=function(){return b(rt(this.rgba),2)},t.prototype.isDark=function(){return rt(this.rgba)<.5},t.prototype.isLight=function(){return rt(this.rgba)>=.5},t.prototype.toHex=function(){return e=et(this.rgba),n=e.r,r=e.g,i=e.b,u=(a=e.a)<1?B(b(255*a)):"","#"+B(n)+B(r)+B(i)+u;var e,n,r,i,a,u},t.prototype.toRgb=function(){return et(this.rgba)},t.prototype.toRgbString=function(){return e=et(this.rgba),n=e.r,r=e.g,i=e.b,(a=e.a)<1?"rgba("+n+", "+r+", "+i+", "+a+")":"rgb("+n+", "+r+", "+i+")";var e,n,r,i,a},t.prototype.toHsl=function(){return bt(j(this.rgba))},t.prototype.toHslString=function(){return e=bt(j(this.rgba)),n=e.h,r=e.s,i=e.l,(a=e.a)<1?"hsla("+n+", "+r+"%, "+i+"%, "+a+")":"hsl("+n+", "+r+"%, "+i+"%)";var e,n,r,i,a},t.prototype.toHsv=function(){return e=pt(this.rgba),{h:b(e.h),s:b(e.s),v:b(e.v),a:b(e.a,3)};var e},t.prototype.invert=function(){return D({r:255-(e=this.rgba).r,g:255-e.g,b:255-e.b,a:e.a});var e},t.prototype.saturate=function(e){return e===void 0&&(e=.1),D(nt(this.rgba,e))},t.prototype.desaturate=function(e){return e===void 0&&(e=.1),D(nt(this.rgba,-e))},t.prototype.grayscale=function(){return D(nt(this.rgba,-1))},t.prototype.lighten=function(e){return e===void 0&&(e=.1),D(_t(this.rgba,e))},t.prototype.darken=function(e){return e===void 0&&(e=.1),D(_t(this.rgba,-e))},t.prototype.rotate=function(e){return e===void 0&&(e=15),this.hue(this.hue()+e)},t.prototype.alpha=function(e){return typeof e=="number"?D({r:(n=this.rgba).r,g:n.g,b:n.b,a:e}):b(this.rgba.a,3);var n},t.prototype.hue=function(e){var n=j(this.rgba);return typeof e=="number"?D({h:e,s:n.s,l:n.l,a:n.a}):b(n.h)},t.prototype.isEqual=function(e){return this.toHex()===D(e).toHex()},t}(),D=function(t){return t instanceof zt?t:new zt(t)};class Fe{eventListeners=new Map;addEventListener(e,n,r){const i={value:n,options:r},a=this.eventListeners.get(e);return a?Array.isArray(a)?a.push(i):this.eventListeners.set(e,[a,i]):this.eventListeners.set(e,i),this}removeEventListener(e,n,r){if(!n)return this.eventListeners.delete(e),this;const i=this.eventListeners.get(e);if(!i)return this;if(Array.isArray(i)){const a=[];for(let u=0,s=i.length;u<s;u++){const d=i[u];(d.value!==n||typeof r=="object"&&r?.once&&(typeof d.options=="boolean"||!d.options?.once))&&a.push(d)}a.length?this.eventListeners.set(e,a.length===1?a[0]:a):this.eventListeners.delete(e)}else i.value===n&&(typeof r=="boolean"||!r?.once||typeof i.options=="boolean"||i.options?.once)&&this.eventListeners.delete(e);return this}removeAllListeners(){return this.eventListeners.clear(),this}hasEventListener(e){return this.eventListeners.has(e)}dispatchEvent(e,...n){const r=this.eventListeners.get(e);if(r){if(Array.isArray(r))for(let i=r.length,a=0;a<i;a++){const u=r[a];typeof u.options=="object"&&u.options?.once&&this.off(e,u.value,u.options),u.value.apply(this,n)}else typeof r.options=="object"&&r.options?.once&&this.off(e,r.value,r.options),r.value.apply(this,n);return!0}else return!1}on(e,n,r){return this.addEventListener(e,n,r)}once(e,n){return this.addEventListener(e,n,{once:!0})}off(e,n,r){return this.removeEventListener(e,n,r)}emit(e,...n){this.dispatchEvent(e,...n)}}function h(t){return t==null||t==="none"}function R(t,e=0,n=10**e){return Math.round(n*t)/n+0}function w(t,e=!1){if(typeof t!="object"||!t)return t;if(Array.isArray(t))return e?t.map(r=>w(r,e)):t;const n={};for(const r in t){const i=t[r];i!=null&&(e?n[r]=w(i,e):n[r]=i)}return n}function K(t,e){const n={};return e.forEach(r=>{r in t&&(n[r]=t[r])}),n}function x(t,e){if(t===e)return!0;if(t&&e&&typeof t=="object"&&typeof e=="object"){const n=Array.from(new Set([...Object.keys(t),...Object.keys(e)]));return!n.length||n.every(r=>t[r]===e[r])}return!1}function Ft(t,e,n){const r=e.length-1;if(r<0)return t===void 0?n:t;for(let i=0;i<r;i++){if(t==null)return n;t=t[e[i]]}return t==null||t[e[r]]===void 0?n:t[e[r]]}function Et(t,e,n){const r=e.length-1;for(let i=0;i<r;i++)typeof t[e[i]]!="object"&&(t[e[i]]={}),t=t[e[i]];t[e[r]]=n}function Lt(t,e,n){return t==null||!e||typeof e!="string"?n:t[e]!==void 0?t[e]:(e=e.replace(/\[(\w+)\]/g,".$1"),e=e.replace(/^\./,""),Ft(t,e.split("."),n))}function Ot(t,e,n){if(!(typeof t!="object"||!e))return e=e.replace(/\[(\w+)\]/g,".$1"),e=e.replace(/^\./,""),Et(t,e.split("."),n)}class Ee{_map=new WeakMap;_toRaw(e){if(e&&typeof e=="object"){const n=e.__v_raw;n&&(e=this._toRaw(n))}return e}delete(e){return this._map.delete(this._toRaw(e))}get(e){return this._map.get(this._toRaw(e))}has(e){return this._map.has(this._toRaw(e))}set(e,n){return this._map.set(this._toRaw(e),this._toRaw(n)),this}}function it(t){let e;return typeof t=="number"?e={r:t>>24&255,g:t>>16&255,b:t>>8&255,a:(t&255)/255}:e=t,D(e)}function Le(t){return{r:R(t.r),g:R(t.g),b:R(t.b),a:R(t.a,3)}}function U(t){const e=t.toString(16);return e.length<2?`0${e}`:e}const T="#000000FF";function Dt(t){return it(t).isValid()}function C(t,e=!1){const n=it(t);if(!n.isValid()){if(typeof t=="string")return t;const s=`Failed to normalizeColor ${t}`;if(e)throw new Error(s);return console.warn(s),T}const{r,g:i,b:a,a:u}=Le(n.rgba);return`#${U(r)}${U(i)}${U(a)}${U(R(u*255))}`}var X=X||{};X.parse=function(){const t={linearGradient:/^(-(webkit|o|ms|moz)-)?(linear-gradient)/i,repeatingLinearGradient:/^(-(webkit|o|ms|moz)-)?(repeating-linear-gradient)/i,radialGradient:/^(-(webkit|o|ms|moz)-)?(radial-gradient)/i,repeatingRadialGradient:/^(-(webkit|o|ms|moz)-)?(repeating-radial-gradient)/i,sideOrCorner:/^to (left (top|bottom)|right (top|bottom)|top (left|right)|bottom (left|right)|left|right|top|bottom)/i,extentKeywords:/^(closest-side|closest-corner|farthest-side|farthest-corner|contain|cover)/,positionKeywords:/^(left|center|right|top|bottom)/i,pixelValue:/^(-?((\d*\.\d+)|(\d+\.?)))px/,percentageValue:/^(-?((\d*\.\d+)|(\d+\.?)))%/,emValue:/^(-?((\d*\.\d+)|(\d+\.?)))em/,angleValue:/^(-?((\d*\.\d+)|(\d+\.?)))deg/,radianValue:/^(-?((\d*\.\d+)|(\d+\.?)))rad/,startCall:/^\(/,endCall:/^\)/,comma:/^,/,hexColor:/^#([0-9a-f]+)/i,literalColor:/^([a-z]+)/i,rgbColor:/^rgb/i,rgbaColor:/^rgba/i,varColor:/^var/i,calcValue:/^calc/i,variableName:/^(--[a-z0-9-,\s#]+)/i,number:/^((\d*\.\d+)|(\d+\.?))/,hslColor:/^hsl/i,hslaColor:/^hsla/i};let e="";function n(l){const c=new Error(`${e}: ${l}`);throw c.source=e,c}function r(){const l=i();return e.length>0&&n("Invalid input not EOF"),l}function i(){return V(a)}function a(){return u("linear-gradient",t.linearGradient,d)||u("repeating-linear-gradient",t.repeatingLinearGradient,d)||u("radial-gradient",t.radialGradient,g)||u("repeating-radial-gradient",t.repeatingRadialGradient,g)}function u(l,c,f){return s(c,S=>{const A=f();return A&&(y(t.comma)||n("Missing comma before color stops")),{type:l,orientation:A,colorStops:V(dt)}})}function s(l,c){const f=y(l);if(f){y(t.startCall)||n("Missing (");const S=c(f);return y(t.endCall)||n("Missing )"),S}}function d(){const l=v();if(l)return l;const c=_("position-keyword",t.positionKeywords,1);return c?{type:"directional",value:c.value}:p()}function v(){return _("directional",t.sideOrCorner,1)}function p(){return _("angular",t.angleValue,1)||_("angular",t.radianValue,1)}function g(){let l,c=m(),f;return c&&(l=[],l.push(c),f=e,y(t.comma)&&(c=m(),c?l.push(c):e=f)),l}function m(){let l=L()||I();if(l)l.at=O();else{const c=F();if(c){l=c;const f=O();f&&(l.at=f)}else{const f=O();if(f)l={type:"default-radial",at:f};else{const S=k();S&&(l={type:"default-radial",at:S})}}}return l}function L(){const l=_("shape",/^(circle)/i,0);return l&&(l.style=me()||F()),l}function I(){const l=_("shape",/^(ellipse)/i,0);return l&&(l.style=k()||tt()||F()),l}function F(){return _("extent-keyword",t.extentKeywords,1)}function O(){if(_("position",/^at/,0)){const l=k();return l||n("Missing positioning value"),l}}function k(){const l=H();if(l.x||l.y)return{type:"position",value:l}}function H(){return{x:tt(),y:tt()}}function V(l){let c=l();const f=[];if(c)for(f.push(c);y(t.comma);)c=l(),c?f.push(c):n("One extra comma");return f}function dt(){const l=He();return l||n("Expected color definition"),l.length=tt(),l}function He(){return Be()||Ye()||Xe()||xe()||Ke()||Ue()||We()}function We(){return _("literal",t.literalColor,0)}function Be(){return _("hex",t.hexColor,1)}function Ke(){return s(t.rgbColor,()=>({type:"rgb",value:V(W)}))}function xe(){return s(t.rgbaColor,()=>({type:"rgba",value:V(W)}))}function Ue(){return s(t.varColor,()=>({type:"var",value:qe()}))}function Xe(){return s(t.hslColor,()=>{y(t.percentageValue)&&n("HSL hue value must be a number in degrees (0-360) or normalized (-360 to 360), not a percentage");const c=W();y(t.comma);let f=y(t.percentageValue);const S=f?f[1]:null;y(t.comma),f=y(t.percentageValue);const A=f?f[1]:null;return(!S||!A)&&n("Expected percentage value for saturation and lightness in HSL"),{type:"hsl",value:[c,S,A]}})}function Ye(){return s(t.hslaColor,()=>{const l=W();y(t.comma);let c=y(t.percentageValue);const f=c?c[1]:null;y(t.comma),c=y(t.percentageValue);const S=c?c[1]:null;y(t.comma);const A=W();return(!f||!S)&&n("Expected percentage value for saturation and lightness in HSLA"),{type:"hsla",value:[l,f,S,A]}})}function qe(){return y(t.variableName)[1]}function W(){return y(t.number)[1]}function tt(){return _("%",t.percentageValue,1)||Ze()||Je()||me()}function Ze(){return _("position-keyword",t.positionKeywords,1)}function Je(){return s(t.calcValue,()=>{let l=1,c=0;for(;l>0&&c<e.length;){const S=e.charAt(c);S==="("?l++:S===")"&&l--,c++}l>0&&n("Missing closing parenthesis in calc() expression");const f=e.substring(0,c-1);return gt(c-1),{type:"calc",value:f}})}function me(){return _("px",t.pixelValue,1)||_("em",t.emValue,1)}function _(l,c,f){const S=y(c);if(S)return{type:l,value:S[f]}}function y(l){let c,f;return f=/^\s+/.exec(e),f&&gt(f[0].length),c=l.exec(e),c&&gt(c[0].length),c}function gt(l){e=e.substr(l)}return function(l){return e=l.toString().trim(),e.endsWith(";")&&(e=e.slice(0,-1)),r()}}();const Nt=X.parse.bind(X);var Y=Y||{};Y.stringify=function(){var t={"visit_linear-gradient":function(e){return t.visit_gradient(e)},"visit_repeating-linear-gradient":function(e){return t.visit_gradient(e)},"visit_radial-gradient":function(e){return t.visit_gradient(e)},"visit_repeating-radial-gradient":function(e){return t.visit_gradient(e)},visit_gradient:function(e){var n=t.visit(e.orientation);return n&&(n+=", "),e.type+"("+n+t.visit(e.colorStops)+")"},visit_shape:function(e){var n=e.value,r=t.visit(e.at),i=t.visit(e.style);return i&&(n+=" "+i),r&&(n+=" at "+r),n},"visit_default-radial":function(e){var n="",r=t.visit(e.at);return r&&(n+=r),n},"visit_extent-keyword":function(e){var n=e.value,r=t.visit(e.at);return r&&(n+=" at "+r),n},"visit_position-keyword":function(e){return e.value},visit_position:function(e){return t.visit(e.value.x)+" "+t.visit(e.value.y)},"visit_%":function(e){return e.value+"%"},visit_em:function(e){return e.value+"em"},visit_px:function(e){return e.value+"px"},visit_calc:function(e){return"calc("+e.value+")"},visit_literal:function(e){return t.visit_color(e.value,e)},visit_hex:function(e){return t.visit_color("#"+e.value,e)},visit_rgb:function(e){return t.visit_color("rgb("+e.value.join(", ")+")",e)},visit_rgba:function(e){return t.visit_color("rgba("+e.value.join(", ")+")",e)},visit_hsl:function(e){return t.visit_color("hsl("+e.value[0]+", "+e.value[1]+"%, "+e.value[2]+"%)",e)},visit_hsla:function(e){return t.visit_color("hsla("+e.value[0]+", "+e.value[1]+"%, "+e.value[2]+"%, "+e.value[3]+")",e)},visit_var:function(e){return t.visit_color("var("+e.value+")",e)},visit_color:function(e,n){var r=e,i=t.visit(n.length);return i&&(r+=" "+i),r},visit_angular:function(e){return e.value+"deg"},visit_directional:function(e){return"to "+e.value},visit_array:function(e){var n="",r=e.length;return e.forEach(function(i,a){n+=t.visit(i),a<r-1&&(n+=", ")}),n},visit_object:function(e){return e.width&&e.height?t.visit(e.width)+" "+t.visit(e.height):""},visit:function(e){if(!e)return"";if(e instanceof Array)return t.visit_array(e);if(typeof e=="object"&&!e.type)return t.visit_object(e);if(e.type){var n=t["visit_"+e.type];if(n)return n(e);throw Error("Missing visitor visit_"+e.type)}else throw Error("Invalid node.")}};return function(e){return t.visit(e)}}();const Oe=Y.stringify.bind(Y);function Rt(t){const e=t.length-1;return t.map((n,r)=>{const i=n.value;let a=R(r/e,3),u="#00000000";switch(n.type){case"rgb":u=C({r:Number(i[0]??0),g:Number(i[1]??0),b:Number(i[2]??0)});break;case"rgba":u=C({r:Number(i[0]??0),g:Number(i[1]??0),b:Number(i[2]??0),a:Number(i[3]??0)});break;case"literal":u=C(n.value);break;case"hex":u=C(`#${n.value}`);break}switch(n.length?.type){case"%":a=Number(n.length.value)/100;break}return{offset:a,color:u}})}function It(t){let e=0;switch(t.orientation?.type){case"angular":e=Number(t.orientation.value);break}return{type:"linear-gradient",angle:e,stops:Rt(t.colorStops)}}function kt(t){return t.orientation?.map(e=>{switch(e?.type){case"shape":case"default-radial":case"extent-keyword":default:return null}}),{type:"radial-gradient",stops:Rt(t.colorStops)}}function M(t){return t.startsWith("linear-gradient(")||t.startsWith("radial-gradient(")}function At(t){return Nt(t).map(e=>{switch(e?.type){case"linear-gradient":return It(e);case"repeating-linear-gradient":return{...It(e),repeat:!0};case"radial-gradient":return kt(e);case"repeating-radial-gradient":return{...kt(e),repeat:!0};default:return}}).filter(Boolean)}function Gt(t){let e;return typeof t=="string"?e={color:t}:e=t,{color:C(e.color)}}function Pt(t){let e;if(typeof t=="string"?e={image:t}:e=t,e.image){const{type:n,...r}=At(e.image)[0]??{};switch(n){case"radial-gradient":return{radialGradient:r};case"linear-gradient":return{linearGradient:r}}}return e}function Vt(t){let e;return typeof t=="string"?e={image:t}:e=t,e}function jt(t){let e;return typeof t=="string"?e={preset:t}:e=t,{preset:e.preset,foregroundColor:h(e.foregroundColor)?void 0:C(e.foregroundColor),backgroundColor:h(e.backgroundColor)?void 0:C(e.backgroundColor)}}function Tt(t){return!h(t.color)}function Mt(t){return typeof t=="string"?Dt(t):Tt(t)}function $t(t){return!h(t.image)&&M(t.image)||!!t.linearGradient||!!t.radialGradient}function Ht(t){return typeof t=="string"?M(t):$t(t)}function Wt(t){return!h(t.image)&&!M(t.image)}function Bt(t){return typeof t=="string"?!M(t):Wt(t)}function Kt(t){return!h(t.preset)}function xt(t){return typeof t=="string"?!1:Kt(t)}function E(t){const e=t&&typeof t=="object"?t.enabled:void 0;return Mt(t)?w({enabled:e,...Gt(t)}):Ht(t)?w({enabled:e,...Pt(t)}):Bt(t)?w({enabled:e,...Vt(t)}):xt(t)?w({enabled:e,...jt(t)}):{}}function Ut(t){return typeof t=="string"?{...E(t)}:{...E(t),...K(t,["fillWithShape"])}}const ot=Symbol("properties"),Xt=Symbol("defaultValueInited");function q(t){let e;if(Object.hasOwn(t,ot))e=t[ot];else{const n=Object.getPrototypeOf(t);e=new Map(n?q(n):void 0),t[ot]=e}return e}function at(t,e={}){const n=Symbol.for(t),{default:r,fallback:i,alias:a}=e,u={declaration:e,internalKey:n},s=()=>typeof r=="function"?r():r,d=()=>typeof i=="function"?i():i;function v(){let g;if(a&&a!==t?g=Lt(this,a):typeof this.getter<"u"?g=this.getter(t,u):g=this[n],g=g??d(),g===void 0&&r!==void 0&&!this[Xt]){this[Xt]=!0;const m=s();m!==void 0&&(p.call(this,m),g=m)}return g}function p(g){a&&a!==t?Ot(this,a,g):typeof this.setter<"u"?this.setter(t,g,u):this[n]=g}return{get:v,set:p}}function Yt(t,e,n={}){q(t).set(e,n);const r=at(e,n);Object.defineProperty(t.prototype,e,{get(){return r.get.call(this)},set(i){const a=r.get.call(this);r.set.call(this,i),this.onUpdateProperty?.(e,i,a,n)},configurable:!0,enumerable:!0})}function De(t){return function(e,n){if(typeof n!="string")throw new TypeError("Failed to @property decorator, prop name cannot be a symbol");Yt(e.constructor,n,t)}}function Ne(t={}){return function(e,n){const r=n.name;if(typeof r!="string")throw new TypeError("Failed to @property decorator, prop name cannot be a symbol");const i=at(r,t);return{init(a){return q(this.constructor).set(r,t),i.set.call(this,a),a},get(){return i.get.call(this)},set(a){const u=i.get?.call(this);i.set.call(this,a),this.onUpdateProperty?.(r,a,u,t)}}}}function lt(){return{color:T,offsetX:0,offsetY:0,blurRadius:1}}function ut(t){return{...lt(),...w({...t,color:h(t.color)?T:C(t.color)})}}function qt(){return{...lt(),scaleX:1,scaleY:1}}function Zt(t){return{...qt(),...ut(t)}}function Re(t){return t}function Jt(t){return w({...t,softEdge:h(t.softEdge)?void 0:t.softEdge,outerShadow:h(t.outerShadow)?void 0:Zt(t.outerShadow),innerShadow:h(t.innerShadow)?void 0:ut(t.innerShadow)})}function Qt(t){return typeof t=="string"?{...E(t)}:{...E(t),...K(t,["fillWithShape"])}}const Ie="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let ke=(t=21)=>{let e="",n=crypto.getRandomValues(new Uint8Array(t|=0));for(;t--;)e+=Ie[n[t]&63];return e};const te=()=>ke(10),ee=te;function $(t){return typeof t=="string"?{...E(t)}:{...E(t),...K(t,["width","style","headEnd","tailEnd"])}}function ne(t){return typeof t=="string"?{color:C(t)}:{...t,color:h(t.color)?T:C(t.color)}}function re(){return{boxShadow:"none"}}function ie(t){return typeof t=="string"?t.startsWith("<svg")?{svg:t}:{paths:[{data:t}]}:Array.isArray(t)?{paths:t.map(e=>typeof e=="string"?{data:e}:e)}:t}function oe(){return{overflow:"visible",direction:void 0,display:void 0,boxSizing:void 0,width:void 0,height:void 0,maxHeight:void 0,maxWidth:void 0,minHeight:void 0,minWidth:void 0,position:void 0,left:0,top:0,right:void 0,bottom:void 0,borderTop:void 0,borderLeft:void 0,borderRight:void 0,borderBottom:void 0,borderWidth:0,border:void 0,flex:void 0,flexBasis:void 0,flexDirection:void 0,flexGrow:void 0,flexShrink:void 0,flexWrap:void 0,justifyContent:void 0,gap:void 0,alignContent:void 0,alignItems:void 0,alignSelf:void 0,marginTop:void 0,marginLeft:void 0,marginRight:void 0,marginBottom:void 0,margin:void 0,paddingTop:void 0,paddingLeft:void 0,paddingRight:void 0,paddingBottom:void 0,padding:void 0}}function ae(){return{rotate:0,scaleX:1,scaleY:1,skewX:0,skewY:0,translateX:0,translateY:0,transform:"none",transformOrigin:"center"}}function le(){return{...oe(),...ae(),...re(),backgroundImage:"none",backgroundSize:"auto, auto",backgroundColor:"none",backgroundColormap:"none",borderRadius:0,borderColor:"none",borderStyle:"solid",outlineWidth:0,outlineOffset:0,outlineColor:"rgb(0, 0, 0)",outlineStyle:"none",visibility:"visible",filter:"none",opacity:1,pointerEvents:"auto",maskImage:"none"}}function ue(){return{highlight:{},highlightImage:"none",highlightReferImage:"none",highlightColormap:"none",highlightLine:"none",highlightSize:"cover",highlightThickness:"100%"}}function se(){return{listStyle:{},listStyleType:"none",listStyleImage:"none",listStyleColormap:"none",listStyleSize:"cover",listStylePosition:"outside"}}function ce(){return{...ue(),color:"rgb(0, 0, 0)",verticalAlign:"baseline",letterSpacing:0,wordSpacing:0,fontSize:14,fontWeight:"normal",fontFamily:"",fontStyle:"normal",fontKerning:"normal",textTransform:"none",textOrientation:"mixed",textDecoration:"none"}}function fe(){return{...se(),writingMode:"horizontal-tb",textWrap:"wrap",textAlign:"start",textIndent:0,lineHeight:1.2}}function de(){return{...fe(),...ce(),textStrokeWidth:0,textStrokeColor:"rgb(0, 0, 0)"}}function P(t){return w({...t,color:h(t.color)?void 0:C(t.color),backgroundColor:h(t.backgroundColor)?void 0:C(t.backgroundColor),borderColor:h(t.borderColor)?void 0:C(t.borderColor),outlineColor:h(t.outlineColor)?void 0:C(t.outlineColor),shadowColor:h(t.shadowColor)?void 0:C(t.shadowColor)})}function Ae(){return{...le(),...de()}}const st=/\r\n|\n\r|\n|\r/,Ge=new RegExp(`${st.source}|<br\\/>`,"g"),Pe=new RegExp(`^(${st.source})$`),Z=`
2
+ `;function Ve(t){return st.test(t)}function ct(t){return Pe.test(t)}function ge(t){return t.replace(Ge,Z)}function J(t){const e=[];function n(){return e[e.length-1]}function r(s,d,v){const p=s?P(s):{},g=d?E(d):void 0,m=v?$(v):void 0,L=w({...p,fill:g,outline:m,fragments:[]});return e[e.length-1]?.fragments.length===0?e[e.length-1]=L:e.push(L),L}function i(s="",d,v,p){const g=d?P(d):{},m=v?E(v):void 0,L=p?$(p):void 0;Array.from(s).forEach(I=>{if(ct(I)){const{fragments:F,fill:O,outline:k,...H}=n()||r();F.length||F.push(w({...g,fill:m,outline:L,content:Z})),r(H,O,k)}else{const F=n()||r(),O=F.fragments[F.fragments.length-1];if(O){const{content:k,fill:H,outline:V,...dt}=O;if(x(m,H)&&x(L,V)&&x(g,dt)){O.content=`${k}${I}`;return}}F.fragments.push(w({...g,fill:m,outline:L,content:I}))}})}(Array.isArray(t)?t:[t]).forEach(s=>{if(typeof s=="string")r(),i(s);else if(ft(s)){const{content:d,fill:v,outline:p,...g}=s;r(g,v,p),i(d)}else if(he(s)){const{fragments:d,fill:v,outline:p,...g}=s;r(g,v,p),d.forEach(m=>{const{content:L,fill:I,outline:F,...O}=m;i(L,O,I,F)})}else Array.isArray(s)?(r(),s.forEach(d=>{if(typeof d=="string")i(d);else if(ft(d)){const{content:v,fill:p,outline:g,...m}=d;i(v,m,p,g)}})):console.warn("Failed to parse text content",s)});const u=n();return u&&!u.fragments.length&&u.fragments.push({content:Z}),e}function he(t){return t&&typeof t=="object"&&"fragments"in t&&Array.isArray(t.fragments)}function ft(t){return t&&typeof t=="object"&&"content"in t&&typeof t.content=="string"}function ve(t){return typeof t=="string"||Array.isArray(t)?{content:J(t)}:w({...t,content:J(t.content??""),style:t.style?P(t.style):void 0,effects:t.effects?t.effects.map(e=>P(e)):void 0,measureDom:t.measureDom,fonts:t.fonts,fill:t.fill?E(t.fill):void 0,outline:t.outline?$(t.outline):void 0})}function je(t){return J(t).map(e=>{const n=ge(e.fragments.flatMap(r=>r.content).join(""));return ct(n)?"":n}).join(Z)}function pe(t){return typeof t=="string"?{src:t}:t}function Q(t){return w({...t,id:t.id??ee(),style:h(t.style)?void 0:P(t.style),text:h(t.text)?void 0:ve(t.text),background:h(t.background)?void 0:Ut(t.background),shape:h(t.shape)?void 0:ie(t.shape),fill:h(t.fill)?void 0:E(t.fill),outline:h(t.outline)?void 0:$(t.outline),foreground:h(t.foreground)?void 0:Qt(t.foreground),shadow:h(t.shadow)?void 0:ne(t.shadow),video:h(t.video)?void 0:pe(t.video),audio:h(t.audio)?void 0:G(t.audio),effect:h(t.effect)?void 0:Jt(t.effect),children:t.children?.map(e=>Q(e))})}function Te(t){return Q(t)}function Me(t){const e={};for(const n in t.children){const r=Q(t.children[n]);delete r.children,e[n]=r}return{...t,children:e}}function $e(t){const{children:e,...n}=t;function r(s){const{parentId:d,childrenIds:v,...p}=s;return{...p,children:[]}}const i={},a=[],u={...n,children:a};for(const s in e){if(i[s])continue;const d=e[s],v=r(d);i[s]=v;const p=d.parentId;if(p){const g=e[p];let m=i[p];m||e[p]&&(m=r(e[p]),i[p]=m),g?.childrenIds&&m?.children&&m.children.splice(g.childrenIds.indexOf(s),0,v)}else a.push(v)}return u}o.EventEmitter=Fe,o.RawWeakMap=Ee,o.clearUndef=w,o.defaultColor=T,o.defineProperty=Yt,o.flatDocumentToDocument=$e,o.getDeclarations=q,o.getDefaultElementStyle=le,o.getDefaultHighlightStyle=ue,o.getDefaultInnerShadow=lt,o.getDefaultLayoutStyle=oe,o.getDefaultListStyleStyle=se,o.getDefaultOuterShadow=qt,o.getDefaultShadowStyle=re,o.getDefaultStyle=Ae,o.getDefaultTextInlineStyle=ce,o.getDefaultTextLineStyle=fe,o.getDefaultTextStyle=de,o.getDefaultTransformStyle=ae,o.getNestedValue=Ft,o.getObjectValueByPath=Lt,o.getPropertyDescriptor=at,o.hasCRLF=Ve,o.idGenerator=ee,o.isCRLF=ct,o.isColor=Dt,o.isColorFill=Mt,o.isColorFillObject=Tt,o.isEqualObject=x,o.isFragmentObject=ft,o.isGradient=M,o.isGradientFill=Ht,o.isGradientFillObject=$t,o.isImageFill=Bt,o.isImageFillObject=Wt,o.isNone=h,o.isParagraphObject=he,o.isPresetFill=xt,o.isPresetFillObject=Kt,o.nanoid=te,o.normalizeAudio=G,o.normalizeBackground=Ut,o.normalizeCRLF=ge,o.normalizeColor=C,o.normalizeColorFill=Gt,o.normalizeDocument=Te,o.normalizeEffect=Jt,o.normalizeElement=Q,o.normalizeFill=E,o.normalizeFlatDocument=Me,o.normalizeForeground=Qt,o.normalizeGradient=At,o.normalizeGradientFill=Pt,o.normalizeImageFill=Vt,o.normalizeInnerShadow=ut,o.normalizeOuterShadow=Zt,o.normalizeOutline=$,o.normalizePresetFill=jt,o.normalizeShadow=ne,o.normalizeShape=ie,o.normalizeSoftEdge=Re,o.normalizeStyle=P,o.normalizeText=ve,o.normalizeTextContent=J,o.normalizeVideo=pe,o.parseColor=it,o.parseGradient=Nt,o.pick=K,o.property=De,o.property2=Ne,o.round=R,o.setNestedValue=Et,o.setObjectValueByPath=Ot,o.stringifyGradient=Oe,o.textContentToString=je,Object.defineProperty(o,Symbol.toStringTag,{value:"Module"})});
package/dist/index.mjs CHANGED
@@ -986,6 +986,7 @@ function normalizeBackground(background) {
986
986
  }
987
987
 
988
988
  const propertiesSymbol = Symbol("properties");
989
+ const defaultValueInitedSymbol = Symbol("defaultValueInited");
989
990
  function getDeclarations(constructor) {
990
991
  let declarations;
991
992
  if (Object.hasOwn(constructor, propertiesSymbol)) {
@@ -1011,7 +1012,6 @@ function getPropertyDescriptor(key, declaration = {}) {
1011
1012
  const getFallbackValue = () => {
1012
1013
  return typeof fallback === "function" ? fallback() : fallback;
1013
1014
  };
1014
- let isFirst = true;
1015
1015
  function get() {
1016
1016
  let result;
1017
1017
  if (alias && alias !== key) {
@@ -1024,8 +1024,8 @@ function getPropertyDescriptor(key, declaration = {}) {
1024
1024
  }
1025
1025
  }
1026
1026
  result = result ?? getFallbackValue();
1027
- if (result === void 0 && isFirst) {
1028
- isFirst = false;
1027
+ if (result === void 0 && _default !== void 0 && !this[defaultValueInitedSymbol]) {
1028
+ this[defaultValueInitedSymbol] = true;
1029
1029
  const defaultValue = getDefaultValue();
1030
1030
  if (defaultValue !== void 0) {
1031
1031
  set.call(this, defaultValue);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "modern-idoc",
3
3
  "type": "module",
4
- "version": "0.8.5",
4
+ "version": "0.8.6",
5
5
  "packageManager": "pnpm@9.15.1",
6
6
  "description": "Intermediate document for modern codec libs",
7
7
  "author": "wxm",