@likec4/core 1.55.1 → 1.57.0
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/THIRD-PARTY-LICENSES.md +30 -30
- package/dist/_chunks/Builder.view-element.mjs +2 -2
- package/dist/_chunks/LikeC4Model.d.mts +2 -1
- package/dist/_chunks/_types.d.mts +7 -3
- package/dist/_chunks/_types2.d.mts +1 -1
- package/dist/_chunks/assignTagColors.mjs +1 -1
- package/dist/_chunks/index.d.mts +64 -2
- package/dist/_chunks/index3.d.mts +1 -1
- package/dist/_chunks/index4.d.mts +1 -1
- package/dist/_chunks/index5.d.mts +13 -2
- package/dist/_chunks/libs/chroma-js.mjs +15 -0
- package/dist/_chunks/libs/graphology-dag.d.mts +607 -0
- package/dist/_chunks/libs/graphology-dag.mjs +1 -1
- package/dist/_chunks/libs/hast-util-to-html.mjs +1 -1
- package/dist/_chunks/libs/mdast-util-find-and-replace.mjs +1 -1
- package/dist/_chunks/libs/mdast-util-from-markdown.mjs +1 -1
- package/dist/_chunks/libs/mdast-util-gfm.mjs +11 -11
- package/dist/_chunks/libs/mnemonist.d.mts +33 -33
- package/dist/_chunks/libs/mnemonist.mjs +1 -1
- package/dist/_chunks/libs/unified.mjs +1 -1
- package/dist/_chunks/manual-layout.mjs +1 -1
- package/dist/_chunks/mnemonist.d.mts +1 -1
- package/dist/_chunks/model.mjs +4 -4
- package/dist/_chunks/rolldown-runtime.mjs +1 -1
- package/dist/_chunks/types.mjs +1 -1
- package/dist/builder/index.d.mts +2 -8
- package/dist/builder/index.mjs +1 -1
- package/dist/compute-view/index.d.mts +2 -6
- package/dist/compute-view/index.mjs +2 -2
- package/dist/geometry/index.mjs +1 -1
- package/dist/index.d.mts +4 -5
- package/dist/index.mjs +1 -1
- package/dist/model/index.d.mts +0 -5
- package/dist/model/index.mjs +1 -1
- package/dist/styles/index.d.mts +1 -2
- package/dist/styles/index.mjs +1 -1
- package/dist/types/index.d.mts +2 -2
- package/dist/types/index.mjs +1 -1
- package/dist/utils/graphology/index.d.mts +2 -1
- package/dist/utils/graphology/index.mjs +1 -1
- package/dist/utils/index.d.mts +3 -5
- package/dist/utils/index.mjs +1 -1
- package/package.json +10 -10
- package/dist/_chunks/geometry.mjs +0 -1
- package/dist/_chunks/libs/@mantine/colors-generator.mjs +0 -15
- package/dist/_chunks/utils.mjs +0 -1
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import{$ as e,$t as t,A as ee,C as n,Cn as r,D as i,Dn as a,E as o,G as s,H as c,J as l,K as u,Lt as d,O as f,On as p,Q as m,Qt as h,S as g,Sn as _,T as v,U as y,V as b,W as x,X as S,Xt as C,Y as w,Z as T,Zt as E,_ as D,_t as O,a as k,at as A,b as j,bn as M,c as N,cn as P,ct as F,d as I,dn as L,dt as R,en as z,et as B,f as V,fn as H,ft as U,g as W,gt as G,h as K,hn as q,ht as J,i as Y,it as X,j as Z,k as Q,kn as te,l as ne,ln as re,lt as ie,m as $,mn as ae,mt as oe,n as se,nn as ce,nt as le,o as ue,ot as de,p as fe,pt as pe,q as me,r as he,rt as ge,s as _e,st as ve,t as ye,tt as be,u as xe,un as Se,ut as Ce,v as we,vt as Te,w as Ee,wn as De,x as Oe,xn as ke,y as Ae,yt as je}from"./_chunks/types.mjs";import{a as Me,n as Ne,o as Pe,r as Fe,t as Ie}from"./_chunks/libs/mnemonist.mjs";import{i as Le,n as Re,t as ze}from"./_chunks/manual-layout.mjs";import"./styles/index.mjs";var Be=Ie.default,Ve=Ne.default,He=Fe.default,Ue=Me.default,We=Pe.default;export{M as BBox,Be as DefaultMap,Ve as DefaultWeakMap,S as DeploymentFqn,T as EdgeId,u as Expression,m as Fqn,me as FqnExpr,w as FqnRef,e as GlobalFqn,B as GroupElementKind,Z as LikeC4Styles,He as LinkedList,be as MarkdownOrString,y as ModelExpression,x as ModelFqnExpr,s as ModelRelationExpr,Ue as MultiMap,le as NodeId,ge as NoneIcon,X as ProjectId,We as Queue,ke as RectBox,l as RelationExpr,A as RelationId,ye as RichText,de as StepEdgeKind,ve as ViewId,G as _layout,O as _stage,Te as _type,ce as ancestorsFqn,Le as applyCachedLayout,Re as applyManualLayout,ze as calcDriftsFromSnapshot,ee as ensureSizes,te as exact,F as extractStep,ie as flattenMarkdownOrString,Y as getParallelStepsPrefix,E as hasProp,_ as invariant,P as isAncestor,Oe as isAndOperator,h as isAnyOf,N as isAutoLayoutDirection,V as isComputedView,b as isDeployedInstance,c as isDeploymentNode,fe as isDeploymentView,re as isDescendantOf,$ as isDiagramView,$ as isLayoutedView,k as isDynamicStep,ue as isDynamicStepsParallel,_e as isDynamicStepsSeries,K as isDynamicView,W as isElementView,D as isExtendsElementView,Ce as isGlobalFqn,R as isGroupElementKind,C as isIterable,g as isKindEqual,n as isMetadataEqual,t as isNonEmptyArray,Ee as isNotOperator,je as isOnStage,v as isOrOperator,o as isParticipantOperator,Se as isSameHierarchy,we as isScopedElementView,U as isStepEdgeId,z as isString,Q as isTagColorSpecified,i as isTagEqual,ne as isViewRuleAutoLayout,xe as isViewRuleGlobalPredicateRef,I as isViewRuleGlobalStyle,se as isViewRuleGroup,Ae as isViewRulePredicate,he as isViewRuleRank,j as isViewRuleStyle,d as memoizeProp,L as nameFromFqn,r as nonNullable,De as nonexhaustive,H as parentFqn,a as preferDescription,p as preferSummary,pe as scalar,ae as sortNaturalByFqn,q as sortParentsFirst,oe as splitGlobalFqn,J as stepEdgeId,f as whereOperatorAsPredicate};
|
package/dist/model/index.d.mts
CHANGED
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
import "../_chunks/index.mjs";
|
|
2
|
-
import "../_chunks/index2.mjs";
|
|
3
|
-
import "../_chunks/index3.mjs";
|
|
4
|
-
import "../_chunks/libs/mnemonist.mjs";
|
|
5
|
-
import "../_chunks/mnemonist.mjs";
|
|
6
1
|
import { C as ElementModel, S as NodeModel, T as RelationshipModel, _ as WithMetadata, a as DeploymentNodeModel, b as LikeC4ViewsFolder, d as DeploymentOrFqn, f as EdgeOrId, g as OutgoingFilter, h as NodeOrId, i as DeploymentElementModel, l as RelationshipsAccum, m as IncomingFilter, n as LikeC4Model, o as DeploymentRelationEndpoint, p as ElementOrFqn, r as DeployedInstanceModel, s as DeploymentRelationModel, t as AnyLikeC4Model, u as LikeC4DeploymentModel, v as WithTags, w as AnyRelationshipModel, x as EdgeModel, y as LikeC4ViewModel } from "../_chunks/LikeC4Model.mjs";
|
|
7
2
|
import { A as sortDeepestFirst, C as hasSameTarget, D as isOutgoing, E as isNestedConnection, M as DeploymentConnectionModel, N as Connection, O as mergeConnections, S as hasSameSourceTarget, T as isIncoming, _ as differenceConnections, a as isDeployedInstanceModel, b as findDescendantConnections, c as isDeploymentRelationModel, d as isLikeC4ViewModel, f as isNestedElementOfDeployedInstanceModel, g as find_d_exports, h as find_d_exports$1, i as normalizeViewPath, j as ConnectionModel, k as sortConnectionsByBoundaryHierarchy, l as isEdgeModel, m as isRelationModel, n as extractViewTitleFromPath, o as isDeploymentElementModel, p as isNodeModel, r as getViewFolderPath, s as isDeploymentNodeModel, t as VIEW_FOLDERS_SEPARATOR, u as isElementModel, v as findAscendingConnections, w as isAnyInOut, x as hasSameSource, y as findDeepestNestedConnection } from "../_chunks/index4.mjs";
|
|
8
3
|
export { AnyLikeC4Model, AnyRelationshipModel, Connection, ConnectionModel, DeployedInstanceModel, DeploymentConnectionModel, DeploymentElementModel, DeploymentNodeModel, DeploymentOrFqn, DeploymentRelationEndpoint, DeploymentRelationModel, EdgeModel, EdgeOrId, ElementModel, ElementOrFqn, IncomingFilter, LikeC4DeploymentModel, LikeC4Model, LikeC4ViewModel, LikeC4ViewsFolder, NodeModel, NodeOrId, OutgoingFilter, RelationshipModel, RelationshipsAccum, VIEW_FOLDERS_SEPARATOR, WithMetadata, WithTags, find_d_exports as deploymentConnection, differenceConnections, extractViewTitleFromPath, findAscendingConnections, findDeepestNestedConnection, findDescendantConnections, getViewFolderPath, hasSameSource, hasSameSourceTarget, hasSameTarget, isAnyInOut, isDeployedInstanceModel, isDeploymentElementModel, isDeploymentNodeModel, isDeploymentRelationModel, isEdgeModel, isElementModel, isIncoming, isLikeC4ViewModel, isRelationModel as isModelRelation, isRelationModel, isRelationModel as isRelationshipModel, isNestedConnection, isNestedElementOfDeployedInstanceModel, isNodeModel, isOutgoing, mergeConnections, find_d_exports$1 as modelConnection, normalizeViewPath, sortConnectionsByBoundaryHierarchy, sortDeepestFirst };
|
package/dist/model/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import{A as e,B as t,C as n,D as r,E as i,F as a,G as o,H as s,I as c,J as l,K as u,L as d,M as f,N as p,O as m,P as h,R as g,S as _,T as v,U as y,V as b,W as x,_ as S,a as C,b as w,c as T,g as E,h as D,i as O,k,l as A,m as j,n as M,o as N,p as P,q as F,r as I,s as L,t as R,u as z,v as B,w as V,x as H,y as U,z as W}from"../_chunks/model.mjs";export{f as Connection,D as ConnectionModel,x as DeployedInstanceModel,e as DeploymentConnectionModel,o as DeploymentNodeModel,u as DeploymentRelationModel,d as EdgeModel,l as ElementModel,W as LikeC4DeploymentModel,p as LikeC4Model,a as LikeC4ViewModel,h as LikeC4ViewsFolder,c as NodeModel,g as RelationshipModel,F as RelationshipsAccum,t as VIEW_FOLDERS_SEPARATOR,j as deploymentConnection,E as differenceConnections,b as extractViewTitleFromPath,S as findAscendingConnections,B as findDeepestNestedConnection,U as findDescendantConnections,s as getViewFolderPath,w as hasSameSource,H as hasSameSourceTarget,_ as hasSameTarget,n as isAnyInOut,R as isDeployedInstanceModel,M as isDeploymentElementModel,I as isDeploymentNodeModel,O as isDeploymentRelationModel,C as isEdgeModel,N as isElementModel,V as isIncoming,L as isLikeC4ViewModel,z as isModelRelation,z as isRelationModel,z as isRelationshipModel,v as isNestedConnection,T as isNestedElementOfDeployedInstanceModel,A as isNodeModel,i as isOutgoing,r as mergeConnections,P as modelConnection,y as normalizeViewPath,m as sortConnectionsByBoundaryHierarchy,k as sortDeepestFirst};
|
package/dist/styles/index.d.mts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { Ar as
|
|
2
|
-
import "../_chunks/index2.mjs";
|
|
1
|
+
import { Ar as IconPositions, Cr as ThemeColor, Dr as BorderStyles, Er as isThemeColor, Mr as ThemeColors, Or as DefaultTagColors, Sr as TextSize, Tr as isCustomColor, _r as RelationshipColorValues, ar as CustomColor, br as Size, cr as ElementShape, dr as IconSize, fr as LikeC4StyleDefaults, gr as RelationshipArrowTypes, hr as RelationshipArrowType, ir as ColorLiteral, jr as Sizes, kr as ElementShapes, lr as HexColor, mr as LikeC4Theme, nr as BorderStyle, or as CustomColorDefinitions, pr as LikeC4StylesConfig, rr as Color, sr as ElementColorValues, ur as IconPosition, vr as RelationshipLineType, wr as ThemeColorValues, xr as SpacingSize, yr as ShapeSize } from "../_chunks/index.mjs";
|
|
3
2
|
import { a as assignTagColors, i as LikeC4Styles, n as styleDefaults, r as computeColorValues, t as defaultTheme } from "../_chunks/index3.mjs";
|
|
4
3
|
export { BorderStyle, BorderStyles, Color, ColorLiteral, CustomColor, CustomColorDefinitions, DefaultTagColors, ElementColorValues, ElementShape, ElementShapes, HexColor, IconPosition, IconPositions, IconSize, LikeC4StyleDefaults, LikeC4Styles, LikeC4StylesConfig, LikeC4Theme, RelationshipArrowType, RelationshipArrowTypes, RelationshipColorValues, RelationshipLineType, ShapeSize, Size, Sizes, SpacingSize, TextSize, ThemeColor, ThemeColorValues, ThemeColors, assignTagColors, computeColorValues, defaultTheme, isCustomColor, isThemeColor, styleDefaults };
|
package/dist/styles/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import{B as e,F as t,I as n,L as r,M as i,N as a,P as o,R as s,j as c,z as l}from"../_chunks/types.mjs";import{t as u}from"../_chunks/assignTagColors.mjs";const d=[`none`,`normal`,`onormal`,`dot`,`odot`,`diamond`,`odiamond`,`crow`,`open`,`vee`];function f(t){return e.includes(t)}function p(e){return!f(e)}export{t as BorderStyles,n as DefaultTagColors,r as ElementShapes,s as IconPositions,c as LikeC4Styles,d as RelationshipArrowTypes,l as Sizes,e as ThemeColors,u as assignTagColors,o as computeColorValues,i as defaultTheme,p as isCustomColor,f as isThemeColor,a as styleDefaults};
|
package/dist/types/index.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { $ as
|
|
1
|
+
import { $ as DiagramNodeDriftReason, $i as Coalesce, $n as isTagEqual, $t as ElementViewIncludePredicate, A as isComputedView, Ai as ProjectId, An as ModelRelationExpr, Ar as IconPositions, At as ElementStyle, B as DeploymentViewIncludePredicate, Bi as flattenMarkdownOrString, Bn as NotOperator, Bt as DynamicStep, C as LayoutedView, Ci as GlobalFqn, Cn as ViewWithNotation, Cr as ThemeColor, Ct as DeploymentNode, D as ViewRule, Di as MarkdownOrString, Dn as isViewRuleGlobalStyle, Dr as BorderStyles, Dt as isDeploymentNode, E as ViewOnStage, Ei as IconUrl, En as isViewRuleGlobalPredicateRef, Er as isThemeColor, Et as isDeployedInstance, F as isExtendsElementView, Fi as StepEdgeIdLiteral, Fn as AndOperator, Fr as AnyLayouted, Ft as GlobalPredicateId, G as ParsedViewRuleAncestors, Gi as splitGlobalFqn, Gn as TagEqual, Gt as DynamicViewRule, H as DeploymentViewRule, Hi as isGroupElementKind, Hn as OrOperator, Ht as DynamicStepsSeries, I as isScopedElementView, Ii as StepEdgeKind, In as EqualOperator, Ir as AnyParsed, It as GlobalPredicates, J as LayoutType, Ji as ModelStage, Jn as isKindEqual, Jt as getParallelStepsPrefix, K as DiagramEdge, Ki as stepEdgeId, Kn as WhereOperator, Kt as DynamicViewStep, L as isViewRulePredicate, Li as Tag, Ln as Filterable, Lr as Aux, Lt as GlobalStyleID, M as isDiagramView, Mi as RelationKind, Mn as FqnExpr, Mr as ThemeColors, Mt as Relationship, N as isDynamicView, Ni as RelationshipKind, Nn as PredicateSelector, Nr as Any, Nt as ensureSizes, O as ViewRulePredicate, Oi as NodeId, On as ModelExpression, Ot as AbstractRelationship, P as isElementView, Pi as StepEdgeId, Pn as RelationExpr, Pr as AnyComputed, Pt as GlobalDynamicPredicates, Q as DiagramEdgeDriftReason, Qi as isOnStage, Qn as isParticipantOperator, Qt as ElementViewExcludePredicate, R as isViewRuleStyle, Ri as ViewId, Rn as KindEqual, Rt as GlobalStyles, S as ComputedView, Si as Fqn, Sn as ViewWithHash, Sr as TextSize, St as DeploymentElementRef, T as ProcessedView, Ti as Icon, Tn as isViewRuleAutoLayout, Tr as isCustomColor, Tt as DeploymentRelationship, U as DeploymentViewRuleStyle, Ui as isStepEdgeId, Un as Participant, Ut as DynamicViewDisplayVariant, V as DeploymentViewPredicate, Vi as isGlobalFqn, Vn as OperatorPredicate, Vt as DynamicStepsParallel, W as ParsedDeploymentView, Wi as scalar_d_exports, Wn as ParticipantOperator, Wt as DynamicViewIncludeRule, X as LayoutedDynamicView, Xi as _stage, Xn as isNotOperator, Xt as isDynamicStepsParallel, Y as LayoutedDeploymentView, Yi as _layout, Yn as isMetadataEqual, Yt as isDynamicStep, Z as LayoutedElementView, Zi as _type, Zn as isOrOperator, Zt as isDynamicStepsSeries, _ as ComputedLikeC4ModelData, _i as BuiltInIcon, _n as ViewRuleAutoLayout, _r as RelationshipColorValues, _t as Specification, a as isNonEmptyArray, aa as NTuple, an as ParsedElementView, ar as CustomColor, at as ComputedElementView, b as ParsedLikeC4ModelData, bi as EdgeId, bn as ViewRuleRank, br as Size, bt as DeployedInstance, c as RichTextEmpty, ca as Predicate, ci as UnknownLayouted, cn as AnyExcludePredicate, cr as ElementShape, ct as ComputedRankConstraint, d as AuxFromDump, di as _aux_d_exports, dn as AutoLayoutDirection, dr as IconSize, dt as LikeC4ProjectStyleDefaults, ea as ExclusiveUnion, en as ElementViewPredicate, er as whereOperatorAsPredicate, et as LayoutedViewDriftReason, f as LikeC4ModelDump, fi as preferDescription, fn as BaseParsedViewProperties, fr as LikeC4StyleDefaults, ft as LikeC4ProjectStylesConfig, g as AuxFromLikeC4ModelData, gi as AnyFqn, gn as ViewAutoLayout, gr as RelationshipArrowTypes, gt as RelationshipSpecification, h as SpecificationDump, hn as RankValue, hr as RelationshipArrowType, ht as ElementSpecification, i as isAnyOf, ia as Link, in as ElementViewRuleStyle, ir as ColorLiteral, it as ComputedEdge, j as isDeploymentView, ji as RelationId, jn as Expression, jr as Sizes, jt as ModelRelation, k as ViewWithType, ki as NoneIcon, kn as ModelFqnExpr, kr as ElementShapes, kt as Element, l as RichTextOrEmpty, la as ReorderedArray, li as UnknownParsed, ln as AnyIncludePredicate, lr as HexColor, lt as LikeC4Project, m as SpecTypesFromDump, mn as NodeNotation, mr as LikeC4Theme, mt as LikeC4ProjectTheme, n as GuardedBy, na as IteratorLike, nn as ElementViewRuleGroup, nr as BorderStyle, nt as ComputedDeploymentView, o as isString, oa as NonEmptyArray, oi as Unknown, on as isViewRuleGroup, or as CustomColorDefinitions, ot as ComputedNode, p as ProjectDump, pi as preferSummary, pn as BaseViewProperties, pr as LikeC4StylesConfig, pt as LikeC4ProjectStylesCustomStylesheets, q as DiagramNode, qi as ExtractOnStage, qn as isAndOperator, qr as LooseLiteral, qt as ParsedDynamicView, r as hasProp, ra as KeysOf, rn as ElementViewRuleRank, rr as Color, rt as ComputedDynamicView, s as RichText, sa as NonEmptyReadonlyArray, si as UnknownComputed, sn as isViewRuleRank, sr as ElementColorValues, st as ComputedNodeStyle, t as Guard, ta as IterableContainer, ti as SpecAux, tn as ElementViewRule, tr as FqnRef, tt as ViewManualLayoutSnapshot, u as ViewChange, ua as exact, un as AnyViewRuleStyle, ur as IconPosition, ut as LikeC4ProjectManualLayoutsConfig, v as LayoutedLikeC4ModelData, vi as DeploymentFqn, vn as ViewRuleGlobalPredicateRef, vr as RelationshipLineType, vt as TagSpecification, w as ParsedView, wi as GroupElementKind, wn as isAutoLayoutDirection, wr as ThemeColorValues, wt as DeploymentRelation, x as AnyView, xi as ElementKind, xn as ViewType, xr as SpacingSize, xt as DeploymentElement, y as LikeC4ModelData, yi as DeploymentKind, yn as ViewRuleGlobalStyle, yr as ShapeSize, yt as isTagColorSpecified, z as DeploymentViewExcludePredicate, zi as extractStep, zn as MetadataEqual, zt as ModelGlobals } from "../_chunks/index.mjs";
|
|
2
2
|
import { a as RectBox, c as XYPoint, i as BBox, l as convertPoint, n as VectorValue, o as Dimensions, r as vector, s as Point, t as Vector, u as isPoint } from "../_chunks/index2.mjs";
|
|
3
|
-
export { AbstractRelationship, AndOperator, Any, Any as AnyAux, AnyComputed, AnyExcludePredicate, AnyFqn, AnyIncludePredicate, AnyLayouted, AnyParsed, AnyView, AnyViewRuleStyle, AutoLayoutDirection, Aux, AuxFromDump, AuxFromLikeC4ModelData, BBox, BaseParsedViewProperties, BaseViewProperties, BorderStyle, BorderStyles, BuiltInIcon, Coalesce, Color, ColorLiteral, ComputedDeploymentView, ComputedDynamicView, ComputedEdge, ComputedElementView, ComputedLikeC4ModelData, ComputedNode, ComputedNodeStyle, ComputedRankConstraint, ComputedView, CustomColor, CustomColorDefinitions, DeployedInstance, DeploymentElement, DeploymentElementRef, DeploymentFqn, DeploymentKind, DeploymentNode, DeploymentRelation, DeploymentRelationship, DeploymentViewExcludePredicate, DeploymentViewIncludePredicate, DeploymentViewPredicate, DeploymentViewRule, DeploymentViewRuleStyle, DiagramEdge, DiagramEdgeDriftReason, DiagramNode, DiagramNodeDriftReason, LayoutedView as DiagramView, LayoutedView, Dimensions, DynamicStep, DynamicStepsParallel, DynamicStepsSeries, DynamicViewDisplayVariant, DynamicViewIncludeRule, DynamicViewRule, DynamicViewStep, EdgeId, Element, ElementColorValues, ElementKind, ElementShape, ElementShapes, ElementSpecification, ElementStyle, ElementViewExcludePredicate, ElementViewIncludePredicate, ElementViewPredicate, ElementViewRule, ElementViewRuleGroup, ElementViewRuleRank, ElementViewRuleStyle, EqualOperator, ExclusiveUnion, Expression, ExtractOnStage, Filterable, Fqn, FqnExpr, FqnRef, GlobalDynamicPredicates, GlobalFqn, GlobalPredicateId, GlobalPredicates, GlobalStyleID, GlobalStyles, GroupElementKind, Guard, GuardedBy, HexColor, Icon, IconPosition, IconPositions, IconSize, IconUrl, IterableContainer, IteratorLike, KeysOf, KindEqual, LayoutType, LayoutedDeploymentView, LayoutedDynamicView, LayoutedElementView, LayoutedLikeC4ModelData, LayoutedViewDriftReason, LikeC4ModelData, LikeC4ModelDump, LikeC4Project, LikeC4ProjectManualLayoutsConfig, LikeC4ProjectStyleDefaults, LikeC4ProjectStylesConfig, LikeC4ProjectStylesCustomStylesheets, LikeC4ProjectTheme, LikeC4StyleDefaults, LikeC4StylesConfig, LikeC4Theme, ParsedView as LikeC4View, ParsedView, Link, LooseLiteral, MarkdownOrString, MetadataEqual, ModelExpression, ModelFqnExpr, ModelGlobals, ModelRelation, ModelRelationExpr, ModelStage, NTuple, NodeId, NodeNotation, NonEmptyArray, NonEmptyReadonlyArray, NoneIcon, NotOperator, OperatorPredicate, OrOperator, ParsedDeploymentView, ParsedDynamicView, ParsedElementView, ParsedLikeC4ModelData, Participant, ParticipantOperator, Point, Predicate, PredicateSelector, ProcessedView, ProjectDump, ProjectId, RankValue, RectBox, RelationExpr, RelationId, RelationKind, Relationship, RelationshipArrowType, RelationshipArrowTypes, RelationshipColorValues, RelationshipKind, RelationshipLineType, RelationshipSpecification, ReorderedArray, RichText, RichTextEmpty, RichTextOrEmpty, ShapeSize, Size, Sizes, SpacingSize, SpecAux, SpecTypesFromDump, Specification, SpecificationDump, StepEdgeId, StepEdgeIdLiteral, StepEdgeKind, Tag, TagEqual, TagSpecification, TextSize, ThemeColor, ThemeColorValues, ThemeColors, Unknown, UnknownComputed, UnknownLayouted, UnknownParsed, Vector, VectorValue, ViewAutoLayout, ViewChange, ViewId, ViewManualLayoutSnapshot, ViewOnStage, ViewRule, ViewRuleAutoLayout, ViewRuleGlobalPredicateRef, ViewRuleGlobalStyle, ViewRulePredicate, ViewRuleRank, ViewType, ViewWithHash, ViewWithNotation, ViewWithType, WhereOperator, XYPoint, _layout, _stage, _type, _aux_d_exports as aux, convertPoint, ensureSizes, exact, extractStep, flattenMarkdownOrString, getParallelStepsPrefix, hasProp, isAndOperator, isAnyOf, isAutoLayoutDirection, isComputedView, isCustomColor, isDeployedInstance, isDeploymentNode, isDeploymentView, isDiagramView, isDiagramView as isLayoutedView, isDynamicStep, isDynamicStepsParallel, isDynamicStepsSeries, isDynamicView, isElementView, isExtendsElementView, isGlobalFqn, isGroupElementKind, isKindEqual, isMetadataEqual, isNonEmptyArray, isNotOperator, isOnStage, isOrOperator, isParticipantOperator, isPoint, isScopedElementView, isStepEdgeId, isString, isTagColorSpecified, isTagEqual, isThemeColor, isViewRuleAutoLayout, isViewRuleGlobalPredicateRef, isViewRuleGlobalStyle, isViewRuleGroup, isViewRulePredicate, isViewRuleRank, isViewRuleStyle, preferDescription, preferSummary, scalar_d_exports as scalar, splitGlobalFqn, stepEdgeId, vector, whereOperatorAsPredicate };
|
|
3
|
+
export { AbstractRelationship, AndOperator, Any, Any as AnyAux, AnyComputed, AnyExcludePredicate, AnyFqn, AnyIncludePredicate, AnyLayouted, AnyParsed, AnyView, AnyViewRuleStyle, AutoLayoutDirection, Aux, AuxFromDump, AuxFromLikeC4ModelData, BBox, BaseParsedViewProperties, BaseViewProperties, BorderStyle, BorderStyles, BuiltInIcon, Coalesce, Color, ColorLiteral, ComputedDeploymentView, ComputedDynamicView, ComputedEdge, ComputedElementView, ComputedLikeC4ModelData, ComputedNode, ComputedNodeStyle, ComputedRankConstraint, ComputedView, CustomColor, CustomColorDefinitions, DeployedInstance, DeploymentElement, DeploymentElementRef, DeploymentFqn, DeploymentKind, DeploymentNode, DeploymentRelation, DeploymentRelationship, DeploymentViewExcludePredicate, DeploymentViewIncludePredicate, DeploymentViewPredicate, DeploymentViewRule, DeploymentViewRuleStyle, DiagramEdge, DiagramEdgeDriftReason, DiagramNode, DiagramNodeDriftReason, LayoutedView as DiagramView, LayoutedView, Dimensions, DynamicStep, DynamicStepsParallel, DynamicStepsSeries, DynamicViewDisplayVariant, DynamicViewIncludeRule, DynamicViewRule, DynamicViewStep, EdgeId, Element, ElementColorValues, ElementKind, ElementShape, ElementShapes, ElementSpecification, ElementStyle, ElementViewExcludePredicate, ElementViewIncludePredicate, ElementViewPredicate, ElementViewRule, ElementViewRuleGroup, ElementViewRuleRank, ElementViewRuleStyle, EqualOperator, ExclusiveUnion, Expression, ExtractOnStage, Filterable, Fqn, FqnExpr, FqnRef, GlobalDynamicPredicates, GlobalFqn, GlobalPredicateId, GlobalPredicates, GlobalStyleID, GlobalStyles, GroupElementKind, Guard, GuardedBy, HexColor, Icon, IconPosition, IconPositions, IconSize, IconUrl, IterableContainer, IteratorLike, KeysOf, KindEqual, LayoutType, LayoutedDeploymentView, LayoutedDynamicView, LayoutedElementView, LayoutedLikeC4ModelData, LayoutedViewDriftReason, LikeC4ModelData, LikeC4ModelDump, LikeC4Project, LikeC4ProjectManualLayoutsConfig, LikeC4ProjectStyleDefaults, LikeC4ProjectStylesConfig, LikeC4ProjectStylesCustomStylesheets, LikeC4ProjectTheme, LikeC4StyleDefaults, LikeC4StylesConfig, LikeC4Theme, ParsedView as LikeC4View, ParsedView, Link, LooseLiteral, MarkdownOrString, MetadataEqual, ModelExpression, ModelFqnExpr, ModelGlobals, ModelRelation, ModelRelationExpr, ModelStage, NTuple, NodeId, NodeNotation, NonEmptyArray, NonEmptyReadonlyArray, NoneIcon, NotOperator, OperatorPredicate, OrOperator, ParsedDeploymentView, ParsedDynamicView, ParsedElementView, ParsedLikeC4ModelData, ParsedViewRuleAncestors, Participant, ParticipantOperator, Point, Predicate, PredicateSelector, ProcessedView, ProjectDump, ProjectId, RankValue, RectBox, RelationExpr, RelationId, RelationKind, Relationship, RelationshipArrowType, RelationshipArrowTypes, RelationshipColorValues, RelationshipKind, RelationshipLineType, RelationshipSpecification, ReorderedArray, RichText, RichTextEmpty, RichTextOrEmpty, ShapeSize, Size, Sizes, SpacingSize, SpecAux, SpecTypesFromDump, Specification, SpecificationDump, StepEdgeId, StepEdgeIdLiteral, StepEdgeKind, Tag, TagEqual, TagSpecification, TextSize, ThemeColor, ThemeColorValues, ThemeColors, Unknown, UnknownComputed, UnknownLayouted, UnknownParsed, Vector, VectorValue, ViewAutoLayout, ViewChange, ViewId, ViewManualLayoutSnapshot, ViewOnStage, ViewRule, ViewRuleAutoLayout, ViewRuleGlobalPredicateRef, ViewRuleGlobalStyle, ViewRulePredicate, ViewRuleRank, ViewType, ViewWithHash, ViewWithNotation, ViewWithType, WhereOperator, XYPoint, _layout, _stage, _type, _aux_d_exports as aux, convertPoint, ensureSizes, exact, extractStep, flattenMarkdownOrString, getParallelStepsPrefix, hasProp, isAndOperator, isAnyOf, isAutoLayoutDirection, isComputedView, isCustomColor, isDeployedInstance, isDeploymentNode, isDeploymentView, isDiagramView, isDiagramView as isLayoutedView, isDynamicStep, isDynamicStepsParallel, isDynamicStepsSeries, isDynamicView, isElementView, isExtendsElementView, isGlobalFqn, isGroupElementKind, isKindEqual, isMetadataEqual, isNonEmptyArray, isNotOperator, isOnStage, isOrOperator, isParticipantOperator, isPoint, isScopedElementView, isStepEdgeId, isString, isTagColorSpecified, isTagEqual, isThemeColor, isViewRuleAutoLayout, isViewRuleGlobalPredicateRef, isViewRuleGlobalStyle, isViewRuleGroup, isViewRulePredicate, isViewRuleRank, isViewRuleStyle, preferDescription, preferSummary, scalar_d_exports as scalar, splitGlobalFqn, stepEdgeId, vector, whereOperatorAsPredicate };
|
package/dist/types/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import{$ as e,$t as t,A as n,C as r,D as i,Dn as a,E as o,G as s,H as c,J as l,K as u,O as d,On as f,Q as p,Qt as m,S as h,T as g,U as _,V as v,W as y,X as b,Y as x,Z as S,Zt as C,_ as w,_t as T,a as E,at as D,b as O,bn as k,c as A,ct as j,d as M,dt as N,en as P,et as F,f as I,ft as L,g as ee,gt as R,h as z,ht as B,i as V,it as H,k as U,kn as W,l as G,lt as K,m as q,mt as J,n as Y,nt as X,o as Z,ot as Q,p as $,pt as te,q as ne,r as re,rt as ie,s as ae,st as oe,t as se,tt as ce,u as le,ut as ue,v as de,vt as fe,w as pe,x as me,xn as he,y as ge,yt as _e}from"../_chunks/types.mjs";export{k as BBox,b as DeploymentFqn,S as EdgeId,u as Expression,p as Fqn,ne as FqnExpr,x as FqnRef,e as GlobalFqn,F as GroupElementKind,ce as MarkdownOrString,_ as ModelExpression,y as ModelFqnExpr,s as ModelRelationExpr,X as NodeId,ie as NoneIcon,H as ProjectId,he as RectBox,l as RelationExpr,D as RelationId,se as RichText,Q as StepEdgeKind,oe as ViewId,R as _layout,T as _stage,fe as _type,n as ensureSizes,W as exact,j as extractStep,K as flattenMarkdownOrString,V as getParallelStepsPrefix,C as hasProp,me as isAndOperator,m as isAnyOf,A as isAutoLayoutDirection,I as isComputedView,v as isDeployedInstance,c as isDeploymentNode,$ as isDeploymentView,q as isDiagramView,q as isLayoutedView,E as isDynamicStep,Z as isDynamicStepsParallel,ae as isDynamicStepsSeries,z as isDynamicView,ee as isElementView,w as isExtendsElementView,ue as isGlobalFqn,N as isGroupElementKind,h as isKindEqual,r as isMetadataEqual,t as isNonEmptyArray,pe as isNotOperator,_e as isOnStage,g as isOrOperator,o as isParticipantOperator,de as isScopedElementView,L as isStepEdgeId,P as isString,U as isTagColorSpecified,i as isTagEqual,G as isViewRuleAutoLayout,le as isViewRuleGlobalPredicateRef,M as isViewRuleGlobalStyle,Y as isViewRuleGroup,ge as isViewRulePredicate,re as isViewRuleRank,O as isViewRuleStyle,a as preferDescription,f as preferSummary,te as scalar,J as splitGlobalFqn,B as stepEdgeId,d as whereOperatorAsPredicate};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{r as e}from"../../_chunks/rolldown-runtime.mjs";import{n as t,t as n}from"../../_chunks/libs/graphology-dag.mjs";import{t as r}from"../../_chunks/libs/graphology.mjs";var i=t(),a=e(n(),1),o=i.topologicalSort,s=a.default;export{r as Graph,a as n,i as t,o as topologicalSort,s as willCreateCycle};
|
package/dist/utils/index.d.mts
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import { a as isNonEmptyArray, o as isString } from "../_chunks/index.mjs";
|
|
2
|
-
import "../_chunks/
|
|
3
|
-
import { a as
|
|
4
|
-
|
|
5
|
-
import { A as commonAncestor, B as sortByFqnHierarchically, C as iflat, D as isIterable, E as ifilter, F as isAncestor, G as sortNatural, H as sortParentsFirst, I as isDescendantOf, J as nonNullable, K as commonHead, L as isSameHierarchy, M as compareFqnHierarchically, N as hierarchyDistance, O as getOrCreate, P as hierarchyLevel, R as nameFromFqn, S as iflatMap, T as ifind, U as compareNatural, V as sortNaturalByFqn, W as compareNaturalHierarchically, Y as nonexhaustive, _ as toSet, a as difference, b as imap, c as symmetricDifference, d as delay, f as onNextTick, g as toArray, h as iunique, i as objectHash, j as compareByFqnHierarchically, k as ancestorsFqn, l as union, m as memoizeProp, n as markdownToHtml, o as equals, p as promiseNextTick, q as invariant, r as stringHash, s as intersection, t as markdownToText, u as compareRelations, v as isome, w as ifirst, x as ihead, y as ireduce, z as parentFqn } from "../_chunks/index5.mjs";
|
|
6
|
-
export { DefaultMap, DefaultWeakMap, LinkedList, MultiMap, Queue, Stack, ancestorsFqn, commonAncestor, commonHead, compareByFqnHierarchically, compareFqnHierarchically, compareNatural, compareNaturalHierarchically, compareRelations, delay, difference, equals as equalsSet, getOrCreate, hierarchyDistance, hierarchyLevel, ifilter, ifind, ifirst, iflat, iflatMap, ihead, imap, intersection, invariant, ireduce, isAncestor, isDescendantOf, isIterable, isNonEmptyArray, isSameHierarchy, isString, isome, iunique, markdownToHtml, markdownToText, memoizeProp, nameFromFqn, nonNullable, nonexhaustive, objectHash, onNextTick, parentFqn, promiseNextTick, sortByFqnHierarchically, sortNatural, sortNaturalByFqn, sortParentsFirst, stringHash, symmetricDifference, toArray, toSet, union };
|
|
2
|
+
import { a as DefaultWeakMap, i as LinkedList, n as Queue, o as DefaultMap, r as MultiMap, t as Stack } from "../_chunks/libs/mnemonist.mjs";
|
|
3
|
+
import { A as ancestorsFqn, B as parentFqn, C as iflatMap, D as ifilter, E as ifind, F as hierarchyLevel, G as compareNaturalHierarchically, H as sortNaturalByFqn, I as isAncestor, J as invariant, K as sortNatural, L as isDescendantOf, M as compareByFqnHierarchically, N as compareFqnHierarchically, O as isIterable, P as hierarchyDistance, R as isSameHierarchy, S as ihead, T as ifirst, U as sortParentsFirst, V as sortByFqnHierarchically, W as compareNatural, X as nonexhaustive, Y as nonNullable, _ as toArray, a as objectHash, b as ireduce, c as intersection, d as compareRelations, f as delay, g as iunique, h as memoizeProp, i as stringHash, j as commonAncestor, k as getOrCreate, l as symmetricDifference, m as promiseNextTick, n as markdownToText, o as difference, p as onNextTick, q as commonHead, r as markdownToHtml, s as equals, t as unsafePartial, u as union, v as toSet, w as iflat, x as imap, y as isome, z as nameFromFqn } from "../_chunks/index5.mjs";
|
|
4
|
+
export { DefaultMap, DefaultWeakMap, LinkedList, MultiMap, Queue, Stack, ancestorsFqn, commonAncestor, commonHead, compareByFqnHierarchically, compareFqnHierarchically, compareNatural, compareNaturalHierarchically, compareRelations, delay, difference, equals as equalsSet, getOrCreate, hierarchyDistance, hierarchyLevel, ifilter, ifind, ifirst, iflat, iflatMap, ihead, imap, intersection, invariant, ireduce, isAncestor, isDescendantOf, isIterable, isNonEmptyArray, isSameHierarchy, isString, isome, iunique, markdownToHtml, markdownToText, memoizeProp, nameFromFqn, nonNullable, nonexhaustive, objectHash, onNextTick, parentFqn, promiseNextTick, sortByFqnHierarchically, sortNatural, sortNaturalByFqn, sortParentsFirst, stringHash, symmetricDifference, toArray, toSet, union, unsafePartial };
|
package/dist/utils/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import{$t as e,At as t,Bt as n,Cn as r,Ct as i,Dt as a,Et as o,Ft as s,Gt as c,Ht as l,It as u,Jt as d,Kt as f,Lt as p,Mt as m,Nt as h,Ot as g,Pt as _,Rt as v,Sn as y,St as b,Tt as x,Ut as S,Vt as C,Wt as w,Xt as T,Yt as E,_n as D,an as O,cn as k,dn as A,en as j,fn as M,gn as N,hn as P,in as F,jt as I,ln as L,mn as R,nn as z,on as B,pn as V,qt as H,rn as U,sn as W,tn as G,un as K,vn as q,wn as J,wt as Y,yn as X,zt as Z}from"../_chunks/types.mjs";import{a as Q,c as $,n as ee,o as te,r as ne,t as re}from"../_chunks/libs/mnemonist.mjs";var ie=re.default,ae=ee.default,oe=ne.default,se=Q.default,ce=te.default,le=$.default;export{ie as DefaultMap,ae as DefaultWeakMap,oe as LinkedList,se as MultiMap,ce as Queue,le as Stack,z as ancestorsFqn,U as commonAncestor,X as commonHead,F as compareByFqnHierarchically,O as compareFqnHierarchically,N as compareNatural,D as compareNaturalHierarchically,h as compareRelations,_ as delay,a as difference,g as equalsSet,G as getOrCreate,B as hierarchyDistance,W as hierarchyLevel,E as ifilter,d as ifind,H as ifirst,f as iflat,c as iflatMap,w as ihead,S as imap,t as intersection,y as invariant,l as ireduce,k as isAncestor,L as isDescendantOf,T as isIterable,e as isNonEmptyArray,K as isSameHierarchy,j as isString,C as isome,v as iunique,Y as markdownToHtml,i as markdownToText,p as memoizeProp,A as nameFromFqn,r as nonNullable,J as nonexhaustive,o as objectHash,s as onNextTick,M as parentFqn,u as promiseNextTick,V as sortByFqnHierarchically,q as sortNatural,R as sortNaturalByFqn,P as sortParentsFirst,x as stringHash,I as symmetricDifference,Z as toArray,n as toSet,m as union,b as unsafePartial};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@likec4/core",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.57.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"homepage": "https://likec4.dev",
|
|
6
6
|
"author": "Denis Davydkov <denis@davydkov.com>",
|
|
@@ -108,17 +108,17 @@
|
|
|
108
108
|
},
|
|
109
109
|
"devDependencies": {
|
|
110
110
|
"@dagrejs/dagre": "1.1.8",
|
|
111
|
-
"@mantine/colors-generator": "
|
|
111
|
+
"@mantine/colors-generator": "9.2.1",
|
|
112
112
|
"@rolldown/plugin-node-polyfills": "^1.0.3",
|
|
113
113
|
"@types/chroma-js": "^3.1.2",
|
|
114
114
|
"@types/extend": "3.0.4",
|
|
115
115
|
"@types/hast": "3.0.4",
|
|
116
116
|
"@types/mdast": "4.0.4",
|
|
117
117
|
"@types/natural-compare-lite": "^1.4.2",
|
|
118
|
-
"@types/node": "~22.19.
|
|
118
|
+
"@types/node": "~22.19.19",
|
|
119
119
|
"@types/unist": "3.0.3",
|
|
120
|
-
"@typescript/native-preview": "7.0.0-dev.
|
|
121
|
-
"chroma-js": "
|
|
120
|
+
"@typescript/native-preview": "7.0.0-dev.20260504.1",
|
|
121
|
+
"chroma-js": "3.2.0",
|
|
122
122
|
"defu": "^6.1.7",
|
|
123
123
|
"fdir": "6.4.0",
|
|
124
124
|
"graphology": "^0.26.0",
|
|
@@ -141,14 +141,14 @@
|
|
|
141
141
|
"remark-parse": "11.0.0",
|
|
142
142
|
"remark-rehype": "11.1.2",
|
|
143
143
|
"remeda": "^2.33.7",
|
|
144
|
-
"turbo": "2.9.
|
|
144
|
+
"turbo": "2.9.14",
|
|
145
145
|
"typescript": "5.9.3",
|
|
146
146
|
"unified": "11.0.5",
|
|
147
147
|
"vitest": "4.1.3",
|
|
148
|
-
"@likec4/devops": "1.
|
|
149
|
-
"@likec4/
|
|
150
|
-
"@likec4/
|
|
151
|
-
"@likec4/tsconfig": "1.
|
|
148
|
+
"@likec4/devops": "1.57.0",
|
|
149
|
+
"@likec4/style-preset": "1.57.0",
|
|
150
|
+
"@likec4/styles": "1.57.0",
|
|
151
|
+
"@likec4/tsconfig": "1.57.0"
|
|
152
152
|
},
|
|
153
153
|
"scripts": {
|
|
154
154
|
"typecheck": "tsc -b --verbose",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Q as e}from"./libs/remeda.mjs";import{Q as t}from"./utils.mjs";function n(e){return Array.isArray(e)&&e.length===2&&typeof e[0]==`number`&&typeof e[1]==`number`}function r(e){return n(e)?{x:e[0],y:e[1]}:[e.x,e.y]}const i={center({x:e,y:t,width:n,height:r}){return{x:e+n/2,y:t+r/2}},toPoints({x:e,y:t,width:n,height:r}){return[{x:e,y:t},{x:e+n,y:t},{x:e+n,y:t+r},{x:e,y:t+r}]},fromPoints(e){let{x1:t,y1:n,x2:r,y2:i}=a.fromPoints(e);return{x:t,y:n,width:r-t,height:i-n}},merge(...n){if(t(e(n,1),`No boxes provided`),n.length===1)return n[0];let r=n[0].x,i=n[0].y,a=n[0].x+n[0].width,o=n[0].y+n[0].height;for(let e=1;e<n.length;e++){let t=n[e];r=Math.min(r,t.x),i=Math.min(i,t.y),a=Math.max(a,t.x+t.width),o=Math.max(o,t.y+t.height)}return{x:Math.floor(r),y:Math.floor(i),width:Math.round(a-r),height:Math.round(o-i)}},fromRectBox(e){return{x:Math.min(e.x1,e.x2),y:Math.min(e.y1,e.y2),width:Math.abs(e.x2-e.x1),height:Math.abs(e.y2-e.y1)}},toRectBox(e){return{x1:e.x,y1:e.y,x2:e.x+e.width,y2:e.y+e.height}},expand(e,t){return t===0?e:{x:e.x-t,y:e.y-t,width:e.width+t*2,height:e.height+t*2}},shrink(e,t){return t===0?e:{x:e.x+t,y:e.y+t,width:e.width-t*2,height:e.height-t*2}},includes(e,t){return e===t?!0:e.x<=t.x&&e.y<=t.y&&e.x+e.width>=t.x+t.width&&e.y+e.height>=t.y+t.height}},a={center({x1:e,y1:t,x2:n,y2:r}){return{x:(e+n)/2,y:(t+r)/2}},fromPoints(e){t(e.length>0,`At least one point is required`);let n=1/0,r=1/0,i=-1/0,a=-1/0;for(let[t,o]of e)n=Math.min(n,t),r=Math.min(r,o),i=Math.max(i,t),a=Math.max(a,o);return{x1:n,y1:r,x2:i,y2:a}},merge(...e){t(e.length>0,`No boxes provided`);let n=1/0,r=1/0,i=-1/0,a=-1/0;for(let t of e)n=Math.min(n,t.x1),r=Math.min(r,t.y1),i=Math.max(i,t.x2),a=Math.max(a,t.y2);return{x1:n,y1:r,x2:i,y2:a}},toBBox(e){return{x:e.x1,y:e.y1,width:e.x2-e.x1,height:e.y2-e.y1}},includes(e,t){return e===t?!0:e.x1<=t.x1&&e.y1<=t.y1&&e.x2>=t.x2&&e.y2>=t.y2}};var o=class e{constructor(e,n){this.x=e,this.y=n,t(typeof e==`number`&&!isNaN(e)&&isFinite(e)&&typeof n==`number`&&!isNaN(n)&&isFinite(n),`Invalid arguments for Vector: (${e}, ${n})`)}static create(...t){return t.length===2?new e(t[0],t[1]):new e(t[0].x,t[0].y)}static add(e,t){return{x:e.x+t.x,y:e.y+t.y}}static subtract(e,t){return{x:e.x-t.x,y:e.y-t.y}}static multiply(e,t){return{x:e.x*t,y:e.y*t}}static divide(e,t){return{x:e.x/t,y:e.y/t}}static dot(e,t){return e.x*t.x+e.y*t.y}add(t){return new e(this.x+t.x,this.y+t.y)}subtract(t){return new e(this.x-t.x,this.y-t.y)}multiply(t){return new e(this.x*t,this.y*t)}divide(t){return new e(this.x/t,this.y/t)}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}length(){return this.x===0&&this.y===0?0:Math.sqrt(this.x**2+this.y**2)}normalize(){let t=this.length();return t===0?new e(0,0):new e(this.x/t,this.y/t)}round(){return new e(Math.round(this.x),Math.round(this.y))}trunc(){return new e(Math.trunc(this.x),Math.trunc(this.y))}toObject(){return{x:this.x,y:this.y}}};function s(...e){return e.length===1&&e[0]instanceof o?e[0]:e.length===2?new o(e[0],e[1]):new o(e[0].x,e[0].y)}export{r as a,a as i,s as n,n as o,i as r,o as t};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
const{min:e,max:t}=Math;var n=(n,r=0,i=1)=>e(t(r,n),i),r=e=>{e._clipped=!1,e._unclipped=e.slice(0);for(let t=0;t<=3;t++)t<3?((e[t]<0||e[t]>255)&&(e._clipped=!0),e[t]=n(e[t],0,255)):t===3&&(e[t]=n(e[t],0,1));return e};const i={};for(let e of[`Boolean`,`Number`,`String`,`Function`,`Array`,`Date`,`RegExp`,`Undefined`,`Null`])i[`[object ${e}]`]=e.toLowerCase();function a(e){return i[Object.prototype.toString.call(e)]||`object`}var o=(e,t=null)=>e.length>=3?Array.prototype.slice.call(e):a(e[0])==`object`&&t?t.split(``).filter(t=>e[0][t]!==void 0).map(t=>e[0][t]):e[0].slice(0),s=e=>{if(e.length<2)return null;let t=e.length-1;return a(e[t])==`string`?e[t].toLowerCase():null};const{PI:c,min:l,max:u}=Math,d=e=>Math.round(e*100)/100,f=e=>Math.round(e*100)/100,p=c*2,m=c/3,h=c/180,g=180/c;function _(e){return[...e.slice(0,3).reverse(),...e.slice(3)]}var v={format:{},autodetect:[]},y=class{constructor(...e){let t=this;if(a(e[0])===`object`&&e[0].constructor&&e[0].constructor===this.constructor)return e[0];let n=s(e),i=!1;if(!n){i=!0,v.sorted||=(v.autodetect=v.autodetect.sort((e,t)=>t.p-e.p),!0);for(let t of v.autodetect)if(n=t.test(...e),n)break}if(v.format[n])t._rgb=r(v.format[n].apply(null,i?e:e.slice(0,-1)));else throw Error(`unknown format: `+e);t._rgb.length===3&&t._rgb.push(1)}toString(){return a(this.hex)==`function`?this.hex():`[${this._rgb.join(`,`)}]`}};const b=(...e)=>new y(...e);b.version=`3.2.0`;const x={aliceblue:`#f0f8ff`,antiquewhite:`#faebd7`,aqua:`#00ffff`,aquamarine:`#7fffd4`,azure:`#f0ffff`,beige:`#f5f5dc`,bisque:`#ffe4c4`,black:`#000000`,blanchedalmond:`#ffebcd`,blue:`#0000ff`,blueviolet:`#8a2be2`,brown:`#a52a2a`,burlywood:`#deb887`,cadetblue:`#5f9ea0`,chartreuse:`#7fff00`,chocolate:`#d2691e`,coral:`#ff7f50`,cornflowerblue:`#6495ed`,cornsilk:`#fff8dc`,crimson:`#dc143c`,cyan:`#00ffff`,darkblue:`#00008b`,darkcyan:`#008b8b`,darkgoldenrod:`#b8860b`,darkgray:`#a9a9a9`,darkgreen:`#006400`,darkgrey:`#a9a9a9`,darkkhaki:`#bdb76b`,darkmagenta:`#8b008b`,darkolivegreen:`#556b2f`,darkorange:`#ff8c00`,darkorchid:`#9932cc`,darkred:`#8b0000`,darksalmon:`#e9967a`,darkseagreen:`#8fbc8f`,darkslateblue:`#483d8b`,darkslategray:`#2f4f4f`,darkslategrey:`#2f4f4f`,darkturquoise:`#00ced1`,darkviolet:`#9400d3`,deeppink:`#ff1493`,deepskyblue:`#00bfff`,dimgray:`#696969`,dimgrey:`#696969`,dodgerblue:`#1e90ff`,firebrick:`#b22222`,floralwhite:`#fffaf0`,forestgreen:`#228b22`,fuchsia:`#ff00ff`,gainsboro:`#dcdcdc`,ghostwhite:`#f8f8ff`,gold:`#ffd700`,goldenrod:`#daa520`,gray:`#808080`,green:`#008000`,greenyellow:`#adff2f`,grey:`#808080`,honeydew:`#f0fff0`,hotpink:`#ff69b4`,indianred:`#cd5c5c`,indigo:`#4b0082`,ivory:`#fffff0`,khaki:`#f0e68c`,laserlemon:`#ffff54`,lavender:`#e6e6fa`,lavenderblush:`#fff0f5`,lawngreen:`#7cfc00`,lemonchiffon:`#fffacd`,lightblue:`#add8e6`,lightcoral:`#f08080`,lightcyan:`#e0ffff`,lightgoldenrod:`#fafad2`,lightgoldenrodyellow:`#fafad2`,lightgray:`#d3d3d3`,lightgreen:`#90ee90`,lightgrey:`#d3d3d3`,lightpink:`#ffb6c1`,lightsalmon:`#ffa07a`,lightseagreen:`#20b2aa`,lightskyblue:`#87cefa`,lightslategray:`#778899`,lightslategrey:`#778899`,lightsteelblue:`#b0c4de`,lightyellow:`#ffffe0`,lime:`#00ff00`,limegreen:`#32cd32`,linen:`#faf0e6`,magenta:`#ff00ff`,maroon:`#800000`,maroon2:`#7f0000`,maroon3:`#b03060`,mediumaquamarine:`#66cdaa`,mediumblue:`#0000cd`,mediumorchid:`#ba55d3`,mediumpurple:`#9370db`,mediumseagreen:`#3cb371`,mediumslateblue:`#7b68ee`,mediumspringgreen:`#00fa9a`,mediumturquoise:`#48d1cc`,mediumvioletred:`#c71585`,midnightblue:`#191970`,mintcream:`#f5fffa`,mistyrose:`#ffe4e1`,moccasin:`#ffe4b5`,navajowhite:`#ffdead`,navy:`#000080`,oldlace:`#fdf5e6`,olive:`#808000`,olivedrab:`#6b8e23`,orange:`#ffa500`,orangered:`#ff4500`,orchid:`#da70d6`,palegoldenrod:`#eee8aa`,palegreen:`#98fb98`,paleturquoise:`#afeeee`,palevioletred:`#db7093`,papayawhip:`#ffefd5`,peachpuff:`#ffdab9`,peru:`#cd853f`,pink:`#ffc0cb`,plum:`#dda0dd`,powderblue:`#b0e0e6`,purple:`#800080`,purple2:`#7f007f`,purple3:`#a020f0`,rebeccapurple:`#663399`,red:`#ff0000`,rosybrown:`#bc8f8f`,royalblue:`#4169e1`,saddlebrown:`#8b4513`,salmon:`#fa8072`,sandybrown:`#f4a460`,seagreen:`#2e8b57`,seashell:`#fff5ee`,sienna:`#a0522d`,silver:`#c0c0c0`,skyblue:`#87ceeb`,slateblue:`#6a5acd`,slategray:`#708090`,slategrey:`#708090`,snow:`#fffafa`,springgreen:`#00ff7f`,steelblue:`#4682b4`,tan:`#d2b48c`,teal:`#008080`,thistle:`#d8bfd8`,tomato:`#ff6347`,turquoise:`#40e0d0`,violet:`#ee82ee`,wheat:`#f5deb3`,white:`#ffffff`,whitesmoke:`#f5f5f5`,yellow:`#ffff00`,yellowgreen:`#9acd32`},S=/^#?([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/,C=/^#?([A-Fa-f0-9]{8}|[A-Fa-f0-9]{4})$/,w=e=>{if(e.match(S)){(e.length===4||e.length===7)&&(e=e.substr(1)),e.length===3&&(e=e.split(``),e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]);let t=parseInt(e,16);return[t>>16,t>>8&255,t&255,1]}if(e.match(C)){(e.length===5||e.length===9)&&(e=e.substr(1)),e.length===4&&(e=e.split(``),e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]+e[3]+e[3]);let t=parseInt(e,16);return[t>>24&255,t>>16&255,t>>8&255,Math.round((t&255)/255*100)/100]}throw Error(`unknown hex color: ${e}`)},{round:T}=Math,E=(...e)=>{let[t,n,r,i]=o(e,`rgba`),a=s(e)||`auto`;i===void 0&&(i=1),a===`auto`&&(a=i<1?`rgba`:`rgb`),t=T(t),n=T(n),r=T(r);let c=`000000`+(t<<16|n<<8|r).toString(16);c=c.substr(c.length-6);let l=`0`+T(i*255).toString(16);switch(l=l.substr(l.length-2),a.toLowerCase()){case`rgba`:return`#${c}${l}`;case`argb`:return`#${l}${c}`;default:return`#${c}`}};y.prototype.name=function(){let e=E(this._rgb,`rgb`);for(let t of Object.keys(x))if(x[t]===e)return t.toLowerCase();return e},v.format.named=e=>{if(e=e.toLowerCase(),x[e])return w(x[e]);throw Error(`unknown color name: `+e)},v.autodetect.push({p:5,test:(e,...t)=>{if(!t.length&&a(e)===`string`&&x[e.toLowerCase()])return`named`}}),y.prototype.alpha=function(e,t=!1){return e!==void 0&&a(e)===`number`?t?(this._rgb[3]=e,this):new y([this._rgb[0],this._rgb[1],this._rgb[2],e],`rgb`):this._rgb[3]},y.prototype.clipped=function(){return this._rgb._clipped||!1};const D={Kn:18,labWhitePoint:`d65`,Xn:.95047,Yn:1,Zn:1.08883,t0:.137931034,t1:.206896552,t2:.12841855,t3:.008856452,kE:216/24389,kKE:8,kK:24389/27,RefWhiteRGB:{X:.95047,Y:1,Z:1.08883},MtxRGB2XYZ:{m00:.4124564390896922,m01:.21267285140562253,m02:.0193338955823293,m10:.357576077643909,m11:.715152155287818,m12:.11919202588130297,m20:.18043748326639894,m21:.07217499330655958,m22:.9503040785363679},MtxXYZ2RGB:{m00:3.2404541621141045,m01:-.9692660305051868,m02:.055643430959114726,m10:-1.5371385127977166,m11:1.8760108454466942,m12:-.2040259135167538,m20:-.498531409556016,m21:.041556017530349834,m22:1.0572251882231791},As:.9414285350000001,Bs:1.040417467,Cs:1.089532651,MtxAdaptMa:{m00:.8951,m01:-.7502,m02:.0389,m10:.2664,m11:1.7135,m12:-.0685,m20:-.1614,m21:.0367,m22:1.0296},MtxAdaptMaI:{m00:.9869929054667123,m01:.43230526972339456,m02:-.008528664575177328,m10:-.14705425642099013,m11:.5183602715367776,m12:.04004282165408487,m20:.15996265166373125,m21:.0492912282128556,m22:.9684866957875502}},O=new Map([[`a`,[1.0985,.35585]],[`b`,[1.0985,.35585]],[`c`,[.98074,1.18232]],[`d50`,[.96422,.82521]],[`d55`,[.95682,.92149]],[`d65`,[.95047,1.08883]],[`e`,[1,1,1]],[`f2`,[.99186,.67393]],[`f7`,[.95041,1.08747]],[`f11`,[1.00962,.6435]],[`icc`,[.96422,.82521]]]);function k(e){let t=O.get(String(e).toLowerCase());if(!t)throw Error(`unknown Lab illuminant `+e);D.labWhitePoint=e,D.Xn=t[0],D.Zn=t[1]}function A(){return D.labWhitePoint}const j=(...e)=>{e=o(e,`lab`);let[t,n,r]=e,[i,a,s]=ee(t,n,r),[c,l,u]=te(i,a,s);return[c,l,u,e.length>3?e[3]:1]},ee=(e,t,n)=>{let{kE:r,kK:i,kKE:a,Xn:o,Yn:s,Zn:c}=D,l=(e+16)/116,u=.002*t+l,d=l-.005*n,f=u*u*u,p=d*d*d,m=f>r?f:(116*u-16)/i,h=e>a?((e+16)/116)**3:e/i,g=p>r?p:(116*d-16)/i;return[m*o,h*s,g*c]},M=e=>{let t=Math.sign(e);return e=Math.abs(e),(e<=.0031308?e*12.92:1.055*e**(1/2.4)-.055)*t},te=(e,t,n)=>{let{MtxAdaptMa:r,MtxAdaptMaI:i,MtxXYZ2RGB:a,RefWhiteRGB:o,Xn:s,Yn:c,Zn:l}=D,u=s*r.m00+c*r.m10+l*r.m20,d=s*r.m01+c*r.m11+l*r.m21,f=s*r.m02+c*r.m12+l*r.m22,p=o.X*r.m00+o.Y*r.m10+o.Z*r.m20,m=o.X*r.m01+o.Y*r.m11+o.Z*r.m21,h=o.X*r.m02+o.Y*r.m12+o.Z*r.m22,g=(e*r.m00+t*r.m10+n*r.m20)*(p/u),_=(e*r.m01+t*r.m11+n*r.m21)*(m/d),v=(e*r.m02+t*r.m12+n*r.m22)*(h/f),y=g*i.m00+_*i.m10+v*i.m20,b=g*i.m01+_*i.m11+v*i.m21,x=g*i.m02+_*i.m12+v*i.m22,S=M(y*a.m00+b*a.m10+x*a.m20),C=M(y*a.m01+b*a.m11+x*a.m21),w=M(y*a.m02+b*a.m12+x*a.m22);return[S*255,C*255,w*255]},N=(...e)=>{let[t,n,r,...i]=o(e,`rgb`),[a,s,c]=ie(t,n,r),[l,u,d]=ne(a,s,c);return[l,u,d,...i.length>0&&i[0]<1?[i[0]]:[]]};function ne(e,t,n){let{Xn:r,Yn:i,Zn:a,kE:o,kK:s}=D,c=e/r,l=t/i,u=n/a,d=c>o?c**(1/3):(s*c+16)/116,f=l>o?l**(1/3):(s*l+16)/116,p=u>o?u**(1/3):(s*u+16)/116;return[116*f-16,500*(d-f),200*(f-p)]}function re(e){let t=Math.sign(e);return e=Math.abs(e),(e<=.04045?e/12.92:((e+.055)/1.055)**2.4)*t}const ie=(e,t,n)=>{e=re(e/255),t=re(t/255),n=re(n/255);let{MtxRGB2XYZ:r,MtxAdaptMa:i,MtxAdaptMaI:a,Xn:o,Yn:s,Zn:c,As:l,Bs:u,Cs:d}=D,f=e*r.m00+t*r.m10+n*r.m20,p=e*r.m01+t*r.m11+n*r.m21,m=e*r.m02+t*r.m12+n*r.m22,h=o*i.m00+s*i.m10+c*i.m20,g=o*i.m01+s*i.m11+c*i.m21,_=o*i.m02+s*i.m12+c*i.m22,v=f*i.m00+p*i.m10+m*i.m20,y=f*i.m01+p*i.m11+m*i.m21,b=f*i.m02+p*i.m12+m*i.m22;return v*=h/l,y*=g/u,b*=_/d,f=v*a.m00+y*a.m10+b*a.m20,p=v*a.m01+y*a.m11+b*a.m21,m=v*a.m02+y*a.m12+b*a.m22,[f,p,m]};y.prototype.lab=function(){return N(this._rgb)};const ae=(...e)=>new y(...e,`lab`);Object.assign(b,{lab:ae,getLabWhitePoint:A,setLabWhitePoint:k}),v.format.lab=j,v.autodetect.push({p:2,test:(...e)=>{if(e=o(e,`lab`),a(e)===`array`&&e.length===3)return`lab`}}),y.prototype.darken=function(e=1){let t=this,n=t.lab();return n[0]-=D.Kn*e,new y(n,`lab`).alpha(t.alpha(),!0)},y.prototype.brighten=function(e=1){return this.darken(-e)},y.prototype.darker=y.prototype.darken,y.prototype.brighter=y.prototype.brighten,y.prototype.get=function(e){let[t,n]=e.split(`.`),r=this[t]();if(n){let e=t.indexOf(n)-(t.substr(0,2)===`ok`?2:0);if(e>-1)return r[e];throw Error(`unknown channel ${n} in mode ${t}`)}else return r};const{pow:oe}=Math;y.prototype.luminance=function(e,t=`rgb`){if(e!==void 0&&a(e)===`number`){if(e===0)return new y([0,0,0,this._rgb[3]],`rgb`);if(e===1)return new y([255,255,255,this._rgb[3]],`rgb`);let n=this.luminance(),r=20,i=(n,a)=>{let o=n.interpolate(a,.5,t),s=o.luminance();return Math.abs(e-s)<1e-7||!r--?o:s>e?i(n,o):i(o,a)};return new y([...(n>e?i(new y([0,0,0]),this):i(this,new y([255,255,255]))).rgb(),this._rgb[3]])}return se(...this._rgb.slice(0,3))};const se=(e,t,n)=>(e=ce(e),t=ce(t),n=ce(n),.2126*e+.7152*t+.0722*n),ce=e=>(e/=255,e<=.03928?e/12.92:oe((e+.055)/1.055,2.4));var P={},F=(e,t,n=.5,...r)=>{let i=r[0]||`lrgb`;if(!P[i]&&!r.length&&(i=Object.keys(P)[0]),!P[i])throw Error(`interpolation mode ${i} is not defined`);return a(e)!==`object`&&(e=new y(e)),a(t)!==`object`&&(t=new y(t)),P[i](e,t,n).alpha(e.alpha()+n*(t.alpha()-e.alpha()))};y.prototype.mix=y.prototype.interpolate=function(e,t=.5,...n){return F(this,e,t,...n)},y.prototype.premultiply=function(e=!1){let t=this._rgb,n=t[3];return e?(this._rgb=[t[0]*n,t[1]*n,t[2]*n,n],this):new y([t[0]*n,t[1]*n,t[2]*n,n],`rgb`)};const{sin:le,cos:ue}=Math,de=(...e)=>{let[t,n,r]=o(e,`lch`);return isNaN(r)&&(r=0),r*=h,[t,ue(r)*n,le(r)*n]},fe=(...e)=>{e=o(e,`lch`);let[t,n,r]=e,[i,a,s]=de(t,n,r),[c,l,u]=j(i,a,s);return[c,l,u,e.length>3?e[3]:1]},pe=(...e)=>fe(..._(o(e,`hcl`))),{sqrt:me,atan2:he,round:ge}=Math,_e=(...e)=>{let[t,n,r]=o(e,`lab`),i=me(n*n+r*r),a=(he(r,n)*g+360)%360;return ge(i*1e4)===0&&(a=NaN),[t,i,a]},ve=(...e)=>{let[t,n,r,...i]=o(e,`rgb`),[a,s,c]=N(t,n,r),[l,u,d]=_e(a,s,c);return[l,u,d,...i.length>0&&i[0]<1?[i[0]]:[]]};y.prototype.lch=function(){return ve(this._rgb)},y.prototype.hcl=function(){return _(ve(this._rgb))};const ye=(...e)=>new y(...e,`lch`),be=(...e)=>new y(...e,`hcl`);Object.assign(b,{lch:ye,hcl:be}),v.format.lch=fe,v.format.hcl=pe,[`lch`,`hcl`].forEach(e=>v.autodetect.push({p:2,test:(...t)=>{if(t=o(t,e),a(t)===`array`&&t.length===3)return e}})),y.prototype.saturate=function(e=1){let t=this,n=t.lch();return n[1]+=D.Kn*e,n[1]<0&&(n[1]=0),new y(n,`lch`).alpha(t.alpha(),!0)},y.prototype.desaturate=function(e=1){return this.saturate(-e)},y.prototype.set=function(e,t,n=!1){let[r,i]=e.split(`.`),o=this[r]();if(i){let e=r.indexOf(i)-(r.substr(0,2)===`ok`?2:0);if(e>-1){if(a(t)==`string`)switch(t.charAt(0)){case`+`:o[e]+=+t;break;case`-`:o[e]+=+t;break;case`*`:o[e]*=+t.substr(1);break;case`/`:o[e]/=+t.substr(1);break;default:o[e]=+t}else if(a(t)===`number`)o[e]=t;else throw Error(`unsupported value for Color.set`);let i=new y(o,r);return n?(this._rgb=i._rgb,this):i}throw Error(`unknown channel ${i} in mode ${r}`)}else return o},y.prototype.tint=function(e=.5,...t){return F(this,`white`,e,...t)},y.prototype.shade=function(e=.5,...t){return F(this,`black`,e,...t)};const xe=(e,t,n)=>{let r=e._rgb,i=t._rgb;return new y(r[0]+n*(i[0]-r[0]),r[1]+n*(i[1]-r[1]),r[2]+n*(i[2]-r[2]),`rgb`)};P.rgb=xe;const{sqrt:Se,pow:I}=Math,Ce=(e,t,n)=>{let[r,i,a]=e._rgb,[o,s,c]=t._rgb;return new y(Se(I(r,2)*(1-n)+I(o,2)*n),Se(I(i,2)*(1-n)+I(s,2)*n),Se(I(a,2)*(1-n)+I(c,2)*n),`rgb`)};P.lrgb=Ce;const we=(e,t,n)=>{let r=e.lab(),i=t.lab();return new y(r[0]+n*(i[0]-r[0]),r[1]+n*(i[1]-r[1]),r[2]+n*(i[2]-r[2]),`lab`)};P.lab=we;var L=(e,t,n,r)=>{let i,a;r===`hsl`?(i=e.hsl(),a=t.hsl()):r===`hsv`?(i=e.hsv(),a=t.hsv()):r===`hcg`?(i=e.hcg(),a=t.hcg()):r===`hsi`?(i=e.hsi(),a=t.hsi()):r===`lch`||r===`hcl`?(r=`hcl`,i=e.hcl(),a=t.hcl()):r===`oklch`&&(i=e.oklch().reverse(),a=t.oklch().reverse());let o,s,c,l,u,d;(r.substr(0,1)===`h`||r===`oklch`)&&([o,c,u]=i,[s,l,d]=a);let f,p,m,h;return!isNaN(o)&&!isNaN(s)?(h=s>o&&s-o>180?s-(o+360):s<o&&o-s>180?s+360-o:s-o,p=o+n*h):isNaN(o)?isNaN(s)?p=NaN:(p=s,(u==1||u==0)&&r!=`hsv`&&(f=l)):(p=o,(d==1||d==0)&&r!=`hsv`&&(f=c)),f===void 0&&(f=c+n*(l-c)),m=u+n*(d-u),r===`oklch`?new y([m,f,p],r):new y([p,f,m],r)};const Te=(e,t,n)=>L(e,t,n,`lch`);P.lch=Te,P.hcl=Te;const Ee=e=>{if(a(e)==`number`&&e>=0&&e<=16777215)return[e>>16,e>>8&255,e&255,1];throw Error(`unknown num color: `+e)},De=(...e)=>{let[t,n,r]=o(e,`rgb`);return(t<<16)+(n<<8)+r};y.prototype.num=function(){return De(this._rgb)};const Oe=(...e)=>new y(...e,`num`);Object.assign(b,{num:Oe}),v.format.num=Ee,v.autodetect.push({p:5,test:(...e)=>{if(e.length===1&&a(e[0])===`number`&&e[0]>=0&&e[0]<=16777215)return`num`}});const ke=(e,t,n)=>{let r=e.num();return new y(r+n*(t.num()-r),`num`)};P.num=ke;const{floor:Ae}=Math,je=(...e)=>{e=o(e,`hcg`);let[t,n,r]=e,i,a,s;r*=255;let c=n*255;if(n===0)i=a=s=r;else{t===360&&(t=0),t>360&&(t-=360),t<0&&(t+=360),t/=60;let e=Ae(t),o=t-e,l=r*(1-n),u=l+c*(1-o),d=l+c*o,f=l+c;switch(e){case 0:[i,a,s]=[f,d,l];break;case 1:[i,a,s]=[u,f,l];break;case 2:[i,a,s]=[l,f,d];break;case 3:[i,a,s]=[l,u,f];break;case 4:[i,a,s]=[d,l,f];break;case 5:[i,a,s]=[f,l,u];break}}return[i,a,s,e.length>3?e[3]:1]},Me=(...e)=>{let[t,n,r]=o(e,`rgb`),i=l(t,n,r),a=u(t,n,r),s=a-i,c=s*100/255,d=i/(255-s)*100,f;return s===0?f=NaN:(t===a&&(f=(n-r)/s),n===a&&(f=2+(r-t)/s),r===a&&(f=4+(t-n)/s),f*=60,f<0&&(f+=360)),[f,c,d]};y.prototype.hcg=function(){return Me(this._rgb)};const Ne=(...e)=>new y(...e,`hcg`);b.hcg=Ne,v.format.hcg=je,v.autodetect.push({p:1,test:(...e)=>{if(e=o(e,`hcg`),a(e)===`array`&&e.length===3)return`hcg`}});const Pe=(e,t,n)=>L(e,t,n,`hcg`);P.hcg=Pe;const{cos:R}=Math,Fe=(...e)=>{e=o(e,`hsi`);let[t,r,i]=e,a,s,c;return isNaN(t)&&(t=0),isNaN(r)&&(r=0),t>360&&(t-=360),t<0&&(t+=360),t/=360,t<1/3?(c=(1-r)/3,a=(1+r*R(p*t)/R(m-p*t))/3,s=1-(c+a)):t<2/3?(t-=1/3,a=(1-r)/3,s=(1+r*R(p*t)/R(m-p*t))/3,c=1-(a+s)):(t-=2/3,s=(1-r)/3,c=(1+r*R(p*t)/R(m-p*t))/3,a=1-(s+c)),a=n(i*a*3),s=n(i*s*3),c=n(i*c*3),[a*255,s*255,c*255,e.length>3?e[3]:1]},{min:Ie,sqrt:Le,acos:Re}=Math,ze=(...e)=>{let[t,n,r]=o(e,`rgb`);t/=255,n/=255,r/=255;let i,a=Ie(t,n,r),s=(t+n+r)/3,c=s>0?1-a/s:0;return c===0?i=NaN:(i=(t-n+(t-r))/2,i/=Le((t-n)*(t-n)+(t-r)*(n-r)),i=Re(i),r>n&&(i=p-i),i/=p),[i*360,c,s]};y.prototype.hsi=function(){return ze(this._rgb)};const Be=(...e)=>new y(...e,`hsi`);b.hsi=Be,v.format.hsi=Fe,v.autodetect.push({p:2,test:(...e)=>{if(e=o(e,`hsi`),a(e)===`array`&&e.length===3)return`hsi`}});const Ve=(e,t,n)=>L(e,t,n,`hsi`);P.hsi=Ve;const He=(...e)=>{e=o(e,`hsl`);let[t,n,r]=e,i,a,s;if(n===0)i=a=s=r*255;else{let e=[0,0,0],o=[0,0,0],c=r<.5?r*(1+n):r+n-r*n,l=2*r-c,u=t/360;e[0]=u+1/3,e[1]=u,e[2]=u-1/3;for(let t=0;t<3;t++)e[t]<0&&(e[t]+=1),e[t]>1&&--e[t],6*e[t]<1?o[t]=l+(c-l)*6*e[t]:2*e[t]<1?o[t]=c:3*e[t]<2?o[t]=l+(c-l)*(2/3-e[t])*6:o[t]=l;[i,a,s]=[o[0]*255,o[1]*255,o[2]*255]}return e.length>3?[i,a,s,e[3]]:[i,a,s,1]},Ue=(...e)=>{e=o(e,`rgba`);let[t,n,r]=e;t/=255,n/=255,r/=255;let i=l(t,n,r),a=u(t,n,r),s=(a+i)/2,c,d;return a===i?(c=0,d=NaN):c=s<.5?(a-i)/(a+i):(a-i)/(2-a-i),t==a?d=(n-r)/(a-i):n==a?d=2+(r-t)/(a-i):r==a&&(d=4+(t-n)/(a-i)),d*=60,d<0&&(d+=360),e.length>3&&e[3]!==void 0?[d,c,s,e[3]]:[d,c,s]};y.prototype.hsl=function(){return Ue(this._rgb)};const We=(...e)=>new y(...e,`hsl`);b.hsl=We,v.format.hsl=He,v.autodetect.push({p:2,test:(...e)=>{if(e=o(e,`hsl`),a(e)===`array`&&e.length===3)return`hsl`}});const Ge=(e,t,n)=>L(e,t,n,`hsl`);P.hsl=Ge;const{floor:Ke}=Math,qe=(...e)=>{e=o(e,`hsv`);let[t,n,r]=e,i,a,s;if(r*=255,n===0)i=a=s=r;else{t===360&&(t=0),t>360&&(t-=360),t<0&&(t+=360),t/=60;let e=Ke(t),o=t-e,c=r*(1-n),l=r*(1-n*o),u=r*(1-n*(1-o));switch(e){case 0:[i,a,s]=[r,u,c];break;case 1:[i,a,s]=[l,r,c];break;case 2:[i,a,s]=[c,r,u];break;case 3:[i,a,s]=[c,l,r];break;case 4:[i,a,s]=[u,c,r];break;case 5:[i,a,s]=[r,c,l];break}}return[i,a,s,e.length>3?e[3]:1]},{min:Je,max:Ye}=Math,Xe=(...e)=>{e=o(e,`rgb`);let[t,n,r]=e,i=Je(t,n,r),a=Ye(t,n,r),s=a-i,c,l,u;return u=a/255,a===0?(c=NaN,l=0):(l=s/a,t===a&&(c=(n-r)/s),n===a&&(c=2+(r-t)/s),r===a&&(c=4+(t-n)/s),c*=60,c<0&&(c+=360)),[c,l,u]};y.prototype.hsv=function(){return Xe(this._rgb)};const Ze=(...e)=>new y(...e,`hsv`);b.hsv=Ze,v.format.hsv=qe,v.autodetect.push({p:2,test:(...e)=>{if(e=o(e,`hsv`),a(e)===`array`&&e.length===3)return`hsv`}});const Qe=(e,t,n)=>L(e,t,n,`hsv`);P.hsv=Qe;function z(e,t){let n=e.length;Array.isArray(e[0])||(e=[e]),Array.isArray(t[0])||(t=t.map(e=>[e]));let r=t[0].length,i=t[0].map((e,n)=>t.map(e=>e[n])),a=e.map(e=>i.map(t=>Array.isArray(e)?e.reduce((e,n,r)=>e+n*(t[r]||0),0):t.reduce((t,n)=>t+n*e,0)));return n===1&&(a=a[0]),r===1?a.map(e=>e[0]):a}const $e=(...e)=>{e=o(e,`lab`);let[t,n,r,...i]=e,[a,s,c]=et([t,n,r]),[l,u,d]=te(a,s,c);return[l,u,d,...i.length>0&&i[0]<1?[i[0]]:[]]};function et(e){return z([[1.2268798758459243,-.5578149944602171,.2813910456659647],[-.0405757452148008,1.112286803280317,-.0717110580655164],[-.0763729366746601,-.4214933324022432,1.5869240198367816]],z([[1,.3963377773761749,.2158037573099136],[1,-.1055613458156586,-.0638541728258133],[1,-.0894841775298119,-1.2914855480194092]],e).map(e=>e**3))}const tt=(...e)=>{let[t,n,r,...i]=o(e,`rgb`);return[...nt(ie(t,n,r)),...i.length>0&&i[0]<1?[i[0]]:[]]};function nt(e){return z([[.210454268309314,.7936177747023054,-.0040720430116193],[1.9779985324311684,-2.42859224204858,.450593709617411],[.0259040424655478,.7827717124575296,-.8086757549230774]],z([[.819022437996703,.3619062600528904,-.1288737815209879],[.0329836539323885,.9292868615863434,.0361446663506424],[.0481771893596242,.2642395317527308,.6335478284694309]],e).map(e=>Math.cbrt(e)))}y.prototype.oklab=function(){return tt(this._rgb)};const rt=(...e)=>new y(...e,`oklab`);Object.assign(b,{oklab:rt}),v.format.oklab=$e,v.autodetect.push({p:2,test:(...e)=>{if(e=o(e,`oklab`),a(e)===`array`&&e.length===3)return`oklab`}});const it=(e,t,n)=>{let r=e.oklab(),i=t.oklab();return new y(r[0]+n*(i[0]-r[0]),r[1]+n*(i[1]-r[1]),r[2]+n*(i[2]-r[2]),`oklab`)};P.oklab=it;const at=(e,t,n)=>L(e,t,n,`oklch`);P.oklch=at;const{pow:ot,sqrt:st,PI:ct,cos:lt,sin:ut,atan2:dt}=Math;var ft=(e,t=`lrgb`,n=null)=>{let r=e.length;n||=Array.from(Array(r)).map(()=>1);let i=r/n.reduce(function(e,t){return e+t});if(n.forEach((e,t)=>{n[t]*=i}),e=e.map(e=>new y(e)),t===`lrgb`)return pt(e,n);let a=e.shift(),o=a.get(t),s=[],c=0,l=0;for(let e=0;e<o.length;e++)if(o[e]=(o[e]||0)*n[0],s.push(isNaN(o[e])?0:n[0]),t.charAt(e)===`h`&&!isNaN(o[e])){let t=o[e]/180*ct;c+=lt(t)*n[0],l+=ut(t)*n[0]}let u=a.alpha()*n[0];e.forEach((e,r)=>{let i=e.get(t);u+=e.alpha()*n[r+1];for(let e=0;e<o.length;e++)if(!isNaN(i[e]))if(s[e]+=n[r+1],t.charAt(e)===`h`){let t=i[e]/180*ct;c+=lt(t)*n[r+1],l+=ut(t)*n[r+1]}else o[e]+=i[e]*n[r+1]});for(let e=0;e<o.length;e++)if(t.charAt(e)===`h`){let t=dt(l/s[e],c/s[e])/ct*180;for(;t<0;)t+=360;for(;t>=360;)t-=360;o[e]=t}else o[e]=o[e]/s[e];return u/=r,new y(o,t).alpha(u>.99999?1:u,!0)};const pt=(e,t)=>{let n=e.length,i=[0,0,0,0];for(let r=0;r<e.length;r++){let a=e[r],o=t[r]/n,s=a._rgb;i[0]+=ot(s[0],2)*o,i[1]+=ot(s[1],2)*o,i[2]+=ot(s[2],2)*o,i[3]+=s[3]*o}return i[0]=st(i[0]),i[1]=st(i[1]),i[2]=st(i[2]),i[3]>.9999999&&(i[3]=1),new y(r(i))},{pow:mt}=Math;function B(e){let t=`rgb`,r=b(`#ccc`),i=0,o=[0,1],s=[0,1],c=[],l=[0,0],u=!1,d=[],f=!1,p=0,m=1,h=!1,g={},_=!0,v=1,y=function(e){if(e||=[`#fff`,`#000`],e&&a(e)===`string`&&b.brewer&&b.brewer[e.toLowerCase()]&&(e=b.brewer[e.toLowerCase()]),a(e)===`array`){e.length===1&&(e=[e[0],e[0]]),e=e.slice(0);for(let t=0;t<e.length;t++)e[t]=b(e[t]);c.length=0;for(let t=0;t<e.length;t++)c.push(t/(e.length-1))}return T(),d=e},x=function(e){if(u!=null){let t=u.length-1,n=0;for(;n<t&&e>=u[n];)n++;return n-1}return 0},S=e=>e,C=e=>e,w=function(e,i){let o,s;if(i??=!1,isNaN(e)||e===null)return r;s=i?e:u&&u.length>2?x(e)/(u.length-2):m===p?1:(e-p)/(m-p),s=C(s),i||(s=S(s)),v!==1&&(s=mt(s,v)),s=l[0]+s*(1-l[0]-l[1]),s=n(s,0,1);let f=Math.floor(s*1e4);if(_&&g[f])o=g[f];else{if(a(d)===`array`)for(let e=0;e<c.length;e++){let n=c[e];if(s<=n){o=d[e];break}if(s>=n&&e===c.length-1){o=d[e];break}if(s>n&&s<c[e+1]){s=(s-n)/(c[e+1]-n),o=b.interpolate(d[e],d[e+1],s,t);break}}else a(d)===`function`&&(o=d(s));_&&(g[f]=o)}return o};var T=()=>g={};y(e);let E=function(e){let t=b(w(e));return f&&t[f]?t[f]():t};return E.classes=function(e){if(e!=null){if(a(e)===`array`)u=e,o=[e[0],e[e.length-1]];else{let t=b.analyze(o);u=e===0?[t.min,t.max]:b.limits(t,`e`,e)}return E}return u},E.domain=function(e){if(!arguments.length)return s;s=e.slice(0),p=e[0],m=e[e.length-1],c=[];let t=d.length;if(e.length===t&&p!==m)for(let t of Array.from(e))c.push((t-p)/(m-p));else{for(let e=0;e<t;e++)c.push(e/(t-1));if(e.length>2){let t=e.map((t,n)=>n/(e.length-1)),n=e.map(e=>(e-p)/(m-p));n.every((e,n)=>t[n]===e)||(C=e=>{if(e<=0||e>=1)return e;let r=0;for(;e>=n[r+1];)r++;let i=(e-n[r])/(n[r+1]-n[r]);return t[r]+i*(t[r+1]-t[r])})}}return o=[p,m],E},E.mode=function(e){return arguments.length?(t=e,T(),E):t},E.range=function(e,t){return y(e,t),E},E.out=function(e){return f=e,E},E.spread=function(e){return arguments.length?(i=e,E):i},E.correctLightness=function(e){return e??=!0,h=e,T(),S=h?function(e){let t=w(0,!0).lab()[0],n=w(1,!0).lab()[0],r=t>n,i=w(e,!0).lab()[0],a=t+(n-t)*e,o=i-a,s=0,c=1,l=20;for(;Math.abs(o)>.01&&l-- >0;)(function(){return r&&(o*=-1),o<0?(s=e,e+=(c-e)*.5):(c=e,e+=(s-e)*.5),i=w(e,!0).lab()[0],o=i-a})();return e}:e=>e,E},E.padding=function(e){return e==null?l:(a(e)===`number`&&(e=[e,e]),l=e,E)},E.colors=function(t,n){arguments.length<2&&(n=`hex`);let r=[];if(arguments.length===0)r=d.slice(0);else if(t===1)r=[E(.5)];else if(t>1){let e=o[0],n=o[1]-e;r=ht(0,t,!1).map(r=>E(e+r/(t-1)*n))}else{e=[];let t=[];if(u&&u.length>2)for(let e=1,n=u.length,r=1<=n;r?e<n:e>n;r?e++:e--)t.push((u[e-1]+u[e])*.5);else t=o;r=t.map(e=>E(e))}return b[n]&&(r=r.map(e=>e[n]())),r},E.cache=function(e){return e==null?_:(_=e,E)},E.gamma=function(e){return e==null?v:(v=e,E)},E.nodata=function(e){return e==null?r:(r=b(e),E)},E}function ht(e,t,n){let r=[],i=e<t,a=n?i?t+1:t-1:t;for(let t=e;i?t<a:t>a;i?t++:t--)r.push(t);return r}const gt=function(e){let t=[1,1];for(let n=1;n<e;n++){let e=[1];for(let n=1;n<=t.length;n++)e[n]=(t[n]||0)+t[n-1];t=e}return t},_t=function(e){let t,n,r,i;if(e=e.map(e=>new y(e)),e.length===2)[n,r]=e.map(e=>e.lab()),t=function(e){return new y([0,1,2].map(t=>n[t]+e*(r[t]-n[t])),`lab`)};else if(e.length===3)[n,r,i]=e.map(e=>e.lab()),t=function(e){return new y([0,1,2].map(t=>(1-e)*(1-e)*n[t]+2*(1-e)*e*r[t]+e*e*i[t]),`lab`)};else if(e.length===4){let a;[n,r,i,a]=e.map(e=>e.lab()),t=function(e){return new y([0,1,2].map(t=>(1-e)*(1-e)*(1-e)*n[t]+3*(1-e)*(1-e)*e*r[t]+3*(1-e)*e*e*i[t]+e*e*e*a[t]),`lab`)}}else if(e.length>=5){let n,r,i;n=e.map(e=>e.lab()),i=e.length-1,r=gt(i),t=function(e){let t=1-e;return new y([0,1,2].map(a=>n.reduce((n,o,s)=>n+r[s]*t**(i-s)*e**s*o[a],0)),`lab`)}}else throw RangeError(`No point in running bezier with only one color.`);return t};var vt=e=>{let t=_t(e);return t.scale=()=>B(t),t};const{round:yt}=Math;y.prototype.rgb=function(e=!0){return e===!1?this._rgb.slice(0,3):this._rgb.slice(0,3).map(yt)},y.prototype.rgba=function(e=!0){return this._rgb.slice(0,4).map((t,n)=>n<3?e===!1?t:yt(t):t)};const bt=(...e)=>new y(...e,`rgb`);Object.assign(b,{rgb:bt}),v.format.rgb=(...e)=>{let t=o(e,`rgba`);return t[3]===void 0&&(t[3]=1),t},v.autodetect.push({p:3,test:(...e)=>{if(e=o(e,`rgba`),a(e)===`array`&&(e.length===3||e.length===4&&a(e[3])==`number`&&e[3]>=0&&e[3]<=1))return`rgb`}});const V=(e,t,n)=>{if(!V[n])throw Error(`unknown blend mode `+n);return V[n](e,t)},H=e=>(t,n)=>{let r=b(n).rgb(),i=b(t).rgb();return b.rgb(e(r,i))},U=e=>(t,n)=>{let r=[];return r[0]=e(t[0],n[0]),r[1]=e(t[1],n[1]),r[2]=e(t[2],n[2]),r},xt=e=>e,St=(e,t)=>e*t/255,Ct=(e,t)=>e>t?t:e,wt=(e,t)=>e>t?e:t,Tt=(e,t)=>255*(1-(1-e/255)*(1-t/255)),Et=(e,t)=>t<128?2*e*t/255:255*(1-2*(1-e/255)*(1-t/255)),Dt=(e,t)=>255*(1-(1-t/255)/(e/255)),Ot=(e,t)=>e===255?255:(e=t/255*255/(1-e/255),e>255?255:e);V.normal=H(U(xt)),V.multiply=H(U(St)),V.screen=H(U(Tt)),V.overlay=H(U(Et)),V.darken=H(U(Ct)),V.lighten=H(U(wt)),V.dodge=H(U(Ot)),V.burn=H(U(Dt));const{pow:kt,sin:At,cos:jt}=Math;function Mt(e=300,t=-1.5,n=1,i=1,o=[0,1]){let s=0,c;a(o)===`array`?c=o[1]-o[0]:(c=0,o=[o,o]);let l=function(a){let l=p*((e+120)/360+t*a),u=kt(o[0]+c*a,i),d=(s===0?n:n[0]+a*s)*u*(1-u)/2,f=jt(l),m=At(l),h=u+d*(-.14861*f+1.78277*m),g=u+d*(-.29227*f-.90649*m),_=u+1.97294*f*d;return b(r([h*255,g*255,_*255,1]))};return l.start=function(t){return t==null?e:(e=t,l)},l.rotations=function(e){return e==null?t:(t=e,l)},l.gamma=function(e){return e==null?i:(i=e,l)},l.hue=function(e){return e==null?n:(n=e,a(n)===`array`?(s=n[1]-n[0],s===0&&(n=n[1])):s=0,l)},l.lightness=function(e){return e==null?o:(a(e)===`array`?(o=e,c=e[1]-e[0]):(o=[e,e],c=0),l)},l.scale=()=>b.scale(l),l.hue(n),l}const{floor:Nt,random:Pt}=Math;var Ft=(e=Pt)=>{let t=`#`;for(let n=0;n<6;n++)t+=`0123456789abcdef`.charAt(Nt(e()*16));return new y(t,`hex`)};const{log:It,pow:Lt,floor:Rt,abs:zt}=Math;function Bt(e,t=null){let n={min:Number.MAX_VALUE,max:Number.MAX_VALUE*-1,sum:0,values:[],count:0};return a(e)===`object`&&(e=Object.values(e)),e.forEach(e=>{t&&a(e)===`object`&&(e=e[t]),e!=null&&!isNaN(e)&&(n.values.push(e),n.sum+=e,e<n.min&&(n.min=e),e>n.max&&(n.max=e),n.count+=1)}),n.domain=[n.min,n.max],n.limits=(e,t)=>Vt(n,e,t),n}function Vt(e,t=`equal`,n=7){a(e)==`array`&&(e=Bt(e));let{min:r,max:i}=e,o=e.values.sort((e,t)=>e-t);if(n===1)return[r,i];let s=[];if(t.substr(0,1)===`c`&&(s.push(r),s.push(i)),t.substr(0,1)===`e`){s.push(r);for(let e=1;e<n;e++)s.push(r+e/n*(i-r));s.push(i)}else if(t.substr(0,1)===`l`){if(r<=0)throw Error(`Logarithmic scales are only possible for values > 0`);let e=Math.LOG10E*It(r),t=Math.LOG10E*It(i);s.push(r);for(let r=1;r<n;r++)s.push(Lt(10,e+r/n*(t-e)));s.push(i)}else if(t.substr(0,1)===`q`){s.push(r);for(let e=1;e<n;e++){let t=(o.length-1)*e/n,r=Rt(t);if(r===t)s.push(o[r]);else{let e=t-r;s.push(o[r]*(1-e)+o[r+1]*e)}}s.push(i)}else if(t.substr(0,1)===`k`){let e,t=o.length,a=Array(t),c=Array(n),l=!0,u=0,d=null;d=[],d.push(r);for(let e=1;e<n;e++)d.push(r+e/n*(i-r));for(d.push(i);l;){for(let e=0;e<n;e++)c[e]=0;for(let e=0;e<t;e++){let t=o[e],r=Number.MAX_VALUE,i;for(let o=0;o<n;o++){let n=zt(d[o]-t);n<r&&(r=n,i=o),c[i]++,a[e]=i}}let r=Array(n);for(let e=0;e<n;e++)r[e]=null;for(let n=0;n<t;n++)e=a[n],r[e]===null?r[e]=o[n]:r[e]+=o[n];for(let e=0;e<n;e++)r[e]*=1/c[e];l=!1;for(let e=0;e<n;e++)if(r[e]!==d[e]){l=!0;break}d=r,u++,u>200&&(l=!1)}let f={};for(let e=0;e<n;e++)f[e]=[];for(let n=0;n<t;n++)e=a[n],f[e].push(o[n]);let p=[];for(let e=0;e<n;e++)p.push(f[e][0]),p.push(f[e][f[e].length-1]);p=p.sort((e,t)=>e-t),s.push(p[0]);for(let e=1;e<p.length;e+=2){let t=p[e];!isNaN(t)&&s.indexOf(t)===-1&&s.push(t)}}return s}var Ht=(e,t)=>{e=new y(e),t=new y(t);let n=e.luminance(),r=t.luminance();return n>r?(n+.05)/(r+.05):(r+.05)/(n+.05)};
|
|
2
|
-
/**
|
|
3
|
-
* @license
|
|
4
|
-
*
|
|
5
|
-
* The APCA contrast prediction algorithm is based of the formulas published
|
|
6
|
-
* in the APCA-1.0.98G specification by Myndex. The specification is available at:
|
|
7
|
-
* https://raw.githubusercontent.com/Myndex/apca-w3/master/images/APCAw3_0.1.17_APCA0.0.98G.svg
|
|
8
|
-
*
|
|
9
|
-
* Note that the APCA implementation is still beta, so please update to
|
|
10
|
-
* future versions of chroma.js when they become available.
|
|
11
|
-
*
|
|
12
|
-
* You can read more about the APCA Readability Criterion at
|
|
13
|
-
* https://readtech.org/ARC/
|
|
14
|
-
*/
|
|
15
|
-
const Ut=.027,Wt=1.14,W=.022,Gt=1.414;var Kt=(e,t)=>{e=new y(e),t=new y(t),e.alpha()<1&&(e=F(t,e,e.alpha(),`rgb`));let n=qt(...e.rgb()),r=qt(...t.rgb()),i=n>=W?n:n+(W-n)**+Gt,a=r>=W?r:r+(W-r)**+Gt,o=a**.56-i**.57,s=a**.65-i**.62,c=Math.abs(a-i)<5e-4?0:i<a?o*Wt:s*Wt;return(Math.abs(c)<.1?0:c>0?c-Ut:c+Ut)*100};function qt(e,t,n){return .2126729*(e/255)**2.4+.7151522*(t/255)**2.4+.072175*(n/255)**2.4}const{sqrt:G,pow:K,min:Jt,max:Yt,atan2:Xt,abs:Zt,cos:q,sin:Qt,exp:$t,PI:en}=Math;function tn(e,t,n=1,r=1,i=1){var a=function(e){return 360*e/(2*en)},o=function(e){return 2*en*e/360};e=new y(e),t=new y(t);let[s,c,l]=Array.from(e.lab()),[u,d,f]=Array.from(t.lab()),p=(s+u)/2,m=(G(K(c,2)+K(l,2))+G(K(d,2)+K(f,2)))/2,h=.5*(1-G(K(m,7)/(K(m,7)+K(25,7)))),g=c*(1+h),_=d*(1+h),v=G(K(g,2)+K(l,2)),b=G(K(_,2)+K(f,2)),x=(v+b)/2,S=a(Xt(l,g)),C=a(Xt(f,_)),w=S>=0?S:S+360,T=C>=0?C:C+360,E=Zt(w-T)>180?(w+T+360)/2:(w+T)/2,D=1-.17*q(o(E-30))+.24*q(o(2*E))+.32*q(o(3*E+6))-.2*q(o(4*E-63)),O=T-w;O=Zt(O)<=180?O:T<=w?O+360:O-360,O=2*G(v*b)*Qt(o(O)/2);let k=u-s,A=b-v,j=1+.015*K(p-50,2)/G(20+K(p-50,2)),ee=1+.045*x,M=1+.015*x*D,te=30*$t(-K((E-275)/25,2)),N=-(2*G(K(x,7)/(K(x,7)+K(25,7))))*Qt(2*o(te));return Yt(0,Jt(100,G(K(k/(n*j),2)+K(A/(r*ee),2)+K(O/(i*M),2)+N*(A/(r*ee))*(O/(i*M)))))}function nn(e,t,n=`lab`){e=new y(e),t=new y(t);let r=e.get(n),i=t.get(n),a=0;for(let e in r){let t=(r[e]||0)-(i[e]||0);a+=t*t}return Math.sqrt(a)}var rn=(...e)=>{try{return new y(...e),!0}catch{return!1}},an={cool(){return B([b.hsl(180,1,.9),b.hsl(250,.7,.4)])},hot(){return B([`#000`,`#f00`,`#ff0`,`#fff`],[0,.25,.75,1]).mode(`rgb`)}};const on={OrRd:[`#fff7ec`,`#fee8c8`,`#fdd49e`,`#fdbb84`,`#fc8d59`,`#ef6548`,`#d7301f`,`#b30000`,`#7f0000`],PuBu:[`#fff7fb`,`#ece7f2`,`#d0d1e6`,`#a6bddb`,`#74a9cf`,`#3690c0`,`#0570b0`,`#045a8d`,`#023858`],BuPu:[`#f7fcfd`,`#e0ecf4`,`#bfd3e6`,`#9ebcda`,`#8c96c6`,`#8c6bb1`,`#88419d`,`#810f7c`,`#4d004b`],Oranges:[`#fff5eb`,`#fee6ce`,`#fdd0a2`,`#fdae6b`,`#fd8d3c`,`#f16913`,`#d94801`,`#a63603`,`#7f2704`],BuGn:[`#f7fcfd`,`#e5f5f9`,`#ccece6`,`#99d8c9`,`#66c2a4`,`#41ae76`,`#238b45`,`#006d2c`,`#00441b`],YlOrBr:[`#ffffe5`,`#fff7bc`,`#fee391`,`#fec44f`,`#fe9929`,`#ec7014`,`#cc4c02`,`#993404`,`#662506`],YlGn:[`#ffffe5`,`#f7fcb9`,`#d9f0a3`,`#addd8e`,`#78c679`,`#41ab5d`,`#238443`,`#006837`,`#004529`],Reds:[`#fff5f0`,`#fee0d2`,`#fcbba1`,`#fc9272`,`#fb6a4a`,`#ef3b2c`,`#cb181d`,`#a50f15`,`#67000d`],RdPu:[`#fff7f3`,`#fde0dd`,`#fcc5c0`,`#fa9fb5`,`#f768a1`,`#dd3497`,`#ae017e`,`#7a0177`,`#49006a`],Greens:[`#f7fcf5`,`#e5f5e0`,`#c7e9c0`,`#a1d99b`,`#74c476`,`#41ab5d`,`#238b45`,`#006d2c`,`#00441b`],YlGnBu:[`#ffffd9`,`#edf8b1`,`#c7e9b4`,`#7fcdbb`,`#41b6c4`,`#1d91c0`,`#225ea8`,`#253494`,`#081d58`],Purples:[`#fcfbfd`,`#efedf5`,`#dadaeb`,`#bcbddc`,`#9e9ac8`,`#807dba`,`#6a51a3`,`#54278f`,`#3f007d`],GnBu:[`#f7fcf0`,`#e0f3db`,`#ccebc5`,`#a8ddb5`,`#7bccc4`,`#4eb3d3`,`#2b8cbe`,`#0868ac`,`#084081`],Greys:[`#ffffff`,`#f0f0f0`,`#d9d9d9`,`#bdbdbd`,`#969696`,`#737373`,`#525252`,`#252525`,`#000000`],YlOrRd:[`#ffffcc`,`#ffeda0`,`#fed976`,`#feb24c`,`#fd8d3c`,`#fc4e2a`,`#e31a1c`,`#bd0026`,`#800026`],PuRd:[`#f7f4f9`,`#e7e1ef`,`#d4b9da`,`#c994c7`,`#df65b0`,`#e7298a`,`#ce1256`,`#980043`,`#67001f`],Blues:[`#f7fbff`,`#deebf7`,`#c6dbef`,`#9ecae1`,`#6baed6`,`#4292c6`,`#2171b5`,`#08519c`,`#08306b`],PuBuGn:[`#fff7fb`,`#ece2f0`,`#d0d1e6`,`#a6bddb`,`#67a9cf`,`#3690c0`,`#02818a`,`#016c59`,`#014636`],Viridis:[`#440154`,`#482777`,`#3f4a8a`,`#31678e`,`#26838f`,`#1f9d8a`,`#6cce5a`,`#b6de2b`,`#fee825`],Spectral:[`#9e0142`,`#d53e4f`,`#f46d43`,`#fdae61`,`#fee08b`,`#ffffbf`,`#e6f598`,`#abdda4`,`#66c2a5`,`#3288bd`,`#5e4fa2`],RdYlGn:[`#a50026`,`#d73027`,`#f46d43`,`#fdae61`,`#fee08b`,`#ffffbf`,`#d9ef8b`,`#a6d96a`,`#66bd63`,`#1a9850`,`#006837`],RdBu:[`#67001f`,`#b2182b`,`#d6604d`,`#f4a582`,`#fddbc7`,`#f7f7f7`,`#d1e5f0`,`#92c5de`,`#4393c3`,`#2166ac`,`#053061`],PiYG:[`#8e0152`,`#c51b7d`,`#de77ae`,`#f1b6da`,`#fde0ef`,`#f7f7f7`,`#e6f5d0`,`#b8e186`,`#7fbc41`,`#4d9221`,`#276419`],PRGn:[`#40004b`,`#762a83`,`#9970ab`,`#c2a5cf`,`#e7d4e8`,`#f7f7f7`,`#d9f0d3`,`#a6dba0`,`#5aae61`,`#1b7837`,`#00441b`],RdYlBu:[`#a50026`,`#d73027`,`#f46d43`,`#fdae61`,`#fee090`,`#ffffbf`,`#e0f3f8`,`#abd9e9`,`#74add1`,`#4575b4`,`#313695`],BrBG:[`#543005`,`#8c510a`,`#bf812d`,`#dfc27d`,`#f6e8c3`,`#f5f5f5`,`#c7eae5`,`#80cdc1`,`#35978f`,`#01665e`,`#003c30`],RdGy:[`#67001f`,`#b2182b`,`#d6604d`,`#f4a582`,`#fddbc7`,`#ffffff`,`#e0e0e0`,`#bababa`,`#878787`,`#4d4d4d`,`#1a1a1a`],PuOr:[`#7f3b08`,`#b35806`,`#e08214`,`#fdb863`,`#fee0b6`,`#f7f7f7`,`#d8daeb`,`#b2abd2`,`#8073ac`,`#542788`,`#2d004b`],Set2:[`#66c2a5`,`#fc8d62`,`#8da0cb`,`#e78ac3`,`#a6d854`,`#ffd92f`,`#e5c494`,`#b3b3b3`],Accent:[`#7fc97f`,`#beaed4`,`#fdc086`,`#ffff99`,`#386cb0`,`#f0027f`,`#bf5b17`,`#666666`],Set1:[`#e41a1c`,`#377eb8`,`#4daf4a`,`#984ea3`,`#ff7f00`,`#ffff33`,`#a65628`,`#f781bf`,`#999999`],Set3:[`#8dd3c7`,`#ffffb3`,`#bebada`,`#fb8072`,`#80b1d3`,`#fdb462`,`#b3de69`,`#fccde5`,`#d9d9d9`,`#bc80bd`,`#ccebc5`,`#ffed6f`],Dark2:[`#1b9e77`,`#d95f02`,`#7570b3`,`#e7298a`,`#66a61e`,`#e6ab02`,`#a6761d`,`#666666`],Paired:[`#a6cee3`,`#1f78b4`,`#b2df8a`,`#33a02c`,`#fb9a99`,`#e31a1c`,`#fdbf6f`,`#ff7f00`,`#cab2d6`,`#6a3d9a`,`#ffff99`,`#b15928`],Pastel2:[`#b3e2cd`,`#fdcdac`,`#cbd5e8`,`#f4cae4`,`#e6f5c9`,`#fff2ae`,`#f1e2cc`,`#cccccc`],Pastel1:[`#fbb4ae`,`#b3cde3`,`#ccebc5`,`#decbe4`,`#fed9a6`,`#ffffcc`,`#e5d8bd`,`#fddaec`,`#f2f2f2`]},sn=Object.keys(on),cn=new Map(sn.map(e=>[e.toLowerCase(),e])),ln=typeof Proxy==`function`?new Proxy(on,{get(e,t){let n=t.toLowerCase();if(cn.has(n))return e[cn.get(n)]},getOwnPropertyNames(){return Object.getOwnPropertyNames(sn)}}):on,un=(...e)=>{e=o(e,`cmyk`);let[t,n,r,i]=e,a=e.length>4?e[4]:1;return i===1?[0,0,0,a]:[t>=1?0:255*(1-t)*(1-i),n>=1?0:255*(1-n)*(1-i),r>=1?0:255*(1-r)*(1-i),a]},{max:dn}=Math,fn=(...e)=>{let[t,n,r]=o(e,`rgb`);t/=255,n/=255,r/=255;let i=1-dn(t,dn(n,r)),a=i<1?1/(1-i):0;return[(1-t-i)*a,(1-n-i)*a,(1-r-i)*a,i]};y.prototype.cmyk=function(){return fn(this._rgb)};const pn=(...e)=>new y(...e,`cmyk`);Object.assign(b,{cmyk:pn}),v.format.cmyk=un,v.autodetect.push({p:2,test:(...e)=>{if(e=o(e,`cmyk`),a(e)===`array`&&e.length===4)return`cmyk`}});const mn=(...e)=>{let t=o(e,`hsla`),n=s(e)||`lsa`;return t[0]=d(t[0]||0)+`deg`,t[1]=d(t[1]*100)+`%`,t[2]=d(t[2]*100)+`%`,n===`hsla`||t.length>3&&t[3]<1?(t[3]=`/ `+(t.length>3?t[3]:1),n=`hsla`):t.length=3,`${n.substr(0,3)}(${t.join(` `)})`},hn=(...e)=>{let t=o(e,`lab`),n=s(e)||`lab`;return t[0]=d(t[0])+`%`,t[1]=d(t[1]),t[2]=d(t[2]),n===`laba`||t.length>3&&t[3]<1?t[3]=`/ `+(t.length>3?t[3]:1):t.length=3,`lab(${t.join(` `)})`},gn=(...e)=>{let t=o(e,`lch`),n=s(e)||`lab`;return t[0]=d(t[0])+`%`,t[1]=d(t[1]),t[2]=isNaN(t[2])?`none`:d(t[2])+`deg`,n===`lcha`||t.length>3&&t[3]<1?t[3]=`/ `+(t.length>3?t[3]:1):t.length=3,`lch(${t.join(` `)})`},_n=(...e)=>{let t=o(e,`lab`);return t[0]=d(t[0]*100)+`%`,t[1]=f(t[1]),t[2]=f(t[2]),t.length>3&&t[3]<1?t[3]=`/ `+(t.length>3?t[3]:1):t.length=3,`oklab(${t.join(` `)})`},vn=(...e)=>{let[t,n,r,...i]=o(e,`rgb`),[a,s,c]=tt(t,n,r),[l,u,d]=_e(a,s,c);return[l,u,d,...i.length>0&&i[0]<1?[i[0]]:[]]},yn=(...e)=>{let t=o(e,`lch`);return t[0]=d(t[0]*100)+`%`,t[1]=f(t[1]),t[2]=isNaN(t[2])?`none`:d(t[2])+`deg`,t.length>3&&t[3]<1?t[3]=`/ `+(t.length>3?t[3]:1):t.length=3,`oklch(${t.join(` `)})`},{round:bn}=Math,xn=(...e)=>{let t=o(e,`rgba`),n=s(e)||`rgb`;if(n.substr(0,3)===`hsl`)return mn(Ue(t),n);if(n.substr(0,3)===`lab`){let e=A();k(`d50`);let r=hn(N(t),n);return k(e),r}if(n.substr(0,3)===`lch`){let e=A();k(`d50`);let r=gn(ve(t),n);return k(e),r}return n.substr(0,5)===`oklab`?_n(tt(t)):n.substr(0,5)===`oklch`?yn(vn(t)):(t[0]=bn(t[0]),t[1]=bn(t[1]),t[2]=bn(t[2]),(n===`rgba`||t.length>3&&t[3]<1)&&(t[3]=`/ `+(t.length>3?t[3]:1),n=`rgba`),`${n.substr(0,3)}(${t.slice(0,n===`rgb`?3:4).join(` `)})`)},Sn=(...e)=>{e=o(e,`lch`);let[t,n,r,...i]=e,[a,s,c]=de(t,n,r),[l,u,d]=$e(a,s,c);return[l,u,d,...i.length>0&&i[0]<1?[i[0]]:[]]},J=`((?:-?\\d+)|(?:-?\\d+(?:\\.\\d+)?)%|none)`,Y=`((?:-?(?:\\d+(?:\\.\\d*)?|\\.\\d+)%?)|none)`,Cn=`((?:-?(?:\\d+(?:\\.\\d*)?|\\.\\d+)%)|none)`,wn=`\\s*,\\s*`,Tn=`((?:-?(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:deg)?)|none)`,X=`\\s*(?:\\/\\s*((?:[01]|[01]?\\.\\d+)|\\d+(?:\\.\\d+)?%))?`,En=RegExp(`^rgba?\\(\\s*`+[J,J,J].join(`\\s+`)+X+`\\)$`),Dn=RegExp(`^rgb\\(\\s*`+[J,J,J].join(wn)+`\\s*\\)$`),On=RegExp(`^rgba\\(\\s*`+[J,J,J,Y].join(wn)+`\\s*\\)$`),kn=RegExp(`^hsla?\\(\\s*`+[Tn,Cn,Cn].join(`\\s+`)+X+`\\)$`),An=RegExp(`^hsl?\\(\\s*`+[Tn,Cn,Cn].join(wn)+`\\s*\\)$`),jn=/^hsla\(\s*(-?\d+(?:\.\d+)?),\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)$/,Mn=RegExp(`^lab\\(\\s*`+[Y,Y,Y].join(`\\s+`)+X+`\\)$`),Nn=RegExp(`^lch\\(\\s*`+[Y,Y,Tn].join(`\\s+`)+X+`\\)$`),Pn=RegExp(`^oklab\\(\\s*`+[Y,Y,Y].join(`\\s+`)+X+`\\)$`),Fn=RegExp(`^oklch\\(\\s*`+[Y,Y,Tn].join(`\\s+`)+X+`\\)$`),{round:In}=Math,Z=e=>e.map((e,t)=>t<=2?n(In(e),0,255):e),Q=(e,t=0,n=100,r=!1)=>(typeof e==`string`&&e.endsWith(`%`)&&(e=parseFloat(e.substring(0,e.length-1))/100,e=r?t+(e+1)*.5*(n-t):t+e*(n-t)),+e),$=(e,t)=>e===`none`?t:e,Ln=e=>{if(e=e.toLowerCase().trim(),e===`transparent`)return[0,0,0,0];let t;if(v.format.named)try{return v.format.named(e)}catch{}if((t=e.match(En))||(t=e.match(Dn))){let e=t.slice(1,4);for(let t=0;t<3;t++)e[t]=+Q($(e[t],0),0,255);e=Z(e);let n=t[4]===void 0?1:+Q(t[4],0,1);return e[3]=n,e}if(t=e.match(On)){let e=t.slice(1,5);for(let t=0;t<4;t++)e[t]=+Q(e[t],0,255);return e}if((t=e.match(kn))||(t=e.match(An))){let e=t.slice(1,4);e[0]=+$(e[0].replace(`deg`,``),0),e[1]=Q($(e[1],0),0,100)*.01,e[2]=Q($(e[2],0),0,100)*.01;let n=Z(He(e));return n[3]=t[4]===void 0?1:+Q(t[4],0,1),n}if(t=e.match(jn)){let e=t.slice(1,4);e[1]*=.01,e[2]*=.01;let n=He(e);for(let e=0;e<3;e++)n[e]=In(n[e]);return n[3]=+t[4],n}if(t=e.match(Mn)){let e=t.slice(1,4);e[0]=Q($(e[0],0),0,100),e[1]=Q($(e[1],0),-125,125,!0),e[2]=Q($(e[2],0),-125,125,!0);let n=A();k(`d50`);let r=Z(j(e));return k(n),r[3]=t[4]===void 0?1:+Q(t[4],0,1),r}if(t=e.match(Nn)){let e=t.slice(1,4);e[0]=Q(e[0],0,100),e[1]=Q($(e[1],0),0,150,!1),e[2]=+$(e[2].replace(`deg`,``),0);let n=A();k(`d50`);let r=Z(fe(e));return k(n),r[3]=t[4]===void 0?1:+Q(t[4],0,1),r}if(t=e.match(Pn)){let e=t.slice(1,4);e[0]=Q($(e[0],0),0,1),e[1]=Q($(e[1],0),-.4,.4,!0),e[2]=Q($(e[2],0),-.4,.4,!0);let n=Z($e(e));return n[3]=t[4]===void 0?1:+Q(t[4],0,1),n}if(t=e.match(Fn)){let e=t.slice(1,4);e[0]=Q($(e[0],0),0,1),e[1]=Q($(e[1],0),0,.4,!1),e[2]=+$(e[2].replace(`deg`,``),0);let n=Z(Sn(e));return n[3]=t[4]===void 0?1:+Q(t[4],0,1),n}};Ln.test=e=>En.test(e)||kn.test(e)||Mn.test(e)||Nn.test(e)||Pn.test(e)||Fn.test(e)||Dn.test(e)||On.test(e)||An.test(e)||jn.test(e)||e===`transparent`,y.prototype.css=function(e){return xn(this._rgb,e)};const Rn=(...e)=>new y(...e,`css`);b.css=Rn,v.format.css=Ln,v.autodetect.push({p:5,test:(e,...t)=>{if(!t.length&&a(e)===`string`&&Ln.test(e))return`css`}}),v.format.gl=(...e)=>{let t=o(e,`rgba`);return t[0]*=255,t[1]*=255,t[2]*=255,t};const zn=(...e)=>new y(...e,`gl`);b.gl=zn,y.prototype.gl=function(){let e=this._rgb;return[e[0]/255,e[1]/255,e[2]/255,e[3]]},y.prototype.hex=function(e){return E(this._rgb,e)};const Bn=(...e)=>new y(...e,`hex`);b.hex=Bn,v.format.hex=w,v.autodetect.push({p:4,test:(e,...t)=>{if(!t.length&&a(e)===`string`&&[3,4,5,6,7,8,9].indexOf(e.length)>=0)return`hex`}});const{log:Vn}=Math,Hn=e=>{let t=e/100,n,r,i;return t<66?(n=255,r=t<6?0:-155.25485562709179-.44596950469579133*(r=t-2)+104.49216199393888*Vn(r),i=t<20?0:-254.76935184120902+.8274096064007395*(i=t-10)+115.67994401066147*Vn(i)):(n=351.97690566805693+.114206453784165*(n=t-55)-40.25366309332127*Vn(n),r=325.4494125711974+.07943456536662342*(r=t-50)-28.0852963507957*Vn(r),i=255),[n,r,i,1]},{round:Un}=Math,Wn=(...e)=>{let t=o(e,`rgb`),n=t[0],r=t[2],i=1e3,a=4e4,s;for(;a-i>.4;){s=(a+i)*.5;let e=Hn(s);e[2]/e[0]>=r/n?a=s:i=s}return Un(s)};y.prototype.temp=y.prototype.kelvin=y.prototype.temperature=function(){return Wn(this._rgb)};const Gn=(...e)=>new y(...e,`temp`);Object.assign(b,{temp:Gn,kelvin:Gn,temperature:Gn}),v.format.temp=v.format.kelvin=v.format.temperature=Hn,y.prototype.oklch=function(){return vn(this._rgb)};const Kn=(...e)=>new y(...e,`oklch`);Object.assign(b,{oklch:Kn}),v.format.oklch=Sn,v.autodetect.push({p:2,test:(...e)=>{if(e=o(e,`oklch`),a(e)===`array`&&e.length===3)return`oklch`}}),Object.assign(b,{analyze:Bt,average:ft,bezier:vt,blend:V,brewer:ln,Color:y,colors:x,contrast:Ht,contrastAPCA:Kt,cubehelix:Mt,deltaE:tn,distance:nn,input:v,interpolate:F,limits:Vt,mix:F,random:Ft,scale:B,scales:an,valid:rn});var qn=b;const Jn=[.96,.907,.805,.697,.605,.547,.518,.445,.395,.34],Yn=[.32,.16,.08,.04,0,0,.04,.08,.16,.32];function Xn(e){let t=e.get(`hsl.l`);return Jn.reduce((e,n)=>Math.abs(n-t)<Math.abs(e-t)?n:e)}function Zn(e){let t=qn(e),n=Xn(t),r=Jn.findIndex(e=>e===n),i=Jn.map(e=>t.set(`hsl.l`,e)).map(e=>qn(e)).map((e,t)=>{let n=Yn[t]-Yn[r];return n>=0?e.saturate(n):e.desaturate(n*-1)});return i[r]=qn(e),{baseColorIndex:r,colors:i}}function Qn(e){return Zn(e).colors.map(e=>e.hex())}export{qn as n,Qn as t};
|
package/dist/_chunks/utils.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime.mjs";import{t}from"./libs/defu.mjs";import{F as n,P as r,Q as i,R as a,T as o,a as s,et as ee,f as c,k as l,l as u,t as d}from"./libs/remeda.mjs";import{s as f}from"./libs/mnemonist.mjs";import{t as te}from"./libs/natural-compare-lite.mjs";import{t as p}from"./libs/ohash.mjs";import{n as m}from"./libs/hast-util-sanitize.mjs";import{t as h}from"./libs/rehype-sanitize.mjs";import{t as g}from"./libs/rehype-stringify.mjs";import{l as _,t as v}from"./libs/mdast-util-from-markdown.mjs";import{t as y}from"./libs/remark-gfm.mjs";import{t as b}from"./libs/remark-github-blockquote-alert.mjs";import{t as ne}from"./libs/remark-parse.mjs";import{t as re}from"./libs/remark-rehype.mjs";import{t as ie}from"./libs/unified.mjs";function ae(e,t){if(e===void 0||e==null){let n=typeof t==`function`?t():t;throw Error(n??`Expected defined value, but received ${e}`)}return e}function x(e,t){if(!e)throw Error(t??`Invariant failed`)}function S(e){throw Error(`NonExhaustive value: ${e}`)}function C(e,t,n){return e.length===0||t.length===0?[]:(n??=Object.is,ee(d(e,t),s(([e,t])=>n(e,t)),o(([e,t])=>e)))}var w=e(te(),1);function T(e,t){return e===t?0:l(e)?l(t)?(0,w.default)(e,t):1:l(t)?-1:0}function E(e){return u(e,T)}function D(...e){return e.length===0?E:E(e[0])}function O(e=`.`,t=!1){return(n,r)=>{if(n===r)return 0;if(!n)return-1;if(!r)return 1;let i=n.split(e),a=r.split(e),o=Math.min(i.length,a.length);for(let e=0;e<o;e++){let t=i[e],n=a[e],r=(0,w.default)(t,n);if(r!==0)return r}let s=i.length-a.length;return t?-1*s:s}}function k(e){return e!=null&&typeof e==`string`}function A(e){return!!e&&Array.isArray(e)&&e.length>0}function j(e,t){return x(typeof t==`string`,`Path must be string`),typeof e==`object`&&!!e&&e[t]!=null}function M(e){return t=>j(t,e)}function N(...e){if(e.length===1&&typeof e[0]==`string`)return M(e[0]);let[t,n]=e;return j(t,n)}function P(...e){return(t=>e.some(e=>e(t)))}function F(e){let t=e.lastIndexOf(`.`);return t>0?e.slice(0,t):null}function I(e){let t=e.lastIndexOf(`.`);return t>0?e.slice(t+1):e}const L=e=>k(e)?e:e.id;function R(e,t){let n=L(e);return t?L(t).startsWith(n+`.`):e=>{let t=L(e);return n.startsWith(t+`.`)}}function z(e,t){if(!t)return t=>z(e,t);let n=L(e),r=L(t);return n===r||r.startsWith(n+`.`)||n.startsWith(r+`.`)}function B(e,t){return t?R(t,e):t=>R(e,t)}function V(e){return(k(e)?e:e.id).split(`.`).length}function H(e,t){let n=k(e)?e:e.id,r=k(t)?t:t.id;if(n===r)return 0;let i=V(n),a=V(r);if(z(n,r))return Math.abs(i-a);let o=U(n,r),s=o?V(o):0;return i+a-(2*s+1)}function U(e,t){let n=e.split(`.`);if(n.length<2)return null;let r=t.split(`.`);if(r.length<2)return null;let i=[];for(let e=0;e<Math.min(n.length,r.length)-1&&n[e]===r[e];e++)i.push(n[e]);return i.length===0?null:i.join(`.`)}function W(e){let t=e.split(`.`);if(t.pop(),!i(t,2))return t;for(let e=1;e<t.length;e++)t[e]=t[e-1]+`.`+t[e];return t.reverse()}function G(e,t){let n=e.split(`.`).length,r=t.split(`.`).length;switch(!0){case n>r:return 1;case n<r:return-1;default:return 0}}function K(e,t){return G(e.id,t.id)}function q(e){return e.map(e=>({item:e,fqn:e.id.split(`.`)})).sort((e,t)=>e.fqn.length-t.fqn.length).map(({item:e})=>e)}function J(e,t){let n=t;for(let t of e)t!==n&&R(t,n)&&(n=t);return n===t?null:n}function oe(e){let t=[],n=[...e],r;for(;r=n.shift();){let e;for(;e=J(n,r);)t.push(...n.splice(n.indexOf(e),1));t.push(r)}return t}function Y(e,t){if(!e||k(e)){let t=e??`asc`;return e=>Y(e,t)}let n=t===`desc`?-1:1;return e.map(e=>({item:e,fqn:e.id.split(`.`)})).sort((e,t)=>{if(e.fqn.length!==t.fqn.length)return(e.fqn.length-t.fqn.length)*n;for(let n=0;n<e.fqn.length;n++){let r=T(e.fqn[n],t.fqn[n]);if(r!==0)return r}return 0}).map(({item:e})=>e)}function se(e,t,n){let r=e.get(t);return r||(r=n(t),e.set(t,r)),r}function ce(e){return typeof e==`object`&&!!e&&Symbol.iterator in e}function le(e,t){let r=t??e;x(n(r));function*i(e){for(let t of e)r(t)&&(yield t)}return t?i(e):i}function ue(e,t){let r=t??e;x(n(r));function i(e){for(let t of e)if(r(t))return t}return t?i(e):i}function de(e,t){let n=t??e;x(typeof n==`number`&&n>=0,`Count must be a non-negative number`);function*r(e){let t=0;for(let r of e){if(t>=n)break;yield r,t++}}return t===void 0?e=>r(e):r(e)}function fe(e){return e?X(e):X}function*X(e){for(let t of e)yield*t}function pe(e,t){let r=t??e;x(n(r));function*i(e){for(let t of e)yield*r(t)}return t?i(e):i}function me(e){return e?Z(e):Z}function Z(e){let{value:t}=e[Symbol.iterator]().next();return t}function he(e,t){let r=t??e;x(n(r));function*i(e){for(let t of e)yield r(t)}return t?i(e):i}function ge(e,t,r){let i=a(r)?t:e,o=r??t;x(n(i));function s(e){let t=o;for(let n of e)t=i(t,n);return t}return a(r)?s(e):s}function _e(e,t){let r=t??e;x(n(r));function i(e){for(let t of e)if(r(t))return!0;return!1}return t?i(e):i}function ve(e){return e?Array.from(e):e=>Array.from(e)}function ye(e){return e?new Set(e):e=>new Set(e)}function be(e){return e?Q(e):Q}function*Q(e){let t=new Set;for(let n of e)t.has(n)||(t.add(n),yield n)}function xe(e,t,n){let r=typeof t==`symbol`?t:Symbol.for(t);return e.hasOwnProperty(r)||Object.defineProperty(e,r,{enumerable:!1,writable:!1,value:n()}),e[r]}function Se(...e){let t=100;return e.length===2?t=c(e[0],e[1]):e.length===1&&(t=e[0]),new Promise(e=>{setTimeout(()=>{e(`LIKEC4_DELAY`)},t??100)})}function Ce(){return Promise.resolve().then(()=>void 0)}function we(e){Promise.resolve().then(e)}const Te=(e,t)=>{let n=U(e.source.id,e.target.id),r=U(t.source.id,t.target.id);if(n&&!r)return 1;if(!n&&r)return-1;let i=n&&r?G(n,r):0;if(i!==0)return i;let a=G(e.source.id,t.source.id);return a===0?G(e.target.id,t.target.id):a};function Ee(...e){let t=new Set;for(let n of e)for(let e of n)t.add(e);return t}function $(e,...t){let n=new Set;if(e.size===0)return n;let r=i(t,2)?(0,f.intersection)(...t):t[0];if(r.size===0)return n;for(let t of e)r.has(t)&&n.add(t);return n}function De(e,t){if(e.size===0)return new Set;if(t.size===0)return new Set(e);let n=new Set;for(let r of e)t.has(r)||n.add(r);return n}function Oe(e,t){return e.size===t.size&&[...e].every(e=>t.has(e))}function ke(e,t){return(0,f.symmetricDifference)(e,t)}function Ae(e,t){if(e.size===0||t.size===0)return!1;t.size<e.size&&([e,t]=[t,e]);for(let n of e)if(t.has(n))return!0;return!1}function je(e){return x(typeof e==`object`&&r(e),`objectHash: value must be an object`),p(e)}function Me(e){let t=5381,n=e.length;x(n>0,`stringHash: empty string`);for(let r=0;r<n;r++)t=t*33^e.charCodeAt(r);return(t>>>0).toString(36)}function Ne(){return ie().use(ne).use(y).use(b).use(re,{allowDangerousHtml:!0}).use(h,t({attributes:{"*":[`className`],svg:[`width`,`height`,`viewBox`,`fill`,`ariaHidden`],path:[`d`,`fill`,`stroke`,`strokeWidth`,`strokeLinecap`,`strokeLinejoin`]},tagNames:[`svg`,`g`,`path`,`div`],protocols:{src:[`data`]}},m)).use(g,{allowDangerousHtml:!0})}function Pe(e){return(``+Ne().processSync(e)).trim()}function Fe(e){return _(v(e),{includeHtml:!1,includeImageAlt:!1})}export{ae as $,W as A,F as B,pe as C,le as D,ue as E,V as F,P as G,Y as H,R as I,T as J,A as K,B as L,K as M,G as N,ce as O,H as P,x as Q,z as R,me as S,de as T,oe as U,q as V,N as W,D as X,O as Y,C as Z,ve as _,De as a,ge as b,$ as c,Te as d,S as et,Se as f,be as g,xe as h,je as i,U as j,se as k,ke as l,Ce as m,Pe as n,Oe as o,we as p,k as q,Me as r,Ae as s,Fe as t,Ee as u,ye as v,fe as w,he as x,_e as y,I as z};
|