@tyanxie/paimon-darwin-arm64 1.6.0 → 2.0.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.
Files changed (79) hide show
  1. package/bin/paimon +2 -2
  2. package/package.json +1 -1
  3. package/web/assets/abnfDiagram-VCTEODGH-C_ttoOR-.js +1 -0
  4. package/web/assets/arc-yAsaH0Dw.js +1 -0
  5. package/web/assets/architectureDiagram-5GKGNRK7-CaDJakVP.js +36 -0
  6. package/web/assets/blockDiagram-I7D4REHJ-BQd0dwKa.js +129 -0
  7. package/web/assets/c4Diagram-7LVT6UL2-nZGUi3mU.js +38 -0
  8. package/web/assets/channel-DF8NlRb_.js +1 -0
  9. package/web/assets/chunk-2Q5K7J3B-NPXGjG3f.js +1 -0
  10. package/web/assets/chunk-5VM5RSS4-CJY7RIjt.js +15 -0
  11. package/web/assets/chunk-F27PBJKO-DT1ynzIY.js +1 -0
  12. package/web/assets/chunk-IMKFNOWR-CH6O0dOI.js +231 -0
  13. package/web/assets/chunk-JWPE2WC7-HT0bbIVb.js +1 -0
  14. package/web/assets/chunk-POPQ4Y6H-JAIuAfSC.js +1 -0
  15. package/web/assets/chunk-SVP7TREG-6IvqfLNl.js +88 -0
  16. package/web/assets/chunk-TICWLB2K-Un-BtVJH.js +206 -0
  17. package/web/assets/chunk-XXDRQBXY-MmAyjRcU.js +1 -0
  18. package/web/assets/classDiagram-ZZMXUADV-BJm7NJbs.js +1 -0
  19. package/web/assets/classDiagram-v2-VYDZK3BY-BJm7NJbs.js +1 -0
  20. package/web/assets/cose-bilkent-JH36ORCC-BKY655a1.js +1 -0
  21. package/web/assets/cynefin-OW5HDTMX-Oul7bDb8.js +178 -0
  22. package/web/assets/cynefinDiagram-5FMLGOSQ-C2liQpUc.js +62 -0
  23. package/web/assets/cytoscape.esm-BLAcgzS2.js +331 -0
  24. package/web/assets/dagre-GXQ25YYZ-DYrwe_pj.js +4 -0
  25. package/web/assets/defaultLocale-CrowFXzY.js +1 -0
  26. package/web/assets/diagram-S7CK7UJ4-BiMW816X.js +30 -0
  27. package/web/assets/diagram-UQ7AKVKN-Dx--Yu_z.js +41 -0
  28. package/web/assets/diagram-VSXAHHWV-DRrurU6X.js +3 -0
  29. package/web/assets/diagram-VX7I27RA-00uuQ0k2.js +24 -0
  30. package/web/assets/diagram-Z3DM3KII-Cvgf5Y5I.js +24 -0
  31. package/web/assets/ebnfDiagram-PWID7BFC-CHZyB5eb.js +1 -0
  32. package/web/assets/erDiagram-RLTQ6QDP-BfpNZTDy.js +99 -0
  33. package/web/assets/flowDiagram-HODETNUW-BNTRT4LN.js +168 -0
  34. package/web/assets/framework-gzBbjyR4.js +49 -0
  35. package/web/assets/ganttDiagram-EL5Y4UJY-B8LaEeAd.js +292 -0
  36. package/web/assets/gitGraphDiagram-WWUBYQGX-BPhOAW6u.js +106 -0
  37. package/web/assets/index-BLBkIpT7.css +1 -0
  38. package/web/assets/index-DsjiosHk.js +78 -0
  39. package/web/assets/index-xz7ziSVU.js +264 -0
  40. package/web/assets/infoDiagram-27XIBGKW-U6LgO_ju.js +2 -0
  41. package/web/assets/init-Gi6I4Gst.js +1 -0
  42. package/web/assets/isObjectLike-DlmVz5ty.js +1 -0
  43. package/web/assets/ishikawaDiagram-5VMMS53U-DxXeMYDc.js +70 -0
  44. package/web/assets/journeyDiagram-3NMN7TZE-Bx7POPvm.js +139 -0
  45. package/web/assets/kanban-definition-UXKFOSKX-CpYDSQwK.js +89 -0
  46. package/web/assets/katex-C5jXJg4s.js +257 -0
  47. package/web/assets/layout-Bt4nl8Oy.js +1 -0
  48. package/web/assets/linear-IZfkTFEW.js +1 -0
  49. package/web/assets/markdown-OowzRXxA.js +69 -0
  50. package/web/assets/mermaid.core-DVbCkJL3.js +310 -0
  51. package/web/assets/mermaidTheme-DoQvsUbV.js +24 -0
  52. package/web/assets/mindmap-definition-YA3MSWOX-CcsjXg_l.js +96 -0
  53. package/web/assets/mix-CrMk8dT1.js +1 -0
  54. package/web/assets/modalFeatures-BeDlpc4S.js +1 -0
  55. package/web/assets/modelConfig-BWIG2U9q.js +374 -0
  56. package/web/assets/ordinal-Cboi1Yqb.js +1 -0
  57. package/web/assets/pegDiagram-XKGWAZYB-D8bhpeEX.js +1 -0
  58. package/web/assets/pieDiagram-E7YTZNPT-DpqpRrk3.js +39 -0
  59. package/web/assets/purify.es-CAi2OJFm.js +3 -0
  60. package/web/assets/quadrantDiagram-AXDQQJYC-D3jcnC7Q.js +7 -0
  61. package/web/assets/railroadDiagram-O6MQD6OU-KAu7lO3i.js +1 -0
  62. package/web/assets/requirementDiagram-BXWQKSXE-BjvIFtJN.js +84 -0
  63. package/web/assets/sankeyDiagram-P5KCCOFB-BAeQKqir.js +40 -0
  64. package/web/assets/sequenceDiagram-WJ2MYXX4-COPuE32n.js +162 -0
  65. package/web/assets/sizeCapture-INFHLROL-DOSmwQs7.js +1 -0
  66. package/web/assets/stateDiagram-D77RDMKH-DkQ3KhXj.js +1 -0
  67. package/web/assets/stateDiagram-v2-MP3YSRHH-C2O-IoZS.js +1 -0
  68. package/web/assets/swimlanes-42K2YHIH-Belip6eP.js +1 -0
  69. package/web/assets/swimlanesDiagram-VR7AAH4N-CzGu2D2p.js +8 -0
  70. package/web/assets/timeline-definition-24CTP7MA-Bntb2OTs.js +120 -0
  71. package/web/assets/vennDiagram-4TSXK5OY-Cw2eTnvz.js +34 -0
  72. package/web/assets/wardleyDiagram-VM6X3IG4-DzJNpWOP.js +78 -0
  73. package/web/assets/xychartDiagram-S5SC5T6Z-CmlwEiU8.js +7 -0
  74. package/web/index.html +15 -10
  75. package/web/assets/framework-CY9iUjoF.js +0 -49
  76. package/web/assets/index-BVDOOsji.js +0 -6
  77. package/web/assets/index-DGclViZs.css +0 -1
  78. package/web/assets/markdown-CbB-lJ6c.js +0 -69
  79. package/web/assets/vendor-BXh3TPFq.js +0 -200
