clawpad 0.4.15 → 0.4.17

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 (169) hide show
  1. package/.next/standalone/.next/BUILD_ID +1 -1
  2. package/.next/standalone/.next/app-path-routes-manifest.json +10 -10
  3. package/.next/standalone/.next/build-manifest.json +2 -2
  4. package/.next/standalone/.next/prerender-manifest.json +3 -3
  5. package/.next/standalone/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  6. package/.next/standalone/.next/server/app/_global-error.html +2 -2
  7. package/.next/standalone/.next/server/app/_global-error.rsc +1 -1
  8. package/.next/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  9. package/.next/standalone/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  10. package/.next/standalone/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  11. package/.next/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  12. package/.next/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  13. package/.next/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  14. package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  15. package/.next/standalone/.next/server/app/_not-found.html +1 -1
  16. package/.next/standalone/.next/server/app/_not-found.rsc +4 -4
  17. package/.next/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +4 -4
  18. package/.next/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  19. package/.next/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +4 -4
  20. package/.next/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  21. package/.next/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  22. package/.next/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  23. package/.next/standalone/.next/server/app/api/ai/write/route_client-reference-manifest.js +1 -1
  24. package/.next/standalone/.next/server/app/api/changes/[id]/route_client-reference-manifest.js +1 -1
  25. package/.next/standalone/.next/server/app/api/changes/record/route_client-reference-manifest.js +1 -1
  26. package/.next/standalone/.next/server/app/api/changes/revert/route_client-reference-manifest.js +1 -1
  27. package/.next/standalone/.next/server/app/api/changes/route_client-reference-manifest.js +1 -1
  28. package/.next/standalone/.next/server/app/api/changes/run/route_client-reference-manifest.js +1 -1
  29. package/.next/standalone/.next/server/app/api/chat/abort/route_client-reference-manifest.js +1 -1
  30. package/.next/standalone/.next/server/app/api/chat/route.js +4 -4
  31. package/.next/standalone/.next/server/app/api/chat/route_client-reference-manifest.js +1 -1
  32. package/.next/standalone/.next/server/app/api/files/pages/[...path]/route_client-reference-manifest.js +1 -1
  33. package/.next/standalone/.next/server/app/api/files/recent/route_client-reference-manifest.js +1 -1
  34. package/.next/standalone/.next/server/app/api/files/search/route_client-reference-manifest.js +1 -1
  35. package/.next/standalone/.next/server/app/api/files/spaces/[space]/pages/route_client-reference-manifest.js +1 -1
  36. package/.next/standalone/.next/server/app/api/files/spaces/route_client-reference-manifest.js +1 -1
  37. package/.next/standalone/.next/server/app/api/files/watch/route.js +2 -2
  38. package/.next/standalone/.next/server/app/api/files/watch/route_client-reference-manifest.js +1 -1
  39. package/.next/standalone/.next/server/app/api/gateway/config/route_client-reference-manifest.js +1 -1
  40. package/.next/standalone/.next/server/app/api/gateway/detect/route_client-reference-manifest.js +1 -1
  41. package/.next/standalone/.next/server/app/api/gateway/events/route_client-reference-manifest.js +1 -1
  42. package/.next/standalone/.next/server/app/api/gateway/features/route_client-reference-manifest.js +1 -1
  43. package/.next/standalone/.next/server/app/api/gateway/history/route.js +1 -1
  44. package/.next/standalone/.next/server/app/api/gateway/history/route_client-reference-manifest.js +1 -1
  45. package/.next/standalone/.next/server/app/api/gateway/resolve/route_client-reference-manifest.js +1 -1
  46. package/.next/standalone/.next/server/app/api/gateway/sessions/route_client-reference-manifest.js +1 -1
  47. package/.next/standalone/.next/server/app/api/gateway/status/route_client-reference-manifest.js +1 -1
  48. package/.next/standalone/.next/server/app/api/openclaw/commands/route_client-reference-manifest.js +1 -1
  49. package/.next/standalone/.next/server/app/api/search/route_client-reference-manifest.js +1 -1
  50. package/.next/standalone/.next/server/app/api/settings/search-status/route_client-reference-manifest.js +1 -1
  51. package/.next/standalone/.next/server/app/api/setup/bootstrap/route_client-reference-manifest.js +1 -1
  52. package/.next/standalone/.next/server/app/api/setup/bootstrap-workspace/route_client-reference-manifest.js +1 -1
  53. package/.next/standalone/.next/server/app/api/setup/status/route_client-reference-manifest.js +1 -1
  54. package/.next/standalone/.next/server/app/api/setup/trigger-onboarding/route_client-reference-manifest.js +1 -1
  55. package/.next/standalone/.next/server/app/api/version/route_client-reference-manifest.js +1 -1
  56. package/.next/standalone/.next/server/app/index.html +1 -1
  57. package/.next/standalone/.next/server/app/index.rsc +4 -4
  58. package/.next/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +1 -1
  59. package/.next/standalone/.next/server/app/index.segments/_full.segment.rsc +4 -4
  60. package/.next/standalone/.next/server/app/index.segments/_head.segment.rsc +1 -1
  61. package/.next/standalone/.next/server/app/index.segments/_index.segment.rsc +4 -4
  62. package/.next/standalone/.next/server/app/index.segments/_tree.segment.rsc +2 -2
  63. package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
  64. package/.next/standalone/.next/server/app/settings/connection/page_client-reference-manifest.js +1 -1
  65. package/.next/standalone/.next/server/app/settings/connection.html +1 -1
  66. package/.next/standalone/.next/server/app/settings/connection.rsc +4 -4
  67. package/.next/standalone/.next/server/app/settings/connection.segments/_full.segment.rsc +4 -4
  68. package/.next/standalone/.next/server/app/settings/connection.segments/_head.segment.rsc +1 -1
  69. package/.next/standalone/.next/server/app/settings/connection.segments/_index.segment.rsc +4 -4
  70. package/.next/standalone/.next/server/app/settings/connection.segments/_tree.segment.rsc +2 -2
  71. package/.next/standalone/.next/server/app/settings/connection.segments/settings/connection/__PAGE__.segment.rsc +1 -1
  72. package/.next/standalone/.next/server/app/settings/connection.segments/settings/connection.segment.rsc +1 -1
  73. package/.next/standalone/.next/server/app/settings/connection.segments/settings.segment.rsc +1 -1
  74. package/.next/standalone/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  75. package/.next/standalone/.next/server/app/settings/relay/page_client-reference-manifest.js +1 -1
  76. package/.next/standalone/.next/server/app/settings/relay.html +1 -1
  77. package/.next/standalone/.next/server/app/settings/relay.rsc +4 -4
  78. package/.next/standalone/.next/server/app/settings/relay.segments/_full.segment.rsc +4 -4
  79. package/.next/standalone/.next/server/app/settings/relay.segments/_head.segment.rsc +1 -1
  80. package/.next/standalone/.next/server/app/settings/relay.segments/_index.segment.rsc +4 -4
  81. package/.next/standalone/.next/server/app/settings/relay.segments/_tree.segment.rsc +2 -2
  82. package/.next/standalone/.next/server/app/settings/relay.segments/settings/relay/__PAGE__.segment.rsc +1 -1
  83. package/.next/standalone/.next/server/app/settings/relay.segments/settings/relay.segment.rsc +1 -1
  84. package/.next/standalone/.next/server/app/settings/relay.segments/settings.segment.rsc +1 -1
  85. package/.next/standalone/.next/server/app/settings.html +1 -1
  86. package/.next/standalone/.next/server/app/settings.rsc +4 -4
  87. package/.next/standalone/.next/server/app/settings.segments/_full.segment.rsc +4 -4
  88. package/.next/standalone/.next/server/app/settings.segments/_head.segment.rsc +1 -1
  89. package/.next/standalone/.next/server/app/settings.segments/_index.segment.rsc +4 -4
  90. package/.next/standalone/.next/server/app/settings.segments/_tree.segment.rsc +2 -2
  91. package/.next/standalone/.next/server/app/settings.segments/settings/__PAGE__.segment.rsc +1 -1
  92. package/.next/standalone/.next/server/app/settings.segments/settings.segment.rsc +1 -1
  93. package/.next/standalone/.next/server/app/setup/page_client-reference-manifest.js +1 -1
  94. package/.next/standalone/.next/server/app/setup.html +1 -1
  95. package/.next/standalone/.next/server/app/setup.rsc +5 -5
  96. package/.next/standalone/.next/server/app/setup.segments/_full.segment.rsc +5 -5
  97. package/.next/standalone/.next/server/app/setup.segments/_head.segment.rsc +1 -1
  98. package/.next/standalone/.next/server/app/setup.segments/_index.segment.rsc +4 -4
  99. package/.next/standalone/.next/server/app/setup.segments/_tree.segment.rsc +2 -2
  100. package/.next/standalone/.next/server/app/setup.segments/setup/__PAGE__.segment.rsc +2 -2
  101. package/.next/standalone/.next/server/app/setup.segments/setup.segment.rsc +1 -1
  102. package/.next/standalone/.next/server/app/waitlist/page_client-reference-manifest.js +1 -1
  103. package/.next/standalone/.next/server/app/waitlist.html +1 -1
  104. package/.next/standalone/.next/server/app/waitlist.rsc +4 -4
  105. package/.next/standalone/.next/server/app/waitlist.segments/_full.segment.rsc +4 -4
  106. package/.next/standalone/.next/server/app/waitlist.segments/_head.segment.rsc +1 -1
  107. package/.next/standalone/.next/server/app/waitlist.segments/_index.segment.rsc +4 -4
  108. package/.next/standalone/.next/server/app/waitlist.segments/_tree.segment.rsc +2 -2
  109. package/.next/standalone/.next/server/app/waitlist.segments/waitlist/__PAGE__.segment.rsc +1 -1
  110. package/.next/standalone/.next/server/app/waitlist.segments/waitlist.segment.rsc +1 -1
  111. package/.next/standalone/.next/server/app/workspace/[...path]/page.js +2 -2
  112. package/.next/standalone/.next/server/app/workspace/[...path]/page.js.nft.json +1 -1
  113. package/.next/standalone/.next/server/app/workspace/[...path]/page_client-reference-manifest.js +1 -1
  114. package/.next/standalone/.next/server/app/workspace/page.js +1 -1
  115. package/.next/standalone/.next/server/app/workspace/page.js.nft.json +1 -1
  116. package/.next/standalone/.next/server/app/workspace/page_client-reference-manifest.js +1 -1
  117. package/.next/standalone/.next/server/app/workspace/search/page.js +1 -1
  118. package/.next/standalone/.next/server/app/workspace/search/page.js.nft.json +1 -1
  119. package/.next/standalone/.next/server/app/workspace/search/page_client-reference-manifest.js +1 -1
  120. package/.next/standalone/.next/server/app/workspace/search.html +2 -2
  121. package/.next/standalone/.next/server/app/workspace/search.rsc +5 -5
  122. package/.next/standalone/.next/server/app/workspace/search.segments/_full.segment.rsc +5 -5
  123. package/.next/standalone/.next/server/app/workspace/search.segments/_head.segment.rsc +1 -1
  124. package/.next/standalone/.next/server/app/workspace/search.segments/_index.segment.rsc +4 -4
  125. package/.next/standalone/.next/server/app/workspace/search.segments/_tree.segment.rsc +2 -2
  126. package/.next/standalone/.next/server/app/workspace/search.segments/workspace/search/__PAGE__.segment.rsc +1 -1
  127. package/.next/standalone/.next/server/app/workspace/search.segments/workspace/search.segment.rsc +1 -1
  128. package/.next/standalone/.next/server/app/workspace/search.segments/workspace.segment.rsc +2 -2
  129. package/.next/standalone/.next/server/app/workspace.html +2 -2
  130. package/.next/standalone/.next/server/app/workspace.rsc +5 -5
  131. package/.next/standalone/.next/server/app/workspace.segments/_full.segment.rsc +5 -5
  132. package/.next/standalone/.next/server/app/workspace.segments/_head.segment.rsc +1 -1
  133. package/.next/standalone/.next/server/app/workspace.segments/_index.segment.rsc +4 -4
  134. package/.next/standalone/.next/server/app/workspace.segments/_tree.segment.rsc +2 -2
  135. package/.next/standalone/.next/server/app/workspace.segments/workspace/__PAGE__.segment.rsc +1 -1
  136. package/.next/standalone/.next/server/app/workspace.segments/workspace.segment.rsc +2 -2
  137. package/.next/standalone/.next/server/app-paths-manifest.json +10 -10
  138. package/.next/standalone/.next/server/chunks/2461.js +1 -1
  139. package/.next/standalone/.next/server/chunks/2470.js +1 -1
  140. package/.next/standalone/.next/server/chunks/{7174.js → 2518.js} +2 -2
  141. package/.next/standalone/.next/server/chunks/3114.js +1 -1
  142. package/.next/standalone/.next/server/chunks/3251.js +2 -2
  143. package/.next/standalone/.next/server/chunks/534.js +2 -2
  144. package/.next/standalone/.next/server/pages/404.html +1 -1
  145. package/.next/standalone/.next/server/pages/500.html +2 -2
  146. package/.next/standalone/.next/server/server-reference-manifest.json +1 -1
  147. package/.next/standalone/node_modules/@img/sharp-libvips-linuxmusl-x64/lib/index.js +1 -0
  148. package/.next/standalone/node_modules/@img/sharp-libvips-linuxmusl-x64/lib/libvips-cpp.so.8.17.3 +0 -0
  149. package/.next/standalone/node_modules/@img/sharp-libvips-linuxmusl-x64/package.json +42 -0
  150. package/.next/standalone/node_modules/@img/sharp-libvips-linuxmusl-x64/versions.json +30 -0
  151. package/.next/standalone/node_modules/@img/sharp-linuxmusl-x64/LICENSE +191 -0
  152. package/.next/standalone/node_modules/@img/sharp-linuxmusl-x64/lib/sharp-linuxmusl-x64.node +0 -0
  153. package/.next/standalone/node_modules/@img/sharp-linuxmusl-x64/package.json +46 -0
  154. package/.next/standalone/package.json +1 -1
  155. package/.next/static/chunks/1285-4a6c410db884bf7b.js +9 -0
  156. package/.next/static/chunks/{7230-ae3fcfca93b2ad80.js → 4512-d722f6ea7cf6241b.js} +5 -5
  157. package/.next/static/chunks/app/layout-57d1abd59f4edb90.js +1 -0
  158. package/.next/static/chunks/app/workspace/[...path]/page-3d66400a5ed06c49.js +38 -0
  159. package/.next/static/chunks/app/workspace/layout-5b1e29fb406cff83.js +6 -0
  160. package/.next/static/chunks/{ba12c10f-cb1126b897816a0f.js → ba12c10f-60ae8f6a2f0b4dd3.js} +1 -1
  161. package/.next/static/css/ee598b7014e1ece1.css +1 -0
  162. package/package.json +1 -1
  163. package/.next/static/chunks/1285-5a2da086334493ab.js +0 -9
  164. package/.next/static/chunks/app/layout-6fad2f96726e757a.js +0 -1
  165. package/.next/static/chunks/app/workspace/[...path]/page-463022f5d199eabc.js +0 -38
  166. package/.next/static/chunks/app/workspace/layout-10e6e52da47d81e4.js +0 -6
  167. package/.next/static/css/b5d2bd8e17641061.css +0 -1
  168. /package/.next/static/{Wa475fYq7y8N9jedn5ZlJ → mut1jCnDAviqx0VdlAtkQ}/_buildManifest.js +0 -0
  169. /package/.next/static/{Wa475fYq7y8N9jedn5ZlJ → mut1jCnDAviqx0VdlAtkQ}/_ssgManifest.js +0 -0