@@ -0,0 +1,24 @@
1
+ import{C as z,m as q,c as w}from"./mix-CrMk8dT1.js";import{c as v}from"./channel-DF8NlRb_.js";const p=k=>z.format.hex.stringify(z.parse(k)),E=k=>v(k,"a");function P(k){const t=k==="dark",$=getComputedStyle(document.documentElement),n=(e,r)=>$.getPropertyValue(e).trim()||r,B=Number.parseFloat(n("--radius-content","8px")),L=Number.parseFloat(n("--radius-inline","4px")),i=p(n("--btn-solid",t?"#282828":"#f6f6f6")),F=e=>p(q(w(e,{a:1}),i,E(e)*100)),o=F(n("--label-primary",t?"#ffffffd9":"#000000d9")),l=F(n("--label-secondary",t?"#ffffff8c":"#00000080")),a=(e,r)=>p(q(e,i,r)),C=t?F(n("--fill-primary","#ffffff1a")):"#ffffff",c=F(n("--fill-quaternary",t?"#ffffff08":"#00000008")),d=a(o,48),f=a(o,25),m=p(n("--color-accent","#0091ff")),h=p(n("--toast-icon-success",t?"#3bdb63":"#30d158")),b=p(n("--toast-icon-warning",t?"#ff9e33":"#ff9230")),S=p(n("--toast-icon-error",t?"#ff4747":"#ff4245")),T=a(m,t?22:12),y=a(b,t?18:10),u=n("--font-sans",'-apple-system, BlinkMacSystemFont, "Inter", "SF Pro", sans-serif'),x=[m,"#6d7cff",h,b,"#ff375f","#00d2e0","#db34f2","#b78a66","#ffd600",S,"#3cd3fe","#00dac3"],g=x.map(e=>a(e,t?28:24)),A=x.map(e=>a(e,t?32:45)),s={};x.forEach((e,r)=>{s[`cScale${r}`]=g[r],s[`cScalePeer${r}`]=a(e,t?45:60),s[`cScaleInv${r}`]=o,s[`cScaleLabel${r}`]=o,s[`pie${r+1}`]=A[r],r<8&&(s[`fillType${r}`]=g[r],s[`git${r}`]=g[r],s[`gitInv${r}`]=o,s[`gitBranchLabel${r}`]=o)});for(let e=0;e<5;e++)s[`surface${e}`]=a(o,t?6+e*3:3+e*2),s[`surfacePeer${e}`]=a(o,t?10+e*3:7+e*2);return{startOnLoad:!1,securityLevel:"strict",suppressErrorRendering:!0,theme:"base",look:"classic",darkMode:t,htmlLabels:!1,fontFamily:u,themeVariables:{darkMode:t,background:i,fontFamily:u,fontSize:"14px",fontWeight:"400",radius:B,strokeWidth:1,useGradient:!1,dropShadow:"none",primaryColor:C,primaryTextColor:o,primaryBorderColor:d,secondaryColor:T,secondaryTextColor:o,secondaryBorderColor:m,tertiaryColor:c,tertiaryTextColor:o,tertiaryBorderColor:f,textColor:o,lineColor:l,arrowheadColor:l,nodeBkg:C,mainBkg:C,nodeBorder:d,nodeTextColor:o,clusterBkg:c,clusterBorder:f,titleColor:o,defaultLinkColor:l,edgeLabelBackground:i,noteBkgColor:y,noteTextColor:o,noteBorderColor:a(b,50),noteFontWeight:"400",actorBkg:C,actorBorder:d,actorTextColor:o,actorLineColor:d,signalColor:l,signalTextColor:o,labelBoxBkgColor:c,labelBoxBorderColor:f,labelTextColor:o,loopTextColor:o,activationBkgColor:T,activationBorderColor:m,sequenceNumberColor:i,rectBkgColor:c,stateBkg:C,stateLabelColor:o,transitionColor:l,transitionLabelColor:o,labelBackgroundColor:i,compositeBackground:c,compositeTitleBackground:C,compositeBorder:f,altBackground:i,innerEndBackground:l,specialStateColor:l,classText:o,attributeBackgroundColorOdd:C,attributeBackgroundColorEven:c,rowOdd:C,rowEven:c,sectionBkgColor:c,altSectionBkgColor:i,sectionBkgColor2:c,excludeBkgColor:c,taskBkgColor:T,taskBorderColor:m,activeTaskBkgColor:a(h,t?22:14),activeTaskBorderColor:a(h,70),doneTaskBkgColor:c,doneTaskBorderColor:d,critBkgColor:a(S,t?24:14),critBorderColor:S,todayLineColor:S,taskTextColor:o,taskTextOutsideColor:o,taskTextLightColor:o,taskTextDarkColor:o,taskTextClickableColor:o,gridColor:f,vertLineColor:l,faceColor:y,personBkg:C,personBorder:d,scaleLabelColor:o,pieTitleTextSize:"17px",pieTitleTextColor:o,pieSectionTextSize:"14px",pieSectionTextColor:o,pieLegendTextSize:"13px",pieLegendTextColor:o,pieStrokeColor:i,pieStrokeWidth:"2px",pieOuterStrokeColor:i,pieOuterStrokeWidth:"0px",pieOpacity:"1",branchLabelColor:o,tagLabelColor:o,tagLabelBackground:y,tagBorder:a(b,50),tagLabelBorder:a(b,50),tagLabelFontSize:"12px",commitLabelColor:o,commitLabelBackground:i,commitLabelFontSize:"12px",requirementBackground:C,requirementBorderColor:d,requirementTextColor:o,relationColor:l,relationLabelBackground:i,relationLabelColor:o,archEdgeColor:l,archEdgeArrowColor:l,archEdgeWidth:"1.5",archGroupBorderColor:f,archGroupBorderWidth:"1px",quadrant1Fill:g[0],quadrant2Fill:g[1],quadrant3Fill:g[2],quadrant4Fill:g[3],quadrant1TextFill:o,quadrant2TextFill:o,quadrant3TextFill:o,quadrant4TextFill:o,quadrantPointFill:l,quadrantPointTextFill:o,quadrantXAxisTextFill:o,quadrantYAxisTextFill:o,quadrantInternalBorderStrokeFill:f,quadrantExternalBorderStrokeFill:d,quadrantTitleFill:o,xyChart:{backgroundColor:"transparent",titleColor:o,dataLabelColor:o,legendTextColor:o,xAxisTitleColor:o,xAxisLabelColor:l,xAxisTickColor:f,xAxisLineColor:d,yAxisTitleColor:o,yAxisLabelColor:l,yAxisTickColor:f,yAxisLineColor:d,plotColorPalette:x.map(e=>a(e,75)).join(",")},radar:{axisColor:d,graticuleColor:f},...s},themeCSS:`
2
+ text { fill: ${o}; }
3
+ .titleText, text[font-size="4ex"] { font-size: 17px; font-weight: 500; }
4
+ .lineWrapper line, line[stroke="black"][marker-end] {
5
+ stroke: ${l};
6
+ stroke-width: 1.5px;
7
+ }
8
+ marker[id$="-arrowhead"] path { fill: ${l}; }
9
+ .eventWrapper { filter: none; }
10
+ .edge[class*="edge-depth-"] { stroke-width: 2px; }
11
+ ${x.map((e,r)=>`.section-edge-${r-1} { stroke: ${a(e,65)}; }`).join(`
12
+ `)}
13
+ .node > rect.label-container:not([rx]), .node > rect.label-container[rx="0"],
14
+ .node > rect.outer, .cluster > rect, rect.actor, rect.note, rect.labelBox {
15
+ rx: ${B}px;
16
+ ry: ${B}px;
17
+ }
18
+ .edgeLabel rect { opacity: 1; rx: ${L}px; ry: ${L}px; }
19
+ .cluster-label text, .cluster-label span { font-weight: 500; }
20
+ .flowchart-link, .transition, .messageLine0, .messageLine1 {
21
+ stroke-linecap: round;
22
+ stroke-linejoin: round;
23
+ }
24
+ `,flowchart:{padding:12,nodeSpacing:36,rankSpacing:48,diagramPadding:16},sequence:{actorFontFamily:u,noteFontFamily:u,messageFontFamily:u,actorFontSize:14,noteFontSize:13,messageFontSize:13,actorFontWeight:500,noteFontWeight:400,messageFontWeight:400,diagramMarginX:16,diagramMarginY:16},state:{fontSize:14,radius:B},er:{fontSize:14},gantt:{fontSize:13,sectionFontSize:13},xyChart:{titleFontSize:17,legendFontSize:13,xAxis:{labelFontSize:13,titleFontSize:14},yAxis:{labelFontSize:13,titleFontSize:14}},quadrantChart:{titleFontSize:17,xAxisLabelFontSize:13,yAxisLabelFontSize:13,quadrantLabelFontSize:14,pointLabelFontSize:12},journey:{actorColours:x,titleColor:o,titleFontFamily:u,titleFontSize:"17px",sectionFills:g,sectionColours:g.map(()=>o),taskFontSize:14,taskFontFamily:u},secure:["secure","securityLevel","startOnLoad","maxTextSize","maxEdges","suppressErrorRendering","htmlLabels","dompurifyConfig","theme","themeCSS","themeVariables","fontFamily","darkMode","look"]}}export{P as createMermaidConfig};
@@ -0,0 +1,96 @@
1
+ import{g as oe}from"./chunk-XXDRQBXY-MmAyjRcU.js";import{s as ce}from"./chunk-POPQ4Y6H-JAIuAfSC.js";import{b as h,bd as R,au as le,bz as he,ap as de,a9 as z,aq as U,bD as H,aA as ge,aX as ue,b9 as pe,a4 as fe}from"./mermaid.core-DVbCkJL3.js";import"./framework-gzBbjyR4.js";import"./purify.es-CAi2OJFm.js";import"./mix-CrMk8dT1.js";import"./isObjectLike-DlmVz5ty.js";const b=[];for(let t=0;t<256;++t)b.push((t+256).toString(16).slice(1));function me(t,e=0){return(b[t[e+0]]+b[t[e+1]]+b[t[e+2]]+b[t[e+3]]+"-"+b[t[e+4]]+b[t[e+5]]+"-"+b[t[e+6]]+b[t[e+7]]+"-"+b[t[e+8]]+b[t[e+9]]+"-"+b[t[e+10]]+b[t[e+11]]+b[t[e+12]]+b[t[e+13]]+b[t[e+14]]+b[t[e+15]]).toLowerCase()}const ye=new Uint8Array(16);function Ee(){return crypto.getRandomValues(ye)}function be(t,e,o){return crypto.randomUUID?crypto.randomUUID():_e(t)}function _e(t,e,o){var n;t=t||{};const l=t.random??((n=t.rng)==null?void 0:n.call(t))??Ee();if(l.length<16)throw new Error("Random bytes length must be >= 16");return l[6]=l[6]&15|64,l[8]=l[8]&63|128,me(l)}var K=(function(){var t=h(function(O,s,i,a){for(i=i||{},a=O.length;a--;i[O[a]]=s);return i},"o"),e=[1,4],o=[1,13],l=[1,12],n=[1,15],d=[1,16],p=[1,20],y=[1,19],E=[6,7,8],k=[1,26],L=[1,24],D=[1,25],_=[6,7,11],$=[1,6,13,15,16,19,22],f=[1,33],B=[1,34],P=[1,6,7,11,13,15,16,19,22],W={trace:h(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,MINDMAP:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,ICON:15,CLASS:16,nodeWithId:17,nodeWithoutId:18,NODE_DSTART:19,NODE_DESCR:20,NODE_DEND:21,NODE_ID:22,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"MINDMAP",11:"EOF",13:"SPACELIST",15:"ICON",16:"CLASS",19:"NODE_DSTART",20:"NODE_DESCR",21:"NODE_DEND",22:"NODE_ID"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[18,3],[17,1],[17,4]],performAction:h(function(s,i,a,c,u,r,M){var g=r.length-1;switch(u){case 6:case 7:return c;case 8:c.getLogger().trace("Stop NL ");break;case 9:c.getLogger().trace("Stop EOF ");break;case 11:c.getLogger().trace("Stop NL2 ");break;case 12:c.getLogger().trace("Stop EOF2 ");break;case 15:c.getLogger().info("Node: ",r[g].id),c.addNode(r[g-1].length,r[g].id,r[g].descr,r[g].type);break;case 16:c.getLogger().trace("Icon: ",r[g]),c.decorateNode({icon:r[g]});break;case 17:case 21:c.decorateNode({class:r[g]});break;case 18:c.getLogger().trace("SPACELIST");break;case 19:c.getLogger().trace("Node: ",r[g].id),c.addNode(0,r[g].id,r[g].descr,r[g].type);break;case 20:c.decorateNode({icon:r[g]});break;case 25:c.getLogger().trace("node found ..",r[g-2]),this.$={id:r[g-1],descr:r[g-1],type:c.getType(r[g-2],r[g])};break;case 26:this.$={id:r[g],descr:r[g],type:c.nodeType.DEFAULT};break;case 27:c.getLogger().trace("node found ..",r[g-3]),this.$={id:r[g-3],descr:r[g-1],type:c.getType(r[g-2],r[g])};break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:e},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:e},{6:o,7:[1,10],9:9,12:11,13:l,14:14,15:n,16:d,17:17,18:18,19:p,22:y},t(E,[2,3]),{1:[2,2]},t(E,[2,4]),t(E,[2,5]),{1:[2,6],6:o,12:21,13:l,14:14,15:n,16:d,17:17,18:18,19:p,22:y},{6:o,9:22,12:11,13:l,14:14,15:n,16:d,17:17,18:18,19:p,22:y},{6:k,7:L,10:23,11:D},t(_,[2,22],{17:17,18:18,14:27,15:[1,28],16:[1,29],19:p,22:y}),t(_,[2,18]),t(_,[2,19]),t(_,[2,20]),t(_,[2,21]),t(_,[2,23]),t(_,[2,24]),t(_,[2,26],{19:[1,30]}),{20:[1,31]},{6:k,7:L,10:32,11:D},{1:[2,7],6:o,12:21,13:l,14:14,15:n,16:d,17:17,18:18,19:p,22:y},t($,[2,14],{7:f,11:B}),t(P,[2,8]),t(P,[2,9]),t(P,[2,10]),t(_,[2,15]),t(_,[2,16]),t(_,[2,17]),{20:[1,35]},{21:[1,36]},t($,[2,13],{7:f,11:B}),t(P,[2,11]),t(P,[2,12]),{21:[1,37]},t(_,[2,25]),t(_,[2,27])],defaultActions:{2:[2,1],6:[2,2]},parseError:h(function(s,i){if(i.recoverable)this.trace(s);else{var a=new Error(s);throw a.hash=i,a}},"parseError"),parse:h(function(s){var i=this,a=[0],c=[],u=[null],r=[],M=this.table,g="",F=0,Q=0,ie=2,Z=1,se=r.slice.call(arguments,1),m=Object.create(this.lexer),C={yy:{}};for(var X in this.yy)Object.prototype.hasOwnProperty.call(this.yy,X)&&(C.yy[X]=this.yy[X]);m.setInput(s,C.yy),C.yy.lexer=m,C.yy.parser=this,typeof m.yylloc>"u"&&(m.yylloc={});var Y=m.yylloc;r.push(Y);var re=m.options&&m.options.ranges;typeof C.yy.parseError=="function"?this.parseError=C.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ae(x){a.length=a.length-2*x,u.length=u.length-x,r.length=r.length-x}h(ae,"popStack");function ee(){var x;return x=c.pop()||m.lex()||Z,typeof x!="number"&&(x instanceof Array&&(c=x,x=c.pop()),x=i.symbols_[x]||x),x}h(ee,"lex");for(var S,I,N,q,w={},G,v,te,j;;){if(I=a[a.length-1],this.defaultActions[I]?N=this.defaultActions[I]:((S===null||typeof S>"u")&&(S=ee()),N=M[I]&&M[I][S]),typeof N>"u"||!N.length||!N[0]){var J="";j=[];for(G in M[I])this.terminals_[G]&&G>ie&&j.push("'"+this.terminals_[G]+"'");m.showPosition?J="Parse error on line "+(F+1)+`:
2
+ `+m.showPosition()+`
3
+ Expecting `+j.join(", ")+", got '"+(this.terminals_[S]||S)+"'":J="Parse error on line "+(F+1)+": Unexpected "+(S==Z?"end of input":"'"+(this.terminals_[S]||S)+"'"),this.parseError(J,{text:m.match,token:this.terminals_[S]||S,line:m.yylineno,loc:Y,expected:j})}if(N[0]instanceof Array&&N.length>1)throw new Error("Parse Error: multiple actions possible at state: "+I+", token: "+S);switch(N[0]){case 1:a.push(S),u.push(m.yytext),r.push(m.yylloc),a.push(N[1]),S=null,Q=m.yyleng,g=m.yytext,F=m.yylineno,Y=m.yylloc;break;case 2:if(v=this.productions_[N[1]][1],w.$=u[u.length-v],w._$={first_line:r[r.length-(v||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(v||1)].first_column,last_column:r[r.length-1].last_column},re&&(w._$.range=[r[r.length-(v||1)].range[0],r[r.length-1].range[1]]),q=this.performAction.apply(w,[g,Q,F,C.yy,N[1],u,r].concat(se)),typeof q<"u")return q;v&&(a=a.slice(0,-1*v*2),u=u.slice(0,-1*v),r=r.slice(0,-1*v)),a.push(this.productions_[N[1]][0]),u.push(w.$),r.push(w._$),te=M[a[a.length-2]][a[a.length-1]],a.push(te);break;case 3:return!0}}return!0},"parse")},ne=(function(){var O={EOF:1,parseError:h(function(i,a){if(this.yy.parser)this.yy.parser.parseError(i,a);else throw new Error(i)},"parseError"),setInput:h(function(s,i){return this.yy=i||this.yy||{},this._input=s,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:h(function(){var s=this._input[0];this.yytext+=s,this.yyleng++,this.offset++,this.match+=s,this.matched+=s;var i=s.match(/(?:\r\n?|\n).*/g);return i?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),s},"input"),unput:h(function(s){var i=s.length,a=s.split(/(?:\r\n?|\n)/g);this._input=s+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-i),this.offset-=i;var c=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),a.length-1&&(this.yylineno-=a.length-1);var u=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:a?(a.length===c.length?this.yylloc.first_column:0)+c[c.length-a.length].length-a[0].length:this.yylloc.first_column-i},this.options.ranges&&(this.yylloc.range=[u[0],u[0]+this.yyleng-i]),this.yyleng=this.yytext.length,this},"unput"),more:h(function(){return this._more=!0,this},"more"),reject:h(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
4
+ `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:h(function(s){this.unput(this.match.slice(s))},"less"),pastInput:h(function(){var s=this.matched.substr(0,this.matched.length-this.match.length);return(s.length>20?"...":"")+s.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:h(function(){var s=this.match;return s.length<20&&(s+=this._input.substr(0,20-s.length)),(s.substr(0,20)+(s.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:h(function(){var s=this.pastInput(),i=new Array(s.length+1).join("-");return s+this.upcomingInput()+`
5
+ `+i+"^"},"showPosition"),test_match:h(function(s,i){var a,c,u;if(this.options.backtrack_lexer&&(u={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(u.yylloc.range=this.yylloc.range.slice(0))),c=s[0].match(/(?:\r\n?|\n).*/g),c&&(this.yylineno+=c.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:c?c[c.length-1].length-c[c.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+s[0].length},this.yytext+=s[0],this.match+=s[0],this.matches=s,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(s[0].length),this.matched+=s[0],a=this.performAction.call(this,this.yy,this,i,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),a)return a;if(this._backtrack){for(var r in u)this[r]=u[r];return!1}return!1},"test_match"),next:h(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var s,i,a,c;this._more||(this.yytext="",this.match="");for(var u=this._currentRules(),r=0;r<u.length;r++)if(a=this._input.match(this.rules[u[r]]),a&&(!i||a[0].length>i[0].length)){if(i=a,c=r,this.options.backtrack_lexer){if(s=this.test_match(a,u[r]),s!==!1)return s;if(this._backtrack){i=!1;continue}else return!1}else if(!this.options.flex)break}return i?(s=this.test_match(i,u[c]),s!==!1?s:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
6
+ `+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:h(function(){var i=this.next();return i||this.lex()},"lex"),begin:h(function(i){this.conditionStack.push(i)},"begin"),popState:h(function(){var i=this.conditionStack.length-1;return i>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:h(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:h(function(i){return i=this.conditionStack.length-1-Math.abs(i||0),i>=0?this.conditionStack[i]:"INITIAL"},"topState"),pushState:h(function(i){this.begin(i)},"pushState"),stateStackSize:h(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:h(function(i,a,c,u){switch(c){case 0:return i.getLogger().trace("Found comment",a.yytext),6;case 1:return 8;case 2:this.begin("CLASS");break;case 3:return this.popState(),16;case 4:this.popState();break;case 5:i.getLogger().trace("Begin icon"),this.begin("ICON");break;case 6:return i.getLogger().trace("SPACELINE"),6;case 7:return 7;case 8:return 15;case 9:i.getLogger().trace("end icon"),this.popState();break;case 10:return i.getLogger().trace("Exploding node"),this.begin("NODE"),19;case 11:return i.getLogger().trace("Cloud"),this.begin("NODE"),19;case 12:return i.getLogger().trace("Explosion Bang"),this.begin("NODE"),19;case 13:return i.getLogger().trace("Cloud Bang"),this.begin("NODE"),19;case 14:return this.begin("NODE"),19;case 15:return this.begin("NODE"),19;case 16:return this.begin("NODE"),19;case 17:return this.begin("NODE"),19;case 18:return 13;case 19:return 22;case 20:return 11;case 21:this.begin("NSTR2");break;case 22:return"NODE_DESCR";case 23:this.popState();break;case 24:i.getLogger().trace("Starting NSTR"),this.begin("NSTR");break;case 25:return i.getLogger().trace("description:",a.yytext),"NODE_DESCR";case 26:this.popState();break;case 27:return this.popState(),i.getLogger().trace("node end ))"),"NODE_DEND";case 28:return this.popState(),i.getLogger().trace("node end )"),"NODE_DEND";case 29:return this.popState(),i.getLogger().trace("node end ...",a.yytext),"NODE_DEND";case 30:return this.popState(),i.getLogger().trace("node end (("),"NODE_DEND";case 31:return this.popState(),i.getLogger().trace("node end (-"),"NODE_DEND";case 32:return this.popState(),i.getLogger().trace("node end (-"),"NODE_DEND";case 33:return this.popState(),i.getLogger().trace("node end (("),"NODE_DEND";case 34:return this.popState(),i.getLogger().trace("node end (("),"NODE_DEND";case 35:return i.getLogger().trace("Long description:",a.yytext),20;case 36:return i.getLogger().trace("Long description:",a.yytext),20}},"anonymous"),rules:[/^(?:\s*%%.*)/i,/^(?:mindmap\b)/i,/^(?::::)/i,/^(?:.+)/i,/^(?:\n)/i,/^(?:::icon\()/i,/^(?:[\s]+[\n])/i,/^(?:[\n]+)/i,/^(?:[^\)]+)/i,/^(?:\))/i,/^(?:-\))/i,/^(?:\(-)/i,/^(?:\)\))/i,/^(?:\))/i,/^(?:\(\()/i,/^(?:\{\{)/i,/^(?:\()/i,/^(?:\[)/i,/^(?:[\s]+)/i,/^(?:[^\(\[\n\)\{\}]+)/i,/^(?:$)/i,/^(?:["][`])/i,/^(?:[^`"]+)/i,/^(?:[`]["])/i,/^(?:["])/i,/^(?:[^"]+)/i,/^(?:["])/i,/^(?:[\)]\))/i,/^(?:[\)])/i,/^(?:[\]])/i,/^(?:\}\})/i,/^(?:\(-)/i,/^(?:-\))/i,/^(?:\(\()/i,/^(?:\()/i,/^(?:[^\)\]\(\}]+)/i,/^(?:.+(?!\(\())/i],conditions:{CLASS:{rules:[3,4],inclusive:!1},ICON:{rules:[8,9],inclusive:!1},NSTR2:{rules:[22,23],inclusive:!1},NSTR:{rules:[25,26],inclusive:!1},NODE:{rules:[21,24,27,28,29,30,31,32,33,34,35,36],inclusive:!1},INITIAL:{rules:[0,1,2,5,6,7,10,11,12,13,14,15,16,17,18,19,20],inclusive:!0}}};return O})();W.lexer=ne;function V(){this.yy={}}return h(V,"Parser"),V.prototype=W,W.Parser=V,new V})();K.parser=K;var ke=K,Se=12,T={DEFAULT:0,NO_BORDER:0,ROUNDED_RECT:1,RECT:2,CIRCLE:3,CLOUD:4,BANG:5,HEXAGON:6},A,xe=(A=class{constructor(){this.nodes=[],this.count=0,this.elements={},this.getLogger=this.getLogger.bind(this),this.nodeType=T,this.clear(),this.getType=this.getType.bind(this),this.getElementById=this.getElementById.bind(this),this.getParent=this.getParent.bind(this),this.getMindmap=this.getMindmap.bind(this),this.addNode=this.addNode.bind(this),this.decorateNode=this.decorateNode.bind(this)}clear(){this.nodes=[],this.count=0,this.elements={},this.baseLevel=void 0}getParent(e){for(let o=this.nodes.length-1;o>=0;o--)if(this.nodes[o].level<e)return this.nodes[o];return null}getMindmap(){return this.nodes.length>0?this.nodes[0]:null}addNode(e,o,l,n){var L,D;R.info("addNode",e,o,l,n);let d=!1;this.nodes.length===0?(this.baseLevel=e,e=0,d=!0):this.baseLevel!==void 0&&(e=e-this.baseLevel,d=!1);const p=U();let y=((L=p.mindmap)==null?void 0:L.padding)??z.mindmap.padding;switch(n){case this.nodeType.ROUNDED_RECT:case this.nodeType.RECT:case this.nodeType.HEXAGON:y*=2;break}const E={id:this.count++,nodeId:H(o,p),level:e,descr:H(l,p),type:n,children:[],width:((D=p.mindmap)==null?void 0:D.maxNodeWidth)??z.mindmap.maxNodeWidth,padding:y,isRoot:d},k=this.getParent(e);if(k)k.children.push(E),this.nodes.push(E);else if(d)this.nodes.push(E);else throw new Error(`There can be only one root. No parent could be found for ("${E.descr}")`)}getType(e,o){switch(R.debug("In get type",e,o),e){case"[":return this.nodeType.RECT;case"(":return o===")"?this.nodeType.ROUNDED_RECT:this.nodeType.CLOUD;case"((":return this.nodeType.CIRCLE;case")":return this.nodeType.CLOUD;case"))":return this.nodeType.BANG;case"{{":return this.nodeType.HEXAGON;default:return this.nodeType.DEFAULT}}setElementForId(e,o){this.elements[e]=o}getElementById(e){return this.elements[e]}decorateNode(e){if(!e)return;const o=U(),l=this.nodes[this.nodes.length-1];e.icon&&(l.icon=H(e.icon,o)),e.class&&(l.class=H(e.class,o))}type2Str(e){switch(e){case this.nodeType.DEFAULT:return"no-border";case this.nodeType.RECT:return"rect";case this.nodeType.ROUNDED_RECT:return"rounded-rect";case this.nodeType.CIRCLE:return"circle";case this.nodeType.CLOUD:return"cloud";case this.nodeType.BANG:return"bang";case this.nodeType.HEXAGON:return"hexgon";default:return"no-border"}}assignSections(e,o){if(e.level===0?e.section=void 0:e.section=o,e.children)for(const[l,n]of e.children.entries()){const d=e.level===0?l%(Se-1):o;this.assignSections(n,d)}}flattenNodes(e,o){const l=U(),n=["mindmap-node"];e.isRoot===!0?n.push("section-root","section--1"):e.section!==void 0&&n.push(`section-${e.section}`),e.class&&n.push(e.class);const d=n.join(" "),p=h(E=>{var D;const L=(((D=l.theme)==null?void 0:D.toLowerCase())??"").includes("redux");switch(E){case T.CIRCLE:return"mindmapCircle";case T.RECT:return"rect";case T.ROUNDED_RECT:return"rounded";case T.CLOUD:return"cloud";case T.BANG:return"bang";case T.HEXAGON:return"hexagon";case T.DEFAULT:return L?"rounded":"defaultMindmapNode";case T.NO_BORDER:default:return"rect"}},"getShapeFromType"),y={id:e.id.toString(),domId:"node_"+e.id.toString(),label:e.descr,labelType:"markdown",isGroup:!1,shape:p(e.type),width:e.width,height:e.height??0,padding:e.padding,cssClasses:d,cssStyles:[],look:l.look,icon:e.icon,x:e.x,y:e.y,level:e.level,nodeId:e.nodeId,type:e.type,section:e.section};if(o.push(y),e.children)for(const E of e.children)this.flattenNodes(E,o)}generateEdges(e,o){if(!e.children)return;const l=U();for(const n of e.children){let d="edge";n.section!==void 0&&(d+=` section-edge-${n.section}`);const p=e.level+1;d+=` edge-depth-${p}`;const y={id:`edge_${e.id}_${n.id}`,start:e.id.toString(),end:n.id.toString(),type:"normal",curve:"basis",thickness:"normal",look:l.look,classes:d,depth:e.level,section:n.section};o.push(y),this.generateEdges(n,o)}}getData(){const e=this.getMindmap(),o=U(),n=ge().layout!==void 0,d=o;if(n||(d.layout="cose-bilkent"),!e)return{nodes:[],edges:[],config:d};R.debug("getData: mindmapRoot",e,o),this.assignSections(e);const p=[],y=[];this.flattenNodes(e,p),this.generateEdges(e,y),R.debug(`getData: processed ${p.length} nodes and ${y.length} edges`);const E=new Map;for(const k of p)E.set(k.id,{shape:k.shape,width:k.width,height:k.height,padding:k.padding});return{nodes:p,edges:y,config:d,rootNode:e,markers:["point"],direction:"TB",nodeSpacing:50,rankSpacing:50,shapes:Object.fromEntries(E),type:"mindmap",diagramId:"mindmap-"+be()}}getLogger(){return R}},h(A,"MindmapDB"),A),Ne=h(async(t,e,o,l)=>{var _,$;R.debug(`Rendering mindmap diagram
7
+ `+t);const n=l.db,d=n.getData(),p=oe(e,d.config.securityLevel);if(d.type=l.type,d.layoutAlgorithm=le(d.config.layout,{fallback:"cose-bilkent"}),d.diagramId=e,!n.getMindmap())return;d.nodes.forEach(f=>{f.shape==="rounded"?(f.radius=15,f.taper=15,f.stroke="none",f.width=0,f.padding=15):f.shape==="circle"?f.padding=10:f.shape==="rect"?(f.width=0,f.padding=10):f.shape==="hexagon"&&(f.width=0,f.height=0)}),await he(d,p);const{themeVariables:E}=de(),{useGradient:k,gradientStart:L,gradientStop:D}=E;if(k&&L&&D){const f=p.attr("id"),B=p.append("defs").append("linearGradient").attr("id",`${f}-gradient`).attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");B.append("stop").attr("offset","0%").attr("stop-color",L).attr("stop-opacity",1),B.append("stop").attr("offset","100%").attr("stop-color",D).attr("stop-opacity",1)}ce(p,((_=d.config.mindmap)==null?void 0:_.padding)??z.mindmap.padding,"mindmapDiagram",(($=d.config.mindmap)==null?void 0:$.useMaxWidth)??z.mindmap.useMaxWidth)},"draw"),De={draw:Ne},Le=h(t=>{const{theme:e,look:o}=t;let l="";for(let n=0;n<t.THEME_COLOR_LIMIT;n++)t["lineColor"+n]=t["lineColor"+n]||t["cScaleInv"+n],ue(t["lineColor"+n])?t["lineColor"+n]=pe(t["lineColor"+n],20):t["lineColor"+n]=fe(t["lineColor"+n],20);for(let n=0;n<t.THEME_COLOR_LIMIT;n++){const d=""+(o==="neo"?Math.max(10-(n-1)*2,2):17-3*n);l+=`
8
+ .section-${n-1} rect, .section-${n-1} path, .section-${n-1} circle, .section-${n-1} polygon, .section-${n-1} path {
9
+ fill: ${t["cScale"+n]};
10
+ }
11
+ .section-${n-1} text {
12
+ fill: ${t["cScaleLabel"+n]};
13
+ }
14
+ .section-${n-1} span {
15
+ color: ${t["cScaleLabel"+n]};
16
+ }
17
+ .node-icon-${n-1} {
18
+ font-size: 40px;
19
+ color: ${t["cScaleLabel"+n]};
20
+ }
21
+ .section-edge-${n-1}{
22
+ stroke: ${t["cScale"+n]};
23
+ }
24
+ .edge-depth-${n-1}{
25
+ stroke-width: ${d};
26
+ }
27
+ .section-${n-1} line {
28
+ stroke: ${t["cScaleInv"+n]} ;
29
+ stroke-width: 3;
30
+ }
31
+
32
+ .disabled, .disabled circle, .disabled text {
33
+ fill: lightgray;
34
+ }
35
+ .disabled text {
36
+ fill: #efefef;
37
+ }
38
+ [data-look="neo"].mindmap-node.section-${n-1} rect, [data-look="neo"].mindmap-node.section-${n-1} path, [data-look="neo"].mindmap-node.section-${n-1} circle, [data-look="neo"].mindmap-node.section-${n-1} polygon {
39
+ fill: ${e==="redux"||e==="redux-dark"||e==="neutral"?t.mainBkg:t["cScale"+n]};
40
+ stroke: ${e==="redux"||e==="redux-dark"?t.nodeBorder:t["cScale"+n]};
41
+ stroke-width: ${t.strokeWidth??2}px;
42
+ }
43
+ [data-look="neo"].section-edge-${n-1}{
44
+ stroke: ${e!=null&&e.includes("redux")||e==="neo-dark"?t.nodeBorder:t["cScale"+n]};
45
+ }
46
+ [data-look="neo"].mindmap-node.section-${n-1} text {
47
+ fill: ${e==="redux"||e==="redux-dark"?t.nodeBorder:t["cScaleLabel"+(e==="neutral"?1:n)]};
48
+ }
49
+ `}return l},"genSections"),ve=h((t,e,o)=>{let l="";for(let n=0;n<t;n++)l+=`
50
+ [data-look="neo"].mindmap-node.section-${n-1} rect, [data-look="neo"].mindmap-node.section-${n-1} path, [data-look="neo"].mindmap-node.section-${n-1} circle, [data-look="neo"].mindmap-node.section-${n-1} polygon {
51
+ stroke: url(${e}-gradient);
52
+ fill: ${o};
53
+ }
54
+ .section-${n-1} line {
55
+ stroke-width: 0;
56
+ }`;return l},"genGradient"),Te=h(t=>{const{theme:e}=t,o=t.svgId,l=t.dropShadow?t.dropShadow.replace("url(#drop-shadow)",`url(${o}-drop-shadow)`):"none";return`
57
+ .edge {
58
+ stroke-width: 3;
59
+ }
60
+ ${Le(t)}
61
+ .section-root rect, .section-root path, .section-root circle, .section-root polygon {
62
+ fill: ${t.git0};
63
+ }
64
+ .section-root text {
65
+ fill: ${t.gitBranchLabel0};
66
+ }
67
+ .section-root span {
68
+ color: ${e!=null&&e.includes("redux")?t.nodeBorder:t.gitBranchLabel0};
69
+ }
70
+ .icon-container {
71
+ height:100%;
72
+ display: flex;
73
+ justify-content: center;
74
+ align-items: center;
75
+ }
76
+ .edge {
77
+ fill: none;
78
+ }
79
+ .mindmap-node-label {
80
+ dy: 1em;
81
+ alignment-baseline: middle;
82
+ text-anchor: middle;
83
+ dominant-baseline: middle;
84
+ text-align: center;
85
+ }
86
+ [data-look="neo"].mindmap-node {
87
+ filter: ${l};
88
+ }
89
+ [data-look="neo"].mindmap-node.section-root rect, [data-look="neo"].mindmap-node.section-root path, [data-look="neo"].mindmap-node.section-root circle, [data-look="neo"].mindmap-node.section-root polygon {
90
+ fill: ${e!=null&&e.includes("redux")?t.mainBkg:t.git0};
91
+ }
92
+ [data-look="neo"].mindmap-node.section-root .text-inner-tspan {
93
+ fill: ${e!=null&&e.includes("redux")?t.nodeBorder:t["cScaleLabel"+(e==="neutral"?1:0)]};
94
+ }
95
+ ${t.useGradient&&o&&t.mainBkg?ve(t.THEME_COLOR_LIMIT,o,t.mainBkg):""}
96
+ `},"getStyles"),Oe=Te,Pe={get db(){return new xe},renderer:De,parser:ke,styles:Oe};export{Pe as diagram};
@@ -0,0 +1 @@
1
+ const $={min:{r:0,g:0,b:0,s:0,l:0,a:0},max:{r:255,g:255,b:255,h:360,s:100,l:100,a:1},clamp:{r:t=>t>=255?255:t<0?0:t,g:t=>t>=255?255:t<0?0:t,b:t=>t>=255?255:t<0?0:t,h:t=>t%360,s:t=>t>=100?100:t<0?0:t,l:t=>t>=100?100:t<0?0:t,a:t=>t>=1?1:t<0?0:t},toLinear:t=>{const e=t/255;return t>.03928?Math.pow((e+.055)/1.055,2.4):e/12.92},hue2rgb:(t,e,a)=>(a<0&&(a+=1),a>1&&(a-=1),a<.16666666666666666?t+(e-t)*6*a:a<.5?e:a<.6666666666666666?t+(e-t)*(.6666666666666666-a)*6:t),hsl2rgb:({h:t,s:e,l:a},n)=>{if(!e)return a*2.55;t/=360,e/=100,a/=100;const s=a<.5?a*(1+e):a+e-a*e,i=2*a-s;switch(n){case"r":return $.hue2rgb(i,s,t+.3333333333333333)*255;case"g":return $.hue2rgb(i,s,t)*255;case"b":return $.hue2rgb(i,s,t-.3333333333333333)*255}},rgb2hsl:({r:t,g:e,b:a},n)=>{t/=255,e/=255,a/=255;const s=Math.max(t,e,a),i=Math.min(t,e,a),c=(s+i)/2;if(n==="l")return c*100;if(s===i)return 0;const d=s-i,h=c>.5?d/(2-s-i):d/(s+i);if(n==="s")return h*100;switch(s){case t:return((e-a)/d+(e<a?6:0))*60;case e:return((a-t)/d+2)*60;case a:return((t-e)/d+4)*60;default:return-1}}},B={clamp:(t,e,a)=>e>a?Math.min(e,Math.max(a,t)):Math.min(a,Math.max(e,t)),round:t=>Math.round(t*1e10)/1e10},G={dec2hex:t=>{const e=Math.round(t).toString(16);return e.length>1?e:`0${e}`}},r={channel:$,lang:B,unit:G},u={};for(let t=0;t<=255;t++)u[t]=r.unit.dec2hex(t);const f={ALL:0,RGB:1,HSL:2};class C{constructor(){this.type=f.ALL}get(){return this.type}set(e){if(this.type&&this.type!==e)throw new Error("Cannot change both RGB and HSL channels at the same time");this.type=e}reset(){this.type=f.ALL}is(e){return this.type===e}}class A{constructor(e,a){this.color=a,this.changed=!1,this.data=e,this.type=new C}set(e,a){return this.color=a,this.changed=!1,this.data=e,this.type.type=f.ALL,this}_ensureHSL(){const e=this.data,{h:a,s:n,l:s}=e;a===void 0&&(e.h=r.channel.rgb2hsl(e,"h")),n===void 0&&(e.s=r.channel.rgb2hsl(e,"s")),s===void 0&&(e.l=r.channel.rgb2hsl(e,"l"))}_ensureRGB(){const e=this.data,{r:a,g:n,b:s}=e;a===void 0&&(e.r=r.channel.hsl2rgb(e,"r")),n===void 0&&(e.g=r.channel.hsl2rgb(e,"g")),s===void 0&&(e.b=r.channel.hsl2rgb(e,"b"))}get r(){const e=this.data,a=e.r;return!this.type.is(f.HSL)&&a!==void 0?a:(this._ensureHSL(),r.channel.hsl2rgb(e,"r"))}get g(){const e=this.data,a=e.g;return!this.type.is(f.HSL)&&a!==void 0?a:(this._ensureHSL(),r.channel.hsl2rgb(e,"g"))}get b(){const e=this.data,a=e.b;return!this.type.is(f.HSL)&&a!==void 0?a:(this._ensureHSL(),r.channel.hsl2rgb(e,"b"))}get h(){const e=this.data,a=e.h;return!this.type.is(f.RGB)&&a!==void 0?a:(this._ensureRGB(),r.channel.rgb2hsl(e,"h"))}get s(){const e=this.data,a=e.s;return!this.type.is(f.RGB)&&a!==void 0?a:(this._ensureRGB(),r.channel.rgb2hsl(e,"s"))}get l(){const e=this.data,a=e.l;return!this.type.is(f.RGB)&&a!==void 0?a:(this._ensureRGB(),r.channel.rgb2hsl(e,"l"))}get a(){return this.data.a}set r(e){this.type.set(f.RGB),this.changed=!0,this.data.r=e}set g(e){this.type.set(f.RGB),this.changed=!0,this.data.g=e}set b(e){this.type.set(f.RGB),this.changed=!0,this.data.b=e}set h(e){this.type.set(f.HSL),this.changed=!0,this.data.h=e}set s(e){this.type.set(f.HSL),this.changed=!0,this.data.s=e}set l(e){this.type.set(f.HSL),this.changed=!0,this.data.l=e}set a(e){this.changed=!0,this.data.a=e}}const L=new A({r:0,g:0,b:0,a:0},"transparent"),b={re:/^#((?:[a-f0-9]{2}){2,4}|[a-f0-9]{3})$/i,parse:t=>{if(t.charCodeAt(0)!==35)return;const e=t.match(b.re);if(!e)return;const a=e[1],n=parseInt(a,16),s=a.length,i=s%4===0,c=s>4,d=c?1:17,h=c?8:4,l=i?0:-1,o=c?255:15;return L.set({r:(n>>h*(l+3)&o)*d,g:(n>>h*(l+2)&o)*d,b:(n>>h*(l+1)&o)*d,a:i?(n&o)*d/255:1},t)},stringify:t=>{const{r:e,g:a,b:n,a:s}=t;return s<1?`#${u[Math.round(e)]}${u[Math.round(a)]}${u[Math.round(n)]}${u[Math.round(s*255)]}`:`#${u[Math.round(e)]}${u[Math.round(a)]}${u[Math.round(n)]}`}},g={re:/^hsla?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(?:deg|grad|rad|turn)?)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(%)?))?\s*?\)$/i,hueRe:/^(.+?)(deg|grad|rad|turn)$/i,_hue2deg:t=>{const e=t.match(g.hueRe);if(e){const[,a,n]=e;switch(n){case"grad":return r.channel.clamp.h(parseFloat(a)*.9);case"rad":return r.channel.clamp.h(parseFloat(a)*180/Math.PI);case"turn":return r.channel.clamp.h(parseFloat(a)*360)}}return r.channel.clamp.h(parseFloat(t))},parse:t=>{const e=t.charCodeAt(0);if(e!==104&&e!==72)return;const a=t.match(g.re);if(!a)return;const[,n,s,i,c,d]=a;return L.set({h:g._hue2deg(n),s:r.channel.clamp.s(parseFloat(s)),l:r.channel.clamp.l(parseFloat(i)),a:c?r.channel.clamp.a(d?parseFloat(c)/100:parseFloat(c)):1},t)},stringify:t=>{const{h:e,s:a,l:n,a:s}=t;return s<1?`hsla(${r.lang.round(e)}, ${r.lang.round(a)}%, ${r.lang.round(n)}%, ${s})`:`hsl(${r.lang.round(e)}, ${r.lang.round(a)}%, ${r.lang.round(n)}%)`}},m={colors:{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",cyanaqua:"#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",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",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",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",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",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",transparent:"#00000000",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},parse:t=>{t=t.toLowerCase();const e=m.colors[t];if(e)return b.parse(e)},stringify:t=>{const e=b.stringify(t);for(const a in m.colors)if(m.colors[a]===e)return a}},p={re:/^rgba?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?)))?\s*?\)$/i,parse:t=>{const e=t.charCodeAt(0);if(e!==114&&e!==82)return;const a=t.match(p.re);if(!a)return;const[,n,s,i,c,d,h,l,o]=a;return L.set({r:r.channel.clamp.r(s?parseFloat(n)*2.55:parseFloat(n)),g:r.channel.clamp.g(c?parseFloat(i)*2.55:parseFloat(i)),b:r.channel.clamp.b(h?parseFloat(d)*2.55:parseFloat(d)),a:l?r.channel.clamp.a(o?parseFloat(l)/100:parseFloat(l)):1},t)},stringify:t=>{const{r:e,g:a,b:n,a:s}=t;return s<1?`rgba(${r.lang.round(e)}, ${r.lang.round(a)}, ${r.lang.round(n)}, ${r.lang.round(s)})`:`rgb(${r.lang.round(e)}, ${r.lang.round(a)}, ${r.lang.round(n)})`}},y={format:{keyword:m,hex:b,rgb:p,rgba:p,hsl:g,hsla:g},parse:t=>{if(typeof t!="string")return t;const e=b.parse(t)||p.parse(t)||g.parse(t)||m.parse(t);if(e)return e;throw new Error(`Unsupported color format: "${t}"`)},stringify:t=>!t.changed&&t.color?t.color:t.type.is(f.HSL)||t.data.r===void 0?g.stringify(t):t.a<1||!Number.isInteger(t.r)||!Number.isInteger(t.g)||!Number.isInteger(t.b)?p.stringify(t):b.stringify(t)},_=(t,e)=>{const a=y.parse(t);for(const n in e)a[n]=r.channel.clamp[n](e[n]);return y.stringify(a)},q=(t,e,a=0,n=1)=>{if(typeof t!="number")return _(t,{a:e});const s=L.set({r:r.channel.clamp.r(t),g:r.channel.clamp.g(e),b:r.channel.clamp.b(a),a:r.channel.clamp.a(n)});return y.stringify(s)},E=(t,e,a=50)=>{const{r:n,g:s,b:i,a:c}=y.parse(t),{r:d,g:h,b:l,a:o}=y.parse(e),F=a/100,w=F*2-1,M=c-o,k=((w*M===-1?w:(w+M)/(1+w*M))+1)/2,H=1-k,R=n*k+d*H,S=s*k+h*H,x=i*k+l*H,v=c*F+o*(1-F);return q(R,S,x,v)};export{y as C,r as U,_ as c,E as m,q as r};
@@ -0,0 +1 @@
1
+ import{b3 as Se,b2 as Le,b9 as ne,aF as oe,bm as ft,aS as D,aI as N,b8 as x,bc as q,bf as dt,be as at,aJ as we,ba as U,bk as vt,aD as re,bg as lt,aL as xt,ap as Re,aW as Ae,aU as K,aT as L,b6 as ae,aO as T,a_ as k,bp as V,bn as J,aZ as Pt,aG as Ce,aY as Be,aH as Ve,aP as b,bb as je,bi as Q,bj as _,aK as le,aV as Me,bo as ke,aB as mt,aC as be,bh as Ie,b4 as Ue,aR as Oe,bd as Fe,bl as Tt,b7 as We,b0 as A,b5 as ze,aN as Ne,aM as Ge,aE as Dt,a$ as $e,aX as He,b1 as Xe,ad as he,bs as Ye,ao as qe,aq as _e,aQ as Ze}from"./index-xz7ziSVU.js";import{a as ht,j as Ke}from"./framework-gzBbjyR4.js";import"./markdown-OowzRXxA.js";const pt=["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"];function yt(t){return Se(t)&&"ownerSVGElement"in t}function Je(t,e,n){const s=Le(t)?t:ne(t);return s.start(oe("",s,e,n)),s.animation}function Qe(t,e){const n=ft.now(),s=({timestamp:r})=>{const c=r-n;c>=e&&(N(s),t(c-e))};return D.setup(s,!0),()=>N(s)}function ts(t){return yt(t)&&t.tagName==="svg"}const Et=t=>typeof t=="number"?t:parseFloat(t),es=pt.length,ue=["rotate","rotateX","rotateY","rotateZ","skewX","skewY"],ss=ue.length,St=t=>typeof t=="number"||dt.test(t);function is(t,e,n,s,r,c){r?(t.opacity=x(0,n.opacity??1,ns(s)),t.opacityExit=x(e.opacity??1,0,os(s))):c&&(t.opacity=x(e.opacity??1,n.opacity??1,s));for(let i=0;i<es;i++){const o=pt[i];let a=Lt(e,o),l=Lt(n,o);if(a===void 0&&l===void 0)continue;a||(a=0),l||(l=0),a===0||l===0||St(a)===St(l)?(t[o]=Math.max(x(Et(a),Et(l),s),0),(q.test(l)||q.test(a))&&(t[o]+="%")):t[o]=l}for(let i=0;i<ss;i++){const o=ue[i];(e[o]||n[o])&&(t[o]=x(e[o]||0,n[o]||0,s))}}function Lt(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const ns=ce(0,.5,we),os=ce(.5,.95,U);function ce(t,e,n){return s=>s<t?0:s>e?1:n(at(t,e,s))}function ut(t,e){t.min=e.min,t.max=e.max}function w(t,e){ut(t.x,e.x),ut(t.y,e.y)}function wt(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}const fe=1e-4,rs=1-fe,as=1+fe,de=.01,ls=0-de,hs=0+de;function E(t){return t.max-t.min}function us(t,e,n){return Math.abs(t-e)<=n}function Rt(t,e,n,s=.5){t.origin=s,t.originPoint=x(e.min,e.max,t.origin),t.scale=E(n)/E(e),t.translate=x(n.min,n.max,t.origin)-t.originPoint,(t.scale>=rs&&t.scale<=as||isNaN(t.scale))&&(t.scale=1),(t.translate>=ls&&t.translate<=hs||isNaN(t.translate))&&(t.translate=0)}function W(t,e,n,s){Rt(t.x,e.x,n.x,s?s.originX:void 0),Rt(t.y,e.y,n.y,s?s.originY:void 0)}function At(t,e,n,s=0){const r=s?x(n.min,n.max,s):n.min;t.min=r+e.min,t.max=t.min+E(e)}function cs(t,e,n,s){At(t.x,e.x,n.x,s==null?void 0:s.x),At(t.y,e.y,n.y,s==null?void 0:s.y)}function Ct(t,e,n,s=0){const r=s?x(n.min,n.max,s):n.min;t.min=e.min-r,t.max=t.min+E(e)}function Z(t,e,n,s){Ct(t.x,e.x,n.x,s==null?void 0:s.x),Ct(t.y,e.y,n.y,s==null?void 0:s.y)}function Bt(t,e,n,s,r){return t-=e,t=vt(t,1/n,s),r!==void 0&&(t=vt(t,1/r,s)),t}function fs(t,e=0,n=1,s=.5,r,c=t,i=t){if(q.test(e)&&(e=parseFloat(e),e=x(i.min,i.max,e/100)-i.min),typeof e!="number")return;let o=x(c.min,c.max,s);t===c&&(o-=e),t.min=Bt(t.min,e,n,o,r),t.max=Bt(t.max,e,n,o,r)}function Vt(t,e,[n,s,r],c,i){fs(t,e[n],e[s],e[r],e.scale,c,i)}const ds=["x","scaleX","originX"],ms=["y","scaleY","originY"];function jt(t,e,n,s){Vt(t.x,e,ds,n?n.x:void 0,s?s.x:void 0),Vt(t.y,e,ms,n?n.y:void 0,s?s.y:void 0)}function Mt(t){return t.translate===0&&t.scale===1}function me(t){return Mt(t.x)&&Mt(t.y)}function kt(t,e){return t.min===e.min&&t.max===e.max}function ps(t,e){return kt(t.x,e.x)&&kt(t.y,e.y)}function bt(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function pe(t,e){return bt(t.x,e.x)&&bt(t.y,e.y)}function It(t){return E(t.x)/E(t.y)}function Ut(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}class ys{constructor(){this.members=[]}add(e){re(this.members,e);for(let n=this.members.length-1;n>=0;n--){const s=this.members[n];if(s===e||s===this.lead||s===this.prevLead)continue;const r=s.instance;(!r||r.isConnected===!1)&&!s.snapshot&&(lt(this.members,s),s.unmount())}e.scheduleRender()}remove(e){if(lt(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(e){var n;for(let s=this.members.indexOf(e)-1;s>=0;s--){const r=this.members[s];if(r.isPresent!==!1&&((n=r.instance)==null?void 0:n.isConnected)!==!1)return this.promote(r),!0}return!1}promote(e,n){var r;const s=this.lead;if(e!==s&&(this.prevLead=s,this.lead=e,e.show(),s)){s.updateSnapshot(),e.scheduleRender();const{layoutDependency:c}=s.options,{layoutDependency:i}=e.options;(c===void 0||c!==i)&&(e.resumeFrom=s,n&&(s.preserveOpacity=!0),s.snapshot&&(e.snapshot=s.snapshot,e.snapshot.latestValues=s.animationValues||s.latestValues),(r=e.root)!=null&&r.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&s.hide()}}exitAnimationComplete(){this.members.forEach(e=>{var n,s,r,c,i;(s=(n=e.options).onExitComplete)==null||s.call(n),(i=(r=e.resumingFrom)==null?void 0:(c=r.options).onExitComplete)==null||i.call(c)})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){var e;(e=this.lead)!=null&&e.snapshot&&(this.lead.snapshot=void 0)}}function Ot(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const O={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(dt.test(t))t=parseFloat(t);else return t;const n=Ot(t,e.target.x),s=Ot(t,e.target.y);return`${n}% ${s}%`}},gs={correct:(t,{treeScale:e,projectionDelta:n})=>{const s=t,r=xt.parse(t);if(r.length>5)return s;const c=xt.createTransformer(t),i=typeof r[0]!="number"?1:0,o=n.x.scale*e.x,a=n.y.scale*e.y;r[0+i]/=o,r[1+i]/=a;const l=x(o,a,.5);return typeof r[2+i]=="number"&&(r[2+i]/=l),typeof r[3+i]=="number"&&(r[3+i]/=l),c(r)}},vs={borderRadius:{...O,applyTo:[...pt]},borderTopLeftRadius:O,borderTopRightRadius:O,borderBottomLeftRadius:O,borderBottomRightRadius:O,boxShadow:gs};function xs(t,e,n){let s="";const r=t.x.translate/e.x,c=t.y.translate/e.y,i=(n==null?void 0:n.z)||0;if((r||c||i)&&(s=`translate3d(${r}px, ${c}px, ${i}px) `),(e.x!==1||e.y!==1)&&(s+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:l,rotate:h,pathRotation:u,rotateX:f,rotateY:d,rotateZ:m,skewX:g,skewY:p}=n;l&&(s=`perspective(${l}px) ${s}`),h&&(s+=`rotate(${h}deg) `),u&&(s+=`rotate(${u}deg) `),f&&(s+=`rotateX(${f}deg) `),d&&(s+=`rotateY(${d}deg) `),m&&(s+=`rotateZ(${m}deg) `),g&&(s+=`skewX(${g}deg) `),p&&(s+=`skewY(${p}deg) `)}const o=t.x.scale*e.x,a=t.y.scale*e.y;return(o!==1||a!==1)&&(s+=`scale(${o}, ${a})`),s||"none"}function R(t){return[t("x"),t("y")]}const Ps=(t,e)=>t.depth-e.depth;class Ts{constructor(){this.children=[],this.isDirty=!1}add(e){re(this.children,e),this.isDirty=!0}remove(e){lt(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(Ps),this.isDirty=!1,this.children.forEach(e)}}const H={hasAnimatedSinceResize:!0,hasEverUpdated:!1};Object.assign(_,{...vs,..._});const tt=["","X","Y","Z"],Ds=1e3;let Es=0;function et(t,e,n,s){const{latestValues:r}=e;r[t]&&(n[t]=r[t],e.setStaticValue(t,0),s&&(s[t]=0))}const st=({instance:t})=>{var e;return t&&((e=ke.get(t))==null?void 0:e.demote())};function ye(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=Me(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:r,layoutId:c}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",D,!(r||c))}const{parent:s}=t;s&&!s.hasCheckedOptimisedAppear&&ye(s)}function ge({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:s,resetTransform:r}){return class{constructor(i={},o=e==null?void 0:e()){this.id=Es++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(ws),this.nodes.forEach(ks),this.nodes.forEach(bs),this.nodes.forEach(Rs)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=i,this.root=o?o.root||o:this,this.path=o?[...o.path,o]:[],this.parent=o,this.depth=o?o.depth+1:0;for(let a=0;a<this.path.length;a++)this.path[a].shouldResetTransform=!0;this.root===this&&(this.nodes=new Ts)}addEventListener(i,o){return this.eventHandlers.has(i)||this.eventHandlers.set(i,new Re),this.eventHandlers.get(i).add(o)}notifyListeners(i,...o){const a=this.eventHandlers.get(i);a&&a.notify(...o)}hasListeners(i){return this.eventHandlers.has(i)}mount(i){if(this.instance)return;this.isSVG=yt(i)&&!ts(i),this.instance=i;const{layoutId:o,layout:a,visualElement:l}=this.options;if(l&&!l.current&&l.mount(i),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(a||o)&&(this.isLayoutDirty=!0),t){let h,u=0;const f=()=>this.root.updateBlockedByResize=!1;D.read(()=>{u=window.innerWidth}),t(i,()=>{const d=window.innerWidth;d!==u&&(u=d,this.root.updateBlockedByResize=!0,h&&h(),h=Qe(f,250),H.hasAnimatedSinceResize&&(H.hasAnimatedSinceResize=!1,this.nodes.forEach(zt)))})}o&&this.root.registerSharedNode(o,this),this.addLayoutListener()}addLayoutListener(){const{layoutId:i,layout:o,visualElement:a,animate:l}=this.options;!this.instance||this.hasLayoutListener||l===!1||!a||!(i||o)||(this.hasLayoutListener=!0,this.addEventListener("didUpdate",({delta:h,hasLayoutChanged:u,hasRelativeLayoutChanged:f,layout:d})=>{if(this.isAnimationBlocked){this.target=void 0,this.relativeTarget=void 0;return}const m=this.options.transition||a.getDefaultTransition()||Fs,{onLayoutAnimationStart:g,onLayoutAnimationComplete:p}=a.getProps(),P=!this.targetLayout||!pe(this.targetLayout,d),v=!u&&f;if(this.options.layoutRoot||this.resumeFrom||v||u&&(P||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const y={...Ae(m,"layout"),onPlay:g,onComplete:p};(a.shouldReduceMotion||this.options.layoutRoot)&&(y.delay=0,y.type=!1),this.startAnimation(y),this.setAnimationOrigin(h,v,y.path)}else u||zt(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=d}))}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const i=this.getStack();i&&i.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),this.hasLayoutListener=!1,N(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(Is),this.animationId++)}getTransformTemplate(){const{visualElement:i}=this.options;return i&&i.getProps().transformTemplate}willUpdate(i=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&ye(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;st(this),this.isLayoutDirty=!0;for(let h=0;h<this.path.length;h++){const u=this.path[h];u.shouldResetTransform=!0,st(u),(typeof u.latestValues.x=="string"||typeof u.latestValues.y=="string")&&(u.isLayoutDirty=!0),u.updateScroll("snapshot"),u.options.layoutRoot&&u.willUpdate(!1),u.isAnimationBlocked&&(u.dragSnapshot||(u.dragSnapshot=u.measure()),this.dragAncestor=u)}const{layoutId:o,layout:a}=this.options;if(o===void 0&&!a)return;const l=this.getTransformTemplate();this.prevTransformTemplateValue=l?l(this.latestValues,""):void 0,this.updateSnapshot(),i&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){const a=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),a&&this.nodes.forEach(Cs),this.nodes.forEach(Ft);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Wt);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Vs),this.nodes.forEach(js),this.nodes.forEach(Ms),this.nodes.forEach(Ss),this.nodes.forEach(Ls)):this.nodes.forEach(Wt),this.clearAllSnapshots();const o=ft.now();L.delta=le(0,1e3/60,o-L.timestamp),L.timestamp=o,L.isProcessing=!0,K.update.process(L),K.preRender.process(L),K.render.process(L),L.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,ae.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(As),this.sharedNodes.forEach((i,o)=>i.members.length?i.removeLeadSnapshot():this.sharedNodes.delete(o))}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,D.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){D.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!E(this.snapshot.measuredBox.x)&&!E(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let a=0;a<this.path.length;a++)this.path[a].updateScroll();const i=this.layout;this.layout=this.measure(!1),this.layoutCorrected||(this.layoutCorrected=T()),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:o}=this.options;o&&o.notify("LayoutMeasure",this.layout.layoutBox,i?i.layoutBox:void 0)}updateScroll(i="measure"){let o=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===i&&(o=!1),o&&this.instance){const a=s(this.instance);this.scroll={animationId:this.root.animationId,phase:i,isRoot:a,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:a}}}resetTransform(){if(!r)return;const i=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout;i&&st(this);const o=this.projectionDelta&&!me(this.projectionDelta),a=this.getTransformTemplate(),l=a?a(this.latestValues,""):void 0,h=l!==this.prevTransformTemplateValue;i&&this.instance&&(o||k(this.latestValues)||h)&&(r(this.instance,l),this.shouldResetTransform=!1,this.scheduleRender())}measure(i=!0){const o=this.measurePageBox();let a=this.removeElementScroll(o);return i&&(a=this.removeTransform(a)),Ws(a),{animationId:this.root.animationId,measuredBox:o,layoutBox:a,latestValues:{},source:this.id}}measurePageBox(){var l;const{visualElement:i}=this.options;if(!i)return T();const o=i.measureViewportBox();if(!(((l=this.scroll)==null?void 0:l.wasRoot)||this.path.some(zs))){const{scroll:h}=this.root;h&&(V(o.x,h.offset.x),V(o.y,h.offset.y))}return o}removeElementScroll(i){var a;const o=T();if(w(o,i),(a=this.scroll)!=null&&a.wasRoot)return o;for(let l=0;l<this.path.length;l++){const h=this.path[l],{scroll:u,options:f}=h;h!==this.root&&u&&f.layoutScroll&&(u.wasRoot&&w(o,i),V(o.x,u.offset.x),V(o.y,u.offset.y))}return o}applyTransform(i,o=!1,a){var h,u;const l=a||T();w(l,i);for(let f=0;f<this.path.length;f++){const d=this.path[f];!o&&d.options.layoutScroll&&d.scroll&&d!==d.root&&(V(l.x,-d.scroll.offset.x),V(l.y,-d.scroll.offset.y)),k(d.latestValues)&&J(l,d.latestValues,(h=d.layout)==null?void 0:h.layoutBox)}return k(this.latestValues)&&J(l,this.latestValues,(u=this.layout)==null?void 0:u.layoutBox),l}removeTransform(i){var a;const o=T();w(o,i);for(let l=0;l<this.path.length;l++){const h=this.path[l];if(!k(h.latestValues))continue;let u;h.instance&&(Pt(h.latestValues)&&h.updateSnapshot(),u=T(),w(u,h.measurePageBox())),jt(o,h.latestValues,(a=h.snapshot)==null?void 0:a.layoutBox,u)}return k(this.latestValues)&&jt(o,this.latestValues),o}setTargetDelta(i){this.targetDelta=i,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(i){this.options={...this.options,...i,crossfade:i.crossfade!==void 0?i.crossfade:!0},this.addLayoutListener()}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==L.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(i=!1){var d;const o=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=o.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=o.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=o.isSharedProjectionDirty);const a=!!this.resumingFrom||this!==o;if(!(i||a&&this.isSharedProjectionDirty||this.isProjectionDirty||(d=this.parent)!=null&&d.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:h,layoutId:u}=this.options;if(!this.layout||!(h||u))return;this.resolvedRelativeTargetAt=L.timestamp;const f=this.getClosestProjectingParent();!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&f&&f.layout?this.createRelativeTarget(f,this.layout.layoutBox,f.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=T(),this.targetWithTransforms=T()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),cs(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):w(this.target,this.layout.layoutBox),Ce(this.target,this.targetDelta)):w(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&f&&!!f.resumingFrom==!!this.resumingFrom&&!f.options.layoutScroll&&f.target&&this.animationProgress!==1?this.createRelativeTarget(f,this.target,f.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||Pt(this.parent.latestValues)||Be(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(i,o,a){this.relativeParent=i,this.forceRelativeParentToResolveTarget(),this.relativeTarget=T(),this.relativeTargetOrigin=T(),Z(this.relativeTargetOrigin,o,a,this.options.layoutAnchor||void 0),w(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){var m;const i=this.getLead(),o=!!this.resumingFrom||this!==i;let a=!0;if((this.isProjectionDirty||(m=this.parent)!=null&&m.isProjectionDirty)&&(a=!1),o&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(a=!1),this.resolvedRelativeTargetAt===L.timestamp&&(a=!1),a)return;const{layout:l,layoutId:h}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(l||h))return;w(this.layoutCorrected,this.layout.layoutBox);const u=this.treeScale.x,f=this.treeScale.y;Ve(this.layoutCorrected,this.treeScale,this.path,o),i.layout&&!i.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(i.target=i.layout.layoutBox,i.targetWithTransforms=T());const{target:d}=i;if(!d){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(wt(this.prevProjectionDelta.x,this.projectionDelta.x),wt(this.prevProjectionDelta.y,this.projectionDelta.y)),W(this.projectionDelta,this.layoutCorrected,d,this.latestValues),(this.treeScale.x!==u||this.treeScale.y!==f||!Ut(this.projectionDelta.x,this.prevProjectionDelta.x)||!Ut(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",d))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(i=!0){var o;if((o=this.options.visualElement)==null||o.scheduleRender(),i){const a=this.getStack();a&&a.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=b(),this.projectionDelta=b(),this.projectionDeltaWithTransform=b()}setAnimationOrigin(i,o=!1,a){const l=this.snapshot,h=l?l.latestValues:{},u={...this.latestValues},f=b();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!o;const d=T(),m=l?l.source:void 0,g=this.layout?this.layout.source:void 0,p=m!==g,P=this.getStack(),v=!P||P.members.length<=1,y=!!(p&&!v&&this.options.crossfade===!0&&!this.path.some(Os));this.animationProgress=0;let S;const j=a==null?void 0:a.interpolateProjection(i);this.mixTargetDelta=gt=>{const C=gt/1e3,M=j==null?void 0:j(C);M?(f.x.translate=M.x,f.x.scale=x(i.x.scale,1,C),f.x.origin=i.x.origin,f.x.originPoint=i.x.originPoint,f.y.translate=M.y,f.y.scale=x(i.y.scale,1,C),f.y.origin=i.y.origin,f.y.originPoint=i.y.originPoint):(Nt(f.x,i.x,C),Nt(f.y,i.y,C)),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Z(d,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),Us(this.relativeTarget,this.relativeTargetOrigin,d,C),S&&ps(this.relativeTarget,S)&&(this.isProjectionDirty=!1),S||(S=T()),w(S,this.relativeTarget)),p&&(this.animationValues=u,is(u,h,this.latestValues,C,y,v)),M&&M.rotate!==void 0&&(this.animationValues||(this.animationValues=u),this.animationValues.pathRotation=M.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=C},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(i){var o,a,l;this.notifyListeners("animationStart"),(o=this.currentAnimation)==null||o.stop(),(l=(a=this.resumingFrom)==null?void 0:a.currentAnimation)==null||l.stop(),this.pendingAnimation&&(N(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=D.update(()=>{H.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=ne(0)),this.motionValue.jump(0,!1),this.currentAnimation=Je(this.motionValue,[0,1e3],{...i,velocity:0,isSync:!0,onUpdate:h=>{this.mixTargetDelta(h),i.onUpdate&&i.onUpdate(h)},onComplete:()=>{i.onComplete&&i.onComplete(),this.completeAnimation()}}),je(this.currentAnimation,this),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const i=this.getStack();i&&i.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(Ds),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const i=this.getLead(),{targetWithTransforms:o,layout:a,latestValues:l}=i;let{target:h}=i;if(!(!o||!h||!a)){if(this!==i&&this.layout&&a&&ve(this.options.animationType,this.layout.layoutBox,a.layoutBox)){h=this.target||T();const u=E(this.layout.layoutBox.x);h.x.min=i.target.x.min,h.x.max=h.x.min+u;const f=E(this.layout.layoutBox.y);h.y.min=i.target.y.min,h.y.max=h.y.min+f}w(o,h),J(o,l),W(this.projectionDeltaWithTransform,this.layoutCorrected,o,l)}}registerSharedNode(i,o){this.sharedNodes.has(i)||this.sharedNodes.set(i,new ys),this.sharedNodes.get(i).add(o);const l=o.options.initialPromotionConfig;o.promote({transition:l?l.transition:void 0,preserveFollowOpacity:l&&l.shouldPreserveFollowOpacity?l.shouldPreserveFollowOpacity(o):void 0})}isLead(){const i=this.getStack();return i?i.lead===this:!0}getLead(){var o;const{layoutId:i}=this.options;return i?((o=this.getStack())==null?void 0:o.lead)||this:this}getPrevLead(){var o;const{layoutId:i}=this.options;return i?(o=this.getStack())==null?void 0:o.prevLead:void 0}getStack(){const{layoutId:i}=this.options;if(i)return this.root.sharedNodes.get(i)}promote({needsReset:i,transition:o,preserveFollowOpacity:a}={}){const l=this.getStack();l&&l.promote(this,a),i&&(this.projectionDelta=void 0,this.needsReset=!0),o&&this.setOptions({transition:o})}relegate(){const i=this.getStack();return i?i.relegate(this):!1}resetSkewAndRotation(){const{visualElement:i}=this.options;if(!i)return;let o=!1;const{latestValues:a}=i;if((a.z||a.rotate||a.rotateX||a.rotateY||a.rotateZ||a.skewX||a.skewY)&&(o=!0),!o)return;const l={};a.z&&et("z",i,l,this.animationValues);for(let h=0;h<tt.length;h++)et(`rotate${tt[h]}`,i,l,this.animationValues),et(`skew${tt[h]}`,i,l,this.animationValues);i.render();for(const h in l)i.setStaticValue(h,l[h]),this.animationValues&&(this.animationValues[h]=l[h]);i.scheduleRender()}applyProjectionStyles(i,o){if(!this.instance||this.isSVG)return;if(!this.isVisible){i.visibility="hidden";return}const a=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,i.visibility="",i.opacity="",i.pointerEvents=Q(o==null?void 0:o.pointerEvents)||"",i.transform=a?a(this.latestValues,""):"none";return}const l=this.getLead();if(!this.projectionDelta||!this.layout||!l.target){this.options.layoutId&&(i.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,i.pointerEvents=Q(o==null?void 0:o.pointerEvents)||""),this.hasProjected&&!k(this.latestValues)&&(i.transform=a?a({},""):"none",this.hasProjected=!1);return}i.visibility="";const h=l.animationValues||l.latestValues;this.applyTransformsToTarget();let u=xs(this.projectionDeltaWithTransform,this.treeScale,h);a&&(u=a(h,u)),i.transform=u;const{x:f,y:d}=this.projectionDelta;i.transformOrigin=`${f.origin*100}% ${d.origin*100}% 0`,l.animationValues?i.opacity=l===this?h.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:h.opacityExit:i.opacity=l===this?h.opacity!==void 0?h.opacity:"":h.opacityExit!==void 0?h.opacityExit:0;for(const m in _){if(h[m]===void 0)continue;const{correct:g,applyTo:p,isCSSVariable:P}=_[m],v=u==="none"?h[m]:g(h[m],l);if(p){const y=p.length;for(let S=0;S<y;S++)i[p[S]]=v}else P?this.options.visualElement.renderState.vars[m]=v:i[m]=v}this.options.layoutId&&(i.pointerEvents=l===this?Q(o==null?void 0:o.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=this.dragSnapshot=this.dragAncestor=void 0}resetTree(){this.root.nodes.forEach(i=>{var o;return(o=i.currentAnimation)==null?void 0:o.stop()}),this.root.nodes.forEach(Ft),this.root.sharedNodes.clear()}}}function Ss(t){t.updateLayout(),Bs(t)}function Ls(t){var n;const e=((n=t.resumeFrom)==null?void 0:n.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){const{layoutBox:s,measuredBox:r}=t.layout,{animationType:c}=t.options,i=e.source!==t.layout.source;if(c==="size")R(u=>{const f=i?e.measuredBox[u]:e.layoutBox[u],d=E(f);f.min=s[u].min,f.max=f.min+d});else if(c==="x"||c==="y"){const u=c==="x"?"y":"x";ut(i?e.measuredBox[u]:e.layoutBox[u],s[u])}else ve(c,e.layoutBox,s)&&R(u=>{const f=i?e.measuredBox[u]:e.layoutBox[u],d=E(s[u]);f.max=f.min+d,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[u].max=t.relativeTarget[u].min+d)});const o=b();W(o,s,e.layoutBox);const a=b();i?W(a,t.applyTransform(r,!0),e.measuredBox):W(a,s,e.layoutBox);const l=!me(o);let h=!1;if(!t.resumeFrom){const u=t.getClosestProjectingParent();if(u&&!u.resumeFrom){const{snapshot:f,layout:d}=u;if(f&&d){const m=t.options.layoutAnchor||void 0,g=T();Z(g,e.layoutBox,f.layoutBox,m);const p=T();Z(p,s,d.layoutBox,m),pe(g,p)||(h=!0),u.options.layoutRoot&&(t.relativeTarget=p,t.relativeTargetOrigin=g,t.relativeParent=u)}}}t.notifyListeners("didUpdate",{layout:s,snapshot:e,delta:a,layoutDelta:o,hasLayoutChanged:l,hasRelativeLayoutChanged:h})}else if(t.isLead()){const{onExitComplete:s}=t.options;s&&s()}t.options.transition=void 0}function ws(t){t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function Rs(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function As(t){t.clearSnapshot()}function Ft(t){t.clearMeasurements()}function Cs(t){t.isLayoutDirty=!0,t.updateLayout()}function Wt(t){t.isLayoutDirty=!1}function Bs(t){const{snapshot:e,dragAncestor:n}=t,s=n==null?void 0:n.layout;if(!e||!s||t.resumeFrom||t.isAnimationBlocked)return;const r=n.dragSnapshot;R(c=>V(e.layoutBox[c],s.layoutBox[c].min-r.layoutBox[c].min))}function Vs(t){t.isAnimationBlocked&&t.layout&&!t.isLayoutDirty&&(t.snapshot=t.dragSnapshot||t.layout,t.isLayoutDirty=!0)}function js(t){var e;t.relativeTarget&&((e=t.relativeParent)!=null&&e.isLayoutDirty)&&(t.currentAnimation?t.isLayoutDirty=!0:(t.targetDelta=void 0,t.removeRelativeTarget()))}function Ms(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function zt(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function ks(t){t.resolveTargetDelta()}function bs(t){t.calcProjection()}function Is(t){t.resetSkewAndRotation()}function Nt(t,e,n){t.translate=x(e.translate,0,n),t.scale=x(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function Gt(t,e,n,s){t.min=x(e.min,n.min,s),t.max=x(e.max,n.max,s)}function Us(t,e,n,s){Gt(t.x,e.x,n.x,s),Gt(t.y,e.y,n.y,s)}function Os(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const Fs={duration:.45,ease:[.4,0,.1,1]},$t=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),Ht=$t("applewebkit/")&&!$t("chrome/")?Math.round:U;function Xt(t){t.min=Ht(t.min),t.max=Ht(t.max)}function Ws(t){Xt(t.x),Xt(t.y)}function ve(t,e,n){return t==="position"||t==="preserve-aspect"&&!us(It(e),It(n),.2)}function zs(t){var e;return t!==t.root&&((e=t.scroll)==null?void 0:e.wasRoot)}const Ns=ge({attachResizeListener:(t,e)=>mt(t,"resize",e),measureScroll:()=>{var t,e;return{x:document.documentElement.scrollLeft||((t=document.body)==null?void 0:t.scrollLeft)||0,y:document.documentElement.scrollTop||((e=document.body)==null?void 0:e.scrollTop)||0}},checkIsScrollRoot:()=>!0}),it={current:void 0},xe=ge({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!it.current){const t=new Ns({});t.mount(window),t.setOptions({layoutScroll:!0}),it.current=t}return it.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"});function z(t,e,n,s){return mt(t,e,be(n),s)}const X=new WeakMap;let B;const Pe=(t,e,n)=>(s,r)=>r&&r[0]?r[0][t+"Size"]:yt(s)&&"getBBox"in s?s.getBBox()[e]:s[n],Gs=Pe("inline","width","offsetWidth"),$s=Pe("block","height","offsetHeight");function Hs({target:t,borderBoxSize:e}){var n;(n=X.get(t))==null||n.forEach(s=>{s(t,{get width(){return Gs(t,e)},get height(){return $s(t,e)}})})}function Xs(t){t.forEach(Hs)}function Ys(){typeof ResizeObserver>"u"||(B=new ResizeObserver(Xs))}function qs(t,e){B||Ys();const n=Ie(t);return n.forEach(s=>{let r=X.get(s);r||(r=new Set,X.set(s,r)),r.add(e),B==null||B.observe(s)}),()=>{n.forEach(s=>{const r=X.get(s);r==null||r.delete(e),r!=null&&r.size||B==null||B.unobserve(s)})}}const Y=new Set;let I;function _s(){I=()=>{const t={get width(){return window.innerWidth},get height(){return window.innerHeight}};Y.forEach(e=>e(t))},window.addEventListener("resize",I)}function Zs(t){return Y.add(t),I||_s(),()=>{Y.delete(t),!Y.size&&typeof I=="function"&&(window.removeEventListener("resize",I),I=void 0)}}function Yt(t,e){return typeof t=="function"?Zs(t):qs(t,e)}const qt=(t,e)=>Math.abs(t-e);function Ks(t,e){const n=qt(t.x,e.x),s=qt(t.y,e.y);return Math.sqrt(n**2+s**2)}const _t=new Set(["auto","scroll"]);class Te{constructor(e,n,{transformPagePoint:s,contextWindow:r=window,dragSnapToOrigin:c=!1,distanceThreshold:i=3,element:o}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=m=>{this.handleScroll(m.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.hasPendingMove=!1,this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=G(this.lastRawMoveEventInfo,this.transformPagePoint));const m=nt(this.lastMoveEventInfo,this.history),g=this.startEvent!==null,p=Ks(m.offset,{x:0,y:0})>=this.distanceThreshold;if(!g&&!p)return;const{point:P}=m;this.history.push({...P,timestamp:ft.now()});const{onStart:v,onMove:y}=this.handlers;g||(v&&v(this.lastMoveEvent,m),this.startEvent=this.lastMoveEvent),y&&y(this.lastMoveEvent,m)},this.handlePointerMove=(m,g)=>{this.lastMoveEvent=m,this.lastRawMoveEventInfo=g,this.lastMoveEventInfo=G(g,this.transformPagePoint),this.hasPendingMove=!0,D.update(this.updatePoint,!0)},this.handlePointerUp=(m,g)=>{this.hasPendingMove&&this.updatePoint(),this.end();const{onEnd:p,onSessionEnd:P,resumeAnimation:v}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&v&&v(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const y=nt(m.type==="pointercancel"?this.lastMoveEventInfo:G(g,this.transformPagePoint),this.history);this.startEvent&&p&&p(m,y),P&&P(m,y)},!Ue(e))return;this.dragSnapToOrigin=c,this.handlers=n,this.transformPagePoint=s,this.distanceThreshold=i,this.contextWindow=r||window;const a=Oe(e),l=G(a,this.transformPagePoint),{point:h}=l,{timestamp:u}=L;this.history=[{...h,timestamp:u}];const{onSessionStart:f}=n;f&&f(e,nt(l,this.history));const d={passive:!0,capture:!0};this.removeListeners=Fe(z(this.contextWindow,"pointermove",this.handlePointerMove,d),z(this.contextWindow,"pointerup",this.handlePointerUp,d),z(this.contextWindow,"pointercancel",this.handlePointerUp,d)),o&&this.startScrollTracking(o)}startScrollTracking(e){let n=e.parentElement;for(;n;){const s=getComputedStyle(n);(_t.has(s.overflowX)||_t.has(s.overflowY))&&this.scrollPositions.set(n,{x:n.scrollLeft,y:n.scrollTop}),n=n.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(e){const n=this.scrollPositions.get(e);if(!n)return;const s=e===window,r=s?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},c={x:r.x-n.x,y:r.y-n.y};c.x===0&&c.y===0||(s?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=c.x,this.lastMoveEventInfo.point.y+=c.y):this.history.length>0&&(this.history[0].x-=c.x,this.history[0].y-=c.y),this.scrollPositions.set(e,r),D.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),N(this.updatePoint)}}function G(t,e){return e?{point:e(t.point)}:t}function Zt(t,e){return{x:t.x-e.x,y:t.y-e.y}}function nt({point:t},e){return{point:t,delta:Zt(t,De(e)),offset:Zt(t,Js(e)),velocity:Qs(e,.1)}}function Js(t){return t[0]}function De(t){return t[t.length-1]}function Qs(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,s=null;const r=De(t);for(;n>=0&&(s=t[n],!(r.timestamp-s.timestamp>Tt(e)));)n--;if(!s)return{x:0,y:0};s===t[0]&&t.length>2&&r.timestamp-s.timestamp>Tt(e)*2&&(s=t[1]);const c=We(r.timestamp-s.timestamp);if(c===0)return{x:0,y:0};const i={x:(r.x-s.x)/c,y:(r.y-s.y)/c};return i.x===1/0&&(i.x=0),i.y===1/0&&(i.y=0),i}function ti(t){return t==="x"||t==="y"?A[t]?null:(A[t]=!0,()=>{A[t]=!1}):A.x||A.y?null:(A.x=A.y=!0,()=>{A.x=A.y=!1})}function ei(t,{min:e,max:n},s){return e!==void 0&&t<e?t=s?x(e,t,s.min):Math.max(t,e):n!==void 0&&t>n&&(t=s?x(n,t,s.max):Math.min(t,n)),t}function Kt(t,e,n){return{min:e!==void 0?t.min+e:void 0,max:n!==void 0?t.max+n-(t.max-t.min):void 0}}function si(t,{top:e,left:n,bottom:s,right:r}){return{x:Kt(t.x,n,r),y:Kt(t.y,e,s)}}function Jt(t,e){let n=e.min-t.min,s=e.max-t.max;return e.max-e.min<t.max-t.min&&([n,s]=[s,n]),{min:n,max:s}}function ii(t,e){return{x:Jt(t.x,e.x),y:Jt(t.y,e.y)}}function ni(t,e){let n=.5;const s=E(t),r=E(e);return r>s?n=at(e.min,e.max-s,t.min):s>r&&(n=at(t.min,t.max-r,e.min)),le(0,1,n)}function oi(t,e){const n={};return e.min!==void 0&&(n.min=e.min-t.min),e.max!==void 0&&(n.max=e.max-t.min),n}const ct=.35;function ri(t=ct){return t===!1?t=0:t===!0&&(t=ct),{x:Qt(t,"left","right"),y:Qt(t,"top","bottom")}}function Qt(t,e,n){return{min:te(t,e),max:te(t,n)}}function te(t,e){return typeof t=="number"?t:t[e]||0}const ai=new WeakMap;class li{constructor(e,n=()=>e.getProps()){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=T(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e,this.readProps=n}start(e,{snapToCursor:n=!1,distanceThreshold:s}={}){var u;const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const c=f=>{n&&this.snapToCursor(f),this.stopAnimation()},i=(f,d)=>{const{drag:m,dragPropagation:g,onDragStart:p}=this.getProps();if(m&&!g&&(this.openDragLock&&this.openDragLock(),this.openDragLock=ti(m),!this.openDragLock))return;this.latestPointerEvent=f,this.latestPanInfo=d,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),R(v=>{let y=this.getAxisMotionValue(v).get()||0;if($e(y)&&(y=He(y,this.visualElement.current)||0),dt.test(y))y=parseFloat(y);else if(q.test(y)){const{projection:S}=this.visualElement;if(S&&S.layout){const j=S.layout.layoutBox[v];j&&(y=E(j)*(parseFloat(y)/100))}}this.originPoint[v]=y}),p&&D.update(()=>p(f,d),!1,!0),Dt(this.visualElement,"transform");const{animationState:P}=this.visualElement;P&&P.setActive("whileDrag",!0)},o=(f,d)=>{this.latestPointerEvent=f,this.latestPanInfo=d;const{dragPropagation:m,dragDirectionLock:g,onDirectionLock:p,onDrag:P}=this.getProps();if(!m&&!this.openDragLock)return;const{offset:v}=d;if(g&&this.currentDirection===null){if(this.currentDirection=ui(v),this.currentDirection===null)return;p&&p(this.currentDirection)}this.updateAxis("x",d.point,v),this.updateAxis("y",d.point,v),this.visualElement.render(),P&&D.update(()=>P(f,d),!1,!0)},a=(f,d)=>{this.latestPointerEvent=f,this.latestPanInfo=d,this.stop(f,d),this.latestPointerEvent=null,this.latestPanInfo=null},l=()=>{const{dragSnapToOrigin:f}=this.getProps();(f||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:h}=this.getProps();this.panSession=new Te(e,{onSessionStart:c,onStart:i,onMove:o,onSessionEnd:a,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:h,distanceThreshold:s,contextWindow:(u=this.visualElement.current)==null?void 0:u.ownerDocument.defaultView,element:this.visualElement.current})}stop(e,n){const s=e||this.latestPointerEvent,r=n||this.latestPanInfo,c=this.isDragging;if(this.cancel(),!c||!r||!s)return;const{velocity:i}=r;this.startAnimation(i);const{onDragEnd:o}=this.getProps();o&&D.postRender(()=>o(s,r))}cancel(){this.isDragging=!1;const{projection:e,animationState:n}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:s}=this.getProps();!s&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,n,s){const{drag:r}=this.getProps();if(!s||!$(e,r,this.currentDirection))return;const c=this.getAxisMotionValue(e);let i=this.originPoint[e]+s[e];this.constraints&&this.constraints[e]&&(i=ei(i,this.constraints[e],this.elastic[e])),c.set(i)}resolveConstraints(){var c;const{dragConstraints:e,dragElastic:n}=this.getProps(),s=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(c=this.visualElement.projection)==null?void 0:c.layout,r=this.constraints;F(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&s?this.constraints=si(s.layoutBox,e):this.constraints=!1,this.elastic=ri(n),r!==this.constraints&&!F(e)&&s&&this.constraints&&!this.hasMutatedConstraints&&R(i=>{this.constraints!==!1&&this.getAxisMotionValue(i)&&(this.constraints[i]=oi(s.layoutBox[i],this.constraints[i]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!F(e))return!1;const s=ee(e),{projection:r}=this.visualElement;if(!r||!r.layout)return!1;r.root&&(r.root.scroll=void 0,r.root.updateScroll());const c=ze(s,r.root,this.visualElement.getTransformPagePoint());let i=ii(r.layout.layoutBox,c);if(n){const o=n(Ne(i));this.hasMutatedConstraints=!!o,o&&(i=Ge(o))}return i}startAnimation(e){const{drag:n,dragMomentum:s,dragElastic:r,dragTransition:c,dragSnapToOrigin:i,onDragTransitionEnd:o}=this.getProps(),a=this.constraints||{},l=R(h=>{if(!$(h,n,this.currentDirection))return;let u=a&&a[h]||{};(i===!0||i===h)&&(u={min:0,max:0});const f=r?200:1e6,d=r?40:1e7,m={type:"inertia",velocity:s?e[h]:0,bounceStiffness:f,bounceDamping:d,timeConstant:750,restDelta:1,restSpeed:10,...c,...u};return this.startAxisValueAnimation(h,m)});return Promise.all(l).then(o)}startAxisValueAnimation(e,n){const s=this.getAxisMotionValue(e);return Dt(this.visualElement,e),s.start(oe(e,s,0,n,this.visualElement,!1))}stopAnimation(){R(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){const n=`_drag${e.toUpperCase()}`,r=this.readProps()[n];return r||this.visualElement.getValue(e,this.visualElement.latestValues[e]??0)}snapToCursor({clientX:e,clientY:n}){var o;const{drag:s}=this.getProps(),r={x:e,y:n},c=((o=this.visualElement.getTransformPagePoint())==null?void 0:o(r))||r,i=this.visualElement.measureViewportBox();R(a=>{if(!$(a,s,this.currentDirection))return;const l=this.getAxisMotionValue(a),{min:h,max:u}=i[a];l.set((l.get()||0)+c[a]-x(h,u,.5))})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:s}=this.visualElement;if(!F(n)||!s||!this.constraints)return;this.stopAnimation();const r=this.constraints,c={x:0,y:0};R(o=>{const a=this.getAxisMotionValue(o).get();c[o]=ni({min:a,max:a},r[o])});const{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},""):"none",s.root&&s.root.updateScroll(),s.updateLayout(),this.constraints=!1,this.resolveConstraints(),R(o=>{const a=this.getAxisMotionValue(o);if(!$(o,e,null)||!a.get())return;const{min:l,max:h}=this.constraints[o];a.set(x(l,h,c[o]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;ai.set(this.visualElement,this);const e=this.visualElement.current,n=z(e,"pointerdown",l=>{const{drag:h,dragListener:u=!0}=this.getProps(),f=l.target,d=f!==e&&Xe(f);h&&u&&!d&&this.start(l)});let s;const r=()=>{const{dragConstraints:l}=this.getProps(),h=F(l)&&ee(l);h&&(this.constraints=this.resolveRefConstraints(),s||(s=hi(e,h,()=>this.scalePositionWithinConstraints())))},{projection:c}=this.visualElement,i=c.addEventListener("measure",r);c&&!c.layout&&(c.root&&c.root.updateScroll(),c.updateLayout()),D.read(r);const o=mt(window,"resize",()=>this.scalePositionWithinConstraints()),a=c.addEventListener("didUpdate",(({delta:l,hasLayoutChanged:h})=>{this.isDragging&&h&&(R(u=>{const f=this.getAxisMotionValue(u);f&&(this.originPoint[u]+=l[u].translate,f.set(f.get()+l[u].translate))}),this.visualElement.render())}));return()=>{o(),n(),i(),a&&a(),s&&s()}}getProps(){const e=this.readProps(),{drag:n=!1,dragDirectionLock:s=!1,dragPropagation:r=!1,dragConstraints:c=!1,dragElastic:i=ct,dragMomentum:o=!0}=e;return{...e,drag:n,dragDirectionLock:s,dragPropagation:r,dragConstraints:c,dragElastic:i,dragMomentum:o}}}function F(t){return!!t&&typeof t=="object"&&("current"in t||"nodeType"in t)}const ee=t=>"current"in t?t.current:t;function se(t){let e=!0;return()=>{if(e){e=!1;return}t()}}function hi(t,e,n){const s=Yt(t,se(n)),r=Yt(e,se(n));return()=>{s(),r()}}function $(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function ui(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}class ci extends he{constructor(e){super(e),this.removeGroupControls=U,this.removeListeners=U,this.controls=new li(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||U}update(){const{dragControls:e}=this.node.getProps(),{dragControls:n}=this.node.prevProps||{};e!==n&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const fi=({current:t})=>t?t.ownerDocument.defaultView:null,ot=t=>(e,n)=>{t&&D.update(()=>t(e,n),!1,!0)};class di extends he{constructor(){super(...arguments),this.removePointerDownListener=U}onPointerDown(e){this.session=new Te(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:fi(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:n,onPan:s,onPanEnd:r}=this.node.getProps();return{onSessionStart:ot(e),onStart:ot(n),onMove:ot(s),onEnd:(c,i)=>{delete this.session,r&&D.postRender(()=>r(c,i))}}}mount(){this.removePointerDownListener=z(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let rt=!1;const ie=({layout:t,layoutDependency:e})=>({layout:t,layoutDependency:e,animationType:typeof t=="string"?t:"both"});class mi extends ht.Component{componentDidMount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:s,layoutId:r}=this.props,{projection:c}=e;c&&(n.group&&n.group.add(c),s&&s.register&&r&&s.register(c),rt&&c.root.didUpdate(),c.addEventListener("animationComplete",()=>{this.safeToRemove()}),c.setOptions({...c.options,...ie(this.props),onExitComplete:()=>this.safeToRemove()})),H.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layout:n,layoutDependency:s,visualElement:r,drag:c,isPresent:i}=this.props,{projection:o}=r;return o&&(o.isPresent=i,(e.layoutDependency!==s||e.layout!==n)&&o.setOptions({...o.options,...ie(this.props)}),rt=!0,c||e.layoutDependency!==s||s===void 0||e.isPresent!==i?o.willUpdate():this.safeToRemove(),e.isPresent!==i&&(i?o.promote():o.relegate()||D.postRender(()=>{const a=o.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{visualElement:e,layoutAnchor:n}=this.props,{projection:s}=e;s&&(s.options.layoutAnchor=n,s.root.didUpdate(),ae.postRender(()=>{!s.currentAnimation&&s.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:s}=this.props,{projection:r}=e;rt=!0,r&&(r.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(r),s&&s.deregister&&s.deregister(r))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function Ee(t){const[e,n]=Ye(),s=ht.useContext(qe);return Ke.jsx(mi,{...t,layoutGroup:s,switchLayoutGroup:ht.useContext(_e),isPresent:e,safeToRemove:n})}const pi={pan:{Feature:di},drag:{Feature:ci,ProjectionNode:xe,MeasureLayout:Ee}},yi={layout:{ProjectionNode:xe,MeasureLayout:Ee}},Ti={...Ze,...pi,...yi};export{Ti as default};