@@ -1,9 +0,0 @@
1
- "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1285],{6296:(t,e,i)=>{i.d(e,{A:()=>n});let n=(0,i(90425).A)("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},10887:(t,e,i)=>{i.d(e,{Uu:()=>r});var n=i(25620);let s="u">typeof window;function r(){if(n.r.current=!0,s)if(window.matchMedia){let t=window.matchMedia("(prefers-reduced-motion)"),e=()=>n.O.current=t.matches;t.addEventListener("change",e),e()}else n.O.current=!1}},15131:(t,e,i)=>{i.d(e,{t:()=>n});let n=(0,i(12115).createContext)(null)},21362:(t,e,i)=>{i.d(e,{A:()=>n});let n=(0,i(90425).A)("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]])},24866:(t,e,i)=>{i.d(e,{Q:()=>n});let n=(0,i(12115).createContext)({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"})},25620:(t,e,i)=>{i.d(e,{O:()=>n,r:()=>s});let n={current:null},s={current:!1}},28819:(t,e,i)=>{i.d(e,{M:()=>s});var n=i(12115);function s(t){let e=(0,n.useRef)(null);return null===e.current&&(e.current=t()),e.current}},39551:(t,e,i)=>{i.d(e,{L:()=>n});let n=(0,i(12115).createContext)({})},42129:(t,e,i)=>{i.d(e,{A:()=>n});let n=(0,i(90425).A)("folder-open",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]])},52159:(t,e,i)=>{let n,s,r,o;i.d(e,{P:()=>rF});let a=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],l=new Set(a),h=(t,e,i)=>i>e?e:i<t?t:i,u={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},d={...u,transform:t=>h(0,1,t)},c={...u,default:1},p=t=>Math.round(1e5*t)/1e5,m=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu,f=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,g=(t,e)=>i=>!!("string"==typeof i&&f.test(i)&&i.startsWith(t)||e&&null!=i&&Object.prototype.hasOwnProperty.call(i,e)),y=(t,e,i)=>n=>{if("string"!=typeof n)return n;let[s,r,o,a]=n.match(m);return{[t]:parseFloat(s),[e]:parseFloat(r),[i]:parseFloat(o),alpha:void 0!==a?parseFloat(a):1}},v={...u,transform:t=>Math.round(h(0,255,t))},x={test:g("rgb","red"),parse:y("red","green","blue"),transform:({red:t,green:e,blue:i,alpha:n=1})=>"rgba("+v.transform(t)+", "+v.transform(e)+", "+v.transform(i)+", "+p(d.transform(n))+")"},w={test:g("#"),parse:function(t){let e="",i="",n="",s="";return t.length>5?(e=t.substring(1,3),i=t.substring(3,5),n=t.substring(5,7),s=t.substring(7,9)):(e=t.substring(1,2),i=t.substring(2,3),n=t.substring(3,4),s=t.substring(4,5),e+=e,i+=i,n+=n,s+=s),{red:parseInt(e,16),green:parseInt(i,16),blue:parseInt(n,16),alpha:s?parseInt(s,16)/255:1}},transform:x.transform},T=t=>({test:e=>"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),P=T("deg"),S=T("%"),b=T("px"),A=T("vh"),E=T("vw"),M={...S,parse:t=>S.parse(t)/100,transform:t=>S.transform(100*t)},V={test:g("hsl","hue"),parse:y("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:i,alpha:n=1})=>"hsla("+Math.round(t)+", "+S.transform(p(e))+", "+S.transform(p(i))+", "+p(d.transform(n))+")"},C={test:t=>x.test(t)||w.test(t)||V.test(t),parse:t=>x.test(t)?x.parse(t):V.test(t)?V.parse(t):w.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?x.transform(t):V.transform(t),getAnimatableNone:t=>{let e=C.parse(t);return e.alpha=0,C.transform(e)}},k=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu,D="number",R="color",L=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function j(t){let e=t.toString(),i=[],n={color:[],number:[],var:[]},s=[],r=0,o=e.replace(L,t=>(C.test(t)?(n.color.push(r),s.push(R),i.push(C.parse(t))):t.startsWith("var(")?(n.var.push(r),s.push("var"),i.push(t)):(n.number.push(r),s.push(D),i.push(parseFloat(t))),++r,"${}")).split("${}");return{values:i,split:o,indexes:n,types:s}}function B(t){return j(t).values}function F(t){let{split:e,types:i}=j(t),n=e.length;return t=>{let s="";for(let r=0;r<n;r++)if(s+=e[r],void 0!==t[r]){let e=i[r];e===D?s+=p(t[r]):e===R?s+=C.transform(t[r]):s+=t[r]}return s}}let I=t=>"number"==typeof t?0:C.test(t)?C.getAnimatableNone(t):t,O={test:function(t){return isNaN(t)&&"string"==typeof t&&(t.match(m)?.length||0)+(t.match(k)?.length||0)>0},parse:B,createTransformer:F,getAnimatableNone:function(t){let e=B(t);return F(t)(e.map(I))}},U=new Set(["brightness","contrast","saturate","opacity"]);function $(t){let[e,i]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;let[n]=i.match(m)||[];if(!n)return t;let s=i.replace(n,""),r=+!!U.has(e);return n!==i&&(r*=100),e+"("+r+s+")"}let W=/\b([a-z-]*)\(.*?\)/gu,N={...O,getAnimatableNone:t=>{let e=t.match(W);return e?e.map($).join(" "):t}},z={...O,getAnimatableNone:t=>{let e=O.parse(t);return O.createTransformer(t)(e.map(t=>"number"==typeof t?0:"object"==typeof t?{...t,alpha:1}:t))}},Y={...u,transform:Math.round},H={borderWidth:b,borderTopWidth:b,borderRightWidth:b,borderBottomWidth:b,borderLeftWidth:b,borderRadius:b,borderTopLeftRadius:b,borderTopRightRadius:b,borderBottomRightRadius:b,borderBottomLeftRadius:b,width:b,maxWidth:b,height:b,maxHeight:b,top:b,right:b,bottom:b,left:b,inset:b,insetBlock:b,insetBlockStart:b,insetBlockEnd:b,insetInline:b,insetInlineStart:b,insetInlineEnd:b,padding:b,paddingTop:b,paddingRight:b,paddingBottom:b,paddingLeft:b,paddingBlock:b,paddingBlockStart:b,paddingBlockEnd:b,paddingInline:b,paddingInlineStart:b,paddingInlineEnd:b,margin:b,marginTop:b,marginRight:b,marginBottom:b,marginLeft:b,marginBlock:b,marginBlockStart:b,marginBlockEnd:b,marginInline:b,marginInlineStart:b,marginInlineEnd:b,fontSize:b,backgroundPositionX:b,backgroundPositionY:b,rotate:P,rotateX:P,rotateY:P,rotateZ:P,scale:c,scaleX:c,scaleY:c,scaleZ:c,skew:P,skewX:P,skewY:P,distance:b,translateX:b,translateY:b,translateZ:b,x:b,y:b,z:b,perspective:b,transformPerspective:b,opacity:d,originX:M,originY:M,originZ:b,zIndex:Y,fillOpacity:d,strokeOpacity:d,numOctaves:Y},X={...H,color:C,backgroundColor:C,outlineColor:C,fill:C,stroke:C,borderColor:C,borderTopColor:C,borderRightColor:C,borderBottomColor:C,borderLeftColor:C,filter:N,WebkitFilter:N,mask:z,WebkitMask:z},K=t=>X[t],G=()=>({translate:0,scale:1,origin:0,originPoint:0}),q=()=>({x:G(),y:G()}),_=()=>({min:0,max:0}),Z=()=>({x:_(),y:_()}),Q=t=>!!(t&&t.getVelocity),J=new Set(["width","height","top","left","right","bottom",...a]),tt=t=>e=>e.test(t),te=[u,b,S,P,E,A,{test:t=>"auto"===t,parse:t=>t}],ti=t=>te.find(tt(t));i(41463);let tn=()=>{},ts=()=>{},tr=t=>e=>"string"==typeof e&&e.startsWith(t),to=tr("--"),ta=tr("var(--"),tl=t=>!!ta(t)&&th.test(t.split("/*")[0].trim()),th=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function tu(t){return"string"==typeof t&&t.split("/*")[0].includes("var(--")}let td=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u,tc=t=>180*t/Math.PI,tp=t=>tf(tc(Math.atan2(t[1],t[0]))),tm={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:tp,rotateZ:tp,skewX:t=>tc(Math.atan(t[1])),skewY:t=>tc(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},tf=t=>((t%=360)<0&&(t+=360),t),tg=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),ty=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),tv={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:tg,scaleY:ty,scale:t=>(tg(t)+ty(t))/2,rotateX:t=>tf(tc(Math.atan2(t[6],t[5]))),rotateY:t=>tf(tc(Math.atan2(-t[2],t[0]))),rotateZ:tp,rotate:tp,skewX:t=>tc(Math.atan(t[4])),skewY:t=>tc(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function tx(t){return+!!t.includes("scale")}function tw(t,e){let i,n;if(!t||"none"===t)return tx(e);let s=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);if(s)i=tv,n=s;else{let e=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);i=tm,n=e}if(!n)return tx(e);let r=i[e],o=n[1].split(",").map(tT);return"function"==typeof r?r(o):o[r]}function tT(t){return parseFloat(t.trim())}let tP=t=>t===u||t===b,tS=new Set(["x","y","z"]),tb=a.filter(t=>!tS.has(t)),tA={width:({x:t},{paddingLeft:e="0",paddingRight:i="0"})=>t.max-t.min-parseFloat(e)-parseFloat(i),height:({y:t},{paddingTop:e="0",paddingBottom:i="0"})=>t.max-t.min-parseFloat(e)-parseFloat(i),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>tw(e,"x"),y:(t,{transform:e})=>tw(e,"y")};tA.translateX=tA.x,tA.translateY=tA.y;let tE=t=>t,tM={},tV=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function tC(t,e){let i=!1,n=!0,s={delta:0,timestamp:0,isProcessing:!1},r=()=>i=!0,o=tV.reduce((t,i)=>(t[i]=function(t,e){let i=new Set,n=new Set,s=!1,r=!1,o=new WeakSet,a={delta:0,timestamp:0,isProcessing:!1},l=0;function h(e){o.has(e)&&(u.schedule(e),t()),l++,e(a)}let u={schedule:(t,e=!1,r=!1)=>{let a=r&&s?i:n;return e&&o.add(t),a.has(t)||a.add(t),t},cancel:t=>{n.delete(t),o.delete(t)},process:t=>{if(a=t,s){r=!0;return}s=!0,[i,n]=[n,i],i.forEach(h),e,l=0,i.clear(),s=!1,r&&(r=!1,u.process(t))}};return u}(r,e?i:void 0),t),{}),{setup:a,read:l,resolveKeyframes:h,preUpdate:u,update:d,preRender:c,render:p,postRender:m}=o,f=()=>{let r=tM.useManualTiming?s.timestamp:performance.now();i=!1,tM.useManualTiming||(s.delta=n?1e3/60:Math.max(Math.min(r-s.timestamp,40),1)),s.timestamp=r,s.isProcessing=!0,a.process(s),l.process(s),h.process(s),u.process(s),d.process(s),c.process(s),p.process(s),m.process(s),s.isProcessing=!1,i&&e&&(n=!1,t(f))};return{schedule:tV.reduce((e,r)=>{let a=o[r];return e[r]=(e,r=!1,o=!1)=>(!i&&(i=!0,n=!0,s.isProcessing||t(f)),a.schedule(e,r,o)),e},{}),cancel:t=>{for(let e=0;e<tV.length;e++)o[tV[e]].cancel(t)},state:s,steps:o}}let{schedule:tk,cancel:tD,state:tR,steps:tL}=tC("u">typeof requestAnimationFrame?requestAnimationFrame:tE,!0),tj=new Set,tB=!1,tF=!1,tI=!1;function tO(){if(tF){let t=Array.from(tj).filter(t=>t.needsMeasurement),e=new Set(t.map(t=>t.element)),i=new Map;e.forEach(t=>{let e,n=(e=[],tb.forEach(i=>{let n=t.getValue(i);void 0!==n&&(e.push([i,n.get()]),n.set(+!!i.startsWith("scale")))}),e);n.length&&(i.set(t,n),t.render())}),t.forEach(t=>t.measureInitialState()),e.forEach(t=>{t.render();let e=i.get(t);e&&e.forEach(([e,i])=>{t.getValue(e)?.set(i)})}),t.forEach(t=>t.measureEndState()),t.forEach(t=>{void 0!==t.suspendedScrollY&&window.scrollTo(0,t.suspendedScrollY)})}tF=!1,tB=!1,tj.forEach(t=>t.complete(tI)),tj.clear()}function tU(){tj.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(tF=!0)})}class t${constructor(t,e,i,n,s,r=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=e,this.name=i,this.motionValue=n,this.element=s,this.isAsync=r}scheduleResolve(){this.state="scheduled",this.isAsync?(tj.add(this),tB||(tB=!0,tk.read(tU),tk.resolveKeyframes(tO))):(this.readKeyframes(),this.complete())}readKeyframes(){let{unresolvedKeyframes:t,name:e,element:i,motionValue:n}=this;if(null===t[0]){let s=n?.get(),r=t[t.length-1];if(void 0!==s)t[0]=s;else if(i&&e){let n=i.readValue(e,r);null!=n&&(t[0]=n)}void 0===t[0]&&(t[0]=r),n&&void 0===s&&n.set(t[0])}for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),tj.delete(this)}cancel(){"scheduled"===this.state&&(tj.delete(this),this.state="pending")}resume(){"pending"===this.state&&this.scheduleResolve()}}let tW=new Set([N,z]);function tN(t,e){let i=K(t);return tW.has(i)||(i=O),i.getAnimatableNone?i.getAnimatableNone(e):void 0}let tz=new Set(["auto","none","0"]);class tY extends t${constructor(t,e,i,n,s){super(t,e,i,n,s,!0)}readKeyframes(){let{unresolvedKeyframes:t,element:e,name:i}=this;if(!e||!e.current)return;super.readKeyframes();for(let i=0;i<t.length;i++){let n=t[i];if("string"==typeof n&&tl(n=n.trim())){let s=function t(e,i,n=1){ts(n<=4,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`,"max-css-var-depth");let[s,r]=function(t){let e=td.exec(t);if(!e)return[,];let[,i,n,s]=e;return[`--${i??n}`,s]}(e);if(!s)return;let o=window.getComputedStyle(i).getPropertyValue(s);if(o){let t=o.trim();return/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t)?parseFloat(t):t}return tl(r)?t(r,i,n+1):r}(n,e.current);void 0!==s&&(t[i]=s),i===t.length-1&&(this.finalKeyframe=n)}}if(this.resolveNoneKeyframes(),!J.has(i)||2!==t.length)return;let[n,s]=t,r=ti(n),o=ti(s);if(tu(n)!==tu(s)&&tA[i]){this.needsMeasurement=!0;return}if(r!==o)if(tP(r)&&tP(o))for(let e=0;e<t.length;e++){let i=t[e];"string"==typeof i&&(t[e]=parseFloat(i))}else tA[i]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){let{unresolvedKeyframes:t,name:e}=this,i=[];for(let e=0;e<t.length;e++)(null===t[e]||function(t){if("number"==typeof t)return 0===t;if(null===t)return!0;return"none"===t||"0"===t||/^0[^.\s]+$/u.test(t)}(t[e]))&&i.push(e);i.length&&function(t,e,i){let n,s=0;for(;s<t.length&&!n;){let e=t[s];"string"==typeof e&&!tz.has(e)&&j(e).values.length&&(n=t[s]),s++}if(n&&i)for(let s of e)t[s]=tN(i,n)}(t,i,e)}measureInitialState(){let{element:t,unresolvedKeyframes:e,name:i}=this;if(!t||!t.current)return;"height"===i&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=tA[i](t.measureViewportBox(),window.getComputedStyle(t.current)),e[0]=this.measuredOrigin;let n=e[e.length-1];void 0!==n&&t.getValue(i,n).jump(n,!1)}measureEndState(){let{element:t,name:e,unresolvedKeyframes:i}=this;if(!t||!t.current)return;let n=t.getValue(e);n&&n.jump(this.measuredOrigin,!1);let s=i.length-1,r=i[s];i[s]=tA[e](t.measureViewportBox(),window.getComputedStyle(t.current)),null!==r&&void 0===this.finalKeyframe&&(this.finalKeyframe=r),this.removedTransforms?.length&&this.removedTransforms.forEach(([e,i])=>{t.getValue(e).set(i)}),this.resolveNoneKeyframes()}}let tH=t=>1e3*t;function tX(t,e){-1===t.indexOf(e)&&t.push(e)}function tK(t,e){let i=t.indexOf(e);i>-1&&t.splice(i,1)}class tG{constructor(){this.subscriptions=[]}add(t){return tX(this.subscriptions,t),()=>tK(this.subscriptions,t)}notify(t,e,i){let n=this.subscriptions.length;if(n)if(1===n)this.subscriptions[0](t,e,i);else for(let s=0;s<n;s++){let n=this.subscriptions[s];n&&n(t,e,i)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function tq(t){let e;return()=>(void 0===e&&(e=t()),e)}let t_={};function tZ(t,e){let i=tq(t);return()=>t_[e]??i()}let tQ=tZ(()=>void 0!==window.ScrollTimeline,"scrollTimeline"),tJ=t=>null!==t;function t0(t,{repeat:e,repeatType:i="loop"},n,s=1){let r=t.filter(tJ),o=s<0||e&&"loop"!==i&&e%2==1?0:r.length-1;return o&&void 0!==n?n:r[o]}class t1{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,e){return this.finished.then(t,e)}}let t2={layout:0,mainThread:0,waapi:0},t5=t=>Array.isArray(t)&&"number"==typeof t[0],t3=tZ(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0},"linearEasing"),t9=(t,e,i=10)=>{let n="",s=Math.max(Math.round(e/i),2);for(let e=0;e<s;e++)n+=Math.round(1e4*t(e/(s-1)))/1e4+", ";return`linear(${n.substring(0,n.length-2)})`},t6=([t,e,i,n])=>`cubic-bezier(${t}, ${e}, ${i}, ${n})`,t4={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:t6([0,.65,.55,1]),circOut:t6([.55,0,1,.45]),backIn:t6([.31,.01,.66,-.59]),backOut:t6([.33,1.53,.69,.99])};function t8(t){return"function"==typeof t&&"applyToOptions"in t}class t7 extends t1{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:e,name:i,keyframes:n,pseudoElement:s,allowFlatten:r=!1,finalKeyframe:o,onComplete:a}=t;this.isPseudoElement=!!s,this.allowFlatten=r,this.options=t,ts("string"!=typeof t.type,'Mini animate() doesn\'t support "type" as a string.',"mini-spring");const l=function({type:t,...e}){return t8(t)&&t3()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}(t);this.animation=function(t,e,i,{delay:n=0,duration:s=300,repeat:r=0,repeatType:o="loop",ease:a="easeOut",times:l}={},h){let u={[e]:i};l&&(u.offset=l);let d=function t(e,i){if(e)return"function"==typeof e?t3()?t9(e,i):"ease-out":t5(e)?t6(e):Array.isArray(e)?e.map(e=>t(e,i)||t4.easeOut):t4[e]}(a,s);Array.isArray(d)&&(u.easing=d);let c={delay:n,duration:s,easing:Array.isArray(d)?"linear":d,fill:"both",iterations:r+1,direction:"reverse"===o?"alternate":"normal"};h&&(c.pseudoElement=h);let p=t.animate(u,c);return p}(e,i,n,l,s),!1===l.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!s){let t=t0(n,this.options,o,this.speed);this.updateMotionValue&&this.updateMotionValue(t);i.startsWith("--")?e.style.setProperty(i,t):e.style[i]=t,this.animation.cancel()}a?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),"finished"===this.state&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch(t){}}stop(){if(this.isStopped)return;this.isStopped=!0;let{state:t}=this;"idle"!==t&&"finished"!==t&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){let t=this.options?.element;!this.isPseudoElement&&t?.isConnected&&this.animation.commitStyles?.()}get duration(){return Number(this.animation.effect?.getComputedTiming?.().duration||0)/1e3}get iterationDuration(){let{delay:t=0}=this.options||{};return this.duration+t/1e3}get time(){return(Number(this.animation.currentTime)||0)/1e3}set time(t){this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=tH(t)}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return null!==this.finishedTime?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,rangeStart:e,rangeEnd:i,observe:n}){return(this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&tQ())?(this.animation.timeline=t,e&&(this.animation.rangeStart=e),i&&(this.animation.rangeEnd=i),tE):n(this)}}let et=new Set(["opacity","clipPath","filter","transform"]),{schedule:ee}=tC(queueMicrotask,!1);function ei(){n=void 0}let en={now:()=>(void 0===n&&en.set(tR.isProcessing||tM.useManualTiming?tR.timestamp:performance.now()),n),set:t=>{n=t,queueMicrotask(ei)}};class es{constructor(t,e={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=t=>{let e=en.now();if(this.updatedAt!==e&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(t),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(let t of this.dependents)t.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=e.owner}setCurrent(t){this.current=t,this.updatedAt=en.now(),null===this.canTrackVelocity&&void 0!==t&&(this.canTrackVelocity=!isNaN(parseFloat(this.current)))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,e){this.events[t]||(this.events[t]=new tG);let i=this.events[t].add(e);return"change"===t?()=>{i(),tk.read(()=>{this.events.change.getSize()||this.stop()})}:i}clearListeners(){for(let t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,e,i){this.set(e),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-i}jump(t,e=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,e&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return o&&o.push(this),this.current}getPrevious(){return this.prev}getVelocity(){var t;let e=en.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||e-this.updatedAt>30)return 0;let i=Math.min(this.updatedAt-this.prevUpdatedAt,30);return t=parseFloat(this.current)-parseFloat(this.prevFrameValue),i?1e3/i*t:0}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.animation=t(e),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function er(t,e){return new es(t,e)}let eo=[...te,C,O],ea=new WeakMap;function el(t){return null!==t&&"object"==typeof t&&"function"==typeof t.start}function eh(t){return"string"==typeof t||Array.isArray(t)}let eu=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],ed=["initial",...eu];function ec(t){return el(t.animate)||ed.some(e=>eh(t[e]))}function ep(t){return!!(ec(t)||t.variants)}var em,ef=i(10887);function eg(t){let e=[{},{}];return t?.values.forEach((t,i)=>{e[0][i]=t.get(),e[1][i]=t.getVelocity()}),e}function ey(t,e,i,n){if("function"==typeof e){let[s,r]=eg(n);e=e(void 0!==i?i:t.custom,s,r)}if("string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e){let[s,r]=eg(n);e=e(void 0!==i?i:t.custom,s,r)}return e}var ev=i(25620);let ex=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],ew={};class eT{scrapeMotionValuesFromProps(t,e,i){return{}}constructor({parent:t,props:e,presenceContext:i,reducedMotionConfig:n,skipAnimations:s,blockInitialAnimation:r,visualState:o},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=t$,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{let t=en.now();this.renderScheduledAt<t&&(this.renderScheduledAt=t,tk.render(this.render,!1,!0))};const{latestValues:l,renderState:h}=o;this.latestValues=l,this.baseTarget={...l},this.initialValues=e.initial?{...l}:{},this.renderState=h,this.parent=t,this.props=e,this.presenceContext=i,this.depth=t?t.depth+1:0,this.reducedMotionConfig=n,this.skipAnimationsConfig=s,this.options=a,this.blockInitialAnimation=!!r,this.isControllingVariants=ec(e),this.isVariantNode=ep(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:u,...d}=this.scrapeMotionValuesFromProps(e,{},this);for(const t in d){const e=d[t];void 0!==l[t]&&Q(e)&&e.set(l[t])}}mount(t){if(this.hasBeenMounted)for(let t in this.initialValues)this.values.get(t)?.jump(this.initialValues[t]),this.latestValues[t]=this.initialValues[t];this.current=t,ea.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((t,e)=>this.bindToMotionValue(e,t)),"never"===this.reducedMotionConfig?this.shouldReduceMotion=!1:"always"===this.reducedMotionConfig?this.shouldReduceMotion=!0:(ev.r.current||(0,ef.Uu)(),this.shouldReduceMotion=ev.O.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){for(let t in this.projection&&this.projection.unmount(),tD(this.notifyUpdate),tD(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this),this.events)this.events[t].clear();for(let t in this.features){let e=this.features[t];e&&(e.unmount(),e.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,e){let i;if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),e.accelerate&&et.has(t)&&this.current instanceof HTMLElement){let{factory:i,keyframes:n,times:s,ease:r,duration:o}=e.accelerate,a=new t7({element:this.current,name:t,keyframes:n,times:s,ease:r,duration:tH(o)}),l=i(a);this.valueSubscriptions.set(t,()=>{l(),a.cancel()});return}let n=l.has(t);n&&this.onBindTransform&&this.onBindTransform();let s=e.on("change",e=>{this.latestValues[t]=e,this.props.onUpdate&&tk.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});"u">typeof window&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,t,e)),this.valueSubscriptions.set(t,()=>{s(),i&&i(),e.owner&&e.stop()})}sortNodePosition(t){return this.current&&this.sortInstanceNodePosition&&this.type===t.type?this.sortInstanceNodePosition(this.current,t.current):0}updateFeatures(){let t="animation";for(t in ew){let e=ew[t];if(!e)continue;let{isEnabled:i,Feature:n}=e;if(!this.features[t]&&n&&i(this.props)&&(this.features[t]=new n(this)),this.features[t]){let e=this.features[t];e.isMounted?e.update():(e.mount(),e.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Z()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,e){this.latestValues[t]=e}update(t,e){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=e;for(let e=0;e<ex.length;e++){let i=ex[e];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);let n=t["on"+i];n&&(this.propEventSubscriptions[i]=this.on(i,n))}this.prevMotionValues=function(t,e,i){for(let n in e){let s=e[n],r=i[n];if(Q(s))t.addValue(n,s);else if(Q(r))t.addValue(n,er(s,{owner:t}));else if(r!==s)if(t.hasValue(n)){let e=t.getValue(n);!0===e.liveStyle?e.jump(s):e.hasAnimated||e.set(s)}else{let e=t.getStaticValue(n);t.addValue(n,er(void 0!==e?e:s,{owner:t}))}}for(let n in i)void 0===e[n]&&t.removeValue(n);return e}(this,this.scrapeMotionValuesFromProps(t,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){let e=this.getClosestVariantNode();if(e)return e.variantChildren&&e.variantChildren.add(t),()=>e.variantChildren.delete(t)}addValue(t,e){let i=this.values.get(t);e!==i&&(i&&this.removeValue(t),this.bindToMotionValue(t,e),this.values.set(t,e),this.latestValues[t]=e.get())}removeValue(t){this.values.delete(t);let e=this.valueSubscriptions.get(t);e&&(e(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,e){if(this.props.values&&this.props.values[t])return this.props.values[t];let i=this.values.get(t);return void 0===i&&void 0!==e&&(i=er(null===e?void 0:e,{owner:this}),this.addValue(t,i)),i}readValue(t,e){let i=void 0===this.latestValues[t]&&this.current?this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options):this.latestValues[t];if(null!=i){let n,s;if("string"==typeof i&&(n=i,/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(n)||(s=i,/^0[^.\s]+$/u.test(s))))i=parseFloat(i);else{let n;n=i,!eo.find(tt(n))&&O.test(e)&&(i=tN(t,e))}this.setBaseTarget(t,Q(i)?i.get():i)}return Q(i)?i.get():i}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){let e,{initial:i}=this.props;if("string"==typeof i||"object"==typeof i){let n=ey(this.props,i,this.presenceContext?.custom);n&&(e=n[t])}if(i&&void 0!==e)return e;let n=this.getBaseTargetFromProps(this.props,t);return void 0===n||Q(n)?void 0!==this.initialValues[t]&&void 0===e?void 0:this.baseTarget[t]:n}on(t,e){return this.events[t]||(this.events[t]=new tG),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}scheduleRenderMicrotask(){ee.render(this.render)}}class eP extends eT{constructor(){super(...arguments),this.KeyframeResolver=tY}sortInstanceNodePosition(t,e){return 2&t.compareDocumentPosition(e)?1:-1}getBaseTargetFromProps(t,e){let i=t.style;return i?i[e]:void 0}removeValueFromRenderState(t,{vars:e,style:i}){delete e[t],delete i[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:t}=this.props;Q(t)&&(this.childSubscription=t.on("change",t=>{this.current&&(this.current.textContent=`${t}`)}))}}function eS(t){return t.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}let eb=(t,e)=>e&&"number"==typeof t?e.transform(t):t,eA={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},eE=a.length;function eM(t,e,i){let{style:n,vars:s,transformOrigin:r}=t,o=!1,h=!1;for(let t in e){let i=e[t];if(l.has(t)){o=!0;continue}if(to(t)){s[t]=i;continue}{let e=eb(i,H[t]);t.startsWith("origin")?(h=!0,r[t]=e):n[t]=e}}if(!e.transform&&(o||i?n.transform=function(t,e,i){let n="",s=!0;for(let r=0;r<eE;r++){let o=a[r],l=t[o];if(void 0===l)continue;let h=!0;if("number"==typeof l)h=l===+!!o.startsWith("scale");else{let t=parseFloat(l);h=o.startsWith("scale")?1===t:0===t}if(!h||i){let t=eb(l,H[o]);if(!h){s=!1;let e=eA[o]||o;n+=`${e}(${t}) `}i&&(e[o]=t)}}return n=n.trim(),i?n=i(e,s?"":n):s&&(n="none"),n}(e,t.transform,i):n.transform&&(n.transform="none")),h){let{originX:t="50%",originY:e="50%",originZ:i=0}=r;n.transformOrigin=`${t} ${e} ${i}`}}let eV={offset:"stroke-dashoffset",array:"stroke-dasharray"},eC={offset:"strokeDashoffset",array:"strokeDasharray"},ek=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function eD(t,{attrX:e,attrY:i,attrScale:n,pathLength:s,pathSpacing:r=1,pathOffset:o=0,...a},l,h,u){if(eM(t,a,h),l){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};let{attrs:d,style:c}=t;for(let t of(d.transform&&(c.transform=d.transform,delete d.transform),(c.transform||d.transformOrigin)&&(c.transformOrigin=d.transformOrigin??"50% 50%",delete d.transformOrigin),c.transform&&(c.transformBox=u?.transformBox??"fill-box",delete d.transformBox),ek))void 0!==d[t]&&(c[t]=d[t],delete d[t]);void 0!==e&&(d.x=e),void 0!==i&&(d.y=i),void 0!==n&&(d.scale=n),void 0!==s&&function(t,e,i=1,n=0,s=!0){t.pathLength=1;let r=s?eV:eC;t[r.offset]=`${-n}`,t[r.array]=`${e} ${i}`}(d,s,r,o,!1)}let eR=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),eL=t=>"string"==typeof t&&"svg"===t.toLowerCase();function ej(t,{style:e,vars:i},n,s){let r,o=t.style;for(r in e)o[r]=e[r];for(r in s?.applyProjectionStyles(o,n),i)o.setProperty(r,i[r])}function eB(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}let eF={correct:(t,e)=>{if(!e.target)return t;if("string"==typeof t)if(!b.test(t))return t;else t=parseFloat(t);let i=eB(t,e.target.x),n=eB(t,e.target.y);return`${i}% ${n}%`}},eI=(t,e,i)=>t+(e-t)*i,eO={borderRadius:{...eF,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:eF,borderTopRightRadius:eF,borderBottomLeftRadius:eF,borderBottomRightRadius:eF,boxShadow:{correct:(t,{treeScale:e,projectionDelta:i})=>{let n=O.parse(t);if(n.length>5)return t;let s=O.createTransformer(t),r=+("number"!=typeof n[0]),o=i.x.scale*e.x,a=i.y.scale*e.y;n[0+r]/=o,n[1+r]/=a;let l=eI(o,a,.5);return"number"==typeof n[2+r]&&(n[2+r]/=l),"number"==typeof n[3+r]&&(n[3+r]/=l),s(n)}}};function eU(t,{layout:e,layoutId:i}){return l.has(t)||t.startsWith("origin")||(e||void 0!==i)&&(!!eO[t]||"opacity"===t)}function e$(t,e,i){let n=t.style,s=e?.style,r={};if(!n)return r;for(let e in n)(Q(n[e])||s&&Q(s[e])||eU(e,t)||i?.getValue(e)?.liveStyle!==void 0)&&(r[e]=n[e]);return r}function eW(t,e,i){let n=e$(t,e,i);for(let i in t)(Q(t[i])||Q(e[i]))&&(n[-1!==a.indexOf(i)?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i]=t[i]);return n}class eN extends eP{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Z}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){if(l.has(e)){let t=K(e);return t&&t.default||0}return e=eR.has(e)?e:eS(e),t.getAttribute(e)}scrapeMotionValuesFromProps(t,e,i){return eW(t,e,i)}build(t,e,i){eD(t,e,this.isSVGTag,i.transformTemplate,i.style)}renderInstance(t,e,i,n){for(let i in ej(t,e,void 0,n),e.attrs)t.setAttribute(eR.has(i)?i:eS(i),e.attrs[i])}mount(t){this.isSVGTag=eL(t.tagName),super.mount(t)}}function ez({top:t,left:e,right:i,bottom:n}){return{x:{min:e,max:i},y:{min:t,max:n}}}function eY(t){return void 0===t||1===t}function eH({scale:t,scaleX:e,scaleY:i}){return!eY(t)||!eY(e)||!eY(i)}function eX(t){return eH(t)||eK(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function eK(t){var e,i;return(e=t.x)&&"0%"!==e||(i=t.y)&&"0%"!==i}function eG(t,e,i,n,s){return void 0!==s&&(t=n+s*(t-n)),n+i*(t-n)+e}function eq(t,e=0,i=1,n,s){t.min=eG(t.min,e,i,n,s),t.max=eG(t.max,e,i,n,s)}function e_(t,{x:e,y:i}){eq(t.x,e.translate,e.scale,e.originPoint),eq(t.y,i.translate,i.scale,i.originPoint)}function eZ(t,e){t.min=t.min+e,t.max=t.max+e}function eQ(t,e,i,n,s=.5){let r=eI(t.min,t.max,s);eq(t,e,i,r,n)}function eJ(t,e){return"string"==typeof t?parseFloat(t)/100*(e.max-e.min):t}function e0(t,e){eQ(t.x,eJ(e.x,t.x),e.scaleX,e.scale,e.originX),eQ(t.y,eJ(e.y,t.y),e.scaleY,e.scale,e.originY)}function e1(t,e){return ez(function(t,e){if(!e)return t;let i=e({x:t.left,y:t.top}),n=e({x:t.right,y:t.bottom});return{top:i.y,left:i.x,bottom:n.y,right:n.x}}(t.getBoundingClientRect(),e))}class e2 extends eP{constructor(){super(...arguments),this.type="html",this.renderInstance=ej}readValueFromInstance(t,e){if(l.has(e))return this.projection?.isProjecting?tx(e):((t,e)=>{let{transform:i="none"}=getComputedStyle(t);return tw(i,e)})(t,e);{let i=window.getComputedStyle(t),n=(to(e)?i.getPropertyValue(e):i[e])||0;return"string"==typeof n?n.trim():n}}measureInstanceViewportBox(t,{transformPagePoint:e}){return e1(t,e)}build(t,e,i){eM(t,e,i.transformTemplate)}scrapeMotionValuesFromProps(t,e,i){return e$(t,e,i)}}var e5=i(12115);let e3=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function e9(t){if("string"!=typeof t||t.includes("-"));else if(e3.indexOf(t)>-1||/[A-Z]/u.test(t))return!0;return!1}var e6=i(95155),e4=i(39551);let e8=(0,e5.createContext)({strict:!1});var e7=i(24866);let it=(0,e5.createContext)({});function ie(t){return Array.isArray(t)?t.join(" "):t}let ii=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function is(t,e,i){for(let n in e)Q(e[n])||eU(n,i)||(t[n]=e[n])}let ir=()=>({...ii(),attrs:{}}),io=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function ia(t){return t.startsWith("while")||t.startsWith("drag")&&"draggable"!==t||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||io.has(t)}let il=t=>!ia(t);try{em=require("@emotion/is-prop-valid").default,"function"==typeof em&&(il=t=>t.startsWith("on")?!ia(t):em(t))}catch{}function ih(t){return Q(t)?t.get():t}var iu=i(15131),id=i(28819);let ic=t=>(e,i)=>{let n=(0,e5.useContext)(it),s=(0,e5.useContext)(iu.t),r=()=>(function({scrapeMotionValuesFromProps:t,createRenderState:e},i,n,s){return{latestValues:function(t,e,i,n){let s={},r=n(t,{});for(let t in r)s[t]=ih(r[t]);let{initial:o,animate:a}=t,l=ec(t),h=ep(t);e&&h&&!l&&!1!==t.inherit&&(void 0===o&&(o=e.initial),void 0===a&&(a=e.animate));let u=!!i&&!1===i.initial,d=(u=u||!1===o)?a:o;if(d&&"boolean"!=typeof d&&!el(d)){let e=Array.isArray(d)?d:[d];for(let i=0;i<e.length;i++){let n=ey(t,e[i]);if(n){let{transitionEnd:t,transition:e,...i}=n;for(let t in i){let e=i[t];if(Array.isArray(e)){let t=u?e.length-1:0;e=e[t]}null!==e&&(s[t]=e)}for(let e in t)s[e]=t[e]}}}return s}(i,n,s,t),renderState:e()}})(t,e,n,s);return i?r():(0,id.M)(r)},ip=ic({scrapeMotionValuesFromProps:e$,createRenderState:ii}),im=ic({scrapeMotionValuesFromProps:eW,createRenderState:ir}),ig={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},iy=!1;function iv(){return!function(){if(iy)return;let t={};for(let e in ig)t[e]={isEnabled:t=>ig[e].some(e=>!!t[e])};ew=t,iy=!0}(),ew}let ix=Symbol.for("motionComponentSymbol"),iw="data-"+eS("framerAppearId"),iT=(0,e5.createContext)({});function iP(t){return t&&"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,"current")}var iS=i(65239);function ib(t,{forwardMotionProps:e=!1,type:i}={},n,s){n&&function(t){let e=iv();for(let i in t)e[i]={...e[i],...t[i]};ew=e}(n);let r=i?"svg"===i:e9(t),o=r?im:ip;function a(i,n){var a;let l,h,u,d={...(0,e5.useContext)(e7.Q),...i,layoutId:function({layoutId:t}){let e=(0,e5.useContext)(e4.L).id;return e&&void 0!==t?e+"-"+t:t}(i)},{isStatic:c}=d,p=function(t){let{initial:e,animate:i}=function(t,e){if(ec(t)){let{initial:e,animate:i}=t;return{initial:!1===e||eh(e)?e:void 0,animate:eh(i)?i:void 0}}return!1!==t.inherit?e:{}}(t,(0,e5.useContext)(it));return(0,e5.useMemo)(()=>({initial:e,animate:i}),[ie(e),ie(i)])}(i),m=o(i,c);if(!c&&"u">typeof window){(0,e5.useContext)(e8).strict;let e=function(t){let{drag:e,layout:i}=iv();if(!e&&!i)return{};let n={...e,...i};return{MeasureLayout:e?.isEnabled(t)||i?.isEnabled(t)?n.MeasureLayout:void 0,ProjectionNode:n.ProjectionNode}}(d);l=e.MeasureLayout,p.visualElement=function(t,e,i,n,s,r){let{visualElement:o}=(0,e5.useContext)(it),a=(0,e5.useContext)(e8),l=(0,e5.useContext)(iu.t),h=(0,e5.useContext)(e7.Q),u=h.reducedMotion,d=h.skipAnimations,c=(0,e5.useRef)(null),p=(0,e5.useRef)(!1);n=n||a.renderer,!c.current&&n&&(c.current=n(t,{visualState:e,parent:o,props:i,presenceContext:l,blockInitialAnimation:!!l&&!1===l.initial,reducedMotionConfig:u,skipAnimations:d,isSVG:r}),p.current&&c.current&&(c.current.manuallyAnimateOnMount=!0));let m=c.current,f=(0,e5.useContext)(iT);m&&!m.projection&&s&&("html"===m.type||"svg"===m.type)&&function(t,e,i,n){let{layoutId:s,layout:r,drag:o,dragConstraints:a,layoutScroll:l,layoutRoot:h,layoutCrossfade:u}=e;t.projection=new i(t.latestValues,e["data-framer-portal-id"]?void 0:function t(e){if(e)return!1!==e.options.allowProjection?e.projection:t(e.parent)}(t.parent)),t.projection.setOptions({layoutId:s,layout:r,alwaysMeasureLayout:!!o||a&&iP(a),visualElement:t,animationType:"string"==typeof r?r:"both",initialPromotionConfig:n,crossfade:u,layoutScroll:l,layoutRoot:h})}(c.current,i,s,f);let g=(0,e5.useRef)(!1);(0,e5.useInsertionEffect)(()=>{m&&g.current&&m.update(i,l)});let y=i[iw],v=(0,e5.useRef)(!!y&&"u">typeof window&&!window.MotionHandoffIsComplete?.(y)&&window.MotionHasOptimisedAnimation?.(y));return(0,iS.E)(()=>{p.current=!0,m&&(g.current=!0,window.MotionIsMounted=!0,m.updateFeatures(),m.scheduleRenderMicrotask(),v.current&&m.animationState&&m.animationState.animateChanges())}),(0,e5.useEffect)(()=>{m&&(!v.current&&m.animationState&&m.animationState.animateChanges(),v.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(y)}),v.current=!1),m.enteringChildren=void 0)}),m}(t,m,d,s,e.ProjectionNode,r)}return(0,e6.jsxs)(it.Provider,{value:p,children:[l&&p.visualElement?(0,e6.jsx)(l,{visualElement:p.visualElement,...d}):null,function(t,e,i,{latestValues:n},s,r=!1,o){let a=(o??e9(t)?function(t,e,i,n){let s=(0,e5.useMemo)(()=>{let i=ir();return eD(i,e,eL(n),t.transformTemplate,t.style),{...i.attrs,style:{...i.style}}},[e]);if(t.style){let e={};is(e,t.style,t),s.style={...e,...s.style}}return s}:function(t,e){let i,n,s={},r=(i=t.style||{},is(n={},i,t),Object.assign(n,function({transformTemplate:t},e){return(0,e5.useMemo)(()=>{let i=ii();return eM(i,e,t),Object.assign({},i.vars,i.style)},[e])}(t,e)),n);return t.drag&&!1!==t.dragListener&&(s.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=!0===t.drag?"none":`pan-${"x"===t.drag?"y":"x"}`),void 0===t.tabIndex&&(t.onTap||t.onTapStart||t.whileTap)&&(s.tabIndex=0),s.style=r,s})(e,n,s,t),l=function(t,e,i){let n={};for(let s in t)("values"!==s||"object"!=typeof t.values)&&(il(s)||!0===i&&ia(s)||!e&&!ia(s)||t.draggable&&s.startsWith("onDrag"))&&(n[s]=t[s]);return n}(e,"string"==typeof t,r),h=t!==e5.Fragment?{...l,...a,ref:i}:{},{children:u}=e,d=(0,e5.useMemo)(()=>Q(u)?u.get():u,[u]);return(0,e5.createElement)(t,{...h,children:d})}(t,i,(a=p.visualElement,h=(0,e5.useRef)(n),(0,e5.useInsertionEffect)(()=>{h.current=n}),u=(0,e5.useRef)(null),(0,e5.useCallback)(t=>{t&&m.onMount?.(t);let e=h.current;if("function"==typeof e)if(t){let i=e(t);"function"==typeof i&&(u.current=i)}else u.current?(u.current(),u.current=null):e(t);else e&&(e.current=t);a&&(t?a.mount(t):a.unmount())},[a])),m,c,e,r)]})}a.displayName=`motion.${"string"==typeof t?t:`create(${t.displayName??t.name??""})`}`;let l=(0,e5.forwardRef)(a);return l[ix]=t,l}class iA{constructor(t){this.isMounted=!1,this.node=t}update(){}}function iE(t,e,i){let n=t.getProps();return ey(n,e,void 0!==i?i:n.custom,t)}function iM(t,e){if(t?.inherit&&e){let{inherit:i,...n}=t;return{...e,...n}}return t}function iV(t,e){let i=t?.[e]??t?.default??t;return i!==t?iM(i,t):i}let iC=t=>Array.isArray(t);function ik(t,e){let i=t.getValue("willChange");if(Q(i)&&i.add)return i.add(e);if(!i&&tM.WillChange){let i=new tM.WillChange("auto");t.addValue("willChange",i),i.add(e)}}let iD=(t,e)=>i=>e(t(i)),iR=(...t)=>t.reduce(iD);function iL(t,e,i){return(i<0&&(i+=1),i>1&&(i-=1),i<1/6)?t+(e-t)*6*i:i<.5?e:i<2/3?t+(e-t)*(2/3-i)*6:t}function ij(t,e){return i=>i>0?e:t}let iB=(t,e,i)=>{let n=t*t,s=i*(e*e-n)+n;return s<0?0:Math.sqrt(s)},iF=[w,x,V];function iI(t){let e=iF.find(e=>e.test(t));if(tn(!!e,`'${t}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!e)return!1;let i=e.parse(t);return e===V&&(i=function({hue:t,saturation:e,lightness:i,alpha:n}){t/=360,i/=100;let s=0,r=0,o=0;if(e/=100){let n=i<.5?i*(1+e):i+e-i*e,a=2*i-n;s=iL(a,n,t+1/3),r=iL(a,n,t),o=iL(a,n,t-1/3)}else s=r=o=i;return{red:Math.round(255*s),green:Math.round(255*r),blue:Math.round(255*o),alpha:n}}(i)),i}let iO=(t,e)=>{let i=iI(t),n=iI(e);if(!i||!n)return ij(t,e);let s={...i};return t=>(s.red=iB(i.red,n.red,t),s.green=iB(i.green,n.green,t),s.blue=iB(i.blue,n.blue,t),s.alpha=eI(i.alpha,n.alpha,t),x.transform(s))},iU=new Set(["none","hidden"]);function i$(t,e){return i=>eI(t,e,i)}function iW(t){return"number"==typeof t?i$:"string"==typeof t?tl(t)?ij:C.test(t)?iO:iY:Array.isArray(t)?iN:"object"==typeof t?C.test(t)?iO:iz:ij}function iN(t,e){let i=[...t],n=i.length,s=t.map((t,i)=>iW(t)(t,e[i]));return t=>{for(let e=0;e<n;e++)i[e]=s[e](t);return i}}function iz(t,e){let i={...t,...e},n={};for(let s in i)void 0!==t[s]&&void 0!==e[s]&&(n[s]=iW(t[s])(t[s],e[s]));return t=>{for(let e in n)i[e]=n[e](t);return i}}let iY=(t,e)=>{let i=O.createTransformer(e),n=j(t),s=j(e);if(!(n.indexes.var.length===s.indexes.var.length&&n.indexes.color.length===s.indexes.color.length&&n.indexes.number.length>=s.indexes.number.length))return tn(!0,`Complex values '${t}' and '${e}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`,"complex-values-different"),ij(t,e);if(iU.has(t)&&!s.values.length||iU.has(e)&&!n.values.length)return iU.has(t)?i=>i<=0?t:e:i=>i>=1?e:t;return iR(iN(function(t,e){let i=[],n={color:0,var:0,number:0};for(let s=0;s<e.values.length;s++){let r=e.types[s],o=t.indexes[r][n[r]],a=t.values[o]??0;i[s]=a,n[r]++}return i}(n,s),s.values),i)};function iH(t,e,i){return"number"==typeof t&&"number"==typeof e&&"number"==typeof i?eI(t,e,i):iW(t)(t,e)}let iX=t=>{let e=({timestamp:e})=>t(e);return{start:(t=!0)=>tk.update(e,t),stop:()=>tD(e),now:()=>tR.isProcessing?tR.timestamp:en.now()}};function iK(t){let e=0,i=t.next(e);for(;!i.done&&e<2e4;)e+=50,i=t.next(e);return e>=2e4?1/0:e}function iG(t,e,i){var n,s;let r=Math.max(e-5,0);return n=i-t(r),(s=e-r)?1e3/s*n:0}let iq=.01,i_=2,iZ=.005,iQ=.5;function iJ(t,e){return t*Math.sqrt(1-e*e)}let i0=["duration","bounce"],i1=["stiffness","damping","mass"];function i2(t,e){return e.some(e=>void 0!==t[e])}function i5(t=.3,e=.3){let i,n="object"!=typeof t?{visualDuration:t,keyframes:[0,1],bounce:e}:t,{restSpeed:s,restDelta:r}=n,o=n.keyframes[0],a=n.keyframes[n.keyframes.length-1],l={done:!1,value:o},{stiffness:u,damping:d,mass:c,duration:p,velocity:m,isResolvedFromDuration:f}=function(t){let e={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...t};if(!i2(t,i1)&&i2(t,i0))if(e.velocity=0,t.visualDuration){let i=2*Math.PI/(1.2*t.visualDuration),n=i*i,s=2*h(.05,1,1-(t.bounce||0))*Math.sqrt(n);e={...e,mass:1,stiffness:n,damping:s}}else{let i=function({duration:t=800,bounce:e=.3,velocity:i=0,mass:n=1}){let s,r;tn(t<=tH(10),"Spring duration must be 10 seconds or less","spring-duration-limit");let o=1-e;o=h(.05,1,o),t=h(.01,10,t/1e3),o<1?(s=e=>{let n=e*o,s=n*t;return .001-(n-i)/iJ(e,o)*Math.exp(-s)},r=e=>{let n=e*o*t,r=Math.pow(o,2)*Math.pow(e,2)*t,a=Math.exp(-n),l=iJ(Math.pow(e,2),o);return(n*i+i-r)*a*(-s(e)+.001>0?-1:1)/l}):(s=e=>-.001+Math.exp(-e*t)*((e-i)*t+1),r=e=>t*t*(i-e)*Math.exp(-e*t));let a=function(t,e,i){let n=i;for(let i=1;i<12;i++)n-=t(n)/e(n);return n}(s,r,5/t);if(t=tH(t),isNaN(a))return{stiffness:100,damping:10,duration:t};{let e=Math.pow(a,2)*n;return{stiffness:e,damping:2*o*Math.sqrt(n*e),duration:t}}}({...t,velocity:0});(e={...e,...i,mass:1}).isResolvedFromDuration=!0}return e}({...n,velocity:-((n.velocity||0)/1e3)}),g=m||0,y=d/(2*Math.sqrt(u*c)),v=a-o,x=Math.sqrt(u/c)/1e3,w=5>Math.abs(v);if(s||(s=w?iq:i_),r||(r=w?iZ:iQ),y<1){let t=iJ(x,y);i=e=>a-Math.exp(-y*x*e)*((g+y*x*v)/t*Math.sin(t*e)+v*Math.cos(t*e))}else if(1===y)i=t=>a-Math.exp(-x*t)*(v+(g+x*v)*t);else{let t=x*Math.sqrt(y*y-1);i=e=>{let i=Math.exp(-y*x*e),n=Math.min(t*e,300);return a-i*((g+y*x*v)*Math.sinh(n)+t*v*Math.cosh(n))/t}}let T={calculatedDuration:f&&p||null,next:t=>{let e=i(t);if(f)l.done=t>=p;else{let n=0===t?g:0;y<1&&(n=0===t?tH(g):iG(i,t,e));let o=Math.abs(a-e)<=r;l.done=Math.abs(n)<=s&&o}return l.value=l.done?a:e,l},toString:()=>{let t=Math.min(iK(T),2e4),e=t9(e=>T.next(t*e).value,t,30);return t+"ms "+e},toTransition:()=>{}};return T}function i3({keyframes:t,velocity:e=0,power:i=.8,timeConstant:n=325,bounceDamping:s=10,bounceStiffness:r=500,modifyTarget:o,min:a,max:l,restDelta:h=.5,restSpeed:u}){let d,c,p=t[0],m={done:!1,value:p},f=i*e,g=p+f,y=void 0===o?g:o(g);y!==g&&(f=y-p);let v=t=>-f*Math.exp(-t/n),x=t=>y+v(t),w=t=>{let e=v(t),i=x(t);m.done=Math.abs(e)<=h,m.value=m.done?y:i},T=t=>{let e;if(e=m.value,void 0!==a&&e<a||void 0!==l&&e>l){var i;d=t,c=i5({keyframes:[m.value,(i=m.value,void 0===a?l:void 0===l||Math.abs(a-i)<Math.abs(l-i)?a:l)],velocity:iG(x,t,m.value),damping:s,stiffness:r,restDelta:h,restSpeed:u})}};return T(0),{calculatedDuration:null,next:t=>{let e=!1;return(c||void 0!==d||(e=!0,w(t),T(t)),void 0!==d&&t>=d)?c.next(t-d):(e||w(t),m)}}}i5.applyToOptions=t=>{let e=function(t,e=100,i){let n=i({...t,keyframes:[0,e]}),s=Math.min(iK(n),2e4);return{type:"keyframes",ease:t=>n.next(s*t).value/e,duration:s/1e3}}(t,100,i5);return t.ease=e.ease,t.duration=tH(e.duration),t.type="keyframes",t};let i9=(t,e,i)=>(((1-3*i+3*e)*t+(3*i-6*e))*t+3*e)*t;function i6(t,e,i,n){return t===e&&i===n?tE:s=>0===s||1===s?s:i9(function(t,e,i,n,s){let r,o,a=0;do(r=i9(o=e+(i-e)/2,n,s)-t)>0?i=o:e=o;while(Math.abs(r)>1e-7&&++a<12);return o}(s,0,1,t,i),e,n)}let i4=i6(.42,0,1,1),i8=i6(0,0,.58,1),i7=i6(.42,0,.58,1),nt=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,ne=t=>e=>1-t(1-e),ni=i6(.33,1.53,.69,.99),nn=ne(ni),ns=nt(nn),nr=t=>(t*=2)<1?.5*nn(t):.5*(2-Math.pow(2,-10*(t-1))),no=t=>1-Math.sin(Math.acos(t)),na=ne(no),nl=nt(no),nh={linear:tE,easeIn:i4,easeInOut:i7,easeOut:i8,circIn:no,circInOut:nl,circOut:na,backIn:nn,backInOut:ns,backOut:ni,anticipate:nr},nu=t=>{if(t5(t)){ts(4===t.length,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");let[e,i,n,s]=t;return i6(e,i,n,s)}return"string"==typeof t?(ts(void 0!==nh[t],`Invalid easing type '${t}'`,"invalid-easing-type"),nh[t]):t},nd=(t,e,i)=>{let n=e-t;return 0===n?1:(i-t)/n};function nc({duration:t=300,keyframes:e,times:i,ease:n="easeInOut"}){var s;let r,o=Array.isArray(n)&&"number"!=typeof n[0]?n.map(nu):nu(n),a={done:!1,value:e[0]},l=function(t,e,{clamp:i=!0,ease:n,mixer:s}={}){let r=t.length;if(ts(r===e.length,"Both input and output ranges must be the same length","range-length"),1===r)return()=>e[0];if(2===r&&e[0]===e[1])return()=>e[1];let o=t[0]===t[1];t[0]>t[r-1]&&(t=[...t].reverse(),e=[...e].reverse());let a=function(t,e,i){let n=[],s=i||tM.mix||iH,r=t.length-1;for(let i=0;i<r;i++){let r=s(t[i],t[i+1]);e&&(r=iR(Array.isArray(e)?e[i]||tE:e,r)),n.push(r)}return n}(e,n,s),l=a.length,u=i=>{if(o&&i<t[0])return e[0];let n=0;if(l>1)for(;n<t.length-2&&!(i<t[n+1]);n++);let s=nd(t[n],t[n+1],i);return a[n](s)};return i?e=>u(h(t[0],t[r-1],e)):u}((s=i&&i.length===e.length?i:(!function(t,e){let i=t[t.length-1];for(let n=1;n<=e;n++){let s=nd(0,e,n);t.push(eI(i,1,s))}}(r=[0],e.length-1),r),s.map(e=>e*t)),e,{ease:Array.isArray(o)?o:e.map(()=>o||i7).splice(0,e.length-1)});return{calculatedDuration:t,next:e=>(a.value=l(e),a.done=e>=t,a)}}let np={decay:i3,inertia:i3,tween:nc,keyframes:nc,spring:i5};function nm(t){"string"==typeof t.type&&(t.type=np[t.type])}let nf=t=>t/100;class ng extends t1{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{let{motionValue:t}=this.options;t&&t.updatedAt!==en.now()&&this.tick(en.now()),this.isStopped=!0,"idle"!==this.state&&(this.teardown(),this.options.onStop?.())},t2.mainThread++,this.options=t,this.initAnimation(),this.play(),!1===t.autoplay&&this.pause()}initAnimation(){let{options:t}=this;nm(t);let{type:e=nc,repeat:i=0,repeatDelay:n=0,repeatType:s,velocity:r=0}=t,{keyframes:o}=t,a=e||nc;a!==nc&&"number"!=typeof o[0]&&(this.mixKeyframes=iR(nf,iH(o[0],o[1])),o=[0,100]);let l=a({...t,keyframes:o});"mirror"===s&&(this.mirroredGenerator=a({...t,keyframes:[...o].reverse(),velocity:-r})),null===l.calculatedDuration&&(l.calculatedDuration=iK(l));let{calculatedDuration:h}=l;this.calculatedDuration=h,this.resolvedDuration=h+n,this.totalDuration=this.resolvedDuration*(i+1)-n,this.generator=l}updateTime(t){let e=Math.round(t-this.startTime)*this.playbackSpeed;null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=e}tick(t,e=!1){let{generator:i,totalDuration:n,mixKeyframes:s,mirroredGenerator:r,resolvedDuration:o,calculatedDuration:a}=this;if(null===this.startTime)return i.next(0);let{delay:l=0,keyframes:u,repeat:d,repeatType:c,repeatDelay:p,type:m,onUpdate:f,finalKeyframe:g}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-n/this.speed,this.startTime)),e?this.currentTime=t:this.updateTime(t);let y=this.currentTime-l*(this.playbackSpeed>=0?1:-1),v=this.playbackSpeed>=0?y<0:y>n;this.currentTime=Math.max(y,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=n);let x=this.currentTime,w=i;if(d){let t=Math.min(this.currentTime,n)/o,e=Math.floor(t),i=t%1;!i&&t>=1&&(i=1),1===i&&e--,(e=Math.min(e,d+1))%2&&("reverse"===c?(i=1-i,p&&(i-=p/o)):"mirror"===c&&(w=r)),x=h(0,1,i)*o}let T=v?{done:!1,value:u[0]}:w.next(x);s&&(T.value=s(T.value));let{done:P}=T;v||null===a||(P=this.playbackSpeed>=0?this.currentTime>=n:this.currentTime<=0);let S=null===this.holdTime&&("finished"===this.state||"running"===this.state&&P);return S&&m!==i3&&(T.value=t0(u,this.options,g,this.speed)),f&&f(T.value),S&&this.finish(),T}then(t,e){return this.finished.then(t,e)}get duration(){return this.calculatedDuration/1e3}get iterationDuration(){let{delay:t=0}=this.options||{};return this.duration+t/1e3}get time(){return this.currentTime/1e3}set time(t){t=tH(t),this.currentTime=t,null===this.startTime||null!==this.holdTime||0===this.playbackSpeed?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?.start(!1)}get speed(){return this.playbackSpeed}set speed(t){this.updateTime(en.now());let e=this.playbackSpeed!==t;this.playbackSpeed=t,e&&(this.time=this.currentTime/1e3)}play(){if(this.isStopped)return;let{driver:t=iX,startTime:e}=this.options;this.driver||(this.driver=t(t=>this.tick(t))),this.options.onPlay?.();let i=this.driver.now();"finished"===this.state?(this.updateFinished(),this.startTime=i):null!==this.holdTime?this.startTime=i-this.holdTime:this.startTime||(this.startTime=e??i),"finished"===this.state&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(en.now()),this.holdTime=this.currentTime}complete(){"running"!==this.state&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null,t2.mainThread--}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}}let ny={anticipate:nr,backInOut:ns,circInOut:nl};class nv extends t7{constructor(t){!function(t){"string"==typeof t.ease&&t.ease in ny&&(t.ease=ny[t.ease])}(t),nm(t),super(t),void 0!==t.startTime&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){let{motionValue:e,onUpdate:i,onComplete:n,element:s,...r}=this.options;if(!e)return;if(void 0!==t)return void e.set(t);let o=new ng({...r,autoplay:!1}),a=Math.max(10,en.now()-this.startTime),l=h(0,10,a-10);e.setWithVelocity(o.sample(Math.max(0,a-l)).value,o.sample(a).value,l),o.stop()}}let nx=(t,e)=>"zIndex"!==e&&!!("number"==typeof t||Array.isArray(t)||"string"==typeof t&&(O.test(t)||"0"===t)&&!t.startsWith("url("));function nw(t){t.duration=0,t.type="keyframes"}let nT=new Set(["opacity","clipPath","filter","transform"]),nP=tq(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));class nS extends t1{constructor({autoplay:t=!0,delay:e=0,type:i="keyframes",repeat:n=0,repeatDelay:s=0,repeatType:r="loop",keyframes:o,name:a,motionValue:l,element:h,...u}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=en.now();const d={autoplay:t,delay:e,type:i,repeat:n,repeatDelay:s,repeatType:r,name:a,motionValue:l,element:h,...u},c=h?.KeyframeResolver||t$;this.keyframeResolver=new c(o,(t,e,i)=>this.onKeyframesResolved(t,e,d,!i),a,l,h),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,e,i,n){this.keyframeResolver=void 0;let{name:s,type:r,velocity:o,delay:a,isHandoff:l,onUpdate:h}=i;this.resolvedAt=en.now(),!function(t,e,i,n){let s=t[0];if(null===s)return!1;if("display"===e||"visibility"===e)return!0;let r=t[t.length-1],o=nx(s,e),a=nx(r,e);return tn(o===a,`You are trying to animate ${e} from "${s}" to "${r}". "${o?r:s}" is not an animatable value.`,"value-not-animatable"),!!o&&!!a&&(function(t){let e=t[0];if(1===t.length)return!0;for(let i=0;i<t.length;i++)if(t[i]!==e)return!0}(t)||("spring"===i||t8(i))&&n)}(t,s,r,o)&&((tM.instantAnimations||!a)&&h?.(t0(t,i,e)),t[0]=t[t.length-1],nw(i),i.repeat=0);let u={startTime:n?this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt:void 0,finalKeyframe:e,...i,keyframes:t},d=!l&&function(t){let{motionValue:e,name:i,repeatDelay:n,repeatType:s,damping:r,type:o}=t;if(!(e?.owner?.current instanceof HTMLElement))return!1;let{onUpdate:a,transformTemplate:l}=e.owner.getProps();return nP()&&i&&nT.has(i)&&("transform"!==i||!l)&&!a&&!n&&"mirror"!==s&&0!==r&&"inertia"!==o}(u),c=u.motionValue?.owner?.current,p=d?new nv({...u,element:c}):new ng(u);p.finished.then(()=>{this.notifyFinished()}).catch(tE),this.pendingTimeline&&(this.stopTimeline=p.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=p}get finished(){return this._animation?this.animation.finished:this._finished}then(t,e){return this.finished.finally(t).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),tI=!0,tU(),tO(),tI=!1),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}let nb={type:"spring",stiffness:500,damping:25,restSpeed:10},nA={type:"keyframes",duration:.8},nE={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},nM=t=>null!==t,nV=(t,e,i,n={},s,r)=>o=>{let a=iV(n,t)||{},h=a.delay||n.delay||0,{elapsed:u=0}=n;u-=tH(h);let d={keyframes:Array.isArray(i)?i:[null,i],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-u,onUpdate:t=>{e.set(t),a.onUpdate&&a.onUpdate(t)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:r?void 0:s};!function({when:t,delay:e,delayChildren:i,staggerChildren:n,staggerDirection:s,repeat:r,repeatType:o,repeatDelay:a,from:l,elapsed:h,...u}){return!!Object.keys(u).length}(a)&&Object.assign(d,((t,{keyframes:e})=>e.length>2?nA:l.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:nb:nE)(t,d)),d.duration&&(d.duration=tH(d.duration)),d.repeatDelay&&(d.repeatDelay=tH(d.repeatDelay)),void 0!==d.from&&(d.keyframes[0]=d.from);let c=!1;if(!1!==d.type&&(0!==d.duration||d.repeatDelay)||(nw(d),0===d.delay&&(c=!0)),(tM.instantAnimations||tM.skipAnimations||s?.shouldSkipAnimations)&&(c=!0,nw(d),d.delay=0),d.allowFlatten=!a.type&&!a.ease,c&&!r&&void 0!==e.get()){let t=function(t,{repeat:e,repeatType:i="loop"},n){let s=t.filter(nM),r=e&&"loop"!==i&&e%2==1?0:s.length-1;return s[r]}(d.keyframes,a);if(void 0!==t)return void tk.update(()=>{d.onUpdate(t),d.onComplete()})}return a.isSync?new ng(d):new nS(d)};function nC(t,e,{delay:i=0,transitionOverride:n,type:s}={}){let{transition:r,transitionEnd:o,...a}=e,l=t.getDefaultTransition();r=r?iM(r,l):l;let h=r?.reduceMotion;n&&(r=n);let u=[],d=s&&t.animationState&&t.animationState.getState()[s];for(let e in a){let n=t.getValue(e,t.latestValues[e]??null),s=a[e];if(void 0===s||d&&function({protectedKeys:t,needsAnimating:e},i){let n=t.hasOwnProperty(i)&&!0!==e[i];return e[i]=!1,n}(d,e))continue;let o={delay:i,...iV(r||{},e)},l=n.get();if(void 0!==l&&!n.isAnimating&&!Array.isArray(s)&&s===l&&!o.velocity)continue;let c=!1;if(window.MotionHandoffAnimation){let i=t.props[iw];if(i){let t=window.MotionHandoffAnimation(i,e,tk);null!==t&&(o.startTime=t,c=!0)}}ik(t,e);let p=h??t.shouldReduceMotion;n.start(nV(e,n,s,p&&J.has(e)?{type:!1}:o,t,c));let m=n.animation;m&&u.push(m)}if(o){let e=()=>tk.update(()=>{o&&function(t,e){let{transitionEnd:i={},transition:n={},...s}=iE(t,e)||{};for(let e in s={...s,...i}){var r;let i=iC(r=s[e])?r[r.length-1]||0:r;t.hasValue(e)?t.getValue(e).set(i):t.addValue(e,er(i))}}(t,o)});u.length?Promise.all(u).then(e):e()}return u}function nk(t,e,i,n=0,s=1){let r=Array.from(t).sort((t,e)=>t.sortNodePosition(e)).indexOf(e),o=t.size,a=(o-1)*n;return"function"==typeof i?i(r,o):1===s?r*n:a-r*n}function nD(t,e,i={}){let n=iE(t,e,"exit"===i.type?t.presenceContext?.custom:void 0),{transition:s=t.getDefaultTransition()||{}}=n||{};i.transitionOverride&&(s=i.transitionOverride);let r=n?()=>Promise.all(nC(t,n,i)):()=>Promise.resolve(),o=t.variantChildren&&t.variantChildren.size?(n=0)=>{let{delayChildren:r=0,staggerChildren:o,staggerDirection:a}=s;return function(t,e,i=0,n=0,s=0,r=1,o){let a=[];for(let l of t.variantChildren)l.notify("AnimationStart",e),a.push(nD(l,e,{...o,delay:i+("function"==typeof n?0:n)+nk(t.variantChildren,l,n,s,r)}).then(()=>l.notify("AnimationComplete",e)));return Promise.all(a)}(t,e,n,r,o,a,i)}:()=>Promise.resolve(),{when:a}=s;if(!a)return Promise.all([r(),o(i.delay)]);{let[t,e]="beforeChildren"===a?[r,o]:[o,r];return t().then(()=>e())}}let nR=ed.length;function nL(t,e){if(!Array.isArray(e))return!1;let i=e.length;if(i!==t.length)return!1;for(let n=0;n<i;n++)if(e[n]!==t[n])return!1;return!0}let nj=[...eu].reverse(),nB=eu.length;function nF(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function nI(){return{animate:nF(!0),whileInView:nF(),whileHover:nF(),whileTap:nF(),whileDrag:nF(),whileFocus:nF(),exit:nF()}}class nO extends iA{constructor(t){super(t),t.animationState||(t.animationState=function(t){let e=e=>Promise.all(e.map(({animation:e,options:i})=>(function(t,e,i={}){let n;if(t.notify("AnimationStart",e),Array.isArray(e))n=Promise.all(e.map(e=>nD(t,e,i)));else if("string"==typeof e)n=nD(t,e,i);else{let s="function"==typeof e?iE(t,e,i.custom):e;n=Promise.all(nC(t,s,i))}return n.then(()=>{t.notify("AnimationComplete",e)})})(t,e,i))),i=nI(),n=!0,s=!1,r=e=>(i,n)=>{let s=iE(t,n,"exit"===e?t.presenceContext?.custom:void 0);if(s){let{transition:t,transitionEnd:e,...n}=s;i={...i,...n,...e}}return i};function o(o){let{props:a}=t,l=function t(e){if(!e)return;if(!e.isControllingVariants){let i=e.parent&&t(e.parent)||{};return void 0!==e.props.initial&&(i.initial=e.props.initial),i}let i={};for(let t=0;t<nR;t++){let n=ed[t],s=e.props[n];(eh(s)||!1===s)&&(i[n]=s)}return i}(t.parent)||{},h=[],u=new Set,d={},c=1/0;for(let e=0;e<nB;e++){var p,m;let f=nj[e],g=i[f],y=void 0!==a[f]?a[f]:l[f],v=eh(y),x=f===o?g.isActive:null;!1===x&&(c=e);let w=y===l[f]&&y!==a[f]&&v;if(w&&(n||s)&&t.manuallyAnimateOnMount&&(w=!1),g.protectedKeys={...d},!g.isActive&&null===x||!y&&!g.prevProp||el(y)||"boolean"==typeof y)continue;if("exit"===f&&g.isActive&&!0!==x){g.prevResolvedValues&&(d={...d,...g.prevResolvedValues});continue}let T=(p=g.prevProp,"string"==typeof(m=y)?m!==p:!!Array.isArray(m)&&!nL(m,p)),P=T||f===o&&g.isActive&&!w&&v||e>c&&v,S=!1,b=Array.isArray(y)?y:[y],A=b.reduce(r(f),{});!1===x&&(A={});let{prevResolvedValues:E={}}=g,M={...E,...A},V=e=>{P=!0,u.has(e)&&(S=!0,u.delete(e)),g.needsAnimating[e]=!0;let i=t.getValue(e);i&&(i.liveStyle=!1)};for(let t in M){let e=A[t],i=E[t];if(!d.hasOwnProperty(t))(iC(e)&&iC(i)?nL(e,i):e===i)?void 0!==e&&u.has(t)?V(t):g.protectedKeys[t]=!0:null!=e?V(t):u.add(t)}g.prevProp=y,g.prevResolvedValues=A,g.isActive&&(d={...d,...A}),(n||s)&&t.blockInitialAnimation&&(P=!1);let C=w&&T,k=!C||S;P&&k&&h.push(...b.map(e=>{let i={type:f};if("string"==typeof e&&(n||s)&&!C&&t.manuallyAnimateOnMount&&t.parent){let{parent:n}=t,s=iE(n,e);if(n.enteringChildren&&s){let{delayChildren:e}=s.transition||{};i.delay=nk(n.enteringChildren,t,e)}}return{animation:e,options:i}}))}if(u.size){let e={};if("boolean"!=typeof a.initial){let i=iE(t,Array.isArray(a.initial)?a.initial[0]:a.initial);i&&i.transition&&(e.transition=i.transition)}u.forEach(i=>{let n=t.getBaseTarget(i),s=t.getValue(i);s&&(s.liveStyle=!0),e[i]=n??null}),h.push({animation:e})}let f=!!h.length;return n&&(!1===a.initial||a.initial===a.animate)&&!t.manuallyAnimateOnMount&&(f=!1),n=!1,s=!1,f?e(h):Promise.resolve()}return{animateChanges:o,setActive:function(e,n){if(i[e].isActive===n)return Promise.resolve();t.variantChildren?.forEach(t=>t.animationState?.setActive(e,n)),i[e].isActive=n;let s=o(e);for(let t in i)i[t].protectedKeys={};return s},setAnimateFunction:function(i){e=i(t)},getState:()=>i,reset:()=>{i=nI(),s=!0}}}(t))}updateAnimationControlsSubscription(){let{animate:t}=this.node.getProps();el(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){let{animate:t}=this.node.getProps(),{animate:e}=this.node.prevProps||{};t!==e&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}let nU=0;class n$ extends iA{constructor(){super(...arguments),this.id=nU++}update(){if(!this.node.presenceContext)return;let{isPresent:t,onExitComplete:e}=this.node.presenceContext,{isPresent:i}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===i)return;let n=this.node.animationState.setActive("exit",!t);e&&!t&&n.then(()=>{e(this.id)})}mount(){let{register:t,onExitComplete:e}=this.node.presenceContext||{};e&&e(this.id),t&&(this.unmount=t(this.id))}unmount(){}}let nW={x:!1,y:!1};function nN(t){return[t("x"),t("y")]}function nz(t){return t.max-t.min}function nY(t,e,i,n=.5){t.origin=n,t.originPoint=eI(e.min,e.max,t.origin),t.scale=nz(i)/nz(e),t.translate=eI(i.min,i.max,t.origin)-t.originPoint,(t.scale>=.9999&&t.scale<=1.0001||isNaN(t.scale))&&(t.scale=1),(t.translate>=-.01&&t.translate<=.01||isNaN(t.translate))&&(t.translate=0)}function nH(t,e,i,n){nY(t.x,e.x,i.x,n?n.originX:void 0),nY(t.y,e.y,i.y,n?n.originY:void 0)}function nX(t,e,i){t.min=i.min+e.min,t.max=t.min+nz(e)}function nK(t,e,i){t.min=e.min-i.min,t.max=t.min+nz(e)}function nG(t,e,i){nK(t.x,e.x,i.x),nK(t.y,e.y,i.y)}let nq=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]),n_=new Set(["INPUT","SELECT","TEXTAREA"]);function nZ(t,e,i,n={passive:!0}){return t.addEventListener(e,i,n),()=>t.removeEventListener(e,i)}var nQ=i(94601);function nJ(t){return(0,nQ.G)(t)&&"ownerSVGElement"in t}function n0(t,e,i){if(null==t)return[];if(t instanceof EventTarget)return[t];if("string"==typeof t){let n=document;e&&(n=e.current);let s=i?.[t]??n.querySelectorAll(t);return s?Array.from(s):[]}return Array.from(t).filter(t=>null!=t)}let n1=new WeakMap,n2=(t,e,i)=>(n,s)=>s&&s[0]?s[0][t+"Size"]:nJ(n)&&"getBBox"in n?n.getBBox()[e]:n[i],n5=n2("inline","width","offsetWidth"),n3=n2("block","height","offsetHeight");function n9({target:t,borderBoxSize:e}){n1.get(t)?.forEach(i=>{i(t,{get width(){return n5(t,e)},get height(){return n3(t,e)}})})}function n6(t){t.forEach(n9)}let n4=new Set;function n8(t,e){let i;return"function"==typeof t?(n4.add(t),r||(r=()=>{let t={get width(){return window.innerWidth},get height(){return window.innerHeight}};n4.forEach(e=>e(t))},window.addEventListener("resize",r)),()=>{n4.delete(t),n4.size||"function"!=typeof r||(window.removeEventListener("resize",r),r=void 0)}):(!s&&"u">typeof ResizeObserver&&(s=new ResizeObserver(n6)),(i=n0(t)).forEach(t=>{let i=n1.get(t);i||(i=new Set,n1.set(t,i)),i.add(e),s?.observe(t)}),()=>{i.forEach(t=>{let i=n1.get(t);i?.delete(e),i?.size||s?.unobserve(t)})})}let n7=t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary;function st(t){return{point:{x:t.pageX,y:t.pageY}}}function se(t,e,i,n){return nZ(t,e,t=>n7(t)&&i(t,st(t)),n)}let si=({current:t})=>t?t.ownerDocument.defaultView:null,sn=(t,e)=>Math.abs(t-e),ss=new Set(["auto","scroll"]);class sr{constructor(t,e,{transformPagePoint:i,contextWindow:n=window,dragSnapToOrigin:s=!1,distanceThreshold:r=3,element:o}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=t=>{this.handleScroll(t.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{var t,e;if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let i=sl(this.lastMoveEventInfo,this.history),n=null!==this.startEvent,s=(t=i.offset,e={x:0,y:0},Math.sqrt(sn(t.x,e.x)**2+sn(t.y,e.y)**2)>=this.distanceThreshold);if(!n&&!s)return;let{point:r}=i,{timestamp:o}=tR;this.history.push({...r,timestamp:o});let{onStart:a,onMove:l}=this.handlers;n||(a&&a(this.lastMoveEvent,i),this.startEvent=this.lastMoveEvent),l&&l(this.lastMoveEvent,i)},this.handlePointerMove=(t,e)=>{this.lastMoveEvent=t,this.lastMoveEventInfo=so(e,this.transformPagePoint),tk.update(this.updatePoint,!0)},this.handlePointerUp=(t,e)=>{this.end();let{onEnd:i,onSessionEnd:n,resumeAnimation:s}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&s&&s(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let r=sl("pointercancel"===t.type?this.lastMoveEventInfo:so(e,this.transformPagePoint),this.history);this.startEvent&&i&&i(t,r),n&&n(t,r)},!n7(t))return;this.dragSnapToOrigin=s,this.handlers=e,this.transformPagePoint=i,this.distanceThreshold=r,this.contextWindow=n||window;const a=so(st(t),this.transformPagePoint),{point:l}=a,{timestamp:h}=tR;this.history=[{...l,timestamp:h}];const{onSessionStart:u}=e;u&&u(t,sl(a,this.history)),this.removeListeners=iR(se(this.contextWindow,"pointermove",this.handlePointerMove),se(this.contextWindow,"pointerup",this.handlePointerUp),se(this.contextWindow,"pointercancel",this.handlePointerUp)),o&&this.startScrollTracking(o)}startScrollTracking(t){let e=t.parentElement;for(;e;){let t=getComputedStyle(e);(ss.has(t.overflowX)||ss.has(t.overflowY))&&this.scrollPositions.set(e,{x:e.scrollLeft,y:e.scrollTop}),e=e.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(t){let e=this.scrollPositions.get(t);if(!e)return;let i=t===window,n=i?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},s={x:n.x-e.x,y:n.y-e.y};(0!==s.x||0!==s.y)&&(i?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=s.x,this.lastMoveEventInfo.point.y+=s.y):this.history.length>0&&(this.history[0].x-=s.x,this.history[0].y-=s.y),this.scrollPositions.set(t,n),tk.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),tD(this.updatePoint)}}function so(t,e){return e?{point:e(t.point)}:t}function sa(t,e){return{x:t.x-e.x,y:t.y-e.y}}function sl({point:t},e){return{point:t,delta:sa(t,sh(e)),offset:sa(t,e[0]),velocity:function(t,e){if(t.length<2)return{x:0,y:0};let i=t.length-1,n=null,s=sh(t);for(;i>=0&&(n=t[i],!(s.timestamp-n.timestamp>tH(.1)));)i--;if(!n)return{x:0,y:0};n===t[0]&&t.length>2&&s.timestamp-n.timestamp>2*tH(.1)&&(n=t[1]);let r=(s.timestamp-n.timestamp)/1e3;if(0===r)return{x:0,y:0};let o={x:(s.x-n.x)/r,y:(s.y-n.y)/r};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}(e,.1)}}function sh(t){return t[t.length-1]}function su(t,e,i){return{min:void 0!==e?t.min+e:void 0,max:void 0!==i?t.max+i-(t.max-t.min):void 0}}function sd(t,e){let i=e.min-t.min,n=e.max-t.max;return e.max-e.min<t.max-t.min&&([i,n]=[n,i]),{min:i,max:n}}function sc(t,e,i){return{min:sp(t,e),max:sp(t,i)}}function sp(t,e){return"number"==typeof t?t:t[e]||0}let sm=new WeakMap;class sf{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Z(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:e=!1,distanceThreshold:i}={}){let{presenceContext:n}=this.visualElement;if(n&&!1===n.isPresent)return;let s=t=>{e&&this.snapToCursor(st(t).point),this.stopAnimation()},r=(t,e)=>{let{drag:i,dragPropagation:n,onDragStart:s}=this.getProps();if(i&&!n&&(this.openDragLock&&this.openDragLock(),this.openDragLock=function(t){if("x"===t||"y"===t)if(nW[t])return null;else return nW[t]=!0,()=>{nW[t]=!1};return nW.x||nW.y?null:(nW.x=nW.y=!0,()=>{nW.x=nW.y=!1})}(i),!this.openDragLock))return;this.latestPointerEvent=t,this.latestPanInfo=e,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),nN(t=>{let e=this.getAxisMotionValue(t).get()||0;if(S.test(e)){let{projection:i}=this.visualElement;if(i&&i.layout){let n=i.layout.layoutBox[t];n&&(e=nz(n)*(parseFloat(e)/100))}}this.originPoint[t]=e}),s&&tk.update(()=>s(t,e),!1,!0),ik(this.visualElement,"transform");let{animationState:r}=this.visualElement;r&&r.setActive("whileDrag",!0)},o=(t,e)=>{this.latestPointerEvent=t,this.latestPanInfo=e;let{dragPropagation:i,dragDirectionLock:n,onDirectionLock:s,onDrag:r}=this.getProps();if(!i&&!this.openDragLock)return;let{offset:o}=e;if(n&&null===this.currentDirection){this.currentDirection=function(t,e=10){let i=null;return Math.abs(t.y)>e?i="y":Math.abs(t.x)>e&&(i="x"),i}(o),null!==this.currentDirection&&s&&s(this.currentDirection);return}this.updateAxis("x",e.point,o),this.updateAxis("y",e.point,o),this.visualElement.render(),r&&tk.update(()=>r(t,e),!1,!0)},a=(t,e)=>{this.latestPointerEvent=t,this.latestPanInfo=e,this.stop(t,e),this.latestPointerEvent=null,this.latestPanInfo=null},l=()=>{let{dragSnapToOrigin:t}=this.getProps();(t||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:h}=this.getProps();this.panSession=new sr(t,{onSessionStart:s,onStart:r,onMove:o,onSessionEnd:a,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:h,distanceThreshold:i,contextWindow:si(this.visualElement),element:this.visualElement.current})}stop(t,e){let i=t||this.latestPointerEvent,n=e||this.latestPanInfo,s=this.isDragging;if(this.cancel(),!s||!n||!i)return;let{velocity:r}=n;this.startAnimation(r);let{onDragEnd:o}=this.getProps();o&&tk.postRender(()=>o(i,n))}cancel(){this.isDragging=!1;let{projection:t,animationState:e}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.endPanSession();let{dragPropagation:i}=this.getProps();!i&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),e&&e.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(t,e,i){let{drag:n}=this.getProps();if(!i||!sy(t,n,this.currentDirection))return;let s=this.getAxisMotionValue(t),r=this.originPoint[t]+i[t];this.constraints&&this.constraints[t]&&(r=function(t,{min:e,max:i},n){return void 0!==e&&t<e?t=n?eI(e,t,n.min):Math.max(t,e):void 0!==i&&t>i&&(t=n?eI(i,t,n.max):Math.min(t,i)),t}(r,this.constraints[t],this.elastic[t])),s.set(r)}resolveConstraints(){let{dragConstraints:t,dragElastic:e}=this.getProps(),i=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,n=this.constraints;t&&iP(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&i?this.constraints=function(t,{top:e,left:i,bottom:n,right:s}){return{x:su(t.x,i,s),y:su(t.y,e,n)}}(i.layoutBox,t):this.constraints=!1,this.elastic=function(t=.35){return!1===t?t=0:!0===t&&(t=.35),{x:sc(t,"left","right"),y:sc(t,"top","bottom")}}(e),n!==this.constraints&&!iP(t)&&i&&this.constraints&&!this.hasMutatedConstraints&&nN(t=>{var e,n;let s;!1!==this.constraints&&this.getAxisMotionValue(t)&&(this.constraints[t]=(e=i.layoutBox[t],n=this.constraints[t],s={},void 0!==n.min&&(s.min=n.min-e.min),void 0!==n.max&&(s.max=n.max-e.min),s))})}resolveRefConstraints(){var t;let{dragConstraints:e,onMeasureDragConstraints:i}=this.getProps();if(!e||!iP(e))return!1;let n=e.current;ts(null!==n,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.","drag-constraints-ref");let{projection:s}=this.visualElement;if(!s||!s.layout)return!1;let r=function(t,e,i){let n=e1(t,i),{scroll:s}=e;return s&&(eZ(n.x,s.offset.x),eZ(n.y,s.offset.y)),n}(n,s.root,this.visualElement.getTransformPagePoint()),o=(t=s.layout.layoutBox,{x:sd(t.x,r.x),y:sd(t.y,r.y)});if(i){let t=i(function({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}(o));this.hasMutatedConstraints=!!t,t&&(o=ez(t))}return o}startAnimation(t){let{drag:e,dragMomentum:i,dragElastic:n,dragTransition:s,dragSnapToOrigin:r,onDragTransitionEnd:o}=this.getProps(),a=this.constraints||{};return Promise.all(nN(o=>{if(!sy(o,e,this.currentDirection))return;let l=a&&a[o]||{};r&&(l={min:0,max:0});let h={type:"inertia",velocity:i?t[o]:0,bounceStiffness:n?200:1e6,bounceDamping:n?40:1e7,timeConstant:750,restDelta:1,restSpeed:10,...s,...l};return this.startAxisValueAnimation(o,h)})).then(o)}startAxisValueAnimation(t,e){let i=this.getAxisMotionValue(t);return ik(this.visualElement,t),i.start(nV(t,i,0,e,this.visualElement,!1))}stopAnimation(){nN(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){let e=`_drag${t.toUpperCase()}`,i=this.visualElement.getProps();return i[e]||this.visualElement.getValue(t,(i.initial?i.initial[t]:void 0)||0)}snapToCursor(t){nN(e=>{let{drag:i}=this.getProps();if(!sy(e,i,this.currentDirection))return;let{projection:n}=this.visualElement,s=this.getAxisMotionValue(e);if(n&&n.layout){let{min:i,max:r}=n.layout.layoutBox[e],o=s.get()||0;s.set(t[e]-eI(i,r,.5)+o)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:t,dragConstraints:e}=this.getProps(),{projection:i}=this.visualElement;if(!iP(e)||!i||!this.constraints)return;this.stopAnimation();let n={x:0,y:0};nN(t=>{let e=this.getAxisMotionValue(t);if(e&&!1!==this.constraints){var i,s;let r,o,a,l=e.get();n[t]=(i={min:l,max:l},s=this.constraints[t],r=.5,o=nz(i),(a=nz(s))>o?r=nd(s.min,s.max-o,i.min):o>a&&(r=nd(i.min,i.max-a,s.min)),h(0,1,r))}});let{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",i.root&&i.root.updateScroll(),i.updateLayout(),this.constraints=!1,this.resolveConstraints(),nN(e=>{if(!sy(e,t,null))return;let i=this.getAxisMotionValue(e),{min:s,max:r}=this.constraints[e];i.set(eI(s,r,n[e]))}),this.visualElement.render()}addListeners(){let t;if(!this.visualElement.current)return;sm.set(this.visualElement,this);let e=this.visualElement.current,i=se(e,"pointerdown",t=>{let{drag:i,dragListener:n=!0}=this.getProps(),s=t.target,r=s!==e&&(n_.has(s.tagName)||!0===s.isContentEditable);i&&n&&!r&&this.start(t)}),n=()=>{var i,n,s;let r,o,{dragConstraints:a}=this.getProps();iP(a)&&a.current&&(this.constraints=this.resolveRefConstraints(),t||(i=e,n=a.current,r=n8(i,sg(s=()=>this.scalePositionWithinConstraints())),o=n8(n,sg(s)),t=()=>{r(),o()}))},{projection:s}=this.visualElement,r=s.addEventListener("measure",n);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),tk.read(n);let o=nZ(window,"resize",()=>this.scalePositionWithinConstraints()),a=s.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e})=>{this.isDragging&&e&&(nN(e=>{let i=this.getAxisMotionValue(e);i&&(this.originPoint[e]+=t[e].translate,i.set(i.get()+t[e].translate))}),this.visualElement.render())});return()=>{o(),i(),r(),a&&a(),t&&t()}}getProps(){let t=this.visualElement.getProps(),{drag:e=!1,dragDirectionLock:i=!1,dragPropagation:n=!1,dragConstraints:s=!1,dragElastic:r=.35,dragMomentum:o=!0}=t;return{...t,drag:e,dragDirectionLock:i,dragPropagation:n,dragConstraints:s,dragElastic:r,dragMomentum:o}}}function sg(t){let e=!0;return()=>{if(e){e=!1;return}t()}}function sy(t,e,i){return(!0===e||e===t)&&(null===i||i===t)}class sv extends iA{constructor(t){super(t),this.removeGroupControls=tE,this.removeListeners=tE,this.controls=new sf(t)}mount(){let{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||tE}update(){let{dragControls:t}=this.node.getProps(),{dragControls:e}=this.node.prevProps||{};t!==e&&(this.removeGroupControls(),t&&(this.removeGroupControls=t.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}let sx=t=>(e,i)=>{t&&tk.update(()=>t(e,i),!1,!0)};class sw extends iA{constructor(){super(...arguments),this.removePointerDownListener=tE}onPointerDown(t){this.session=new sr(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:si(this.node)})}createPanHandlers(){let{onPanSessionStart:t,onPanStart:e,onPan:i,onPanEnd:n}=this.node.getProps();return{onSessionStart:sx(t),onStart:sx(e),onMove:sx(i),onEnd:(t,e)=>{delete this.session,n&&tk.postRender(()=>n(t,e))}}}mount(){this.removePointerDownListener=se(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let sT={hasAnimatedSinceResize:!0,hasEverUpdated:!1};var sP=i(79196);let sS=!1;class sb extends e5.Component{componentDidMount(){let{visualElement:t,layoutGroup:e,switchLayoutGroup:i,layoutId:n}=this.props,{projection:s}=t;s&&(e.group&&e.group.add(s),i&&i.register&&n&&i.register(s),sS&&s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),sT.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){let{layoutDependency:e,visualElement:i,drag:n,isPresent:s}=this.props,{projection:r}=i;return r&&(r.isPresent=s,t.layoutDependency!==e&&r.setOptions({...r.options,layoutDependency:e}),sS=!0,n||t.layoutDependency!==e||void 0===e||t.isPresent!==s?r.willUpdate():this.safeToRemove(),t.isPresent!==s&&(s?r.promote():r.relegate()||tk.postRender(()=>{let t=r.getStack();t&&t.members.length||this.safeToRemove()}))),null}componentDidUpdate(){let{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),ee.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:t,layoutGroup:e,switchLayoutGroup:i}=this.props,{projection:n}=t;sS=!0,n&&(n.scheduleCheckAfterUnmount(),e&&e.group&&e.group.remove(n),i&&i.deregister&&i.deregister(n))}safeToRemove(){let{safeToRemove:t}=this.props;t&&t()}render(){return null}}function sA(t){let[e,i]=(0,sP.xQ)(),n=(0,e5.useContext)(e4.L);return(0,e6.jsx)(sb,{...t,layoutGroup:n,switchLayoutGroup:(0,e5.useContext)(iT),isPresent:e,safeToRemove:i})}let sE=["TopLeft","TopRight","BottomLeft","BottomRight"],sM=sE.length,sV=t=>"string"==typeof t?parseFloat(t):t,sC=t=>"number"==typeof t||b.test(t);function sk(t,e){return void 0!==t[e]?t[e]:t.borderRadius}let sD=sL(0,.5,na),sR=sL(.5,.95,tE);function sL(t,e,i){return n=>n<t?0:n>e?1:i(nd(t,e,n))}function sj(t,e){t.min=e.min,t.max=e.max}function sB(t,e){sj(t.x,e.x),sj(t.y,e.y)}function sF(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}function sI(t,e,i,n,s){return t-=e,t=n+1/i*(t-n),void 0!==s&&(t=n+1/s*(t-n)),t}function sO(t,e,[i,n,s],r,o){!function(t,e=0,i=1,n=.5,s,r=t,o=t){if(S.test(e)&&(e=parseFloat(e),e=eI(o.min,o.max,e/100)-o.min),"number"!=typeof e)return;let a=eI(r.min,r.max,n);t===r&&(a-=e),t.min=sI(t.min,e,i,a,s),t.max=sI(t.max,e,i,a,s)}(t,e[i],e[n],e[s],e.scale,r,o)}let sU=["x","scaleX","originX"],s$=["y","scaleY","originY"];function sW(t,e,i,n){sO(t.x,e,sU,i?i.x:void 0,n?n.x:void 0),sO(t.y,e,s$,i?i.y:void 0,n?n.y:void 0)}function sN(t){return 0===t.translate&&1===t.scale}function sz(t){return sN(t.x)&&sN(t.y)}function sY(t,e){return t.min===e.min&&t.max===e.max}function sH(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function sX(t,e){return sH(t.x,e.x)&&sH(t.y,e.y)}function sK(t){return nz(t.x)/nz(t.y)}function sG(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}class sq{constructor(){this.members=[]}add(t){tX(this.members,t);for(let e=this.members.length-1;e>=0;e--){let i=this.members[e];if(i===t||i===this.lead||i===this.prevLead)continue;let n=i.instance;n&&!1!==n.isConnected||i.snapshot||(tK(this.members,i),i.unmount())}t.scheduleRender()}remove(t){if(tK(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){let t=this.members[this.members.length-1];t&&this.promote(t)}}relegate(t){for(let e=this.members.indexOf(t)-1;e>=0;e--){let t=this.members[e];if(!1!==t.isPresent&&t.instance?.isConnected!==!1)return this.promote(t),!0}return!1}promote(t,e){let i=this.lead;if(t!==i&&(this.prevLead=i,this.lead=t,t.show(),i)){i.updateSnapshot(),t.scheduleRender();let{layoutDependency:n}=i.options,{layoutDependency:s}=t.options;(void 0===n||n!==s)&&(t.resumeFrom=i,e&&(i.preserveOpacity=!0),i.snapshot&&(t.snapshot=i.snapshot,t.snapshot.latestValues=i.animationValues||i.latestValues),t.root?.isUpdating&&(t.isLayoutDirty=!0)),!1===t.options.crossfade&&i.hide()}}exitAnimationComplete(){this.members.forEach(t=>{t.options.onExitComplete?.(),t.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(t=>t.instance&&t.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}}let s_=(t,e)=>t.depth-e.depth;class sZ{constructor(){this.children=[],this.isDirty=!1}add(t){tX(this.children,t),this.isDirty=!0}remove(t){tK(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(s_),this.isDirty=!1,this.children.forEach(t)}}let sQ=["","X","Y","Z"],sJ=0;function s0(t,e,i,n){let{latestValues:s}=e;s[t]&&(i[t]=s[t],e.setStaticValue(t,0),n&&(n[t]=0))}function s1({attachResizeListener:t,defaultParent:e,measureScroll:i,checkIsScrollRoot:n,resetTransform:s}){return class{constructor(t={},i=e?.()){this.id=sJ++,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.layoutVersion=0,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(s3),this.nodes.forEach(re),this.nodes.forEach(ri),this.nodes.forEach(s9)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=t,this.root=i?i.root||i:this,this.path=i?[...i.path,i]:[],this.parent=i,this.depth=i?i.depth+1:0;for(let t=0;t<this.path.length;t++)this.path[t].shouldResetTransform=!0;this.root===this&&(this.nodes=new sZ)}addEventListener(t,e){return this.eventHandlers.has(t)||this.eventHandlers.set(t,new tG),this.eventHandlers.get(t).add(e)}notifyListeners(t,...e){let i=this.eventHandlers.get(t);i&&i.notify(...e)}hasListeners(t){return this.eventHandlers.has(t)}mount(e){if(this.instance)return;this.isSVG=nJ(e)&&!(nJ(e)&&"svg"===e.tagName),this.instance=e;let{layoutId:i,layout:n,visualElement:s}=this.options;if(s&&!s.current&&s.mount(e),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(n||i)&&(this.isLayoutDirty=!0),t){let i,n=0,s=()=>this.root.updateBlockedByResize=!1;tk.read(()=>{n=window.innerWidth}),t(e,()=>{let t=window.innerWidth;if(t!==n){let e,r;n=t,this.root.updateBlockedByResize=!0,i&&i(),e=en.now(),r=({timestamp:t})=>{let i=t-e;i>=250&&(tD(r),s(i-250))},tk.setup(r,!0),i=()=>tD(r),sT.hasAnimatedSinceResize&&(sT.hasAnimatedSinceResize=!1,this.nodes.forEach(rt))}})}i&&this.root.registerSharedNode(i,this),!1!==this.options.animate&&s&&(i||n)&&this.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e,hasRelativeLayoutChanged:i,layout:n})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}let r=this.options.transition||s.getDefaultTransition()||rl,{onLayoutAnimationStart:o,onLayoutAnimationComplete:a}=s.getProps(),l=!this.targetLayout||!sX(this.targetLayout,n),h=!e&&i;if(this.options.layoutRoot||this.resumeFrom||h||e&&(l||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);let e={...iV(r,"layout"),onPlay:o,onComplete:a};(s.shouldReduceMotion||this.options.layoutRoot)&&(e.delay=0,e.type=!1),this.startAnimation(e),this.setAnimationOrigin(t,h)}else e||rt(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=n})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);let t=this.getStack();t&&t.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),tD(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){!this.isUpdateBlocked()&&(this.isUpdating=!0,this.nodes&&this.nodes.forEach(rn),this.animationId++)}getTransformTemplate(){let{visualElement:t}=this.options;return t&&t.getProps().transformTemplate}willUpdate(t=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&function t(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;let{visualElement:i}=e.options;if(!i)return;let n=i.props[iw];if(window.MotionHasOptimisedAnimation(n,"transform")){let{layout:t,layoutId:i}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",tk,!(t||i))}let{parent:s}=e;s&&!s.hasCheckedOptimisedAppear&&t(s)}(this),this.root.isUpdating||this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let t=0;t<this.path.length;t++){let e=this.path[t];e.shouldResetTransform=!0,e.updateScroll("snapshot"),e.options.layoutRoot&&e.willUpdate(!1)}let{layoutId:e,layout:i}=this.options;if(void 0===e&&!i)return;let n=this.getTransformTemplate();this.prevTransformTemplateValue=n?n(this.latestValues,""):void 0,this.updateSnapshot(),t&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(s4);return}if(this.animationId<=this.animationCommitId)return void this.nodes.forEach(s8);this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(s7),this.nodes.forEach(s2),this.nodes.forEach(s5)):this.nodes.forEach(s8),this.clearAllSnapshots();let t=en.now();tR.delta=h(0,1e3/60,t-tR.timestamp),tR.timestamp=t,tR.isProcessing=!0,tL.update.process(tR),tL.preRender.process(tR),tL.render.process(tR),tR.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,ee.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(s6),this.sharedNodes.forEach(rs)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,tk.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){tk.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure(),!this.snapshot||nz(this.snapshot.measuredBox.x)||nz(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 t=0;t<this.path.length;t++)this.path[t].updateScroll();let t=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected=Z(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);let{visualElement:e}=this.options;e&&e.notify("LayoutMeasure",this.layout.layoutBox,t?t.layoutBox:void 0)}updateScroll(t="measure"){let e=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===t&&(e=!1),e&&this.instance){let e=n(this.instance);this.scroll={animationId:this.root.animationId,phase:t,isRoot:e,offset:i(this.instance),wasRoot:this.scroll?this.scroll.isRoot:e}}}resetTransform(){if(!s)return;let t=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,e=this.projectionDelta&&!sz(this.projectionDelta),i=this.getTransformTemplate(),n=i?i(this.latestValues,""):void 0,r=n!==this.prevTransformTemplateValue;t&&this.instance&&(e||eX(this.latestValues)||r)&&(s(this.instance,n),this.shouldResetTransform=!1,this.scheduleRender())}measure(t=!0){var e;let i=this.measurePageBox(),n=this.removeElementScroll(i);return t&&(n=this.removeTransform(n)),rd((e=n).x),rd(e.y),{animationId:this.root.animationId,measuredBox:i,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){let{visualElement:t}=this.options;if(!t)return Z();let e=t.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(rp))){let{scroll:t}=this.root;t&&(eZ(e.x,t.offset.x),eZ(e.y,t.offset.y))}return e}removeElementScroll(t){let e=Z();if(sB(e,t),this.scroll?.wasRoot)return e;for(let i=0;i<this.path.length;i++){let n=this.path[i],{scroll:s,options:r}=n;n!==this.root&&s&&r.layoutScroll&&(s.wasRoot&&sB(e,t),eZ(e.x,s.offset.x),eZ(e.y,s.offset.y))}return e}applyTransform(t,e=!1){let i=Z();sB(i,t);for(let t=0;t<this.path.length;t++){let n=this.path[t];!e&&n.options.layoutScroll&&n.scroll&&n!==n.root&&e0(i,{x:-n.scroll.offset.x,y:-n.scroll.offset.y}),eX(n.latestValues)&&e0(i,n.latestValues)}return eX(this.latestValues)&&e0(i,this.latestValues),i}removeTransform(t){let e=Z();sB(e,t);for(let t=0;t<this.path.length;t++){let i=this.path[t];if(!i.instance||!eX(i.latestValues))continue;eH(i.latestValues)&&i.updateSnapshot();let n=Z();sB(n,i.measurePageBox()),sW(e,i.latestValues,i.snapshot?i.snapshot.layoutBox:void 0,n)}return eX(this.latestValues)&&sW(e,this.latestValues),e}setTargetDelta(t){this.targetDelta=t,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(t){this.options={...this.options,...t,crossfade:void 0===t.crossfade||t.crossfade}}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!==tR.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(t=!1){let e=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=e.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=e.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=e.isSharedProjectionDirty);let i=!!this.resumingFrom||this!==e;if(!(t||i&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;let{layout:n,layoutId:s}=this.options;if(!this.layout||!(n||s))return;this.resolvedRelativeTargetAt=tR.timestamp;let r=this.getClosestProjectingParent();if(r&&this.linkedParentVersion!==r.layoutVersion&&!r.options.layoutRoot&&this.removeRelativeTarget(),this.targetDelta||this.relativeTarget||(r&&r.layout?this.createRelativeTarget(r,this.layout.layoutBox,r.layout.layoutBox):this.removeRelativeTarget()),this.relativeTarget||this.targetDelta){if(this.target||(this.target=Z(),this.targetWithTransforms=Z()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target){var o,a,l;this.forceRelativeParentToResolveTarget(),o=this.target,a=this.relativeTarget,l=this.relativeParent.target,nX(o.x,a.x,l.x),nX(o.y,a.y,l.y)}else this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):sB(this.target,this.layout.layoutBox),e_(this.target,this.targetDelta)):sB(this.target,this.layout.layoutBox);this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,r&&!!r.resumingFrom==!!this.resumingFrom&&!r.options.layoutScroll&&r.target&&1!==this.animationProgress?this.createRelativeTarget(r,this.target,r.target):this.relativeParent=this.relativeTarget=void 0)}}getClosestProjectingParent(){if(!(!this.parent||eH(this.parent.latestValues)||eK(this.parent.latestValues)))if(this.parent.isProjecting())return this.parent;else return this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(t,e,i){this.relativeParent=t,this.linkedParentVersion=t.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Z(),this.relativeTargetOrigin=Z(),nG(this.relativeTargetOrigin,e,i),sB(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){let t=this.getLead(),e=!!this.resumingFrom||this!==t,i=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(i=!1),e&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(i=!1),this.resolvedRelativeTargetAt===tR.timestamp&&(i=!1),i)return;let{layout:n,layoutId:s}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(n||s))return;sB(this.layoutCorrected,this.layout.layoutBox);let r=this.treeScale.x,o=this.treeScale.y;!function(t,e,i,n=!1){let s,r,o=i.length;if(o){e.x=e.y=1;for(let a=0;a<o;a++){r=(s=i[a]).projectionDelta;let{visualElement:o}=s.options;(!o||!o.props.style||"contents"!==o.props.style.display)&&(n&&s.options.layoutScroll&&s.scroll&&s!==s.root&&e0(t,{x:-s.scroll.offset.x,y:-s.scroll.offset.y}),r&&(e.x*=r.x.scale,e.y*=r.y.scale,e_(t,r)),n&&eX(s.latestValues)&&e0(t,s.latestValues))}e.x<1.0000000000001&&e.x>.999999999999&&(e.x=1),e.y<1.0000000000001&&e.y>.999999999999&&(e.y=1)}}(this.layoutCorrected,this.treeScale,this.path,e),t.layout&&!t.target&&(1!==this.treeScale.x||1!==this.treeScale.y)&&(t.target=t.layout.layoutBox,t.targetWithTransforms=Z());let{target:a}=t;if(!a){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}this.projectionDelta&&this.prevProjectionDelta?(sF(this.prevProjectionDelta.x,this.projectionDelta.x),sF(this.prevProjectionDelta.y,this.projectionDelta.y)):this.createProjectionDeltas(),nH(this.projectionDelta,this.layoutCorrected,a,this.latestValues),this.treeScale.x===r&&this.treeScale.y===o&&sG(this.projectionDelta.x,this.prevProjectionDelta.x)&&sG(this.projectionDelta.y,this.prevProjectionDelta.y)||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",a))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(t=!0){if(this.options.visualElement?.scheduleRender(),t){let t=this.getStack();t&&t.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=q(),this.projectionDelta=q(),this.projectionDeltaWithTransform=q()}setAnimationOrigin(t,e=!1){let i,n=this.snapshot,s=n?n.latestValues:{},r={...this.latestValues},o=q();this.relativeParent&&this.relativeParent.options.layoutRoot||(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!e;let a=Z(),l=(n?n.source:void 0)!==(this.layout?this.layout.source:void 0),h=this.getStack(),u=!h||h.members.length<=1,d=!!(l&&!u&&!0===this.options.crossfade&&!this.path.some(ra));this.animationProgress=0,this.mixTargetDelta=e=>{let n=e/1e3;if(rr(o.x,t.x,n),rr(o.y,t.y,n),this.setTargetDelta(o),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout){var h,c,p,m,f,g;nG(a,this.layout.layoutBox,this.relativeParent.layout.layoutBox),p=this.relativeTarget,m=this.relativeTargetOrigin,f=a,g=n,ro(p.x,m.x,f.x,g),ro(p.y,m.y,f.y,g),i&&(h=this.relativeTarget,c=i,sY(h.x,c.x)&&sY(h.y,c.y))&&(this.isProjectionDirty=!1),i||(i=Z()),sB(i,this.relativeTarget)}l&&(this.animationValues=r,function(t,e,i,n,s,r){s?(t.opacity=eI(0,i.opacity??1,sD(n)),t.opacityExit=eI(e.opacity??1,0,sR(n))):r&&(t.opacity=eI(e.opacity??1,i.opacity??1,n));for(let s=0;s<sM;s++){let r=`border${sE[s]}Radius`,o=sk(e,r),a=sk(i,r);(void 0!==o||void 0!==a)&&(o||(o=0),a||(a=0),0===o||0===a||sC(o)===sC(a)?(t[r]=Math.max(eI(sV(o),sV(a),n),0),(S.test(a)||S.test(o))&&(t[r]+="%")):t[r]=a)}(e.rotate||i.rotate)&&(t.rotate=eI(e.rotate||0,i.rotate||0,n))}(r,s,this.latestValues,n,d,u)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(1e3*!!this.options.layoutRoot)}startAnimation(t){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(tD(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=tk.update(()=>{var e,i,n;let s;sT.hasAnimatedSinceResize=!0,t2.layout++,this.motionValue||(this.motionValue=er(0)),this.motionValue.jump(0,!1),this.currentAnimation=(e=this.motionValue,i=[0,1e3],n={...t,velocity:0,isSync:!0,onUpdate:e=>{this.mixTargetDelta(e),t.onUpdate&&t.onUpdate(e)},onStop:()=>{t2.layout--},onComplete:()=>{t2.layout--,t.onComplete&&t.onComplete(),this.completeAnimation()}},(s=Q(e)?e:er(e)).start(nV("",s,i,n)),s.animation),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);let t=this.getStack();t&&t.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let t=this.getLead(),{targetWithTransforms:e,target:i,layout:n,latestValues:s}=t;if(e&&i&&n){if(this!==t&&this.layout&&n&&rc(this.options.animationType,this.layout.layoutBox,n.layoutBox)){i=this.target||Z();let e=nz(this.layout.layoutBox.x);i.x.min=t.target.x.min,i.x.max=i.x.min+e;let n=nz(this.layout.layoutBox.y);i.y.min=t.target.y.min,i.y.max=i.y.min+n}sB(e,i),e0(e,s),nH(this.projectionDeltaWithTransform,this.layoutCorrected,e,s)}}registerSharedNode(t,e){this.sharedNodes.has(t)||this.sharedNodes.set(t,new sq),this.sharedNodes.get(t).add(e);let i=e.options.initialPromotionConfig;e.promote({transition:i?i.transition:void 0,preserveFollowOpacity:i&&i.shouldPreserveFollowOpacity?i.shouldPreserveFollowOpacity(e):void 0})}isLead(){let t=this.getStack();return!t||t.lead===this}getLead(){let{layoutId:t}=this.options;return t&&this.getStack()?.lead||this}getPrevLead(){let{layoutId:t}=this.options;return t?this.getStack()?.prevLead:void 0}getStack(){let{layoutId:t}=this.options;if(t)return this.root.sharedNodes.get(t)}promote({needsReset:t,transition:e,preserveFollowOpacity:i}={}){let n=this.getStack();n&&n.promote(this,i),t&&(this.projectionDelta=void 0,this.needsReset=!0),e&&this.setOptions({transition:e})}relegate(){let t=this.getStack();return!!t&&t.relegate(this)}resetSkewAndRotation(){let{visualElement:t}=this.options;if(!t)return;let e=!1,{latestValues:i}=t;if((i.z||i.rotate||i.rotateX||i.rotateY||i.rotateZ||i.skewX||i.skewY)&&(e=!0),!e)return;let n={};i.z&&s0("z",t,n,this.animationValues);for(let e=0;e<sQ.length;e++)s0(`rotate${sQ[e]}`,t,n,this.animationValues),s0(`skew${sQ[e]}`,t,n,this.animationValues);for(let e in t.render(),n)t.setStaticValue(e,n[e]),this.animationValues&&(this.animationValues[e]=n[e]);t.scheduleRender()}applyProjectionStyles(t,e){if(!this.instance||this.isSVG)return;if(!this.isVisible){t.visibility="hidden";return}let i=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,t.visibility="",t.opacity="",t.pointerEvents=ih(e?.pointerEvents)||"",t.transform=i?i(this.latestValues,""):"none";return}let n=this.getLead();if(!this.projectionDelta||!this.layout||!n.target){this.options.layoutId&&(t.opacity=void 0!==this.latestValues.opacity?this.latestValues.opacity:1,t.pointerEvents=ih(e?.pointerEvents)||""),this.hasProjected&&!eX(this.latestValues)&&(t.transform=i?i({},""):"none",this.hasProjected=!1);return}t.visibility="";let s=n.animationValues||n.latestValues;this.applyTransformsToTarget();let r=function(t,e,i){let n="",s=t.x.translate/e.x,r=t.y.translate/e.y,o=i?.z||0;if((s||r||o)&&(n=`translate3d(${s}px, ${r}px, ${o}px) `),(1!==e.x||1!==e.y)&&(n+=`scale(${1/e.x}, ${1/e.y}) `),i){let{transformPerspective:t,rotate:e,rotateX:s,rotateY:r,skewX:o,skewY:a}=i;t&&(n=`perspective(${t}px) ${n}`),e&&(n+=`rotate(${e}deg) `),s&&(n+=`rotateX(${s}deg) `),r&&(n+=`rotateY(${r}deg) `),o&&(n+=`skewX(${o}deg) `),a&&(n+=`skewY(${a}deg) `)}let a=t.x.scale*e.x,l=t.y.scale*e.y;return(1!==a||1!==l)&&(n+=`scale(${a}, ${l})`),n||"none"}(this.projectionDeltaWithTransform,this.treeScale,s);i&&(r=i(s,r)),t.transform=r;let{x:o,y:a}=this.projectionDelta;for(let e in t.transformOrigin=`${100*o.origin}% ${100*a.origin}% 0`,n.animationValues?t.opacity=n===this?s.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:s.opacityExit:t.opacity=n===this?void 0!==s.opacity?s.opacity:"":void 0!==s.opacityExit?s.opacityExit:0,eO){if(void 0===s[e])continue;let{correct:i,applyTo:o,isCSSVariable:a}=eO[e],l="none"===r?s[e]:i(s[e],n);if(o){let e=o.length;for(let i=0;i<e;i++)t[o[i]]=l}else a?this.options.visualElement.renderState.vars[e]=l:t[e]=l}this.options.layoutId&&(t.pointerEvents=n===this?ih(e?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(t=>t.currentAnimation?.stop()),this.root.nodes.forEach(s4),this.root.sharedNodes.clear()}}}function s2(t){t.updateLayout()}function s5(t){let e=t.resumeFrom?.snapshot||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){let{layoutBox:i,measuredBox:n}=t.layout,{animationType:s}=t.options,r=e.source!==t.layout.source;"size"===s?nN(t=>{let n=r?e.measuredBox[t]:e.layoutBox[t],s=nz(n);n.min=i[t].min,n.max=n.min+s}):rc(s,e.layoutBox,i)&&nN(n=>{let s=r?e.measuredBox[n]:e.layoutBox[n],o=nz(i[n]);s.max=s.min+o,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[n].max=t.relativeTarget[n].min+o)});let o=q();nH(o,i,e.layoutBox);let a=q();r?nH(a,t.applyTransform(n,!0),e.measuredBox):nH(a,i,e.layoutBox);let l=!sz(o),h=!1;if(!t.resumeFrom){let n=t.getClosestProjectingParent();if(n&&!n.resumeFrom){let{snapshot:s,layout:r}=n;if(s&&r){let o=Z();nG(o,e.layoutBox,s.layoutBox);let a=Z();nG(a,i,r.layoutBox),sX(o,a)||(h=!0),n.options.layoutRoot&&(t.relativeTarget=a,t.relativeTargetOrigin=o,t.relativeParent=n)}}}t.notifyListeners("didUpdate",{layout:i,snapshot:e,delta:a,layoutDelta:o,hasLayoutChanged:l,hasRelativeLayoutChanged:h})}else if(t.isLead()){let{onExitComplete:e}=t.options;e&&e()}t.options.transition=void 0}function s3(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 s9(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function s6(t){t.clearSnapshot()}function s4(t){t.clearMeasurements()}function s8(t){t.isLayoutDirty=!1}function s7(t){let{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function rt(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function re(t){t.resolveTargetDelta()}function ri(t){t.calcProjection()}function rn(t){t.resetSkewAndRotation()}function rs(t){t.removeLeadSnapshot()}function rr(t,e,i){t.translate=eI(e.translate,0,i),t.scale=eI(e.scale,1,i),t.origin=e.origin,t.originPoint=e.originPoint}function ro(t,e,i,n){t.min=eI(e.min,i.min,n),t.max=eI(e.max,i.max,n)}function ra(t){return t.animationValues&&void 0!==t.animationValues.opacityExit}let rl={duration:.45,ease:[.4,0,.1,1]},rh=t=>"u">typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),ru=rh("applewebkit/")&&!rh("chrome/")?Math.round:tE;function rd(t){t.min=ru(t.min),t.max=ru(t.max)}function rc(t,e,i){return"position"===t||"preserve-aspect"===t&&!(.2>=Math.abs(sK(e)-sK(i)))}function rp(t){return t!==t.root&&t.scroll?.wasRoot}let rm=s1({attachResizeListener:(t,e)=>nZ(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),rf={current:void 0},rg=s1({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!rf.current){let t=new rm({});t.mount(window),t.setOptions({layoutScroll:!0}),rf.current=t}return rf.current},resetTransform:(t,e)=>{t.style.transform=void 0!==e?e:"none"},checkIsScrollRoot:t=>"fixed"===window.getComputedStyle(t).position});function ry(t,e){let i=n0(t),n=new AbortController;return[i,{passive:!0,...e,signal:n.signal},()=>n.abort()]}function rv(t,e,i){let{props:n}=t;t.animationState&&n.whileHover&&t.animationState.setActive("whileHover","Start"===i);let s=n["onHover"+i];s&&tk.postRender(()=>s(e,st(e)))}class rx extends iA{mount(){let{current:t}=this.node;t&&(this.unmount=function(t,e,i={}){let[n,s,r]=ry(t,i);return n.forEach(t=>{let i,n=!1,r=!1,o=e=>{i&&(i(e),i=void 0),t.removeEventListener("pointerleave",l)},a=t=>{n=!1,window.removeEventListener("pointerup",a),window.removeEventListener("pointercancel",a),r&&(r=!1,o(t))},l=t=>{if("touch"!==t.pointerType){if(n){r=!0;return}o(t)}};t.addEventListener("pointerenter",n=>{if("touch"===n.pointerType||nW.x||nW.y)return;r=!1;let o=e(t,n);"function"==typeof o&&(i=o,t.addEventListener("pointerleave",l,s))},s),t.addEventListener("pointerdown",()=>{n=!0,window.addEventListener("pointerup",a,s),window.addEventListener("pointercancel",a,s)},s)}),r}(t,(t,e)=>(rv(this.node,e,"Start"),t=>rv(this.node,t,"End"))))}unmount(){}}class rw extends iA{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch(e){t=!0}t&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=iR(nZ(this.node.current,"focus",()=>this.onFocus()),nZ(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}var rT=i(78757);let rP=(t,e)=>!!e&&(t===e||rP(t,e.parentElement)),rS=new WeakSet;function rb(t){return e=>{"Enter"===e.key&&t(e)}}function rA(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}function rE(t){return n7(t)&&!(nW.x||nW.y)}let rM=new WeakSet;function rV(t,e,i){let{props:n}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&n.whileTap&&t.animationState.setActive("whileTap","Start"===i);let s=n["onTap"+("End"===i?"":i)];s&&tk.postRender(()=>s(e,st(e)))}class rC extends iA{mount(){let{current:t}=this.node;if(!t)return;let{globalTapTarget:e,propagate:i}=this.node.props;this.unmount=function(t,e,i={}){let[n,s,r]=ry(t,i),o=t=>{let n=t.currentTarget;if(!rE(t)||rM.has(t))return;rS.add(n),i.stopPropagation&&rM.add(t);let r=e(n,t),o=(t,e)=>{window.removeEventListener("pointerup",a),window.removeEventListener("pointercancel",l),rS.has(n)&&rS.delete(n),rE(t)&&"function"==typeof r&&r(t,{success:e})},a=t=>{o(t,n===window||n===document||i.useGlobalTarget||rP(n,t.target))},l=t=>{o(t,!1)};window.addEventListener("pointerup",a,s),window.addEventListener("pointercancel",l,s)};return n.forEach(t=>{((i.useGlobalTarget?window:t).addEventListener("pointerdown",o,s),(0,rT.s)(t))&&(t.addEventListener("focus",t=>((t,e)=>{let i=t.currentTarget;if(!i)return;let n=rb(()=>{if(rS.has(i))return;rA(i,"down");let t=rb(()=>{rA(i,"up")});i.addEventListener("keyup",t,e),i.addEventListener("blur",()=>rA(i,"cancel"),e)});i.addEventListener("keydown",n,e),i.addEventListener("blur",()=>i.removeEventListener("keydown",n),e)})(t,s)),nq.has(t.tagName)||!0===t.isContentEditable||t.hasAttribute("tabindex")||(t.tabIndex=0))}),r}(t,(t,e)=>(rV(this.node,e,"Start"),(t,{success:e})=>rV(this.node,t,e?"End":"Cancel")),{useGlobalTarget:e,stopPropagation:i?.tap===!1})}unmount(){}}let rk=new WeakMap,rD=new WeakMap,rR=t=>{let e=rk.get(t.target);e&&e(t)},rL=t=>{t.forEach(rR)},rj={some:0,all:1};class rB extends iA{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){var t;let e;this.unmount();let{viewport:i={}}=this.node.getProps(),{root:n,margin:s,amount:r="some",once:o}=i,a={root:n?n.current:void 0,rootMargin:s,threshold:"number"==typeof r?r:rj[r]},l=t=>{let{isIntersecting:e}=t;if(this.isInView===e||(this.isInView=e,o&&!e&&this.hasEnteredView))return;e&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",e);let{onViewportEnter:i,onViewportLeave:n}=this.node.getProps(),s=e?i:n;s&&s(t)};return t=this.node.current,e=function({root:t,...e}){let i=t||document;rD.has(i)||rD.set(i,{});let n=rD.get(i),s=JSON.stringify(e);return n[s]||(n[s]=new IntersectionObserver(rL,{root:t,...e})),n[s]}(a),rk.set(t,l),e.observe(t),()=>{rk.delete(t),e.unobserve(t)}}mount(){this.startObserver()}update(){if("u"<typeof IntersectionObserver)return;let{props:t,prevProps:e}=this.node;["amount","margin","root"].some(function({viewport:t={}},{viewport:e={}}={}){return i=>t[i]!==e[i]}(t,e))&&this.startObserver()}unmount(){}}let rF=function(t,e){if("u"<typeof Proxy)return ib;let i=new Map,n=(i,n)=>ib(i,n,t,e);return new Proxy((t,e)=>n(t,e),{get:(s,r)=>"create"===r?n:(i.has(r)||i.set(r,ib(r,void 0,t,e)),i.get(r))})}({animation:{Feature:nO},exit:{Feature:n$},inView:{Feature:rB},tap:{Feature:rC},focus:{Feature:rw},hover:{Feature:rx},pan:{Feature:sw},drag:{Feature:sv,ProjectionNode:rg,MeasureLayout:sA},layout:{ProjectionNode:rg,MeasureLayout:sA}},(t,e)=>e.isSVG??e9(t)?new eN(e):new e2(e,{allowProjection:t!==e5.Fragment}))},65239:(t,e,i)=>{i.d(e,{E:()=>s});var n=i(12115);let s="u">typeof window?n.useLayoutEffect:n.useEffect},78757:(t,e,i)=>{i.d(e,{s:()=>s});var n=i(94601);function s(t){return(0,n.G)(t)&&"offsetHeight"in t}},79196:(t,e,i)=>{i.d(e,{xQ:()=>r});var n=i(12115),s=i(15131);function r(t=!0){let e=(0,n.useContext)(s.t);if(null===e)return[!0,null];let{isPresent:i,onExitComplete:o,register:a}=e,l=(0,n.useId)();(0,n.useEffect)(()=>{if(t)return a(l)},[t]);let h=(0,n.useCallback)(()=>t&&o&&o(l),[l,o,t]);return!i&&o?[!1,h]:[!0]}},80642:(t,e,i)=>{i.d(e,{N:()=>x});var n=i(95155),s=i(12115),r=i(39551),o=i(28819),a=i(65239),l=i(15131),h=i(78757),u=i(24866);function d(t,e){if("function"==typeof t)return t(e);null!=t&&(t.current=e)}class c extends s.Component{getSnapshotBeforeUpdate(t){let e=this.props.childRef.current;if(e&&t.isPresent&&!this.props.isPresent&&!1!==this.props.pop){let t=e.offsetParent,i=(0,h.s)(t)&&t.offsetWidth||0,n=(0,h.s)(t)&&t.offsetHeight||0,s=this.props.sizeRef.current;s.height=e.offsetHeight||0,s.width=e.offsetWidth||0,s.top=e.offsetTop,s.left=e.offsetLeft,s.right=i-s.width-s.left,s.bottom=n-s.height-s.top}return null}componentDidUpdate(){}render(){return this.props.children}}function p({children:t,isPresent:e,anchorX:i,anchorY:r,root:o,pop:a}){let l=(0,s.useId)(),h=(0,s.useRef)(null),p=(0,s.useRef)({width:0,height:0,top:0,left:0,right:0,bottom:0}),{nonce:m}=(0,s.useContext)(u.Q),f=function(...t){return s.useCallback(function(...t){return e=>{let i=!1,n=t.map(t=>{let n=d(t,e);return i||"function"!=typeof n||(i=!0),n});if(i)return()=>{for(let e=0;e<n.length;e++){let i=n[e];"function"==typeof i?i():d(t[e],null)}}}}(...t),t)}(h,t.props?.ref??t?.ref);return(0,s.useInsertionEffect)(()=>{let{width:t,height:n,top:s,left:u,right:d,bottom:c}=p.current;if(e||!1===a||!h.current||!t||!n)return;let f="left"===i?`left: ${u}`:`right: ${d}`,g="bottom"===r?`bottom: ${c}`:`top: ${s}`;h.current.dataset.motionPopId=l;let y=document.createElement("style");m&&(y.nonce=m);let v=o??document.head;return v.appendChild(y),y.sheet&&y.sheet.insertRule(`
2
- [data-motion-pop-id="${l}"] {
3
- position: absolute !important;
4
- width: ${t}px !important;
5
- height: ${n}px !important;
6
- ${f}px !important;
7
- ${g}px !important;
8
- }
9
- `),()=>{v.contains(y)&&v.removeChild(y)}},[e]),(0,n.jsx)(c,{isPresent:e,childRef:h,sizeRef:p,pop:a,children:!1===a?t:s.cloneElement(t,{ref:f})})}let m=({children:t,initial:e,isPresent:i,onExitComplete:r,custom:a,presenceAffectsLayout:h,mode:u,anchorX:d,anchorY:c,root:m})=>{let g=(0,o.M)(f),y=(0,s.useId)(),v=!0,x=(0,s.useMemo)(()=>(v=!1,{id:y,initial:e,isPresent:i,custom:a,onExitComplete:t=>{for(let e of(g.set(t,!0),g.values()))if(!e)return;r&&r()},register:t=>(g.set(t,!1),()=>g.delete(t))}),[i,g,r]);return h&&v&&(x={...x}),(0,s.useMemo)(()=>{g.forEach((t,e)=>g.set(e,!1))},[i]),s.useEffect(()=>{i||g.size||!r||r()},[i]),t=(0,n.jsx)(p,{pop:"popLayout"===u,isPresent:i,anchorX:d,anchorY:c,root:m,children:t}),(0,n.jsx)(l.t.Provider,{value:x,children:t})};function f(){return new Map}var g=i(79196);let y=t=>t.key||"";function v(t){let e=[];return s.Children.forEach(t,t=>{(0,s.isValidElement)(t)&&e.push(t)}),e}let x=({children:t,custom:e,initial:i=!0,onExitComplete:l,presenceAffectsLayout:h=!0,mode:u="sync",propagate:d=!1,anchorX:c="left",anchorY:p="top",root:f})=>{let[x,w]=(0,g.xQ)(d),T=(0,s.useMemo)(()=>v(t),[t]),P=d&&!x?[]:T.map(y),S=(0,s.useRef)(!0),b=(0,s.useRef)(T),A=(0,o.M)(()=>new Map),E=(0,s.useRef)(new Set),[M,V]=(0,s.useState)(T),[C,k]=(0,s.useState)(T);(0,a.E)(()=>{S.current=!1,b.current=T;for(let t=0;t<C.length;t++){let e=y(C[t]);P.includes(e)?(A.delete(e),E.current.delete(e)):!0!==A.get(e)&&A.set(e,!1)}},[C,P.length,P.join("-")]);let D=[];if(T!==M){let t=[...T];for(let e=0;e<C.length;e++){let i=C[e],n=y(i);P.includes(n)||(t.splice(e,0,i),D.push(i))}return"wait"===u&&D.length&&(t=D),k(v(t)),V(T),null}let{forceRender:R}=(0,s.useContext)(r.L);return(0,n.jsx)(n.Fragment,{children:C.map(t=>{let s=y(t),r=(!d||!!x)&&(T===C||P.includes(s));return(0,n.jsx)(m,{isPresent:r,initial:(!S.current||!!i)&&void 0,custom:e,presenceAffectsLayout:h,mode:u,root:f,onExitComplete:r?void 0:()=>{if(E.current.has(s)||(E.current.add(s),!A.has(s)))return;A.set(s,!0);let t=!0;A.forEach(e=>{e||(t=!1)}),t&&(R?.(),k(b.current),d&&w?.(),l&&l())},anchorX:c,anchorY:p,children:t},s)})})}},94514:(t,e,i)=>{i.d(e,{A:()=>n});let n=(0,i(90425).A)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]])},94601:(t,e,i)=>{i.d(e,{G:()=>n});function n(t){return"object"==typeof t&&null!==t}}}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7177],{3163:(e,t,n)=>{"use strict";n.d(t,{e:()=>s});var a=n(1934);let r=0,s=(0,a.v)(e=>({items:[],addItem:t=>e(e=>({items:[{...t,id:`activity-${Date.now()}-${++r}`},...e.items].slice(0,20)})),clear:()=>e({items:[]})}))},25044:(e,t,n)=>{"use strict";n.d(t,{Toaster:()=>u});var a=n(95155),r=n(12651),s=n(68822),o=n(41585),i=n(26620),c=n(6296),l=n(70460),d=n(66609);let u=({...e})=>{let{theme:t="system"}=(0,l.D)();return(0,a.jsx)(d.l$,{theme:t,className:"toaster group",icons:{success:(0,a.jsx)(r.A,{className:"size-4"}),info:(0,a.jsx)(s.A,{className:"size-4"}),warning:(0,a.jsx)(o.A,{className:"size-4"}),error:(0,a.jsx)(i.A,{className:"size-4"}),loading:(0,a.jsx)(c.A,{className:"size-4 animate-spin"})},style:{"--normal-bg":"var(--popover)","--normal-text":"var(--popover-foreground)","--normal-border":"var(--border)","--border-radius":"var(--radius)"},...e})}},31328:(e,t,n)=>{"use strict";n.d(t,{z:()=>s});var a=n(1934);let r="http://127.0.0.1:18789",s=(0,a.v)((e,t)=>({connected:!1,connecting:!1,wsStatus:"disconnected",wsError:void 0,reason:null,url:r,token:void 0,agentName:void 0,source:void 0,sessions:[],agentStatus:"idle",error:void 0,manualOverrideDirty:!1,detect:async t=>{try{t?.resetManual&&await fetch("/api/gateway/config",{method:"DELETE"}).catch(()=>void 0);let n=await fetch("/api/gateway/detect");if(!n.ok)throw Error("Failed to detect gateway");let a=await n.json();a&&e({url:a.url||r,token:a.token||void 0,agentName:a.agentName||void 0,source:a.source||void 0,manualOverrideDirty:!1})}catch(t){e({reason:"server_unreachable",error:`Detection failed: ${String(t)}`})}},connect:async()=>{let{url:n,token:a,manualOverrideDirty:r}=t();e({connecting:!0,error:void 0,reason:null});try{if(r&&n&&n.trim()){let e=await fetch("/api/gateway/config",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({url:n,token:a})});if(!e.ok){let t=await e.json().catch(()=>({error:"Failed to save gateway configuration"}));throw Error("string"==typeof t?.error?t.error:"Failed to save gateway configuration")}}let s=await fetch("/api/gateway/status");if(!s.ok)throw Error("Failed to check gateway status");let o=await s.json();o.connected?(e({connected:!0,connecting:!1,agentName:o.agentName||t().agentName,source:r?"clawpad.override":o.source||t().source,manualOverrideDirty:!1,reason:null,error:void 0}),t().loadSessions()):e({connected:!1,connecting:!1,reason:o.reason??"gateway_unreachable",error:o.error||`Cannot connect to ${n}`})}catch(t){e({connected:!1,connecting:!1,reason:"server_unreachable",error:`ClawPad server unreachable: ${String(t)}`})}},disconnect:()=>{e({connected:!1,connecting:!1,wsStatus:"disconnected",reason:null,sessions:[],agentStatus:"idle",error:void 0})},loadSessions:async()=>{try{let t=await fetch("/api/gateway/sessions");if(!t.ok)return;let n=(await t.json()).sessions??[],a=n.some(e=>"active"===e.status),r=n.some(e=>"thinking"===e.status);e({sessions:n,agentStatus:a?"active":r?"thinking":"idle"})}catch{}},setUrl:t=>e({url:t,manualOverrideDirty:!0}),setToken:t=>e({token:t||void 0,manualOverrideDirty:!0}),setWSStatus:(n,a)=>{e({wsStatus:n,wsError:"connected"===n?void 0:a?.error}),"connected"===n?e({connected:!0,connecting:!1,reason:null,error:void 0}):"connecting"===n||"reconnecting"===n?e({connected:!1,connecting:!0,reason:a?.reason??"gateway_unreachable"}):e({connected:!1,connecting:!1,reason:a?.reason??t().reason??"gateway_unreachable"})},setAgentStatus:t=>e({agentStatus:t})}))},37279:(e,t,n)=>{"use strict";n.d(t,{Providers:()=>h});var a=n(95155),r=n(70460),s=n(29905),o=n(35625),i=n(70872),c=n(12115),l=n(3163),d=n(31328),u=n(46794),m=n(18496),g=n(83099),p=n(60464);function w(){let e,t,n,a,r,s,o,i,w,h,f,v,y=(0,d.z)(e=>e.detect),S=(0,d.z)(e=>e.connect);return(0,c.useEffect)(()=>{y().then(()=>S())},[y,S]),e=(0,l.e)(e=>e.addItem),t=(0,d.z)(e=>e.setWSStatus),n=(0,d.z)(e=>e.setAgentStatus),a=(0,u.b)(e=>e.addEvent),r=(0,c.useRef)(new Map),s=(0,c.useRef)(0),o=(0,c.useRef)(0),i=(0,c.useRef)(0),(0,c.useEffect)(()=>{o.current=Date.now(),i.current=Date.now();let c=null,l=null,d=null,u=!1,p=n=>{let a,r;if(u||l)return;let o=s.current+1,i=(r=.2*(a=Math.min(3e4,2e3*Math.pow(1.6,s.current)))*(2*Math.random()-1),Math.max(500,Math.round(a+r)));s.current=o,t("reconnecting",{error:n?`${n}. Retrying in ${Math.round(i/1e3)}s (attempt ${o})`:`Reconnecting in ${Math.round(i/1e3)}s (attempt ${o})`,reason:"gateway_unreachable"}),6===o&&e({type:"sub-agent",description:"Gateway reconnection is taking longer than expected",timestamp:Date.now()}),l=setTimeout(()=>{l=null,w()},i)};function w(){u||(t("connecting",{reason:"gateway_unreachable"}),c=new EventSource("/api/gateway/events"),o.current=Date.now(),c.onopen=()=>{o.current=Date.now()},c.addEventListener("status",e=>{try{let n=JSON.parse(e.data);if(t(n.status,{error:n.error,code:n.code,reason:n.reason??void 0}),o.current=Date.now(),"connected"===n.status){s.current=0,l&&(clearTimeout(l),l=null);let e=m.M.getState();e.loadRecentPages({force:!0,silent:!0}),e.loadSpaces({force:!0,silent:!0});let t=g.W.getState();t.sessionKey&&t.loadChangeSets()}}catch{}}),c.addEventListener("gateway",t=>{try{let r=JSON.parse(t.data);(function(t){let{event:r,payload:s}=t;switch(r){case"agent":!function(t){i.current=Date.now();let a=t.stream,r=t.runId??"unknown",s=t.sessionKey??"main";if(!a){("final"===t.state||"aborted"===t.state||"error"===t.state)&&f(r,s,"error"===t.state);return}switch(a){case"lifecycle":{let e=t.data?.phase;"start"===e?h(r,s):("end"===e||"error"===e)&&f(r,s,"error"===e);break}case"assistant":h(r,s),n("active");break;case"tool":{var o;h(r,s),n("active");let a=t.data?.name??void 0;a&&e({type:"tool-used",description:`Using ${{Read:"file reader",Edit:"file editor",Write:"file writer",exec:"terminal",web_search:"web search",web_fetch:"web fetcher",browser:"browser",message:"messenger",image:"image analyzer",tts:"text-to-speech",nodes:"node manager",canvas:"canvas",process:"process manager"}[o=a]??o}`,timestamp:Date.now()})}}}(s);break;case"chat":e({type:"chat-message",description:"New chat message",timestamp:Date.now()});break;case"heartbeat":var o;let c,l;c=(o=s).ts,l=o.status,"number"!=typeof c||Number.isNaN(c)||"string"!=typeof l||a({...o,ts:c,status:l})}})(r),o.current=Date.now()}catch{}}),c.addEventListener("keepalive",()=>{o.current=Date.now()}),c.onerror=()=>{c?.close(),c=null,t("disconnected",{error:"Event stream disconnected",reason:"gateway_unreachable"}),u||p("Event stream disconnected")})}function h(t,a){r.current.has(t)||(r.current.set(t,a),i.current=Date.now(),n("thinking"),e({type:"sub-agent",description:"Agent started thinking",timestamp:Date.now()}),window.dispatchEvent(new CustomEvent("clawpad:agent-lifecycle",{detail:{phase:"start",runId:t,sessionKey:a,timestamp:Date.now()}})))}function f(t,a,s){r.current.delete(t),i.current=Date.now(),0===r.current.size&&n("idle");let o=g.W.getState();o.activeRun?.runId===t&&(o.setActiveRun(null),o.clearActiveFiles()),e({type:"sub-agent",description:s?"Agent errored":"Agent finished",timestamp:Date.now()}),window.dispatchEvent(new CustomEvent("clawpad:agent-lifecycle",{detail:{phase:"end",runId:t,sessionKey:a,timestamp:Date.now(),error:!!s}}))}return w(),d=setInterval(()=>{if(u)return;let e=Date.now()-o.current,t=Date.now()-i.current;if(r.current.size>0&&t>2e4)for(let[e,t]of Array.from(r.current.entries()))f(e,t);e>45e3&&(c?.close(),c=null,p("Connection stale"))},1e4),()=>{u=!0,l&&clearTimeout(l),d&&clearInterval(d),c?.close()}},[e,t,n,a]),w=(0,l.e)(e=>e.addItem),h=(0,c.useRef)(null),f=(0,c.useRef)(new Set),v=(0,c.useRef)(!1),(0,c.useEffect)(()=>{let e=null,t=null,n=!1,a=0;return!function r(){n||(e=new EventSource("/api/files/watch"),a=0,e.onmessage=e=>{try{let t=JSON.parse(e.data);if("connected"===t.type||"error"===t.type)return;let n=t.path??"",a=n.split("/").pop()?.replace(/\.md$/,"")??n,r={"file-changed":`Edited ${a}`,"file-added":`Created ${a}`,"file-removed":`Deleted ${a}`};w({type:t.type,description:r[t.type]??`${t.type}: ${a}`,path:t.path,timestamp:t.timestamp??Date.now()}),window.dispatchEvent(new CustomEvent("clawpad:file-change",{detail:t}));let s=n.includes("/")?n.split("/")[0]:p.Sz,o="file-added"===t.type||"file-removed"===t.type;s&&f.current.add(s),o&&(v.current=!0),h.current||(h.current=setTimeout(()=>{h.current=null;let{loadRecentPages:e,loadPages:t,loadSpaces:n,pagesBySpace:a}=m.M.getState();for(let e of f.current)a.has(e)&&t(e,{force:!0,silent:!0});f.current.clear(),e({force:!0,silent:!0}),v.current&&(n({force:!0,silent:!0}),v.current=!1)},250))}catch{}},e.onerror=()=>{if(e?.close(),e=null,!n){let e=Math.min(3e4,2e3*Math.pow(1.6,a)),n=.2*e*(2*Math.random()-1);a+=1,t=setTimeout(r,Math.max(500,Math.round(e+n)))}})}(),()=>{n=!0,e?.close(),t&&clearTimeout(t),h.current&&(clearTimeout(h.current),h.current=null)}},[w]),(0,c.useEffect)(()=>{let e=async e=>{await fetch("/api/changes/run",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionKey:e.sessionKey,runId:e.runId,status:e.status,..."start"===e.status?{startedAt:new Date(e.timestamp??Date.now()).toISOString()}:{endedAt:new Date(e.timestamp??Date.now()).toISOString()}})})},t=async t=>{let n=t.detail;if(n?.runId&&n?.sessionKey){if("start"===n.phase){let t=g.W.getState().activeRun;t&&t.runId!==n.runId&&await e({sessionKey:t.sessionKey,runId:t.runId,status:"end",timestamp:n.timestamp??Date.now()}),g.W.getState().setSessionKey(n.sessionKey),g.W.getState().setActiveRun({runId:n.runId,sessionKey:n.sessionKey,startedAt:n.timestamp??Date.now()}),g.W.getState().clearActiveFiles(),await e({sessionKey:n.sessionKey,runId:n.runId,status:"start",timestamp:n.timestamp??Date.now()})}"end"===n.phase&&(g.W.getState().setSessionKey(n.sessionKey),await e({sessionKey:n.sessionKey,runId:n.runId,status:"end",timestamp:n.timestamp??Date.now()}),g.W.getState().setActiveRun(null),g.W.getState().clearActiveFiles(),g.W.getState().loadChangeSets())}},n=async e=>{let t=e.detail;if(!t?.path||!t.type||"connected"===t.type||"error"===t.type)return;let{activeRun:n}=g.W.getState();n&&(g.W.getState().touchFile(t.path),await fetch("/api/changes/record",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionKey:n.sessionKey,runId:n.runId,path:t.path,eventType:t.type,timestamp:t.timestamp??Date.now()})}))};return window.addEventListener("clawpad:agent-lifecycle",t),window.addEventListener("clawpad:file-change",n),()=>{window.removeEventListener("clawpad:agent-lifecycle",t),window.removeEventListener("clawpad:file-change",n)}},[]),null}function h({children:e}){let[t]=(0,c.useState)(()=>new s.E({defaultOptions:{queries:{staleTime:6e4,refetchOnWindowFocus:!1}}}));return(0,a.jsx)(r.N,{attribute:"class",defaultTheme:"system",enableSystem:!0,disableTransitionOnChange:!0,children:(0,a.jsx)(o.Ht,{client:t,children:(0,a.jsxs)(i.Bc,{delayDuration:300,children:[(0,a.jsx)(w,{}),e]})})})}},46794:(e,t,n)=>{"use strict";n.d(t,{b:()=>a});let a=(0,n(1934).v)(e=>({lastEvent:void 0,events:[],updatedAt:void 0,addEvent:t=>e(e=>{let n=function(e,t){if(t)return t;let n=(e??"").toLowerCase();if(n){if("failed"===n)return"error";if("sent"===n)return"alert";if(n.startsWith("ok"))return"ok"}}(t.status,t.indicatorType),a={...t,indicatorType:n,actionable:"alert"===n||"error"===n},r=[a,...e.events];return r.length>20&&(r.length=20),{lastEvent:a,events:r,updatedAt:Date.now()}}),clear:()=>e({lastEvent:void 0,events:[],updatedAt:void 0})}))},49397:(e,t,n)=>{Promise.resolve().then(n.t.bind(n,7086,23)),Promise.resolve().then(n.t.bind(n,84438,23)),Promise.resolve().then(n.t.bind(n,51743,23)),Promise.resolve().then(n.bind(n,37279)),Promise.resolve().then(n.bind(n,25044))},51743:()=>{},70872:(e,t,n)=>{"use strict";n.d(t,{Bc:()=>o,ZI:()=>l,k$:()=>c,m_:()=>i});var a=n(95155);n(12115);var r=n(28935),s=n(52799);function o({delayDuration:e=0,...t}){return(0,a.jsx)(r.Provider,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function i({...e}){return(0,a.jsx)(o,{children:(0,a.jsx)(r.Root,{"data-slot":"tooltip",...e})})}function c({...e}){return(0,a.jsx)(r.Trigger,{"data-slot":"tooltip-trigger",...e})}function l({className:e,sideOffset:t=0,children:n,...o}){return(0,a.jsx)(r.Portal,{children:(0,a.jsxs)(r.Content,{"data-slot":"tooltip-content",sideOffset:t,className:(0,s.cn)("bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",e),...o,children:[n,(0,a.jsx)(r.Arrow,{className:"bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}},83099:(e,t,n)=>{"use strict";n.d(t,{W:()=>a});let a=(0,n(1934).v)((e,t)=>({sessionKey:null,activeRun:null,activeFiles:new Set,lastFileTouchAt:null,changeSets:[],review:{open:!1,changeSetId:null,filePath:null},dismissed:new Set,loading:!1,error:void 0,setSessionKey:t=>e({sessionKey:t}),setActiveRun:t=>e({activeRun:t,...t?{}:{lastFileTouchAt:null}}),touchFile:t=>e(e=>{let n=new Set(e.activeFiles);return n.add(t),{activeFiles:n,lastFileTouchAt:Date.now()}}),clearActiveFiles:()=>e({activeFiles:new Set,lastFileTouchAt:null}),loadChangeSets:async()=>{let n=t().sessionKey;if(n){e({loading:!0,error:void 0});try{let t=await fetch(`/api/changes?sessionKey=${encodeURIComponent(n)}`);if(!t.ok)throw Error("Failed to load change sets");let a=await t.json();e({changeSets:a,loading:!1})}catch(t){e({loading:!1,error:String(t)})}}},openReview:(t,n)=>e({review:{open:!0,changeSetId:t,filePath:n}}),closeReview:()=>e({review:{open:!1,changeSetId:null,filePath:null}}),dismissChangeSet:t=>e(e=>{let n=new Set(e.dismissed);return n.add(t),{dismissed:n}})}))}},e=>{e.O(0,[1817,3334,330,7300,6609,8935,112,1178,8441,3794,7358],()=>e(e.s=49397)),_N_E=e.O()}]);
@@ -1,38 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8118],{1022:(e,t,s)=>{Promise.resolve().then(s.t.bind(s,98500,23)),Promise.resolve().then(s.bind(s,58206)),Promise.resolve().then(s.bind(s,92232))},42317:(e,t,s)=>{"use strict";s.d(t,{L:()=>n});var r=s(95155),a=s(86846);function n(){return(0,r.jsxs)("div",{className:"mx-auto w-full max-w-[720px] px-6",children:[(0,r.jsxs)("div",{className:"pt-20 pb-4",children:[(0,r.jsx)(a.E,{className:"h-10 w-2/3 mb-3"}),(0,r.jsx)(a.E,{className:"h-4 w-1/3"})]}),(0,r.jsxs)("div",{className:"space-y-3 pt-6",children:[(0,r.jsx)(a.E,{className:"h-4 w-full"}),(0,r.jsx)(a.E,{className:"h-4 w-[92%]"}),(0,r.jsx)(a.E,{className:"h-4 w-[78%]"}),(0,r.jsx)("div",{className:"h-3"}),(0,r.jsx)(a.E,{className:"h-4 w-full"}),(0,r.jsx)(a.E,{className:"h-4 w-[85%]"}),(0,r.jsx)(a.E,{className:"h-4 w-[65%]"}),(0,r.jsx)("div",{className:"h-3"}),(0,r.jsx)(a.E,{className:"h-4 w-[90%]"}),(0,r.jsx)(a.E,{className:"h-4 w-[70%]"})]})]})}},58206:(e,t,s)=>{"use strict";s.d(t,{PageDiffFallback:()=>i});var r=s(95155),a=s(83099),n=s(87293);function i({filePath:e,fallback:t}){let s=(0,a.W)(e=>e.review),i=(0,a.W)(e=>e.closeReview);return s.open&&s.changeSetId&&s.filePath===e?(0,r.jsx)(n.W,{changeSetId:s.changeSetId,filePath:e,onExit:i}):(0,r.jsx)(r.Fragment,{children:t})}},83099:(e,t,s)=>{"use strict";s.d(t,{W:()=>r});let r=(0,s(1934).v)((e,t)=>({sessionKey:null,activeRun:null,activeFiles:new Set,lastFileTouchAt:null,changeSets:[],review:{open:!1,changeSetId:null,filePath:null},dismissed:new Set,loading:!1,error:void 0,setSessionKey:t=>e({sessionKey:t}),setActiveRun:t=>e({activeRun:t,...t?{}:{lastFileTouchAt:null}}),touchFile:t=>e(e=>{let s=new Set(e.activeFiles);return s.add(t),{activeFiles:s,lastFileTouchAt:Date.now()}}),clearActiveFiles:()=>e({activeFiles:new Set,lastFileTouchAt:null}),loadChangeSets:async()=>{let s=t().sessionKey;if(s){e({loading:!0,error:void 0});try{let t=await fetch(`/api/changes?sessionKey=${encodeURIComponent(s)}`);if(!t.ok)throw Error("Failed to load change sets");let r=await t.json();e({changeSets:r,loading:!1})}catch(t){e({loading:!1,error:String(t)})}}},openReview:(t,s)=>e({review:{open:!0,changeSetId:t,filePath:s}}),closeReview:()=>e({review:{open:!1,changeSetId:null,filePath:null}}),dismissChangeSet:t=>e(e=>{let s=new Set(e.dismissed);return s.add(t),{dismissed:s}})}))},86846:(e,t,s)=>{"use strict";s.d(t,{E:()=>n});var r=s(95155),a=s(52799);function n({className:e,...t}){return(0,r.jsx)("div",{"data-slot":"skeleton",className:(0,a.cn)("bg-accent animate-pulse rounded-md",e),...t})}},87293:(e,t,s)=>{"use strict";s.d(t,{W:()=>u});var r=s(95155),a=s(12115),n=s(80723),i=s(55711),o=s(89239),l=s(52799),d=s(66609),c=s(83099);function u({changeSetId:e,filePath:t,onExit:s}){let[l,u]=(0,a.useState)(null),[p,h]=(0,a.useState)(!0),[x,f]=(0,a.useState)(!1),g=(0,c.W)(e=>e.loadChangeSets),v=(0,a.useCallback)(async()=>{h(!0);try{let t=await fetch(`/api/changes/${encodeURIComponent(e)}`);if(!t.ok)throw Error("Failed to load diff");let s=await t.json();u(s)}catch(e){d.oR.error("Could not load diff")}finally{h(!1)}},[e]);(0,a.useEffect)(()=>{v()},[v]);let b=l?.files.find(e=>e.path===t),w=async()=>{f(!0);try{if(!(await fetch("/api/changes/revert",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({changeSetId:e,mode:"file",path:t})})).ok)throw Error("Undo failed");await v(),await g()}catch{d.oR.error("Undo failed")}finally{f(!1)}},j=async s=>{f(!0);try{if(!(await fetch("/api/changes/revert",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({changeSetId:e,mode:"hunk",path:t,hunkId:s})})).ok)throw Error("Undo failed");await v(),await g()}catch{d.oR.error("Could not apply undo")}finally{f(!1)}};return p?(0,r.jsx)("div",{className:"flex h-full items-center justify-center text-sm text-muted-foreground",children:"Loading diff…"}):b?(0,r.jsxs)("div",{className:"flex min-h-full flex-col",children:[(0,r.jsxs)("div",{className:"sticky top-0 z-10 flex items-center justify-between border-b bg-background/90 px-4 py-2 backdrop-blur",children:[(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[(0,r.jsx)(o.$,{variant:"ghost",size:"icon",onClick:s,children:(0,r.jsx)(n.A,{className:"h-4 w-4"})}),(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"text-sm font-medium",children:"Review changes"}),(0,r.jsx)("div",{className:"text-xs text-muted-foreground",children:t})]})]}),(0,r.jsxs)(o.$,{variant:"outline",size:"sm",onClick:w,disabled:x,children:[(0,r.jsx)(i.A,{className:"mr-2 h-3.5 w-3.5"}),"Undo file"]})]}),(0,r.jsx)("div",{className:"flex-1 px-4 py-6",children:(0,r.jsx)(m,{file:b,onUndoHunk:j,busy:x})})]}):(0,r.jsxs)("div",{className:"flex h-full flex-col items-center justify-center gap-2 text-sm text-muted-foreground",children:[(0,r.jsx)("span",{children:"No diff available for this file."}),(0,r.jsx)(o.$,{variant:"outline",size:"sm",onClick:s,children:"Back to document"})]})}function m({file:e,onUndoHunk:t,busy:s}){if(e.tooLarge)return(0,r.jsx)("div",{className:"rounded-md border border-border p-4 text-sm text-muted-foreground",children:"File is too large to diff."});let a=e.hunks??[];return 0===a.length?(0,r.jsx)("div",{className:"rounded-md border border-border p-4 text-sm text-muted-foreground",children:"No differences found."}):(0,r.jsx)("div",{className:"space-y-4",children:a.map((e,a)=>(0,r.jsxs)("div",{className:"overflow-hidden rounded-lg border border-border",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between bg-muted/60 px-3 py-1.5 text-xs text-muted-foreground",children:[(0,r.jsxs)("span",{children:["Hunk ",a+1," \xb7 +",e.adds," −",e.removes]}),(0,r.jsx)(o.$,{size:"sm",variant:"ghost",className:"h-7 px-2 text-xs",onClick:()=>t(e.id),disabled:s,children:"Undo"})]}),(0,r.jsx)("div",{className:"bg-background",children:(0,r.jsx)("pre",{className:"whitespace-pre-wrap px-3 py-2 text-xs leading-relaxed",children:e.lines.map((t,s)=>{let a=t[0],n=t.slice(1);return(0,r.jsxs)("div",{className:(0,l.cn)("rounded-sm px-1","+"===a&&"bg-emerald-500/15 text-emerald-700 dark:text-emerald-300","-"===a&&"bg-rose-500/15 text-rose-700 dark:text-rose-300 line-through"),children:[(0,r.jsx)("span",{className:"mr-2 text-muted-foreground/70",children:a}),n]},`${e.id}-${s}`)})})})]},e.id))})}},89239:(e,t,s)=>{"use strict";s.d(t,{$:()=>l});var r=s(95155);s(12115);var a=s(18460),n=s(42442),i=s(52799);let o=(0,a.F)("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",xs:"h-6 gap-1 rounded-md px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-xs":"size-6 rounded-md [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function l({className:e,variant:t="default",size:s="default",asChild:a=!1,...l}){let d=a?n.bL:"button";return(0,r.jsx)(d,{"data-slot":"button","data-variant":t,"data-size":s,className:(0,i.cn)(o({variant:t,size:s,className:e})),...l})}},92232:(e,t,s)=>{"use strict";s.d(t,{PageEditor:()=>E});var r=s(95155),a=s(12115),n=s(37206),i=s(73321),o=s(67635),l=s(6962),d=s(60285),c=s(68459),u=s(66609),m=s(42317),p=s(89239),h=s(25623),x=s(52799);function f({...e}){return(0,r.jsx)(h.Root,{"data-slot":"dropdown-menu",...e})}function g({...e}){return(0,r.jsx)(h.Trigger,{"data-slot":"dropdown-menu-trigger",...e})}function v({className:e,sideOffset:t=4,...s}){return(0,r.jsx)(h.Portal,{children:(0,r.jsx)(h.Content,{"data-slot":"dropdown-menu-content",sideOffset:t,className:(0,x.cn)("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",e),...s})})}function b({className:e,inset:t,variant:s="default",...a}){return(0,r.jsx)(h.Item,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":s,className:(0,x.cn)("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...a})}var w=s(18496),j=s(83099),y=s(87293);let N=(0,n.default)(()=>Promise.all([s.e(3266),s.e(8425),s.e(7105),s.e(1375),s.e(5004),s.e(277),s.e(2545),s.e(4034),s.e(9352),s.e(6361),s.e(3678)]).then(s.bind(s,3678)),{loadableGenerated:{webpack:()=>[3678]},ssr:!1,loading:()=>(0,r.jsx)(m.L,{})}),k=["\uD83D\uDCDD","\uD83D\uDCC4","\uD83D\uDCCB","\uD83D\uDCCC","\uD83D\uDCCE","\uD83D\uDCD1","\uD83D\uDCD2","\uD83D\uDCD3","\uD83D\uDCD4","\uD83D\uDCD5","\uD83D\uDCD6","\uD83D\uDCD7","\uD83D\uDCD8","\uD83D\uDCD9","\uD83C\uDFAF","\uD83D\uDE80","\uD83D\uDCA1","\uD83D\uDD25","⚡","\uD83C\uDFA8","\uD83E\uDDE0","\uD83D\uDCBB","\uD83D\uDD27","\uD83D\uDCCA","\uD83D\uDDC2️","✨","\uD83C\uDF1F","\uD83D\uDC4B","\uD83C\uDF99️","\uD83C\uDFB5","\uD83D\uDCF7","\uD83D\uDD2C","\uD83C\uDFD7️","\uD83D\uDDFA️","\uD83E\uDDE9"],S=(0,a.memo)(function({status:e}){return"idle"===e?null:(0,r.jsx)("span",{className:`text-xs transition-opacity duration-300 ${{idle:"text-text-muted",saved:"text-success",saving:"text-text-muted",unsaved:"text-warning",error:"text-error"}[e]} ${"saved"===e?"animate-fade-out":""}`,children:{idle:"",saved:"Saved",saving:"Saving…",unsaved:"Unsaved changes",error:"Save failed"}[e]})}),C=(0,a.memo)(function({filePath:e}){let t=e.replace(/\.md$/,"").split("/").map(e=>e.replace(/[-_]+/g," ").replace(/\b\w/g,e=>e.toUpperCase()));return(0,r.jsx)("nav",{className:"flex items-center gap-1 text-[13px] text-text-muted",children:t.map((e,s)=>(0,r.jsxs)("span",{className:"flex items-center gap-1",children:[s>0&&(0,r.jsx)("span",{className:"text-text-muted/50",children:"/"}),(0,r.jsx)("span",{className:s===t.length-1?"text-text-secondary":"",children:e})]},s))})});function $({icon:e,onSelect:t}){let[s,n]=(0,a.useState)(!1),i=(0,a.useRef)(null);return(0,a.useEffect)(()=>{if(s)return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e);function e(e){i.current&&!i.current.contains(e.target)&&n(!1)}},[s]),(0,r.jsxs)("div",{ref:i,className:"relative inline-block",children:[(0,r.jsx)("button",{type:"button",onClick:()=>n(!s),className:"text-4xl leading-none hover:bg-surface-hover rounded-lg p-1 transition-colors cursor-pointer md:text-4xl text-3xl",title:"Change icon",children:e||"\uD83D\uDCC4"}),s&&(0,r.jsx)("div",{className:"absolute top-full left-0 z-50 mt-1 grid grid-cols-7 gap-1 rounded-lg border border-border bg-popover p-2 shadow-lg",children:k.map(e=>(0,r.jsx)("button",{type:"button",onClick:()=>{t(e),n(!1)},className:"flex items-center justify-center w-8 h-8 rounded hover:bg-surface-hover transition-colors text-lg cursor-pointer min-h-[44px] min-w-[44px] md:min-h-0 md:min-w-0",children:e},e))})]})}let R=(0,a.memo)(function({status:e,wordCount:t,modified:s}){let[n,i]=(0,a.useState)(!1);(0,a.useEffect)(()=>{i(!0)},[]);let o=new Date(s),l=n?o.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"}):"",d=n?o.toLocaleDateString(void 0,{month:"short",day:"numeric"}):"";return(0,r.jsxs)("div",{className:"sticky bottom-0 z-10 flex items-center justify-between border-t border-border bg-background/80 backdrop-blur-sm px-4 py-1.5 text-xs text-text-muted md:px-6 max-md:bottom-14",children:[(0,r.jsxs)("div",{className:"flex items-center gap-4",children:[(0,r.jsx)(S,{status:e}),(0,r.jsxs)("span",{className:"hidden sm:inline",children:[t," words"]})]}),(0,r.jsxs)("span",{className:"hidden sm:inline",children:["Last edited"," ",(0,r.jsx)("span",{suppressHydrationWarning:!0,children:d})," at"," ",(0,r.jsx)("span",{suppressHydrationWarning:!0,children:l})]}),(0,r.jsx)("span",{className:"sm:hidden",children:(0,r.jsx)(S,{status:e})})]})});function E({initialContent:e,meta:t,filePath:s}){let n=(0,i.useRouter)(),{deletePage:h}=(0,w.M)(),x=(0,j.W)(e=>e.review),k=(0,j.W)(e=>e.closeReview),[S,E]=(0,a.useState)(t),[z,P]=(0,a.useState)(e),[F,T]=(0,a.useState)(0),[U,D]=(0,a.useState)(t.icon),[I,_]=(0,a.useState)("idle"),[W,A]=(0,a.useState)(0),[L,O]=(0,a.useState)(t.modified),[K,q]=(0,a.useState)(!1),H=(0,a.useRef)(null),M=(0,a.useRef)(null),J=(0,a.useRef)(t.title),B=(0,a.useRef)("idle"),G=(0,a.useRef)(e),V=(0,a.useRef)(0),Y=(0,a.useRef)(null),Q=(0,a.useRef)(null),X=(0,a.useRef)(null),Z=(0,a.useRef)(s);(0,a.useEffect)(()=>{B.current=I},[I]),(0,a.useEffect)(()=>{Z.current=s},[s]),(0,a.useEffect)(()=>{q(!0)},[]),(0,a.useEffect)(()=>{E(t),P(e),T(e=>e+1),D(t.icon),O(t.modified),_("idle"),A(0),J.current=t.title,G.current=e,V.current=0,Y.current=null,Q.current&&(u.oR.dismiss(Q.current),Q.current=null)},[s,e,t]);let ee=(0,a.useCallback)(e=>{M.current&&clearTimeout(M.current),M.current=setTimeout(async()=>{try{let t=await fetch(`/api/files/pages/${encodeURIComponent(s)}`);if(!t.ok)return;let r=await t.json();await fetch(`/api/files/pages/${encodeURIComponent(s)}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:r.content,meta:{...e}})});let a=new Date().toISOString();V.current=Date.now(),O(a),E(t=>({...t,...e,modified:a}))}catch(e){console.error("Failed to save meta:",e)}},800)},[s]),et=(0,a.useCallback)(()=>{let e=H.current?.textContent?.trim()||"Untitled";e!==J.current&&(J.current=e,ee({title:e,icon:U}))},[U,ee]),es=(0,a.useCallback)(e=>{if("Enter"===e.key){e.preventDefault();let t=document.querySelector(".clawpad-editor .ProseMirror");t?.focus()}},[]),er=(0,a.useCallback)(e=>{D(e);let t=H.current?.textContent?.trim()||J.current||"Untitled";J.current=t,ee({title:t,icon:e})},[ee]),ea=(0,a.useCallback)(e=>{let t=new Date().toISOString();G.current=e,V.current=Date.now(),O(t),E(e=>({...e,modified:t}))},[]),en=(0,a.useCallback)(async()=>{try{await h(s),n.push("/workspace")}catch(e){console.error("Failed to delete page:",e)}},[h,s,n]),ei=(0,a.useCallback)(async()=>{try{await navigator.clipboard.writeText(z),u.oR.success("Copied to clipboard")}catch(e){console.error("Failed to copy:",e),u.oR.error("Failed to copy to clipboard")}},[z]),eo=(0,a.useCallback)(()=>{let e=("<p>"+z.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/```(\w*)\n([\s\S]*?)```/g,"<pre><code>$2</code></pre>").replace(/^### (.*$)/gm,"<h3>$1</h3>").replace(/^## (.*$)/gm,"<h2>$1</h2>").replace(/^# (.*$)/gm,"<h1>$1</h1>").replace(/\*\*\*(.*?)\*\*\*/g,"<strong><em>$1</em></strong>").replace(/\*\*(.*?)\*\*/g,"<strong>$1</strong>").replace(/\*(.*?)\*/g,"<em>$1</em>").replace(/`([^`]+)`/g,"<code>$1</code>").replace(/\[([^\]]+)\]\(([^)]+)\)/g,'<a href="$2">$1</a>').replace(/^> (.*$)/gm,"<blockquote>$1</blockquote>").replace(/^[-*] (.*$)/gm,"<li>$1</li>").replace(/^\d+\. (.*$)/gm,"<li>$1</li>").replace(/^---$/gm,"<hr>").replace(/\n\n/g,"</p><p>").replace(/\n/g,"<br>")+"</p>").replace(/<p><\/p>/g,"").replace(/<p><br><\/p>/g,"").replace(/(<li>[\s\S]*?<\/li>)+/g,"<ul>$&</ul>"),t=window.open("","_blank");if(!t)return void u.oR.error("Please allow pop-ups to download PDF");let s=S.title||"Untitled";t.document.write(`
2
- <!DOCTYPE html>
3
- <html>
4
- <head>
5
- <title>${s}</title>
6
- <style>
7
- body {
8
- font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
9
- max-width: 700px;
10
- margin: 40px auto;
11
- padding: 20px;
12
- line-height: 1.6;
13
- color: #333;
14
- }
15
- h1 { font-size: 2rem; margin-bottom: 1rem; }
16
- h2 { font-size: 1.5rem; margin-top: 1.5rem; }
17
- h3 { font-size: 1.25rem; margin-top: 1.25rem; }
18
- p { margin: 0.75rem 0; }
19
- code { background: #f4f4f4; padding: 2px 6px; border-radius: 3px; font-family: monospace; }
20
- pre { background: #f4f4f4; padding: 1rem; border-radius: 6px; overflow-x: auto; }
21
- pre code { background: none; padding: 0; }
22
- ul, ol { padding-left: 1.5rem; }
23
- li { margin: 0.25rem 0; }
24
- blockquote { border-left: 3px solid #ddd; margin-left: 0; padding-left: 1rem; color: #666; font-style: italic; }
25
- a { color: #0066cc; }
26
- hr { border: none; border-top: 1px solid #ddd; margin: 1.5rem 0; }
27
- img { max-width: 100%; height: auto; }
28
- @media print {
29
- body { margin: 0; padding: 20px; }
30
- }
31
- </style>
32
- </head>
33
- <body>
34
- <h1>${U||"\uD83D\uDCC4"} ${s}</h1>
35
- ${e}
36
- </body>
37
- </html>
38
- `),t.document.close(),t.onload=()=>{t.print()},setTimeout(()=>{t.print()},500),u.oR.success("Print dialog opened - save as PDF")},[z,S.title,U]),el=(0,a.useCallback)((e,t)=>{Y.current=null,Q.current&&(u.oR.dismiss(Q.current),Q.current=null),E(t),D(t.icon),O(t.modified),P(e),T(e=>e+1),_("idle"),G.current=e},[]),ed=(0,a.useCallback)(async(e=!1)=>{try{let t=await fetch(`/api/files/pages/${encodeURIComponent(Z.current)}`);if(!t.ok){404===t.status&&(u.oR.error("This page was deleted."),n.push("/workspace"));return}let s=await t.json(),r=s.content??"",a=s.meta;if(("unsaved"===B.current||"saving"===B.current)&&!e){Y.current={content:r,meta:a},Q.current||(Q.current=(0,u.oR)("This page changed on disk",{action:{label:"Reload",onClick:()=>ed(!0)},duration:6e3}));return}if(r===G.current&&!e){E(a),D(a.icon),O(a.modified);return}el(r,a)}catch(e){console.error("Failed to refresh page:",e)}},[el,n]);return((0,a.useEffect)(()=>{J.current=S.title,H.current&&(H.current.textContent=S.title)},[S.title,s]),(0,a.useEffect)(()=>{let e=e=>{let t=e.detail;if(t?.path&&t.path===Z.current){if("file-removed"===t.type){u.oR.error("This page was deleted."),n.push("/workspace");return}t.timestamp&&1e3>Math.abs(t.timestamp-V.current)||(X.current&&clearTimeout(X.current),X.current=setTimeout(()=>{ed()},250))}};return window.addEventListener("clawpad:file-change",e),()=>{window.removeEventListener("clawpad:file-change",e),X.current&&(clearTimeout(X.current),X.current=null)}},[ed,n]),(0,a.useEffect)(()=>()=>{M.current&&clearTimeout(M.current)},[]),x.open&&x.changeSetId&&x.filePath===s)?(0,r.jsx)(y.W,{changeSetId:x.changeSetId,filePath:s,onExit:k}):(0,r.jsxs)("div",{className:"flex min-h-full flex-col max-md:pb-14",children:[(0,r.jsxs)("div",{className:"mx-auto w-full flex-1 px-3 md:px-8",style:{maxWidth:"var(--clawpad-editor-width, 720px)"},children:[(0,r.jsxs)("div",{className:"pt-12 pb-1 md:pt-20",children:[(0,r.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,r.jsx)($,{icon:U,onSelect:er}),(0,r.jsxs)("div",{className:"flex items-center gap-1",children:[(0,r.jsxs)(p.$,{variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-foreground",onClick:ei,title:"Copy as markdown",children:[(0,r.jsx)(o.A,{className:"h-4 w-4"}),(0,r.jsx)("span",{className:"sr-only",children:"Copy markdown"})]}),(0,r.jsxs)(p.$,{variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-foreground",onClick:eo,title:"Download as PDF",children:[(0,r.jsx)(l.A,{className:"h-4 w-4"}),(0,r.jsx)("span",{className:"sr-only",children:"Download PDF"})]}),K?(0,r.jsxs)(f,{children:[(0,r.jsx)(g,{asChild:!0,children:(0,r.jsxs)(p.$,{variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-foreground",children:[(0,r.jsx)(d.A,{className:"h-4 w-4"}),(0,r.jsx)("span",{className:"sr-only",children:"Page actions"})]})}),(0,r.jsx)(v,{align:"end",className:"w-44",children:(0,r.jsxs)(b,{className:"text-destructive focus:text-destructive",onClick:en,children:[(0,r.jsx)(c.A,{className:"mr-2 h-4 w-4"}),"Delete"]})})]}):(0,r.jsxs)(p.$,{variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-foreground",disabled:!0,children:[(0,r.jsx)(d.A,{className:"h-4 w-4"}),(0,r.jsx)("span",{className:"sr-only",children:"Page actions"})]})]})]}),(0,r.jsx)("h1",{ref:H,className:"mt-2 text-2xl font-semibold leading-tight tracking-tight outline-none md:text-[2rem] empty:before:content-['Untitled'] empty:before:text-text-muted",contentEditable:!0,suppressContentEditableWarning:!0,onInput:et,onKeyDown:es,spellCheck:!1,dir:"auto"}),(0,r.jsx)("div",{className:"mt-2 mb-4 md:mb-6",children:(0,r.jsx)(C,{filePath:s})})]}),(0,r.jsx)(a.Suspense,{fallback:(0,r.jsx)(m.L,{}),children:(0,r.jsx)(N,{initialContent:z,filePath:s,onSave:ea,onStatusChange:_,onWordCountChange:A,readOnly:!1},`${s}-${F}`)})]}),(0,r.jsx)(R,{status:I,wordCount:W,modified:L})]})}}},e=>{e.O(0,[330,7300,4559,6609,6094,5623,9075,5167,1178,8441,3794,7358],()=>e(e.s=1022)),_N_E=e.O()}]);