diffhub 0.1.15 → 0.1.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 (69) hide show
  1. package/.next/standalone/apps/cli/.next/BUILD_ID +1 -1
  2. package/.next/standalone/apps/cli/.next/build-manifest.json +6 -6
  3. package/.next/standalone/apps/cli/.next/prerender-manifest.json +3 -27
  4. package/.next/standalone/apps/cli/.next/server/app/_global-error/page/build-manifest.json +3 -3
  5. package/.next/standalone/apps/cli/.next/server/app/_global-error/page.js +4 -4
  6. package/.next/standalone/apps/cli/.next/server/app/_global-error/page.js.nft.json +1 -1
  7. package/.next/standalone/apps/cli/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  8. package/.next/standalone/apps/cli/.next/server/app/_global-error.html +1 -1
  9. package/.next/standalone/apps/cli/.next/server/app/_global-error.rsc +8 -8
  10. package/.next/standalone/apps/cli/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +2 -2
  11. package/.next/standalone/apps/cli/.next/server/app/_global-error.segments/_full.segment.rsc +8 -8
  12. package/.next/standalone/apps/cli/.next/server/app/_global-error.segments/_head.segment.rsc +4 -4
  13. package/.next/standalone/apps/cli/.next/server/app/_global-error.segments/_index.segment.rsc +3 -3
  14. package/.next/standalone/apps/cli/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  15. package/.next/standalone/apps/cli/.next/server/app/_not-found/page/build-manifest.json +3 -3
  16. package/.next/standalone/apps/cli/.next/server/app/_not-found/page.js +4 -4
  17. package/.next/standalone/apps/cli/.next/server/app/_not-found/page.js.nft.json +1 -1
  18. package/.next/standalone/apps/cli/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  19. package/.next/standalone/apps/cli/.next/server/app/_not-found.html +1 -1
  20. package/.next/standalone/apps/cli/.next/server/app/_not-found.rsc +11 -11
  21. package/.next/standalone/apps/cli/.next/server/app/_not-found.segments/_full.segment.rsc +11 -11
  22. package/.next/standalone/apps/cli/.next/server/app/_not-found.segments/_head.segment.rsc +4 -4
  23. package/.next/standalone/apps/cli/.next/server/app/_not-found.segments/_index.segment.rsc +6 -6
  24. package/.next/standalone/apps/cli/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +2 -2
  25. package/.next/standalone/apps/cli/.next/server/app/_not-found.segments/_not-found.segment.rsc +3 -3
  26. package/.next/standalone/apps/cli/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  27. package/.next/standalone/apps/cli/.next/server/app/page/build-manifest.json +3 -3
  28. package/.next/standalone/apps/cli/.next/server/app/page.js +5 -4
  29. package/.next/standalone/apps/cli/.next/server/app/page.js.nft.json +1 -1
  30. package/.next/standalone/apps/cli/.next/server/app/page_client-reference-manifest.js +1 -1
  31. package/.next/standalone/apps/cli/.next/server/chunks/_07nb1lf._.js +4 -8
  32. package/.next/standalone/apps/cli/.next/server/chunks/ssr/[root-of-the-server]__07_6rfl._.js +3 -0
  33. package/.next/standalone/apps/cli/.next/server/chunks/ssr/[root-of-the-server]__086fig-._.js +3 -0
  34. package/.next/standalone/apps/cli/.next/server/chunks/ssr/{[root-of-the-server]__008jek4._.js → [root-of-the-server]__0cr5gof._.js} +2 -2
  35. package/.next/standalone/apps/cli/.next/server/chunks/ssr/[root-of-the-server]__0fiikch._.js +3 -0
  36. package/.next/standalone/apps/cli/.next/server/chunks/ssr/{[root-of-the-server]__09z7o2x._.js → [root-of-the-server]__0tz4w46._.js} +2 -2
  37. package/.next/standalone/apps/cli/.next/server/chunks/ssr/_07okxca._.js +8 -12
  38. package/.next/standalone/apps/cli/.next/server/chunks/ssr/_13g0g_e._.js +6 -0
  39. package/.next/standalone/apps/cli/.next/server/chunks/ssr/node_modules_0sy8gnb._.js +3 -0
  40. package/.next/standalone/apps/cli/.next/server/middleware-build-manifest.js +6 -6
  41. package/.next/standalone/apps/cli/.next/server/pages/404.html +1 -1
  42. package/.next/standalone/apps/cli/.next/server/pages/500.html +1 -1
  43. package/.next/standalone/apps/cli/.next/server/server-reference-manifest.js +1 -1
  44. package/.next/standalone/apps/cli/.next/server/server-reference-manifest.json +1 -1
  45. package/.next/standalone/apps/cli/.next/static/chunks/{137rmjzihgq_3.js → 029-i5m87mr_j.js} +1 -1
  46. package/.next/standalone/apps/cli/.next/static/chunks/{0ubsc8e9~hk5c.js → 075fg87~fo-89.js} +1 -1
  47. package/.next/standalone/apps/cli/.next/static/chunks/{0ljspdd3cv1ft.js → 0ijev3dgvkfb8.js} +1 -1
  48. package/.next/standalone/apps/cli/.next/static/chunks/0j4udl9rut-37.css +3 -0
  49. package/.next/standalone/apps/cli/.next/static/chunks/0qozxk3in_yip.js +40 -0
  50. package/.next/standalone/apps/cli/.next/static/chunks/{turbopack-0pi8.kquhduc_.js → turbopack-0j~ashtj9wbn4.js} +1 -1
  51. package/.next/standalone/apps/cli/package.json +1 -1
  52. package/package.json +1 -1
  53. package/.next/standalone/apps/cli/.next/server/app/index.html +0 -1
  54. package/.next/standalone/apps/cli/.next/server/app/index.meta +0 -14
  55. package/.next/standalone/apps/cli/.next/server/app/index.rsc +0 -23
  56. package/.next/standalone/apps/cli/.next/server/app/index.segments/__PAGE__.segment.rsc +0 -6
  57. package/.next/standalone/apps/cli/.next/server/app/index.segments/_full.segment.rsc +0 -23
  58. package/.next/standalone/apps/cli/.next/server/app/index.segments/_head.segment.rsc +0 -6
  59. package/.next/standalone/apps/cli/.next/server/app/index.segments/_index.segment.rsc +0 -7
  60. package/.next/standalone/apps/cli/.next/server/app/index.segments/_tree.segment.rsc +0 -8
  61. package/.next/standalone/apps/cli/.next/server/chunks/ssr/[root-of-the-server]__0khx0sl._.js +0 -3
  62. package/.next/standalone/apps/cli/.next/server/chunks/ssr/[root-of-the-server]__0scy8dd._.js +0 -3
  63. package/.next/standalone/apps/cli/.next/server/chunks/ssr/[root-of-the-server]__10f61k2._.js +0 -3
  64. package/.next/standalone/apps/cli/.next/server/chunks/ssr/node_modules_0vtdjw7._.js +0 -3
  65. package/.next/standalone/apps/cli/.next/static/chunks/0gz~d56inmm7r.css +0 -3
  66. package/.next/standalone/apps/cli/.next/static/chunks/0o7sp50v_8vvk.js +0 -44
  67. /package/.next/standalone/apps/cli/.next/static/{teviHPRd1fKZyDaVtw6AK → 8rORhRJDOFN7qtGNAmPym}/_buildManifest.js +0 -0
  68. /package/.next/standalone/apps/cli/.next/static/{teviHPRd1fKZyDaVtw6AK → 8rORhRJDOFN7qtGNAmPym}/_clientMiddlewareManifest.js +0 -0
  69. /package/.next/standalone/apps/cli/.next/static/{teviHPRd1fKZyDaVtw6AK → 8rORhRJDOFN7qtGNAmPym}/_ssgManifest.js +0 -0
@@ -0,0 +1,40 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,55838,(e,t,r)=>{"use strict";var n=e.r(71645),o="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},i=n.useState,l=n.useEffect,s=n.useLayoutEffect,a=n.useDebugValue;function c(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!o(e,r)}catch(e){return!0}}var u="u"<typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var r=t(),n=i({inst:{value:r,getSnapshot:t}}),o=n[0].inst,u=n[1];return s(function(){o.value=r,o.getSnapshot=t,c(o)&&u({inst:o})},[e,r,t]),l(function(){return c(o)&&u({inst:o}),e(function(){c(o)&&u({inst:o})})},[e]),a(r),r};r.useSyncExternalStore=void 0!==n.useSyncExternalStore?n.useSyncExternalStore:u},2239,(e,t,r)=>{"use strict";t.exports=e.r(55838)},52822,(e,t,r)=>{"use strict";var n=e.r(71645),o=e.r(2239),i="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},l=o.useSyncExternalStore,s=n.useRef,a=n.useEffect,c=n.useMemo,u=n.useDebugValue;r.useSyncExternalStoreWithSelector=function(e,t,r,n,o){var d=s(null);if(null===d.current){var f={hasValue:!1,value:null};d.current=f}else f=d.current;var p=l(e,(d=c(function(){function e(e){if(!a){if(a=!0,l=e,e=n(e),void 0!==o&&f.hasValue){var t=f.value;if(o(t,e))return s=t}return s=e}if(t=s,i(l,e))return t;var r=n(e);return void 0!==o&&o(t,r)?(l=e,t):(l=e,s=r)}var l,s,a=!1,c=void 0===r?null:r;return[function(){return e(t())},null===c?void 0:function(){return e(c())}]},[t,r,n,o]))[0],d[1]);return a(function(){f.hasValue=!0,f.value=p},[p]),u(p),p}},30224,(e,t,r)=>{"use strict";t.exports=e.r(52822)},67585,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"BailoutToCSR",{enumerable:!0,get:function(){return o}});let n=e.r(32061);function o({reason:e,children:t}){if("u"<typeof window)throw Object.defineProperty(new n.BailoutToCSRError(e),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});return t}},9885,(e,t,r)=>{"use strict";function n(e){return e.split("/").map(e=>encodeURIComponent(e)).join("/")}Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"encodeURIPath",{enumerable:!0,get:function(){return n}})},52157,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"PreloadChunks",{enumerable:!0,get:function(){return a}});let n=e.r(43476),o=e.r(74080),i=e.r(95608),l=e.r(9885),s=e.r(43369);function a({moduleIds:e}){if("u">typeof window)return null;let t=i.workAsyncStorage.getStore();if(void 0===t)return null;let r=[];if(t.reactLoadableManifest&&e){let n=t.reactLoadableManifest;for(let t of e){if(!n[t])continue;let e=n[t].files;r.push(...e)}}if(0===r.length)return null;let c=(0,s.getAssetTokenQuery)();return(0,n.jsx)(n.Fragment,{children:r.map(e=>{let r=`${t.assetPrefix}/_next/${(0,l.encodeURIPath)(e)}${c}`;return e.endsWith(".css")?(0,n.jsx)("link",{precedence:"dynamic",href:r,rel:"stylesheet",as:"style",nonce:t.nonce},e):((0,o.preload)(r,{as:"script",fetchPriority:"low",nonce:t.nonce}),null)})})}},69093,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"default",{enumerable:!0,get:function(){return c}});let n=e.r(43476),o=e.r(71645),i=e.r(67585),l=e.r(52157);function s(e){return{default:e&&"default"in e?e.default:e}}let a={loader:()=>Promise.resolve(s(()=>null)),loading:null,ssr:!0},c=function(e){let t={...a,...e},r=(0,o.lazy)(()=>t.loader().then(s)),c=t.loading;function u(e){let s=c?(0,n.jsx)(c,{isLoading:!0,pastDelay:!0,error:null}):null,a=!t.ssr||!!t.loading,u=a?o.Suspense:o.Fragment,d=t.ssr?(0,n.jsxs)(n.Fragment,{children:["u"<typeof window?(0,n.jsx)(l.PreloadChunks,{moduleIds:t.modules}):null,(0,n.jsx)(r,{...e})]}):(0,n.jsx)(i.BailoutToCSR,{reason:"next/dynamic",children:(0,n.jsx)(r,{...e})});return(0,n.jsx)(u,{...a?{fallback:s}:{},children:d})}return u.displayName="LoadableComponent",u}},70703,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"default",{enumerable:!0,get:function(){return o}});let n=e.r(55682)._(e.r(69093));function o(e,t){let r={};"function"==typeof e&&(r.loader=e);let o={...r,...t};return(0,n.default)({...o,modules:o.loadableGenerated?.modules})}("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},93190,e=>{"use strict";let t,r,n;var o,i,l,s,a,c,u,d,f,p,m=e.i(43476),h=e.i(932),g=e.i(63178),b=e.i(71645);function v(e,t){let r=b.forwardRef(({color:e="currentColor",size:r=24,strokeWidth:n=2,...o},i)=>b.createElement(t,{ref:i,width:r,height:r,strokeWidth:n,color:e,...o}));return r.displayName=e,r}let x=v("CheckIcon",(0,b.forwardRef)((e,t)=>b.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,className:"lucide lucide-check",viewBox:"0 0 24 24",ref:t,...e},b.createElement("path",{d:"M20 6 9 17l-5-5"})))),y=v("ChevronDownIcon",(0,b.forwardRef)((e,t)=>b.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",ref:t,...e},b.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"m6 9.5 6 6 6-6"})))),w=v("CopySimpleIcon",(0,b.forwardRef)((e,t)=>b.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",viewBox:"0 0 24 24",ref:t,...e},b.createElement("rect",{width:11,height:11,x:9,y:9,stroke:"currentColor",strokeWidth:2,rx:2}),b.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 15H4c-1.1046 0-2-.8954-2-2V4c0-1.1046.8954-2 2-2h9c1.1046 0 2 .8954 2 2v1"})))),k=v("SunIcon",(0,b.forwardRef)((e,t)=>b.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",viewBox:"0 0 24 24",ref:t,...e},b.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 3V2m0 20v-1m6.3598-15.36.71-.71M4.9302 19.07l.71-.71M21 12h1M2 12h1m15.3598 6.36.71.71M4.9302 4.93l.71.71m9.8953 2.8245c1.9527 1.9526 1.9527 5.1184 0 7.071-1.9526 1.9527-5.1184 1.9527-7.071 0-1.9526-1.9526-1.9526-5.1184 0-7.071s5.1184-1.9526 7.071 0"})))),S=v("MoonIcon",(0,b.forwardRef)((e,t)=>b.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",viewBox:"0 0 24 24",ref:t,...e},b.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M20.9638 12.7674c-1.1277.7773-2.4945 1.2324-3.9677 1.2324-3.866 0-7-3.1341-7-7 0-1.4731.455-2.84 1.2322-3.9676C6.6191 3.4228 3 7.2877 3 11.998c0 4.9695 4.0286 8.9981 8.9981 8.9981 4.7103 0 8.5753-3.6193 8.9657-8.2286"})))),E=v("SplitIcon",(0,b.forwardRef)((e,t)=>b.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",viewBox:"0 0 24 24",ref:t,...e},b.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 3v18M8 5H6C4.3431 5 3 6.3431 3 8v8c0 1.6569 1.3431 3 3 3h2m8 0h2c1.6569 0 3-1.3431 3-3V8c0-1.6569-1.3431-3-3-3h-2"})))),C=v("ArrowRightIcon",(0,b.forwardRef)((e,t)=>b.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,className:"lucide lucide-arrow-right",viewBox:"0 0 24 24",ref:t,...e},b.createElement("path",{d:"M5 12h14M12 5l7 7-7 7"}))));function j(e,t){return e&&!t?e:!e&&t?t:e||t?{...e,...t}:void 0}let R={};function T(e,t,r,n,o){let i={...P(e,R)};return t&&(i=N(i,t)),r&&(i=N(i,r)),n&&(i=N(i,n)),o&&(i=N(i,o)),i}function N(e,t){return O(t)?t(e):function(e,t){if(!t)return e;for(let r in t){let n=t[r];switch(r){case"style":e[r]=j(e.style,n);break;case"className":e[r]=L(e.className,n);break;default:!function(e,t){let r=e.charCodeAt(0),n=e.charCodeAt(1),o=e.charCodeAt(2);return 111===r&&110===n&&o>=65&&o<=90&&("function"==typeof t||void 0===t)}(r,n)?e[r]=n:e[r]=function(e,t){return t?e?r=>{var n;if(null!=(n=r)&&"object"==typeof n&&"nativeEvent"in n){M(r);let n=t(r);return r.baseUIHandlerPrevented||e?.(r),n}let o=t(r);return e?.(r),o}:t:e}(e[r],n)}}return e}(e,t)}function O(e){return"function"==typeof e}function P(e,t){return O(e)?e(t):e??R}function M(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function L(e,t){return t?e?t+" "+e:t:e}e.i(47167);let A=function(e,...t){let r=new URL("https://base-ui.com/production-error");return r.searchParams.set("code",e.toString()),t.forEach(e=>r.searchParams.append("args[]",e)),`Base UI error #${e}; visit ${r} for the full message.`},z={};function I(e,t){let r=b.useRef(z);return r.current===z&&(r.current=e(t)),r}function D(e,t,r,n){var o,i,l,s,a;let c=I(_).current;return o=c,i=e,l=t,s=r,a=n,(o.refs[0]!==i||o.refs[1]!==l||o.refs[2]!==s||o.refs[3]!==a)&&$(c,[e,t,r,n]),c.callback}function _(){return{callback:null,cleanup:null,refs:[]}}function $(e,t){if(e.refs=t,t.every(e=>null==e)){e.callback=null;return}e.callback=r=>{if(e.cleanup&&(e.cleanup(),e.cleanup=null),null!=r){let n=Array(t.length).fill(null);for(let e=0;e<t.length;e+=1){let o=t[e];if(null!=o)switch(typeof o){case"function":{let t=o(r);"function"==typeof t&&(n[e]=t);break}case"object":o.current=r}}e.cleanup=()=>{for(let e=0;e<t.length;e+=1){let r=t[e];if(null!=r)switch(typeof r){case"function":{let t=n[e];"function"==typeof t?t():r(null);break}case"object":r.current=null}}}}}}let B=parseInt(b.version,10);function F(e){if(!b.isValidElement(e))return null;let t=e.props;return(B>=19?t?.ref:e.ref)??null}function H(){}Object.freeze([]);let W=Object.freeze({});function V(e,t,r={}){let n=t.render,o=function(e,t={}){var r,n,o;let{className:i,style:l,render:s}=e,{state:a=W,ref:c,props:u,stateAttributesMapping:d,enabled:f=!0}=t,p=f?"function"==typeof i?i(a):i:void 0,m=f?"function"==typeof l?l(a):l:void 0,h=f?function(e,t){let r={};for(let n in e){let o=e[n];if(t?.hasOwnProperty(n)){let e=t[n](o);null!=e&&Object.assign(r,e);continue}!0===o?r[`data-${n.toLowerCase()}`]="":o&&(r[`data-${n.toLowerCase()}`]=o.toString())}return r}(a,d):W,g=f?j(h,Array.isArray(u)?function(e){if(0===e.length)return R;if(1===e.length)return P(e[0],R);let t={...P(e[0],R)};for(let r=1;r<e.length;r+=1)t=N(t,e[r]);return t}(u):u)??W:W;if("u">typeof document)if(f)if(Array.isArray(c)){let e;r=[g.ref,F(s),...c],n=e=I(_).current,o=r,(n.refs.length!==o.length||n.refs.some((e,t)=>e!==o[t]))&&$(e,r),g.ref=e.callback}else g.ref=D(g.ref,F(s),c);else D(null,null);return f?(void 0!==p&&(g.className=L(g.className,p)),void 0!==m&&(g.style=j(g.style,m)),g):W}(t,r);return!1===r.enabled?null:function(e,t,r,n){if(t){if("function"==typeof t)return t(r,n);let e=T(r,t.props);e.ref=r.ref;let o=t;return o?.$$typeof===U&&(o=b.Children.toArray(t)[0]),b.cloneElement(o,e)}if(e&&"string"==typeof e){var o,i;return o=e,i=r,"button"===o?(0,b.createElement)("button",{type:"button",...i,key:i.key}):"img"===o?(0,b.createElement)("img",{alt:"",...i,key:i.key}):b.createElement(o,i)}throw Error(A(8))}(e,n,o,r.state??W)}let U=Symbol.for("react.lazy");function q(e){return V(e.defaultTagName??"div",e,e)}function K(){for(var e,t,r=0,n="",o=arguments.length;r<o;r++)(e=arguments[r])&&(t=function e(t){var r,n,o="";if("string"==typeof t||"number"==typeof t)o+=t;else if("object"==typeof t)if(Array.isArray(t)){var i=t.length;for(r=0;r<i;r++)t[r]&&(n=e(t[r]))&&(o&&(o+=" "),o+=n)}else for(n in t)t[n]&&(o&&(o+=" "),o+=n);return o}(e))&&(n&&(n+=" "),n+=t);return n}let X=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,Y=(e,t)=>r=>{var n;if((null==t?void 0:t.variants)==null)return K(e,null==r?void 0:r.class,null==r?void 0:r.className);let{variants:o,defaultVariants:i}=t,l=Object.keys(o).map(e=>{let t=null==r?void 0:r[e],n=null==i?void 0:i[e];if(null===t)return null;let l=X(t)||X(n);return o[e][l]}),s=r&&Object.entries(r).reduce((e,t)=>{let[r,n]=t;return void 0===n||(e[r]=n),e},{});return K(e,l,null==t||null==(n=t.compoundVariants)?void 0:n.reduce((e,t)=>{let{class:r,className:n,...o}=t;return Object.entries(o).every(e=>{let[t,r]=e;return Array.isArray(r)?r.includes({...i,...s}[t]):({...i,...s})[t]===r})?[...e,r,n]:e},[]),null==r?void 0:r.class,null==r?void 0:r.className)},G=(e=new Map,t=null,r)=>({nextPart:e,validators:t,classGroupId:r}),Z=[],J=(e,t,r)=>{if(0==e.length-t)return r.classGroupId;let n=e[t],o=r.nextPart.get(n);if(o){let r=J(e,t+1,o);if(r)return r}let i=r.validators;if(null===i)return;let l=0===t?e.join("-"):e.slice(t).join("-"),s=i.length;for(let e=0;e<s;e++){let t=i[e];if(t.validator(l))return t.classGroupId}},Q=(e,t)=>{let r=G();for(let n in e)ee(e[n],r,n,t);return r},ee=(e,t,r,n)=>{let o=e.length;for(let i=0;i<o;i++)et(e[i],t,r,n)},et=(e,t,r,n)=>{"string"==typeof e?er(e,t,r):"function"==typeof e?en(e,t,r,n):eo(e,t,r,n)},er=(e,t,r)=>{(""===e?t:ei(t,e)).classGroupId=r},en=(e,t,r,n)=>{el(e)?ee(e(n),t,r,n):(null===t.validators&&(t.validators=[]),t.validators.push({classGroupId:r,validator:e}))},eo=(e,t,r,n)=>{let o=Object.entries(e),i=o.length;for(let e=0;e<i;e++){let[i,l]=o[e];ee(l,ei(t,i),r,n)}},ei=(e,t)=>{let r=e,n=t.split("-"),o=n.length;for(let e=0;e<o;e++){let t=n[e],o=r.nextPart.get(t);o||(o=G(),r.nextPart.set(t,o)),r=o}return r},el=e=>"isThemeGetter"in e&&!0===e.isThemeGetter,es=[],ea=(e,t,r,n,o)=>({modifiers:e,hasImportantModifier:t,baseClassName:r,maybePostfixModifierPosition:n,isExternal:o}),ec=/\s+/,eu=e=>{let t;if("string"==typeof e)return e;let r="";for(let n=0;n<e.length;n++)e[n]&&(t=eu(e[n]))&&(r&&(r+=" "),r+=t);return r},ed=[],ef=e=>{let t=t=>t[e]||ed;return t.isThemeGetter=!0,t},ep=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,em=/^\((?:(\w[\w-]*):)?(.+)\)$/i,eh=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,eg=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,eb=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,ev=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,ex=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,ey=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ew=e=>eh.test(e),ek=e=>!!e&&!Number.isNaN(Number(e)),eS=e=>!!e&&Number.isInteger(Number(e)),eE=e=>e.endsWith("%")&&ek(e.slice(0,-1)),eC=e=>eg.test(e),ej=()=>!0,eR=e=>eb.test(e)&&!ev.test(e),eT=()=>!1,eN=e=>ex.test(e),eO=e=>ey.test(e),eP=e=>!eL(e)&&!eF(e),eM=e=>eY(e,eQ,eT),eL=e=>ep.test(e),eA=e=>eY(e,e0,eR),ez=e=>eY(e,e1,ek),eI=e=>eY(e,e5,ej),eD=e=>eY(e,e2,eT),e_=e=>eY(e,eZ,eT),e$=e=>eY(e,eJ,eO),eB=e=>eY(e,e3,eN),eF=e=>em.test(e),eH=e=>eG(e,e0),eW=e=>eG(e,e2),eV=e=>eG(e,eZ),eU=e=>eG(e,eQ),eq=e=>eG(e,eJ),eK=e=>eG(e,e3,!0),eX=e=>eG(e,e5,!0),eY=(e,t,r)=>{let n=ep.exec(e);return!!n&&(n[1]?t(n[1]):r(n[2]))},eG=(e,t,r=!1)=>{let n=em.exec(e);return!!n&&(n[1]?t(n[1]):r)},eZ=e=>"position"===e||"percentage"===e,eJ=e=>"image"===e||"url"===e,eQ=e=>"length"===e||"size"===e||"bg-size"===e,e0=e=>"length"===e,e1=e=>"number"===e,e2=e=>"family-name"===e,e5=e=>"number"===e||"weight"===e,e3=e=>"shadow"===e,e4=((e,...t)=>{let r,n,o,i,l=e=>{let t=n(e);if(t)return t;let i=((e,t)=>{let{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:o,sortModifiers:i}=t,l=[],s=e.trim().split(ec),a="";for(let e=s.length-1;e>=0;e-=1){let t=s[e],{isExternal:c,modifiers:u,hasImportantModifier:d,baseClassName:f,maybePostfixModifierPosition:p}=r(t);if(c){a=t+(a.length>0?" "+a:a);continue}let m=!!p,h=n(m?f.substring(0,p):f);if(!h){if(!m||!(h=n(f))){a=t+(a.length>0?" "+a:a);continue}m=!1}let g=0===u.length?"":1===u.length?u[0]:i(u).join(":"),b=d?g+"!":g,v=b+h;if(l.indexOf(v)>-1)continue;l.push(v);let x=o(h,m);for(let e=0;e<x.length;++e){let t=x[e];l.push(b+t)}a=t+(a.length>0?" "+a:a)}return a})(e,r);return o(e,i),i};return i=s=>{var a;let c;return n=(r={cache:(e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,r=Object.create(null),n=Object.create(null),o=(o,i)=>{r[o]=i,++t>e&&(t=0,n=r,r=Object.create(null))};return{get(e){let t=r[e];return void 0!==t?t:void 0!==(t=n[e])?(o(e,t),t):void 0},set(e,t){e in r?r[e]=t:o(e,t)}}})((a=t.reduce((e,t)=>t(e),e())).cacheSize),parseClassName:(e=>{let{prefix:t,experimentalParseClassName:r}=e,n=e=>{let t,r=[],n=0,o=0,i=0,l=e.length;for(let s=0;s<l;s++){let l=e[s];if(0===n&&0===o){if(":"===l){r.push(e.slice(i,s)),i=s+1;continue}if("/"===l){t=s;continue}}"["===l?n++:"]"===l?n--:"("===l?o++:")"===l&&o--}let s=0===r.length?e:e.slice(i),a=s,c=!1;return s.endsWith("!")?(a=s.slice(0,-1),c=!0):s.startsWith("!")&&(a=s.slice(1),c=!0),ea(r,c,a,t&&t>i?t-i:void 0)};if(t){let e=t+":",r=n;n=t=>t.startsWith(e)?r(t.slice(e.length)):ea(es,!1,t,void 0,!0)}if(r){let e=n;n=t=>r({className:t,parseClassName:e})}return n})(a),sortModifiers:(c=new Map,a.orderSensitiveModifiers.forEach((e,t)=>{c.set(e,1e6+t)}),e=>{let t=[],r=[];for(let n=0;n<e.length;n++){let o=e[n],i="["===o[0],l=c.has(o);i||l?(r.length>0&&(r.sort(),t.push(...r),r=[]),t.push(o)):r.push(o)}return r.length>0&&(r.sort(),t.push(...r)),t}),...(e=>{let t=(e=>{let{theme:t,classGroups:r}=e;return Q(r,t)})(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:e=>{if(e.startsWith("[")&&e.endsWith("]")){var r;let t,n,o;return -1===(r=e).slice(1,-1).indexOf(":")?void 0:(n=(t=r.slice(1,-1)).indexOf(":"),(o=t.slice(0,n))?"arbitrary.."+o:void 0)}let n=e.split("-"),o=+(""===n[0]&&n.length>1);return J(n,o,t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=n[e],o=r[e];if(t){if(o){let e=Array(o.length+t.length);for(let t=0;t<o.length;t++)e[t]=o[t];for(let r=0;r<t.length;r++)e[o.length+r]=t[r];return e}return t}return o||Z}return r[e]||Z}}})(a)}).cache.get,o=r.cache.set,i=l,l(s)},(...e)=>i(((...e)=>{let t,r,n=0,o="";for(;n<e.length;)(t=e[n++])&&(r=eu(t))&&(o&&(o+=" "),o+=r);return o})(...e))})(()=>{let e=ef("color"),t=ef("font"),r=ef("text"),n=ef("font-weight"),o=ef("tracking"),i=ef("leading"),l=ef("breakpoint"),s=ef("container"),a=ef("spacing"),c=ef("radius"),u=ef("shadow"),d=ef("inset-shadow"),f=ef("text-shadow"),p=ef("drop-shadow"),m=ef("blur"),h=ef("perspective"),g=ef("aspect"),b=ef("ease"),v=ef("animate"),x=()=>["auto","avoid","all","avoid-page","page","left","right","column"],y=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],w=()=>[...y(),eF,eL],k=()=>["auto","hidden","clip","visible","scroll"],S=()=>["auto","contain","none"],E=()=>[eF,eL,a],C=()=>[ew,"full","auto",...E()],j=()=>[eS,"none","subgrid",eF,eL],R=()=>["auto",{span:["full",eS,eF,eL]},eS,eF,eL],T=()=>[eS,"auto",eF,eL],N=()=>["auto","min","max","fr",eF,eL],O=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],P=()=>["start","end","center","stretch","center-safe","end-safe"],M=()=>["auto",...E()],L=()=>[ew,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...E()],A=()=>[ew,"screen","full","dvw","lvw","svw","min","max","fit",...E()],z=()=>[ew,"screen","full","lh","dvh","lvh","svh","min","max","fit",...E()],I=()=>[e,eF,eL],D=()=>[...y(),eV,e_,{position:[eF,eL]}],_=()=>["no-repeat",{repeat:["","x","y","space","round"]}],$=()=>["auto","cover","contain",eU,eM,{size:[eF,eL]}],B=()=>[eE,eH,eA],F=()=>["","none","full",c,eF,eL],H=()=>["",ek,eH,eA],W=()=>["solid","dashed","dotted","double"],V=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],U=()=>[ek,eE,eV,e_],q=()=>["","none",m,eF,eL],K=()=>["none",ek,eF,eL],X=()=>["none",ek,eF,eL],Y=()=>[ek,eF,eL],G=()=>[ew,"full",...E()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[eC],breakpoint:[eC],color:[ej],container:[eC],"drop-shadow":[eC],ease:["in","out","in-out"],font:[eP],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[eC],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[eC],shadow:[eC],spacing:["px",ek],text:[eC],"text-shadow":[eC],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",ew,eL,eF,g]}],container:["container"],columns:[{columns:[ek,eL,eF,s]}],"break-after":[{"break-after":x()}],"break-before":[{"break-before":x()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:w()}],overflow:[{overflow:k()}],"overflow-x":[{"overflow-x":k()}],"overflow-y":[{"overflow-y":k()}],overscroll:[{overscroll:S()}],"overscroll-x":[{"overscroll-x":S()}],"overscroll-y":[{"overscroll-y":S()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:C()}],"inset-x":[{"inset-x":C()}],"inset-y":[{"inset-y":C()}],start:[{"inset-s":C(),start:C()}],end:[{"inset-e":C(),end:C()}],"inset-bs":[{"inset-bs":C()}],"inset-be":[{"inset-be":C()}],top:[{top:C()}],right:[{right:C()}],bottom:[{bottom:C()}],left:[{left:C()}],visibility:["visible","invisible","collapse"],z:[{z:[eS,"auto",eF,eL]}],basis:[{basis:[ew,"full","auto",s,...E()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[ek,ew,"auto","initial","none",eL]}],grow:[{grow:["",ek,eF,eL]}],shrink:[{shrink:["",ek,eF,eL]}],order:[{order:[eS,"first","last","none",eF,eL]}],"grid-cols":[{"grid-cols":j()}],"col-start-end":[{col:R()}],"col-start":[{"col-start":T()}],"col-end":[{"col-end":T()}],"grid-rows":[{"grid-rows":j()}],"row-start-end":[{row:R()}],"row-start":[{"row-start":T()}],"row-end":[{"row-end":T()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":N()}],"auto-rows":[{"auto-rows":N()}],gap:[{gap:E()}],"gap-x":[{"gap-x":E()}],"gap-y":[{"gap-y":E()}],"justify-content":[{justify:[...O(),"normal"]}],"justify-items":[{"justify-items":[...P(),"normal"]}],"justify-self":[{"justify-self":["auto",...P()]}],"align-content":[{content:["normal",...O()]}],"align-items":[{items:[...P(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...P(),{baseline:["","last"]}]}],"place-content":[{"place-content":O()}],"place-items":[{"place-items":[...P(),"baseline"]}],"place-self":[{"place-self":["auto",...P()]}],p:[{p:E()}],px:[{px:E()}],py:[{py:E()}],ps:[{ps:E()}],pe:[{pe:E()}],pbs:[{pbs:E()}],pbe:[{pbe:E()}],pt:[{pt:E()}],pr:[{pr:E()}],pb:[{pb:E()}],pl:[{pl:E()}],m:[{m:M()}],mx:[{mx:M()}],my:[{my:M()}],ms:[{ms:M()}],me:[{me:M()}],mbs:[{mbs:M()}],mbe:[{mbe:M()}],mt:[{mt:M()}],mr:[{mr:M()}],mb:[{mb:M()}],ml:[{ml:M()}],"space-x":[{"space-x":E()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":E()}],"space-y-reverse":["space-y-reverse"],size:[{size:L()}],"inline-size":[{inline:["auto",...A()]}],"min-inline-size":[{"min-inline":["auto",...A()]}],"max-inline-size":[{"max-inline":["none",...A()]}],"block-size":[{block:["auto",...z()]}],"min-block-size":[{"min-block":["auto",...z()]}],"max-block-size":[{"max-block":["none",...z()]}],w:[{w:[s,"screen",...L()]}],"min-w":[{"min-w":[s,"screen","none",...L()]}],"max-w":[{"max-w":[s,"screen","none","prose",{screen:[l]},...L()]}],h:[{h:["screen","lh",...L()]}],"min-h":[{"min-h":["screen","lh","none",...L()]}],"max-h":[{"max-h":["screen","lh",...L()]}],"font-size":[{text:["base",r,eH,eA]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,eX,eI]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",eE,eL]}],"font-family":[{font:[eW,eD,t]}],"font-features":[{"font-features":[eL]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[o,eF,eL]}],"line-clamp":[{"line-clamp":[ek,"none",eF,ez]}],leading:[{leading:[i,...E()]}],"list-image":[{"list-image":["none",eF,eL]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",eF,eL]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:I()}],"text-color":[{text:I()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...W(),"wavy"]}],"text-decoration-thickness":[{decoration:[ek,"from-font","auto",eF,eA]}],"text-decoration-color":[{decoration:I()}],"underline-offset":[{"underline-offset":[ek,"auto",eF,eL]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:E()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",eF,eL]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",eF,eL]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:D()}],"bg-repeat":[{bg:_()}],"bg-size":[{bg:$()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},eS,eF,eL],radial:["",eF,eL],conic:[eS,eF,eL]},eq,e$]}],"bg-color":[{bg:I()}],"gradient-from-pos":[{from:B()}],"gradient-via-pos":[{via:B()}],"gradient-to-pos":[{to:B()}],"gradient-from":[{from:I()}],"gradient-via":[{via:I()}],"gradient-to":[{to:I()}],rounded:[{rounded:F()}],"rounded-s":[{"rounded-s":F()}],"rounded-e":[{"rounded-e":F()}],"rounded-t":[{"rounded-t":F()}],"rounded-r":[{"rounded-r":F()}],"rounded-b":[{"rounded-b":F()}],"rounded-l":[{"rounded-l":F()}],"rounded-ss":[{"rounded-ss":F()}],"rounded-se":[{"rounded-se":F()}],"rounded-ee":[{"rounded-ee":F()}],"rounded-es":[{"rounded-es":F()}],"rounded-tl":[{"rounded-tl":F()}],"rounded-tr":[{"rounded-tr":F()}],"rounded-br":[{"rounded-br":F()}],"rounded-bl":[{"rounded-bl":F()}],"border-w":[{border:H()}],"border-w-x":[{"border-x":H()}],"border-w-y":[{"border-y":H()}],"border-w-s":[{"border-s":H()}],"border-w-e":[{"border-e":H()}],"border-w-bs":[{"border-bs":H()}],"border-w-be":[{"border-be":H()}],"border-w-t":[{"border-t":H()}],"border-w-r":[{"border-r":H()}],"border-w-b":[{"border-b":H()}],"border-w-l":[{"border-l":H()}],"divide-x":[{"divide-x":H()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":H()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...W(),"hidden","none"]}],"divide-style":[{divide:[...W(),"hidden","none"]}],"border-color":[{border:I()}],"border-color-x":[{"border-x":I()}],"border-color-y":[{"border-y":I()}],"border-color-s":[{"border-s":I()}],"border-color-e":[{"border-e":I()}],"border-color-bs":[{"border-bs":I()}],"border-color-be":[{"border-be":I()}],"border-color-t":[{"border-t":I()}],"border-color-r":[{"border-r":I()}],"border-color-b":[{"border-b":I()}],"border-color-l":[{"border-l":I()}],"divide-color":[{divide:I()}],"outline-style":[{outline:[...W(),"none","hidden"]}],"outline-offset":[{"outline-offset":[ek,eF,eL]}],"outline-w":[{outline:["",ek,eH,eA]}],"outline-color":[{outline:I()}],shadow:[{shadow:["","none",u,eK,eB]}],"shadow-color":[{shadow:I()}],"inset-shadow":[{"inset-shadow":["none",d,eK,eB]}],"inset-shadow-color":[{"inset-shadow":I()}],"ring-w":[{ring:H()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:I()}],"ring-offset-w":[{"ring-offset":[ek,eA]}],"ring-offset-color":[{"ring-offset":I()}],"inset-ring-w":[{"inset-ring":H()}],"inset-ring-color":[{"inset-ring":I()}],"text-shadow":[{"text-shadow":["none",f,eK,eB]}],"text-shadow-color":[{"text-shadow":I()}],opacity:[{opacity:[ek,eF,eL]}],"mix-blend":[{"mix-blend":[...V(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":V()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[ek]}],"mask-image-linear-from-pos":[{"mask-linear-from":U()}],"mask-image-linear-to-pos":[{"mask-linear-to":U()}],"mask-image-linear-from-color":[{"mask-linear-from":I()}],"mask-image-linear-to-color":[{"mask-linear-to":I()}],"mask-image-t-from-pos":[{"mask-t-from":U()}],"mask-image-t-to-pos":[{"mask-t-to":U()}],"mask-image-t-from-color":[{"mask-t-from":I()}],"mask-image-t-to-color":[{"mask-t-to":I()}],"mask-image-r-from-pos":[{"mask-r-from":U()}],"mask-image-r-to-pos":[{"mask-r-to":U()}],"mask-image-r-from-color":[{"mask-r-from":I()}],"mask-image-r-to-color":[{"mask-r-to":I()}],"mask-image-b-from-pos":[{"mask-b-from":U()}],"mask-image-b-to-pos":[{"mask-b-to":U()}],"mask-image-b-from-color":[{"mask-b-from":I()}],"mask-image-b-to-color":[{"mask-b-to":I()}],"mask-image-l-from-pos":[{"mask-l-from":U()}],"mask-image-l-to-pos":[{"mask-l-to":U()}],"mask-image-l-from-color":[{"mask-l-from":I()}],"mask-image-l-to-color":[{"mask-l-to":I()}],"mask-image-x-from-pos":[{"mask-x-from":U()}],"mask-image-x-to-pos":[{"mask-x-to":U()}],"mask-image-x-from-color":[{"mask-x-from":I()}],"mask-image-x-to-color":[{"mask-x-to":I()}],"mask-image-y-from-pos":[{"mask-y-from":U()}],"mask-image-y-to-pos":[{"mask-y-to":U()}],"mask-image-y-from-color":[{"mask-y-from":I()}],"mask-image-y-to-color":[{"mask-y-to":I()}],"mask-image-radial":[{"mask-radial":[eF,eL]}],"mask-image-radial-from-pos":[{"mask-radial-from":U()}],"mask-image-radial-to-pos":[{"mask-radial-to":U()}],"mask-image-radial-from-color":[{"mask-radial-from":I()}],"mask-image-radial-to-color":[{"mask-radial-to":I()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":y()}],"mask-image-conic-pos":[{"mask-conic":[ek]}],"mask-image-conic-from-pos":[{"mask-conic-from":U()}],"mask-image-conic-to-pos":[{"mask-conic-to":U()}],"mask-image-conic-from-color":[{"mask-conic-from":I()}],"mask-image-conic-to-color":[{"mask-conic-to":I()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:D()}],"mask-repeat":[{mask:_()}],"mask-size":[{mask:$()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",eF,eL]}],filter:[{filter:["","none",eF,eL]}],blur:[{blur:q()}],brightness:[{brightness:[ek,eF,eL]}],contrast:[{contrast:[ek,eF,eL]}],"drop-shadow":[{"drop-shadow":["","none",p,eK,eB]}],"drop-shadow-color":[{"drop-shadow":I()}],grayscale:[{grayscale:["",ek,eF,eL]}],"hue-rotate":[{"hue-rotate":[ek,eF,eL]}],invert:[{invert:["",ek,eF,eL]}],saturate:[{saturate:[ek,eF,eL]}],sepia:[{sepia:["",ek,eF,eL]}],"backdrop-filter":[{"backdrop-filter":["","none",eF,eL]}],"backdrop-blur":[{"backdrop-blur":q()}],"backdrop-brightness":[{"backdrop-brightness":[ek,eF,eL]}],"backdrop-contrast":[{"backdrop-contrast":[ek,eF,eL]}],"backdrop-grayscale":[{"backdrop-grayscale":["",ek,eF,eL]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[ek,eF,eL]}],"backdrop-invert":[{"backdrop-invert":["",ek,eF,eL]}],"backdrop-opacity":[{"backdrop-opacity":[ek,eF,eL]}],"backdrop-saturate":[{"backdrop-saturate":[ek,eF,eL]}],"backdrop-sepia":[{"backdrop-sepia":["",ek,eF,eL]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":E()}],"border-spacing-x":[{"border-spacing-x":E()}],"border-spacing-y":[{"border-spacing-y":E()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",eF,eL]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[ek,"initial",eF,eL]}],ease:[{ease:["linear","initial",b,eF,eL]}],delay:[{delay:[ek,eF,eL]}],animate:[{animate:["none",v,eF,eL]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[h,eF,eL]}],"perspective-origin":[{"perspective-origin":w()}],rotate:[{rotate:K()}],"rotate-x":[{"rotate-x":K()}],"rotate-y":[{"rotate-y":K()}],"rotate-z":[{"rotate-z":K()}],scale:[{scale:X()}],"scale-x":[{"scale-x":X()}],"scale-y":[{"scale-y":X()}],"scale-z":[{"scale-z":X()}],"scale-3d":["scale-3d"],skew:[{skew:Y()}],"skew-x":[{"skew-x":Y()}],"skew-y":[{"skew-y":Y()}],transform:[{transform:[eF,eL,"","none","gpu","cpu"]}],"transform-origin":[{origin:w()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:G()}],"translate-x":[{"translate-x":G()}],"translate-y":[{"translate-y":G()}],"translate-z":[{"translate-z":G()}],"translate-none":["translate-none"],accent:[{accent:I()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:I()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",eF,eL]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":E()}],"scroll-mx":[{"scroll-mx":E()}],"scroll-my":[{"scroll-my":E()}],"scroll-ms":[{"scroll-ms":E()}],"scroll-me":[{"scroll-me":E()}],"scroll-mbs":[{"scroll-mbs":E()}],"scroll-mbe":[{"scroll-mbe":E()}],"scroll-mt":[{"scroll-mt":E()}],"scroll-mr":[{"scroll-mr":E()}],"scroll-mb":[{"scroll-mb":E()}],"scroll-ml":[{"scroll-ml":E()}],"scroll-p":[{"scroll-p":E()}],"scroll-px":[{"scroll-px":E()}],"scroll-py":[{"scroll-py":E()}],"scroll-ps":[{"scroll-ps":E()}],"scroll-pe":[{"scroll-pe":E()}],"scroll-pbs":[{"scroll-pbs":E()}],"scroll-pbe":[{"scroll-pbe":E()}],"scroll-pt":[{"scroll-pt":E()}],"scroll-pr":[{"scroll-pr":E()}],"scroll-pb":[{"scroll-pb":E()}],"scroll-pl":[{"scroll-pl":E()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",eF,eL]}],fill:[{fill:["none",...I()]}],"stroke-w":[{stroke:[ek,eH,eA,ez]}],stroke:[{stroke:["none",...I()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}}),e6=(e,t=4)=>{let r=e.split("/");if(r.length<=t)return e;let n=r.at(-1)??"",o=r.at(-2)??"";return`${r[0]}/…/${o}/${n}`},e7=Y("group/button inline-flex shrink-0 select-none items-center justify-center whitespace-nowrap rounded-lg border border-transparent bg-clip-padding font-sans font-medium text-sm outline-none transition-[color,background-color,border-color,box-shadow,opacity,transform] duration-150 ease-out focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/50 focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-45 aria-disabled:pointer-events-none aria-disabled:cursor-not-allowed aria-disabled:opacity-45 aria-invalid:border-destructive aria-invalid:ring-2 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",{defaultVariants:{size:"default",variant:"default"},variants:{size:{default:"h-10 gap-1.5 px-3 has-data-[icon=inline-end]:pr-2.5 has-data-[icon=inline-start]:pl-2.5",icon:"size-10","icon-lg":"size-11","icon-sm":"size-9 in-data-[slot=button-group]:rounded-lg rounded-[min(var(--radius-md),12px)]","icon-xs":"size-8 in-data-[slot=button-group]:rounded-lg rounded-[min(var(--radius-md),10px)] [&_svg:not([class*='size-'])]:size-3",input:"h-[var(--field-height)] gap-2 rounded-[var(--field-radius)] px-[var(--field-padding-x)] py-[var(--field-padding-y)]","input-sm":"h-[var(--field-height-sm)] gap-2 rounded-[var(--field-radius)] px-[var(--field-padding-x)] py-[var(--field-padding-y)]",lg:"h-11 gap-1.5 px-4 has-data-[icon=inline-end]:pr-3.5 has-data-[icon=inline-start]:pl-3.5",sm:"h-9 gap-1 in-data-[slot=button-group]:rounded-lg rounded-[min(var(--radius-md),12px)] px-3 text-[0.8rem] has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2 [&_svg:not([class*='size-'])]:size-3.5",xs:"h-8 gap-1 in-data-[slot=button-group]:rounded-lg rounded-[min(var(--radius-md),10px)] px-2.5 text-xs has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2 [&_svg:not([class*='size-'])]:size-3"},variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90 active:bg-primary/95 aria-pressed:bg-primary/95",destructive:"bg-red-600 text-white hover:bg-red-700 focus-visible:border-red-600 focus-visible:ring-red-500/30 active:bg-red-800 aria-pressed:bg-red-800 dark:bg-red-500 dark:aria-pressed:bg-red-300 dark:active:bg-red-300 dark:hover:bg-red-400",destructiveSecondary:"border-red-200 text-red-700 hover:bg-red-50 active:bg-red-100 aria-pressed:bg-red-100 dark:border-red-800 dark:text-red-300 dark:aria-pressed:bg-red-950 dark:active:bg-red-950 dark:hover:bg-red-950/60",ghost:"hover:bg-muted hover:text-foreground active:bg-muted/80 aria-pressed:bg-muted/80 dark:aria-pressed:bg-muted/60 dark:active:bg-muted/60 dark:hover:bg-muted/50",input:"border-input bg-card font-normal font-sans text-base text-foreground leading-snug shadow-input hover:border-input-hover focus-visible:ring-2 focus-visible:ring-ring/15 focus-visible:ring-offset-1 focus-visible:ring-offset-background active:border-input-hover/80 aria-pressed:border-input-hover aria-invalid:border-destructive-foreground data-[placeholder]:text-placeholder-foreground",link:"text-primary underline-offset-4 hover:underline active:opacity-80 aria-pressed:underline aria-pressed:opacity-80",outline:"border-border bg-background hover:bg-muted hover:text-foreground active:bg-muted/80 aria-expanded:bg-muted aria-pressed:bg-muted/80 dark:border-input dark:bg-input/30 dark:aria-pressed:bg-input/60 dark:active:bg-input/60 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/85 active:bg-secondary/75 aria-expanded:bg-secondary aria-pressed:bg-secondary/75",success:"bg-green-600 text-white hover:bg-green-700 focus-visible:border-green-600 focus-visible:ring-green-500/30 active:bg-green-800 aria-pressed:bg-green-800 dark:bg-green-500 dark:aria-pressed:bg-green-300 dark:active:bg-green-300 dark:hover:bg-green-400",successSecondary:"border-green-200 text-green-700 hover:bg-green-50 active:bg-green-100 aria-pressed:bg-green-100 dark:border-green-800 dark:text-green-300 dark:aria-pressed:bg-green-950 dark:active:bg-green-950 dark:hover:bg-green-950/60",warning:"bg-yellow-600 text-white hover:bg-yellow-700 focus-visible:border-yellow-600 focus-visible:ring-yellow-500/30 active:bg-yellow-800 aria-pressed:bg-yellow-800 dark:bg-yellow-500 dark:text-yellow-950 dark:aria-pressed:bg-yellow-300 dark:active:bg-yellow-300 dark:hover:bg-yellow-400",warningSecondary:"border-yellow-200 text-yellow-700 hover:bg-yellow-50 active:bg-yellow-100 aria-pressed:bg-yellow-100 dark:border-yellow-800 dark:text-yellow-300 dark:aria-pressed:bg-yellow-950 dark:active:bg-yellow-950 dark:hover:bg-yellow-950/60"}}}),e8=e=>{let t,r,n,o,i,l,s,a,c,u=(0,h.c)(16);if(u[0]!==e){let{className:a,variant:c,size:d,asChild:f,children:p,...m}=e;r=p,s=void 0===c?"default":c,n=void 0===d?"default":d,t=void 0!==f&&f,l=q,o="button",i=T({className:((...e)=>e4(K(e)))(e7({className:a,size:n,variant:s}))},t?m:{...m,children:r}),u[0]=e,u[1]=t,u[2]=r,u[3]=n,u[4]=o,u[5]=i,u[6]=l,u[7]=s}else t=u[1],r=u[2],n=u[3],o=u[4],i=u[5],l=u[6],s=u[7];let d=t?r:void 0;return u[8]!==n||u[9]!==s?(a={size:n,slot:"button",variant:s},u[8]=n,u[9]=s,u[10]=a):a=u[10],u[11]!==o||u[12]!==i||u[13]!==d||u[14]!==a?(c={defaultTagName:o,props:i,render:d,state:a},u[11]=o,u[12]=i,u[13]=d,u[14]=a,u[15]=c):c=u[15],l(c)},e9=e=>{let t,r,n,o,i,l=(0,h.c)(10);return l[0]!==e?({className:r,children:t,...n}=e,l[0]=e,l[1]=t,l[2]=r,l[3]=n):(t=l[1],r=l[2],n=l[3]),l[4]!==r?(o=((...e)=>e4(K(e)))("inline-flex h-5 items-center rounded border border-border bg-muted px-1.5 font-mono text-[10px] text-muted-foreground",r),l[4]=r,l[5]=o):o=l[5],l[6]!==t||l[7]!==n||l[8]!==o?(i=(0,m.jsx)("kbd",{className:o,...n,children:t}),l[6]=t,l[7]=n,l[8]=o,l[9]=i):i=l[9],i},te=v("LayoutLeftIcon",(0,b.forwardRef)((e,t)=>b.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",viewBox:"0 0 24 24",ref:t,...e},b.createElement("path",{fill:"currentColor",d:"m5.638 19.673.454-.891zm-1.311-1.311-.891.454zm15.346 0-.891-.454zm-1.311 1.311-.454-.891zm1.311-14.035-.891.454zm-1.311-1.311.454-.891zM4.327 5.638l.891.454zm1.311-1.311.454.891zM11 4V3H9v1zM9 20v1h2v-1zM19 8.8v6.4h2V8.8zM15.2 19H8.8v2h6.4zM5 15.2V8.8H3v6.4zM8.8 5h6.4V3H8.8zm0 14c-.8566 0-1.4389-.0008-1.889-.0376-.4384-.0358-.6626-.1007-.819-.1804l-.908 1.782c.4854.2473 1.002.3459 1.5642.3918C7.2986 21.0008 7.9764 21 8.8 21zM3 15.2c0 .8236-.0008 1.5014.0442 2.0518.046.5621.1445 1.0788.3918 1.5642l1.782-.908c-.0797-.1564-.1446-.3806-.1804-.819C5.0008 16.6389 5 16.0566 5 15.2zm3.092 3.582a2 2 0 0 1-.874-.874l-1.782.908a4 4 0 0 0 1.748 1.748zM19 15.2c0 .8566-.0008 1.4389-.0376 1.889-.0358.4384-.1007.6626-.1804.819l1.782.908c.2473-.4854.3459-1.0021.3918-1.5642.045-.5504.0442-1.2282.0442-2.0518zM15.2 21c.8236 0 1.5014.0008 2.0518-.0442.5621-.0459 1.0788-.1445 1.5642-.3918l-.908-1.782c-.1564.0797-.3806.1446-.819.1804-.4501.0368-1.0324.0376-1.889.0376zm3.582-3.092a2 2 0 0 1-.874.874l.908 1.782a4 4 0 0 0 1.748-1.748zM21 8.8c0-.8236.0008-1.5014-.0442-2.0518-.0459-.5621-.1445-1.0788-.3918-1.5642l-1.782.908c.0797.1564.1446.3806.1804.819C18.9992 7.3611 19 7.9434 19 8.8zM15.2 5c.8566 0 1.4389.0008 1.889.0376.4384.0358.6626.1007.819.1804l.908-1.782c-.4854-.2473-1.0021-.3459-1.5642-.3918C16.7014 2.9992 16.0236 3 15.2 3zm5.364.184a4 4 0 0 0-1.748-1.748l-.908 1.782c.3763.1917.6823.4977.874.874zM5 8.8c0-.8566.0008-1.4389.0376-1.889.0358-.4384.1007-.6626.1804-.819l-1.782-.908c-.2473.4854-.3459 1.002-.3918 1.5642C2.9992 7.2986 3 7.9764 3 8.8zM8.8 3c-.8236 0-1.5014-.0008-2.0518.0442-.5621.046-1.0788.1445-1.5642.3918l.908 1.782c.1564-.0797.3806-.1446.819-.1804C7.3611 5.0008 7.9434 5 8.8 5zM5.218 6.092a2 2 0 0 1 .874-.874l-.908-1.782a4 4 0 0 0-1.748 1.748zM9 4v16h2V4z"}))));e.s([],75704),e.i(75704);let tt=b.createContext(void 0);function tr(e){let t=b.useContext(tt);if(!1===e&&void 0===t)throw Error(A(27));return t}let tn=((o={}).startingStyle="data-starting-style",o.endingStyle="data-ending-style",o),to={[tn.startingStyle]:""},ti={[tn.endingStyle]:""},tl={transitionStatus:e=>"starting"===e?to:"ending"===e?ti:null},ts=((i={}).open="data-open",i.closed="data-closed",i[i.startingStyle=tn.startingStyle]="startingStyle",i[i.endingStyle=tn.endingStyle]="endingStyle",i.anchorHidden="data-anchor-hidden",i.side="data-side",i.align="data-align",i),ta=((l={}).popupOpen="data-popup-open",l.pressed="data-pressed",l),tc={[ta.popupOpen]:""};ta.popupOpen,ta.pressed;let tu={[ts.open]:""},td={[ts.closed]:""},tf={[ts.anchorHidden]:""},tp={open:e=>e?tc:null},tm={open:e=>e?tu:td,anchorHidden:e=>e?tf:null},th={...tm,...tl},tg=b.forwardRef(function(e,t){let{render:r,className:n,forceRender:o=!1,...i}=e,{store:l}=tr(),s=l.useState("open"),a=l.useState("nested"),c=l.useState("mounted");return V("div",e,{state:{open:s,transitionStatus:l.useState("transitionStatus")},ref:[l.context.backdropRef,t],stateAttributesMapping:th,props:[{role:"presentation",hidden:!c,style:{userSelect:"none",WebkitUserSelect:"none"}},i],enabled:o||!a})});function tb(){return"u">typeof window}function tv(e){return tw(e)?(e.nodeName||"").toLowerCase():"#document"}function tx(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function ty(e){var t;return null==(t=(tw(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function tw(e){return!!tb()&&(e instanceof Node||e instanceof tx(e).Node)}function tk(e){return!!tb()&&(e instanceof Element||e instanceof tx(e).Element)}function tS(e){return!!tb()&&(e instanceof HTMLElement||e instanceof tx(e).HTMLElement)}function tE(e){return!(!tb()||"u"<typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof tx(e).ShadowRoot)}function tC(e){let{overflow:t,overflowX:r,overflowY:n,display:o}=tL(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&"inline"!==o&&"contents"!==o}function tj(e){try{if(e.matches(":popover-open"))return!0}catch(e){}try{return e.matches(":modal")}catch(e){return!1}}let tR=/transform|translate|scale|rotate|perspective|filter/,tT=/paint|layout|strict|content/,tN=e=>!!e&&"none"!==e;function tO(e){let t=tk(e)?tL(e):e;return tN(t.transform)||tN(t.translate)||tN(t.scale)||tN(t.rotate)||tN(t.perspective)||!tP()&&(tN(t.backdropFilter)||tN(t.filter))||tR.test(t.willChange||"")||tT.test(t.contain||"")}function tP(){return null==t&&(t="u">typeof CSS&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),t}function tM(e){return/^(html|body|#document)$/.test(tv(e))}function tL(e){return tx(e).getComputedStyle(e)}function tA(e){return tk(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function tz(e){if("html"===tv(e))return e;let t=e.assignedSlot||e.parentNode||tE(e)&&e.host||ty(e);return tE(t)?t.host:t}function tI(e,t,r){var n;void 0===t&&(t=[]),void 0===r&&(r=!0);let o=function e(t){let r=tz(t);return tM(r)?t.ownerDocument?t.ownerDocument.body:t.body:tS(r)&&tC(r)?r:e(r)}(e),i=o===(null==(n=e.ownerDocument)?void 0:n.body),l=tx(o);if(!i)return t.concat(o,tI(o,[],r));{let e=tD(l);return t.concat(l,l.visualViewport||[],tC(o)?o:[],e&&r?tI(e):[])}}function tD(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}let t_=b[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],t$=t_&&t_!==b.useLayoutEffect?t_:e=>e();function tB(e){let t=I(tF).current;return t.next=e,t$(t.effect),t.trampoline}function tF(){let e={next:void 0,callback:tH,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function tH(){}let tW="u">typeof document?b.useLayoutEffect:()=>{},tV=b.createContext(void 0);function tU(e={}){let{disabled:t=!1,focusableWhenDisabled:r,tabIndex:n=0,native:o=!0,composite:i}=e,l=b.useRef(null),s=function(e=!1){let t=b.useContext(tV);if(void 0===t&&!e)throw Error(A(16));return t}(!0),a=i??void 0!==s,{props:c}=function(e){let{focusableWhenDisabled:t,disabled:r,composite:n=!1,tabIndex:o=0,isNativeButton:i}=e,l=n&&!1!==t,s=n&&!1===t;return{props:b.useMemo(()=>{let e={onKeyDown(e){r&&t&&"Tab"!==e.key&&e.preventDefault()}};return n||(e.tabIndex=o,!i&&r&&(e.tabIndex=t?o:-1)),(i&&(t||l)||!i&&r)&&(e["aria-disabled"]=r),i&&(!t||s)&&(e.disabled=r),e},[n,r,t,l,s,i,o])}}({focusableWhenDisabled:r,disabled:t,composite:a,tabIndex:n,isNativeButton:o}),u=b.useCallback(()=>{let e=l.current;tq(e)&&a&&t&&void 0===c.disabled&&e.disabled&&(e.disabled=!1)},[t,c.disabled,a]);return tW(u,[u]),{getButtonProps:b.useCallback((e={})=>{let{onClick:r,onMouseDown:n,onKeyUp:i,onKeyDown:l,onPointerDown:s,...u}=e;return T({type:o?"button":void 0,onClick(e){t?e.preventDefault():r?.(e)},onMouseDown(e){t||n?.(e)},onKeyDown(e){var n;if(t||(M(e),l?.(e),e.baseUIHandlerPrevented))return;let i=e.target===e.currentTarget,s=e.currentTarget,c=tq(s),u=!o&&(n=s,!!(n?.tagName==="A"&&n?.href)),d=i&&(o?c:!u),f="Enter"===e.key,p=" "===e.key,m=s.getAttribute("role"),h=m?.startsWith("menuitem")||"option"===m||"gridcell"===m;if(i&&a&&p){if(e.defaultPrevented&&h)return;e.preventDefault(),u||o&&c?(s.click(),e.preventBaseUIHandler()):d&&(r?.(e),e.preventBaseUIHandler());return}d&&(!o&&(p||f)&&e.preventDefault(),!o&&f&&r?.(e))},onKeyUp(e){t||((M(e),i?.(e),e.target===e.currentTarget&&o&&a&&tq(e.currentTarget)&&" "===e.key)?e.preventDefault():!e.baseUIHandlerPrevented&&(e.target!==e.currentTarget||o||a||" "!==e.key||r?.(e)))},onPointerDown(e){t?e.preventDefault():s?.(e)}},o?void 0:{role:"button"},c,u)},[t,c,a,o]),buttonRef:tB(e=>{l.current=e,u()})}}function tq(e){return tS(e)&&"BUTTON"===e.tagName}function tK(e,t,r,n){let o=!1,i=!1,l=n??W;return{reason:e,event:t??new Event("base-ui"),cancel(){o=!0},allowPropagation(){i=!0},get isCanceled(){return o},get isPropagationAllowed(){return i},trigger:r,...l}}e.s(["cancelOpen",0,"cancel-open","chipRemovePress",0,"chip-remove-press","clearPress",0,"clear-press","closePress",0,"close-press","closeWatcher",0,"close-watcher","decrementPress",0,"decrement-press","disabled",0,"disabled","drag",0,"drag","escapeKey",0,"escape-key","focusOut",0,"focus-out","imperativeAction",0,"imperative-action","incrementPress",0,"increment-press","inputBlur",0,"input-blur","inputChange",0,"input-change","inputClear",0,"input-clear","inputPaste",0,"input-paste","inputPress",0,"input-press","itemPress",0,"item-press","keyboard",0,"keyboard","linkPress",0,"link-press","listNavigation",0,"list-navigation","none",0,"none","outsidePress",0,"outside-press","pointer",0,"pointer","scrub",0,"scrub","siblingOpen",0,"sibling-open","swipe",0,"swipe","trackPress",0,"track-press","triggerFocus",0,"trigger-focus","triggerHover",0,"trigger-hover","triggerPress",0,"trigger-press","wheel",0,"wheel","windowResize",0,"window-resize"],16162);var tX=e.i(16162),tX=tX;let tY=b.forwardRef(function(e,t){let{render:r,className:n,disabled:o=!1,nativeButton:i=!0,...l}=e,{store:s}=tr(),a=s.useState("open"),{getButtonProps:c,buttonRef:u}=tU({disabled:o,native:i});return V("button",e,{state:{disabled:o},ref:[t,u],props:[{onClick:function(e){a&&s.setOpen(!1,tK(tX.closePress,e.nativeEvent))}},l,c]})}),tG={...b},tZ=0,tJ=tG.useId;function tQ(e,t){if(void 0!==tJ){let r=tJ();return e??(t?`${t}-${r}`:r)}return function(e,t="mui"){let[r,n]=b.useState(e),o=e||r;return b.useEffect(()=>{null==r&&(tZ+=1,n(`${t}-${tZ}`))},[r,t]),o}(e,t)}function t0(e){return tQ(e,"base-ui")}let t1=b.forwardRef(function(e,t){let{render:r,className:n,id:o,...i}=e,{store:l}=tr(),s=t0(o);return l.useSyncedValueWithCleanup("descriptionElementId",s),V("p",e,{ref:t,props:[{id:s},i]})});var t2='input:not([inert]):not([inert] *),select:not([inert]):not([inert] *),textarea:not([inert]):not([inert] *),a[href]:not([inert]):not([inert] *),button:not([inert]):not([inert] *),[tabindex]:not(slot):not([inert]):not([inert] *),audio[controls]:not([inert]):not([inert] *),video[controls]:not([inert]):not([inert] *),[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *),details>summary:first-of-type:not([inert]):not([inert] *),details:not([inert]):not([inert] *)',t5="u"<typeof Element,t3=t5?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,t4=!t5&&Element.prototype.getRootNode?function(e){var t;return null==e||null==(t=e.getRootNode)?void 0:t.call(e)}:function(e){return null==e?void 0:e.ownerDocument},t6=function(e,t){void 0===t&&(t=!0);var r,n=null==e||null==(r=e.getAttribute)?void 0:r.call(e,"inert");return""===n||"true"===n||t&&e&&("function"==typeof e.closest?e.closest("[inert]"):t6(e.parentNode))},t7=function(e){var t,r=null==e||null==(t=e.getAttribute)?void 0:t.call(e,"contenteditable");return""===r||"true"===r},t8=function(e,t,r){if(t6(e))return[];var n=Array.prototype.slice.apply(e.querySelectorAll(t2));return t&&t3.call(e,t2)&&n.unshift(e),n=n.filter(r)},t9=function(e,t,r){for(var n=[],o=Array.from(e);o.length;){var i=o.shift();if(!t6(i,!1))if("SLOT"===i.tagName){var l=i.assignedElements(),s=t9(l.length?l:i.children,!0,r);r.flatten?n.push.apply(n,s):n.push({scopeParent:i,candidates:s})}else{t3.call(i,t2)&&r.filter(i)&&(t||!e.includes(i))&&n.push(i);var a=i.shadowRoot||"function"==typeof r.getShadowRoot&&r.getShadowRoot(i),c=!t6(a,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(i));if(a&&c){var u=t9(!0===a?i.children:a.children,!0,r);r.flatten?n.push.apply(n,u):n.push({scopeParent:i,candidates:u})}else o.unshift.apply(o,i.children)}}return n},re=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},rt=function(e){if(!e)throw Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||t7(e))&&!re(e)?0:e.tabIndex},rr=function(e,t){var r=rt(e);return r<0&&t&&!re(e)?0:r},rn=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},ro=function(e){return"INPUT"===e.tagName},ri=function(e,t){for(var r=0;r<e.length;r++)if(e[r].checked&&e[r].form===t)return e[r]},rl=function(e){if(!e.name)return!0;var t,r=e.form||t4(e),n=function(e){return r.querySelectorAll('input[type="radio"][name="'+e+'"]')};if("u">typeof window&&void 0!==window.CSS&&"function"==typeof window.CSS.escape)t=n(window.CSS.escape(e.name));else try{t=n(e.name)}catch(e){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",e.message),!1}var o=ri(t,e.form);return!o||o===e},rs=function(e){return ro(e)&&"radio"===e.type&&!rl(e)},ra=function(e){var t,r,n,o,i,l,s,a=e&&t4(e),c=null==(t=a)?void 0:t.host,u=!1;if(a&&a!==e)for(u=!!(null!=(r=c)&&null!=(n=r.ownerDocument)&&n.contains(c)||null!=e&&null!=(o=e.ownerDocument)&&o.contains(e));!u&&c;)u=!!(null!=(l=c=null==(i=a=t4(c))?void 0:i.host)&&null!=(s=l.ownerDocument)&&s.contains(c));return u},rc=function(e){var t=e.getBoundingClientRect(),r=t.width,n=t.height;return 0===r&&0===n},ru=function(e,t){var r=t.displayCheck,n=t.getShadowRoot;if("full-native"===r&&"checkVisibility"in e)return!e.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});if("hidden"===getComputedStyle(e).visibility)return!0;var o=t3.call(e,"details>summary:first-of-type")?e.parentElement:e;if(t3.call(o,"details:not([open]) *"))return!0;if(r&&"full"!==r&&"full-native"!==r&&"legacy-full"!==r){if("non-zero-area"===r)return rc(e)}else{if("function"==typeof n){for(var i=e;e;){var l=e.parentElement,s=t4(e);if(l&&!l.shadowRoot&&!0===n(l))return rc(e);e=e.assignedSlot?e.assignedSlot:l||s===e.ownerDocument?l:s.host}e=i}if(ra(e))return!e.getClientRects().length;if("legacy-full"!==r)return!0}return!1},rd=function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if("FIELDSET"===t.tagName&&t.disabled){for(var r=0;r<t.children.length;r++){var n=t.children.item(r);if("LEGEND"===n.tagName)return!!t3.call(t,"fieldset[disabled] *")||!n.contains(e)}return!0}t=t.parentElement}return!1},rf=function(e,t){return!(t.disabled||ro(t)&&"hidden"===t.type||ru(t,e)||"DETAILS"===t.tagName&&Array.prototype.slice.apply(t.children).some(function(e){return"SUMMARY"===e.tagName})||rd(t))},rp=function(e,t){return!(rs(t)||0>rt(t))&&!!rf(e,t)},rm=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!isNaN(t)||!!(t>=0)},rh=function(e){var t=[],r=[];return e.forEach(function(e,n){var o=!!e.scopeParent,i=o?e.scopeParent:e,l=rr(i,o),s=o?rh(e.candidates):i;0===l?o?t.push.apply(t,s):t.push(i):r.push({documentOrder:n,tabIndex:l,item:e,isScope:o,content:s})}),r.sort(rn).reduce(function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e},[]).concat(t)},rg=function(e,t){return rh((t=t||{}).getShadowRoot?t9([e],t.includeContainer,{filter:rp.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:rm}):t8(e,t.includeContainer,rp.bind(null,t)))},rb=function(e,t){return(t=t||{}).getShadowRoot?t9([e],t.includeContainer,{filter:rf.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):t8(e,t.includeContainer,rf.bind(null,t))},rv=function(e,t){if(t=t||{},!e)throw Error("No node provided");return!1!==t3.call(e,t2)&&rp(t,e)};function rx(e){let t=I(ry,e).current;return t.next=e,tW(t.effect),t}function ry(e){let t={current:e,next:e,effect:()=>{t.current=t.next}};return t}let rw=[];function rk(e){b.useEffect(e,rw)}class rS{static create(){return new rS}currentId=0;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=0,t()},e)}isStarted(){return 0!==this.currentId}clear=()=>{0!==this.currentId&&(clearTimeout(this.currentId),this.currentId=0)};disposeEffect=()=>this.clear}function rE(){let e=I(rS.create).current;return rk(e.disposeEffect),e}let rC="u">typeof navigator,rj=function(){if(!rC)return{platform:"",maxTouchPoints:-1};let e=navigator.userAgentData;return e?.platform?{platform:e.platform,maxTouchPoints:navigator.maxTouchPoints}:{platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??-1}}(),rR=function(){if(!rC)return"";let e=navigator.userAgentData;return e?.platform?e.platform:navigator.platform??""}(),rT=function(){if(!rC)return"";let e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:e,version:t})=>`${e}/${t}`).join(" "):navigator.userAgent}(),rN="u">typeof CSS&&!!CSS.supports&&CSS.supports("-webkit-backdrop-filter:none"),rO="MacIntel"===rj.platform&&rj.maxTouchPoints>1||/iP(hone|ad|od)|iOS/.test(rj.platform);rC&&/firefox/i.test(rT);let rP=rC&&/apple/i.test(navigator.vendor);rC&&/Edg/i.test(rT);let rM=rC&&/android/i.test(rR)||/android/i.test(rT),rL=rC&&rR.toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints,rA=rT.includes("jsdom/"),rz=new class{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=e=>{this.isScheduled=!1;let t=this.callbacks,r=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,r>0)for(let r=0;r<t.length;r+=1)t[r]?.(e)};request(e){let t=this.nextId;return this.nextId+=1,this.callbacks.push(e),this.callbacksCount+=1,this.isScheduled||(requestAnimationFrame(this.tick),this.isScheduled=!0),t}cancel(e){let t=e-this.startId;t<0||t>=this.callbacks.length||(this.callbacks[t]=null,this.callbacksCount-=1)}};class rI{static create(){return new rI}static request(e){return rz.request(e)}static cancel(e){return rz.cancel(e)}currentId=null;request(e){this.cancel(),this.currentId=rz.request(()=>{this.currentId=null,e()})}cancel=()=>{null!==this.currentId&&(rz.cancel(this.currentId),this.currentId=null)};disposeEffect=()=>this.cancel}function rD(){let e=I(rI.create).current;return rk(e.disposeEffect),e}function r_(e){return e?.ownerDocument||document}let r$={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},rB={...r$,position:"fixed",top:0,left:0};({...r$,position:"absolute"});let rF=b.forwardRef(function(e,t){let[r,n]=b.useState();return tW(()=>{rP&&n("button")},[]),(0,m.jsx)("span",{...e,ref:t,style:rB,"aria-hidden":!r||void 0,tabIndex:0,role:r,"data-base-ui-focus-guard":""})}),rH="data-base-ui-focusable",rW="active",rV="selected",rU="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function rq(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function rK(e,t){if(!e||!t)return!1;let r=t.getRootNode?.();if(e.contains(t))return!0;if(r&&tE(r)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function rX(e,t){if(!tk(e))return!1;if(t.hasElement(e))return!e.hasAttribute("data-trigger-disabled");for(let[,r]of t.entries())if(rK(r,e))return!r.hasAttribute("data-trigger-disabled");return!1}function rY(e){return"composedPath"in e?e.composedPath()[0]:e.target}function rG(e,t){return null!=t&&("composedPath"in e?e.composedPath().includes(t):null!=e.target&&t.contains(e.target))}function rZ(e){return tS(e)&&e.matches(rU)}function rJ(e){return!!e&&"combobox"===e.getAttribute("role")&&rZ(e)}function rQ(e){return e?e.hasAttribute(rH)?e:e.querySelector(`[${rH}]`)||e:null}function r0(e,t){let r=["mouse","pen"];return t||r.push("",void 0),r.includes(e)}function r1(e){let t=e.type;return"click"===t||"mousedown"===t||"keydown"===t||"keyup"===t}function r2(e,t,r=!0){return e.filter(e=>e.parentId===t&&(!r||e.context?.open)).flatMap(t=>[t,...r2(e,t.id,r)])}function r5(e,t){let r=[],n=e.find(e=>e.id===t)?.parentId;for(;n;){let t=e.find(e=>e.id===n);n=t?.parentId,t&&(r=r.concat(t))}return r}let r3=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function r4(e,t){let r=rg(e,r3()),n=r.length;if(0===n)return;let o=rq(r_(e)),i=r.indexOf(o);return r[-1===i?1===t?0:n-1:i+t]}function r6(e){return r4(r_(e).body,1)||e}function r7(e){return r4(r_(e).body,-1)||e}function r8(e,t){let r=t||e.currentTarget,n=e.relatedTarget;return!n||!rK(r,n)}function r9(e){e.querySelectorAll("[data-tabindex]").forEach(e=>{let t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute("tabindex",t):e.removeAttribute("tabindex")})}var tX=tX;function ne(e){return`data-base-ui-${e}`}let nt=0;function nr(e,t={}){let{preventScroll:r=!1,cancelPrevious:n=!0,sync:o=!1}=t;n&&cancelAnimationFrame(nt);let i=()=>e?.focus({preventScroll:r});o?i():nt=requestAnimationFrame(i)}let nn={inert:new WeakMap,"aria-hidden":new WeakMap},no="data-base-ui-inert",ni={inert:new WeakSet,"aria-hidden":new WeakSet},nl=new WeakMap,ns=0,na=(e,t)=>t.map(t=>{if(e.contains(t))return t;let r=function e(t){return t?tE(t)?t.host:e(t.parentNode):null}(t);return e.contains(r)?r:null}).filter(e=>null!=e),nc=e=>{let t=new Set;return e.forEach(e=>{let r=e;for(;r&&!t.has(r);)t.add(r),r=r.parentNode}),t},nu=(e,t,r)=>{let n=[],o=e=>{!e||r.has(e)||Array.from(e.children).forEach(e=>{"script"!==tv(e)&&(t.has(e)?o(e):n.push(e))})};return o(e),n};function nd(e,t={}){let{ariaHidden:r=!1,inert:n=!1,mark:o=!0,markerIgnoreElements:i=[]}=t,l=r_(e[0]).body;return function(e,t,r,n,{mark:o=!0,markerIgnoreElements:i=[]}){let l=n?"inert":r?"aria-hidden":null,s=null,a=null,c=na(t,e),u=new Set(o?na(t,i):[]),d=o?nu(t,nc(c),new Set(c)).filter(e=>!u.has(e)):[],f=[],p=[];if(l){let e=nn[l],r=ni[l];a=r,s=e;let n=na(t,Array.from(t.querySelectorAll("[aria-live]"))),o=c.concat(n);nu(t,nc(o),new Set(o)).forEach(t=>{let n=t.getAttribute(l),o=null!==n&&"false"!==n,i=(e.get(t)||0)+1;e.set(t,i),f.push(t),1===i&&o&&r.add(t),o||t.setAttribute(l,"inert"===l?"":"true")})}return o&&d.forEach(e=>{let t=(nl.get(e)||0)+1;nl.set(e,t),p.push(e),1===t&&e.setAttribute(no,"")}),ns+=1,()=>{s&&f.forEach(e=>{let t=(s.get(e)||0)-1;s.set(e,t),t||(!a?.has(e)&&l&&e.removeAttribute(l),a?.delete(e))}),o&&p.forEach(e=>{let t=(nl.get(e)||0)-1;nl.set(e,t),t||e.removeAttribute(no)}),(ns-=1)||(nn.inert=new WeakMap,nn["aria-hidden"]=new WeakMap,ni.inert=new WeakSet,ni["aria-hidden"]=new WeakSet,nl=new WeakMap)}}(e,l,r,n,{mark:o,markerIgnoreElements:i})}var nf=e.i(74080),tX=tX;let np={style:{transition:"none"}},nm="data-base-ui-click-trigger",nh={fallbackAxisSide:"end"},ng={clipPath:"inset(50%)",position:"fixed",top:0,left:0},nb=b.createContext(null),nv=ne("portal");function nx(e={}){let{ref:t,container:r,componentProps:n=W,elementProps:o}=e,i=tQ(),l=b.useContext(nb),s=l?.portalNode,[a,c]=b.useState(null),[u,d]=b.useState(null),f=tB(e=>{null!==e&&d(e)}),p=b.useRef(null);tW(()=>{if(null===r){p.current&&(p.current=null,d(null),c(null));return}if(null==i)return;let e=(r&&(tw(r)?r:r.current))??s??document.body;if(null==e){p.current&&(p.current=null,d(null),c(null));return}p.current!==e&&(p.current=e,d(null),c(e))},[r,s,i]);let m=V("div",n,{ref:[t,f],props:[{id:i,[nv]:""},o]});return{portalNode:u,portalSubtree:a&&m?nf.createPortal(m,a):null}}let ny=b.forwardRef(function(e,t){let{children:r,container:n,className:o,render:i,renderGuards:l,...s}=e,{portalNode:a,portalSubtree:c}=nx({container:n,ref:t,componentProps:e,elementProps:s}),u=b.useRef(null),d=b.useRef(null),f=b.useRef(null),p=b.useRef(null),[h,g]=b.useState(null),v=h?.modal,x=h?.open,y="boolean"==typeof l?l:!!h&&!h.modal&&h.open&&!!a;b.useEffect(()=>{if(a&&!v)return a.addEventListener("focusin",e,!0),a.addEventListener("focusout",e,!0),()=>{a.removeEventListener("focusin",e,!0),a.removeEventListener("focusout",e,!0)};function e(e){a&&e.relatedTarget&&r8(e)&&("focusin"===e.type?r9:function(e){rg(e,r3()).forEach(e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")})})(a)}},[a,v]),b.useEffect(()=>{a&&!x&&r9(a)},[x,a]);let w=b.useMemo(()=>({beforeOutsideRef:u,afterOutsideRef:d,beforeInsideRef:f,afterInsideRef:p,portalNode:a,setFocusManagerState:g}),[a]);return(0,m.jsxs)(b.Fragment,{children:[c,(0,m.jsxs)(nb.Provider,{value:w,children:[y&&a&&(0,m.jsx)(rF,{"data-type":"outside",ref:u,onFocus:e=>{if(r8(e,a))f.current?.focus();else{let e=r7(h?h.domReference:null);e?.focus()}}}),y&&a&&(0,m.jsx)("span",{"aria-owns":a.id,style:ng}),a&&nf.createPortal(r,a),y&&a&&(0,m.jsx)(rF,{"data-type":"outside",ref:d,onFocus:e=>{if(r8(e,a))p.current?.focus();else{let t=r6(h?h.domReference:null);t?.focus(),h?.closeOnFocusOut&&h?.onOpenChange(!1,tK(tX.focusOut,e.nativeEvent))}}})]})]})}),nw=b.createContext(null),nk=b.createContext(null),nS=()=>b.useContext(nw)?.id||null,nE=e=>{let t=b.useContext(nk);return e??t};function nC(e){return null==e?e:"current"in e?e.current:e}let nj=[];function nR(){nj=nj.filter(e=>e.deref()?.isConnected)}function nT(){return nR(),nj[nj.length-1]?.deref()}function nN(e,t){if(!t.current.includes("floating")&&!e.getAttribute("role")?.includes("dialog"))return;let r=r3(),n=rb(e,r).filter(e=>{let t=e.getAttribute("data-tabindex")||"";return rv(e,r)||e.hasAttribute("data-tabindex")&&!t.startsWith("-")}),o=e.getAttribute("tabindex");t.current.includes("floating")||0===n.length?"0"!==o&&e.setAttribute("tabindex","0"):("-1"!==o||e.hasAttribute("data-tabindex")&&"-1"!==e.getAttribute("data-tabindex"))&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}function nO(e){let{context:t,children:r,disabled:n=!1,initialFocus:o=!0,returnFocus:i=!0,restoreFocus:l=!1,modal:s=!0,closeOnFocusOut:a=!0,openInteractionType:c="",nextFocusableElement:u,previousFocusableElement:d,beforeContentFocusGuardRef:f,externalTree:p,getInsideElements:h}=e,g="rootStore"in t?t.rootStore:t,v=g.useState("open"),x=g.useState("domReferenceElement"),y=g.useState("floatingElement"),{events:w,dataRef:k}=g.context,S=tB(()=>k.current.floatingContext?.nodeId),E=!1===o,C=rJ(x)&&E,j=b.useRef(["content"]),R=rx(o),T=rx(i),N=rx(c),O=nE(p),P=b.useContext(nb),M=b.useRef(!1),L=b.useRef(!1),A=b.useRef(!1),z=b.useRef(-1),I=b.useRef(""),_=b.useRef(""),$=b.useRef(null),B=b.useRef(null),F=D($,f,P?.beforeInsideRef),H=D(B,P?.afterInsideRef),W=rE(),V=rE(),U=rD(),q=null!=P,K=rQ(y),X=tB((e=K)=>e?rg(e,r3()):[]),Y=tB(()=>h?.().filter(e=>null!=e)??[]),G=tB(e=>{let t=X(e);return j.current.map(()=>t).filter(Boolean).flat()});b.useEffect(()=>{if(n||!s)return;function e(e){"Tab"===e.key&&rK(K,rq(r_(K)))&&0===X().length&&!C&&(e.preventDefault(),e.stopPropagation())}let t=r_(K);return t.addEventListener("keydown",e),()=>{t.removeEventListener("keydown",e)}},[n,x,K,s,j,C,X,G]),b.useEffect(()=>{if(n||!v)return;let e=r_(K);function t(){A.current=!1}function r(e){let t=rY(e),r=Y();A.current=!(rK(y,t)||rK(x,t)||rK(P?.portalNode,t)||r.some(e=>e===t||rK(e,t))),_.current=e.pointerType||"keyboard",t?.closest(`[${nm}]`)&&(L.current=!0)}function o(){_.current="keyboard"}return e.addEventListener("pointerdown",r,!0),e.addEventListener("pointerup",t,!0),e.addEventListener("pointercancel",t,!0),e.addEventListener("keydown",o,!0),()=>{e.removeEventListener("pointerdown",r,!0),e.removeEventListener("pointerup",t,!0),e.removeEventListener("pointercancel",t,!0),e.removeEventListener("keydown",o,!0)}},[n,y,x,K,v,P,Y]),b.useEffect(()=>{if(n||!a)return;let e=r_(K);function t(){L.current=!0,V.start(0,()=>{L.current=!1})}function r(e){let t=rY(e),r=X().indexOf(t);-1!==r&&(z.current=r)}function o(t){let r=t.relatedTarget,n=t.currentTarget,o=rY(t);queueMicrotask(()=>{var i;let a=S(),c=g.context.triggerElements,f=Y(),p=r?.hasAttribute(ne("focus-guard"))&&[$.current,B.current,P?.beforeInsideRef.current,P?.afterInsideRef.current,P?.beforeOutsideRef.current,P?.afterOutsideRef.current,nC(d),nC(u)].includes(r),m=!(rK(x,r)||rK(y,r)||rK(r,y)||rK(P?.portalNode,r)||f.some(e=>e===r||rK(e,r))||null!=r&&c.hasElement(r)||c.hasMatchingElement(e=>rK(e,r))||p||O&&(r2(O.nodesRef.current,a).find(e=>rK(e.context?.elements.floating,r)||rK(e.context?.elements.domReference,r))||r5(O.nodesRef.current,a).find(e=>[e.context?.elements.floating,rQ(e.context?.elements.floating)].includes(r)||e.context?.elements.domReference===r)));if(n===x&&K&&nN(K,j),l&&n!==x&&!((i=o)&&i.isConnected&&("function"==typeof i.checkVisibility?i.checkVisibility():"none"!==tL(i).display))&&rq(e)===e.body){if(tS(K)&&(K.focus(),"popup"===l))return void U.request(()=>{K.focus()});let e=z.current,t=X(),r=t[e]||t[t.length-1]||K;tS(r)&&r.focus()}if(k.current.insideReactTree){k.current.insideReactTree=!1;return}(C||!s)&&r&&m&&!L.current&&(C||r!==nT())&&(M.current=!0,g.setOpen(!1,tK(tX.focusOut,t)))})}function i(){A.current||(k.current.insideReactTree=!0,W.start(0,()=>{k.current.insideReactTree=!1}))}let c=tS(x)?x:null,f=[];if(y||c)return c&&(c.addEventListener("focusout",o),c.addEventListener("pointerdown",t),f.push(()=>{c.removeEventListener("focusout",o),c.removeEventListener("pointerdown",t)})),y&&(y.addEventListener("focusin",r),y.addEventListener("focusout",o),P&&(y.addEventListener("focusout",i,!0),f.push(()=>{y.removeEventListener("focusout",i,!0)})),f.push(()=>{y.removeEventListener("focusin",r),y.removeEventListener("focusout",o)})),()=>{f.forEach(e=>{e()})}},[n,x,y,K,s,O,P,g,a,l,X,C,S,j,k,W,V,U,u,d,Y]),b.useEffect(()=>{if(n||!y||!v)return;let e=Array.from(P?.portalNode?.querySelectorAll(`[${ne("portal")}]`)||[]),t=O?r5(O.nodesRef.current,S()):[],r=t.find(e=>rJ(e.context?.elements.domReference||null))?.context?.elements.domReference,o=nd([y,...e,$.current,B.current,P?.beforeOutsideRef.current,P?.afterOutsideRef.current,...Y(),r,nC(d),nC(u),C?x:null].filter(e=>null!=e),{ariaHidden:s||C,mark:!1}),i=nd([y,...e].filter(e=>null!=e));return()=>{i(),o()}},[v,n,x,y,s,j,P,C,O,S,u,d,Y]),tW(()=>{if(!v||n||!tS(K))return;let e=rq(r_(K));queueMicrotask(()=>{let t,r=G(K),n=R.current,o="function"==typeof n?n(N.current||""):n;void 0===o||!1===o||(t=(t=!0===o||null===o?r[0]||K:nC(o))||r[0]||K,rK(K,e)||nr(t,{preventScroll:t===K}))})},[n,v,K,E,G,R,N]),tW(()=>{var e;if(n||!K)return;let t=r_(K);function r(e){var t,r,n,o;let i;if(e.open||(t=e.nativeEvent,r=_.current,i=tx(t.target),I.current=t instanceof i.KeyboardEvent?"keyboard":t instanceof i.FocusEvent?r||"keyboard":"pointerType"in t?t.pointerType||"keyboard":"touches"in t?"touch":t instanceof i.MouseEvent?r||(0===t.detail?"keyboard":"mouse"):""),e.reason===tX.triggerHover&&"mouseleave"===e.nativeEvent.type&&(M.current=!0),e.reason===tX.outsidePress)if(e.nested)M.current=!1;else if((""===(n=e.nativeEvent).pointerType&&n.isTrusted?0:rM&&n.pointerType?"click"!==n.type||1!==n.buttons:0!==n.detail||n.pointerType)&&(o=e.nativeEvent,rA?1:(rM||0!==o.width||0!==o.height)&&(!rM||1!==o.width||1!==o.height||0!==o.pressure||0!==o.detail||"mouse"!==o.pointerType)&&(!(o.width<1)||!(o.height<1)||0!==o.pressure||0!==o.detail||"touch"!==o.pointerType))){let e=!1;document.createElement("div").focus({get preventScroll(){return e=!0,!1}}),e?M.current=!1:M.current=!0}else M.current=!1}return e=rq(t),nR(),e&&"body"!==tv(e)&&(nj.push(new WeakRef(e)),nj.length>20&&(nj=nj.slice(-20))),w.on("openchange",r),()=>{w.off("openchange",r);let e=rq(t),n=Y(),o=rK(y,e)||n.some(t=>t===e||rK(t,e))||O&&r2(O.nodesRef.current,S(),!1).some(t=>rK(t.context?.elements.floating,e)),i=function(){let e=T.current,t="function"==typeof e?e(I.current):e;if(void 0===t||!1===t)return null;if(null===t&&(t=!0),"boolean"==typeof t){let e=x||nT();return e&&e.isConnected?e:null}let r=x||nT();return nC(t)||r||null}();queueMicrotask(()=>{let r=function(e){if(!e)return null;let t=r3();return rv(e,t)?e:rg(e,t)[0]||e}(i),n="boolean"!=typeof T.current;T.current&&!M.current&&tS(r)&&(n||r===e||e===t.body||o)&&r.focus({preventScroll:!0}),M.current=!1})}},[n,y,K,T,k,w,O,x,S,Y]),tW(()=>{if(!rN||v||!y)return;let e=rq(r_(y));tS(e)&&rZ(e)&&rK(y,e)&&e.blur()},[v,y]),tW(()=>{if(!n&&P)return P.setFocusManagerState({modal:s,closeOnFocusOut:a,open:v,onOpenChange:g.setOpen,domReference:x}),()=>{P.setFocusManagerState(null)}},[n,P,s,v,g,a,x]),tW(()=>{if(!n&&K)return nN(K,j),()=>{queueMicrotask(nR)}},[n,K,j]);let Z=!n&&(!s||!C)&&(q||s);return(0,m.jsxs)(b.Fragment,{children:[Z&&(0,m.jsx)(rF,{"data-type":"inside",ref:F,onFocus:e=>{if(s){let e=G();nr(e[e.length-1])}else if(P?.portalNode)if(M.current=!1,r8(e,P.portalNode)){let e=r6(x);e?.focus()}else nC(d??P.beforeOutsideRef)?.focus()}}),r,Z&&(0,m.jsx)(rF,{"data-type":"inside",ref:H,onFocus:e=>{if(s)nr(G()[0]);else if(P?.portalNode)if(a&&(M.current=!0),r8(e,P.portalNode)){let e=r7(x);e?.focus()}else nC(u??P.afterOutsideRef)?.focus()}})]})}let nP=((s={}).nestedDialogs="--nested-dialogs",s),nM=((a={})[a.open=ts.open]="open",a[a.closed=ts.closed]="closed",a[a.startingStyle=ts.startingStyle]="startingStyle",a[a.endingStyle=ts.endingStyle]="endingStyle",a.nested="data-nested",a.nestedDialogOpen="data-nested-dialog-open",a),nL=b.createContext(void 0);function nA(){let e=b.useContext(nL);if(void 0===e)throw Error(A(26));return e}function nz(e,t=!1,r=!0){let n=rD();return tB((o,i=null)=>{function l(){nf.flushSync(o)}n.cancel();let s=nC(e);if(null!=s)if("function"!=typeof s.getAnimations||globalThis.BASE_UI_ANIMATIONS_DISABLED)o();else{function a(){Promise.all(s.getAnimations().map(e=>e.finished)).then(()=>{i?.aborted||l()}).catch(()=>{let e=s.getAnimations();if(r){if(i?.aborted)return;l()}else e.length>0&&e.some(e=>e.pending||"finished"!==e.playState)&&a()})}if(t)return void function(){let e=tn.startingStyle;if(!s.hasAttribute(e))return n.request(a);let t=new MutationObserver(()=>{s.hasAttribute(e)||(t.disconnect(),a())});t.observe(s,{attributes:!0,attributeFilter:[e]}),i?.addEventListener("abort",()=>t.disconnect(),{once:!0})}();n.request(a)}})}function nI(e){let{enabled:t=!0,open:r,ref:n,onComplete:o}=e,i=tB(o),l=nz(n,r,!1);b.useEffect(()=>{if(!t)return;let e=new AbortController;return l(i,e.signal),()=>{e.abort()}},[t,r,i,l])}let nD="ArrowUp",n_="ArrowDown",n$="ArrowLeft",nB="ArrowRight";[...new Set([...new Set([n$,nB]),...new Set([nD,n_])])];let nF=new Set([nD,n_,n$,nB,"Home","End"]),nH={...tm,...tl,nestedDialogOpen:e=>e?{[nM.nestedDialogOpen]:""}:null},nW=b.forwardRef(function(e,t){let{className:r,finalFocus:n,initialFocus:o,render:i,...l}=e,{store:s}=tr(),a=s.useState("descriptionElementId"),c=s.useState("disablePointerDismissal"),u=s.useState("floatingRootContext"),d=s.useState("popupProps"),f=s.useState("modal"),p=s.useState("mounted"),h=s.useState("nested"),g=s.useState("nestedOpenDialogCount"),b=s.useState("open"),v=s.useState("openMethod"),x=s.useState("titleElementId"),y=s.useState("transitionStatus"),w=s.useState("role");nA(),nI({open:b,ref:s.context.popupRef,onComplete(){b&&s.context.onOpenChangeComplete?.(!0)}});let k=void 0===o?function(e){return"touch"!==e||s.context.popupRef.current}:o,S=V("div",e,{state:{open:b,nested:h,transitionStatus:y,nestedDialogOpen:g>0},props:[d,{"aria-labelledby":x??void 0,"aria-describedby":a??void 0,role:w,tabIndex:-1,hidden:!p,onKeyDown(e){nF.has(e.key)&&e.stopPropagation()},style:{[nP.nestedDialogs]:g}},l],ref:[t,s.context.popupRef,s.useStateSetter("popupElement")],stateAttributesMapping:nH});return(0,m.jsx)(nO,{context:u,openInteractionType:v,disabled:!p,closeOnFocusOut:!c,initialFocus:k,returnFocus:n,modal:!1!==f,restoreFocus:"popup",children:S})});function nV(e){return B>=19?e:e?"true":void 0}let nU=b.forwardRef(function(e,t){let r,{cutout:n,...o}=e;if(n){let e=n?.getBoundingClientRect();r=`polygon(
2
+ 0% 0%,
3
+ 100% 0%,
4
+ 100% 100%,
5
+ 0% 100%,
6
+ 0% 0%,
7
+ ${e.left}px ${e.top}px,
8
+ ${e.left}px ${e.bottom}px,
9
+ ${e.right}px ${e.bottom}px,
10
+ ${e.right}px ${e.top}px,
11
+ ${e.left}px ${e.top}px
12
+ )`}return(0,m.jsx)("div",{ref:t,role:"presentation","data-base-ui-inert":"",...o,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:r}})}),nq=b.forwardRef(function(e,t){let{keepMounted:r=!1,...n}=e,{store:o}=tr(),i=o.useState("mounted"),l=o.useState("modal"),s=o.useState("open");return i||r?(0,m.jsx)(nL.Provider,{value:r,children:(0,m.jsxs)(ny,{ref:t,...n,children:[i&&!0===l&&(0,m.jsx)(nU,{ref:o.context.internalBackdropRef,inert:nV(!s)}),e.children]})}):null});function nK(e){let t=b.useRef(!0);t.current&&(t.current=!1,e())}let nX={},nY={},nG="";class nZ{lockCount=0;restore=null;timeoutLock=rS.create();timeoutUnlock=rS.create();acquire(e){return this.lockCount+=1,1===this.lockCount&&null===this.restore&&this.timeoutLock.start(0,()=>this.lock(e)),this.release}release=()=>{this.lockCount-=1,0===this.lockCount&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{0===this.lockCount&&this.restore&&(this.restore?.(),this.restore=null)};lock(e){let t,r,n,o,i;if(0===this.lockCount||null!==this.restore)return;let l=r_(e).documentElement,s=tx(l).getComputedStyle(l).overflowY;if("hidden"===s||"clip"===s){this.restore=H;return}let a=rO||!function(e){if("u"<typeof document)return!1;let t=r_(e);return tx(t).innerWidth-t.documentElement.clientWidth>0}(e);this.restore=a?(r=(t=r_(e)).documentElement,n=t.body,i={overflowY:(o=tC(r)?r:n).style.overflowY,overflowX:o.style.overflowX},Object.assign(o.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(o.style,i)}):function(e){let t=r_(e),r=t.documentElement,n=t.body,o=tx(r),i=0,l=0,s=!1,a=rI.create();if(rN&&(o.visualViewport?.scale??1)!==1)return()=>{};function c(){let t=o.getComputedStyle(r),a=o.getComputedStyle(n),c=(t.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";i=r.scrollTop,l=r.scrollLeft,nX={scrollbarGutter:r.style.scrollbarGutter,overflowY:r.style.overflowY,overflowX:r.style.overflowX},nG=r.style.scrollBehavior,nY={position:n.style.position,height:n.style.height,width:n.style.width,boxSizing:n.style.boxSizing,overflowY:n.style.overflowY,overflowX:n.style.overflowX,scrollBehavior:n.style.scrollBehavior};let u=r.scrollHeight>r.clientHeight,d=r.scrollWidth>r.clientWidth,f="scroll"===t.overflowY||"scroll"===a.overflowY,p="scroll"===t.overflowX||"scroll"===a.overflowX,m=Math.max(0,o.innerWidth-n.clientWidth),h=Math.max(0,o.innerHeight-n.clientHeight),g=parseFloat(a.marginTop)+parseFloat(a.marginBottom),b=parseFloat(a.marginLeft)+parseFloat(a.marginRight),v=tC(r)?r:n;if(s=function(e){if(!("u">typeof CSS&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||"u"<typeof document)return!1;let t=r_(e),r=t.documentElement,n=t.body,o=tC(r)?r:n,i=o.style.overflowY,l=r.style.scrollbarGutter;r.style.scrollbarGutter="stable",o.style.overflowY="scroll";let s=o.offsetWidth;o.style.overflowY="hidden";let a=o.offsetWidth;return o.style.overflowY=i,r.style.scrollbarGutter=l,s===a}(e)){r.style.scrollbarGutter=c,v.style.overflowY="hidden",v.style.overflowX="hidden";return}Object.assign(r.style,{scrollbarGutter:c,overflowY:"hidden",overflowX:"hidden"}),(u||f)&&(r.style.overflowY="scroll"),(d||p)&&(r.style.overflowX="scroll"),Object.assign(n.style,{position:"relative",height:g||h?`calc(100dvh - ${g+h}px)`:"100dvh",width:b||m?`calc(100vw - ${b+m}px)`:"100vw",boxSizing:"border-box",overflow:"hidden",scrollBehavior:"unset"}),n.scrollTop=i,n.scrollLeft=l,r.setAttribute("data-base-ui-scroll-locked",""),r.style.scrollBehavior="unset"}function u(){Object.assign(r.style,nX),Object.assign(n.style,nY),s||(r.scrollTop=i,r.scrollLeft=l,r.removeAttribute("data-base-ui-scroll-locked"),r.style.scrollBehavior=nG)}function d(){u(),a.request(c)}return c(),o.addEventListener("resize",d),()=>{a.cancel(),u(),"function"==typeof o.removeEventListener&&o.removeEventListener("resize",d)}}(e)}}let nJ=new nZ;var tX=tX;let nQ={intentional:"onClick",sloppy:"onPointerDown"};function n0(){return!1}function n1(e,t={}){let r="rootStore"in e?e.rootStore:e,n=r.useState("open"),o=r.useState("floatingElement"),{dataRef:i}=r.context,{enabled:l=!0,escapeKey:s=!0,outsidePress:a=!0,outsidePressEvent:c="sloppy",referencePress:u=n0,referencePressEvent:d="sloppy",bubbles:f,externalTree:p}=t,m=nE(p),h=tB("function"==typeof a?a:()=>!1),g="function"==typeof a?h:a,v=!1!==g,x=tB(()=>c),y=b.useRef(!1),w=b.useRef(!1),k=b.useRef(!1),{escapeKey:S,outsidePress:E}={escapeKey:"boolean"==typeof f?f:f?.escapeKey??!1,outsidePress:"boolean"==typeof f?f:f?.outsidePress??!0},C=b.useRef(null),j=rE(),R=rE(),T=tB(()=>{R.clear(),i.current.insideReactTree=!1}),N=b.useRef(!1),O=b.useRef(""),P=tB(u),M=tB(e=>{if(!n||!l||!s||"Escape"!==e.key||N.current)return;let t=i.current.floatingContext?.nodeId,o=m?r2(m.nodesRef.current,t):[];if(!S&&o.length>0){let e=!0;if(o.forEach(t=>{t.context?.open&&!t.context.dataRef.current.__escapeKeyBubbles&&(e=!1)}),!e)return}let a="nativeEvent"in e?e.nativeEvent:e,c=tK(tX.escapeKey,a);r.setOpen(!1,c),S||c.isPropagationAllowed||e.stopPropagation()}),L=tB(()=>{i.current.insideReactTree=!0,R.start(0,T)});b.useEffect(()=>{if(!n||!l)return;i.current.__escapeKeyBubbles=S,i.current.__outsidePressBubbles=E;let e=new rS,t=new rS;function a(){e.clear(),N.current=!0}function c(){e.start(5*!!tP(),()=>{N.current=!1})}function u(){k.current=!0,t.start(0,()=>{k.current=!1})}function d(){y.current=!1,w.current=!1}function f(){let e=O.current,t=x(),r="function"==typeof t?t():t;return"string"==typeof r?r:r["pen"!==e&&e?e:"mouse"]}function p(e){let t=i.current.floatingContext?.nodeId,n=m&&r2(m.nodesRef.current,t).some(t=>rG(e,t.context?.elements.floating));return rG(e,r.select("floatingElement"))||rG(e,r.select("domReferenceElement"))||n}function h(e){let n;if("intentional"===(n=f())&&"click"!==e.type||"sloppy"===n&&"click"===e.type||i.current.insideReactTree)return void T();let o=rY(e),l=`[${ne("inert")}]`,s=Array.from(r_(r.select("floatingElement")).querySelectorAll(l)),a=tk(o)?o.getRootNode():null;tE(a)&&(s=s.concat(Array.from(a.querySelectorAll(l))));let c=r.context.triggerElements;if(o&&(c.hasElement(o)||c.hasMatchingElement(e=>rK(e,o))))return;let u=tk(o)?o:null;for(;u&&!tM(u);){let e=tz(u);if(tM(e)||!tk(e))break;u=e}if(s.length&&tk(o)&&!o.matches("html,body")&&!rK(o,r.select("floatingElement"))&&s.every(e=>!rK(u,e)))return;if(tS(o)&&!("touches"in e)){let t=tM(o),r=tL(o),n=/auto|scroll/,i=t||n.test(r.overflowX),l=t||n.test(r.overflowY),s=i&&o.clientWidth>0&&o.scrollWidth>o.clientWidth,a=l&&o.clientHeight>0&&o.scrollHeight>o.clientHeight,c="rtl"===r.direction,u=a&&(c?e.offsetX<=o.offsetWidth-o.clientWidth:e.offsetX>o.clientWidth),d=s&&e.offsetY>o.clientHeight;if(u||d)return}if(p(e))return;if("intentional"===f()&&k.current){t.clear(),k.current=!1;return}if("function"==typeof g&&!g(e))return;let d=i.current.floatingContext?.nodeId,h=m?r2(m.nodesRef.current,d):[];if(h.length>0){let e=!0;if(h.forEach(t=>{t.context?.open&&!t.context.dataRef.current.__outsidePressBubbles&&(e=!1)}),!e)return}r.setOpen(!1,tK(tX.outsidePress,e)),T()}function b(e){O.current="touch";let t=rY(e);t?.addEventListener(e.type,function n(){!function(e){if("sloppy"!==f()||!r.select("open")||!l||rG(e,r.select("floatingElement"))||rG(e,r.select("domReferenceElement")))return;let t=e.touches[0];t&&(C.current={startTime:Date.now(),startX:t.clientX,startY:t.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},j.start(1e3,()=>{C.current&&(C.current.dismissOnTouchEnd=!1,C.current.dismissOnMouseDown=!1)}))}(e),t?.removeEventListener(e.type,n)})}function R(e){if(j.clear(),"pointerdown"===e.type&&(O.current=e.pointerType),"mousedown"===e.type&&C.current&&!C.current.dismissOnMouseDown)return;let t=rY(e);t?.addEventListener(e.type,function n(){if("pointerdown"===e.type)"sloppy"!==f()||"touch"===e.pointerType||!r.select("open")||!l||rG(e,r.select("floatingElement"))||rG(e,r.select("domReferenceElement"))||h(e);else h(e);t?.removeEventListener(e.type,n)})}function P(e){if(!y.current)return;let r=w.current;if(d(),"intentional"===f()){if("pointercancel"===e.type){r&&u();return}p(e)||(r?u():("function"!=typeof g||g(e))&&(t.clear(),k.current=!0,T()))}}function L(e){let t=rY(e);t?.addEventListener(e.type,function n(){!function(e){if("sloppy"!==f()||!C.current||rG(e,r.select("floatingElement"))||rG(e,r.select("domReferenceElement")))return;let t=e.touches[0];if(!t)return;let n=Math.abs(t.clientX-C.current.startX),o=Math.abs(t.clientY-C.current.startY),i=Math.sqrt(n*n+o*o);i>5&&(C.current.dismissOnTouchEnd=!0),i>10&&(h(e),j.clear(),C.current=null)}(e),t?.removeEventListener(e.type,n)})}function A(e){let t=rY(e);t?.addEventListener(e.type,function n(){"sloppy"!==f()||!C.current||rG(e,r.select("floatingElement"))||rG(e,r.select("domReferenceElement"))||(C.current.dismissOnTouchEnd&&h(e),j.clear(),C.current=null),t?.removeEventListener(e.type,n)})}let z=r_(o);return s&&(z.addEventListener("keydown",M),z.addEventListener("compositionstart",a),z.addEventListener("compositionend",c)),v&&(z.addEventListener("click",R,!0),z.addEventListener("pointerdown",R,!0),z.addEventListener("pointerup",P,!0),z.addEventListener("pointercancel",P,!0),z.addEventListener("mousedown",R,!0),z.addEventListener("mouseup",P,!0),z.addEventListener("touchstart",b,!0),z.addEventListener("touchmove",L,!0),z.addEventListener("touchend",A,!0)),()=>{s&&(z.removeEventListener("keydown",M),z.removeEventListener("compositionstart",a),z.removeEventListener("compositionend",c)),v&&(z.removeEventListener("click",R,!0),z.removeEventListener("pointerdown",R,!0),z.removeEventListener("pointerup",P,!0),z.removeEventListener("pointercancel",P,!0),z.removeEventListener("mousedown",R,!0),z.removeEventListener("mouseup",P,!0),z.removeEventListener("touchstart",b,!0),z.removeEventListener("touchmove",L,!0),z.removeEventListener("touchend",A,!0)),e.clear(),t.clear(),d(),k.current=!1}},[i,o,s,v,g,n,l,S,E,M,T,x,m,r,j]),b.useEffect(T,[g,T]);let A=b.useMemo(()=>({onKeyDown:M,[nQ[d]]:e=>{P()&&r.setOpen(!1,tK(tX.triggerPress,e.nativeEvent))},..."intentional"!==d&&{onClick(e){P()&&r.setOpen(!1,tK(tX.triggerPress,e.nativeEvent))}}}),[M,r,d,P]),z=tB(e=>{if(!n||!l||0!==e.button)return;let t=rY(e.nativeEvent);rK(r.select("floatingElement"),t)&&(y.current||(y.current=!0,w.current=!1))}),I=tB(e=>{!n||!l||(e.defaultPrevented||e.nativeEvent.defaultPrevented)&&y.current&&(w.current=!0)}),D=b.useMemo(()=>({onKeyDown:M,onPointerDown:I,onMouseDown:I,onClickCapture:L,onMouseDownCapture(e){L(),z(e)},onPointerDownCapture(e){L(),z(e)},onMouseUpCapture:L,onTouchEndCapture:L,onTouchMoveCapture:L}),[M,L,z,I]);return b.useMemo(()=>l?{reference:A,floating:D,trigger:A}:{},[l,A,D])}function n2(e=[]){let t=e.map(e=>e?.reference),r=e.map(e=>e?.floating),n=e.map(e=>e?.item),o=e.map(e=>e?.trigger),i=b.useCallback(t=>n5(t,e,"reference"),t),l=b.useCallback(t=>n5(t,e,"floating"),r),s=b.useCallback(t=>n5(t,e,"item"),n),a=b.useCallback(t=>n5(t,e,"trigger"),o);return b.useMemo(()=>({getReferenceProps:i,getFloatingProps:l,getItemProps:s,getTriggerProps:a}),[i,l,s,a])}function n5(e,t,r){let n=new Map,o="item"===r,i={};for(let t in"floating"===r&&(i.tabIndex=-1,i[rH]=""),e)o&&e&&(t===rW||t===rV)||(i[t]=e[t]);for(let l=0;l<t.length;l+=1){let s,a=t[l]?.[r];(s="function"==typeof a?e?a(e):null:a)&&n3(i,s,o,n)}return n3(i,e,o,n),i}function n3(e,t,r,n){for(let o in t){let i=t[o];r&&(o===rW||o===rV)||(o.startsWith("on")?(n.has(o)||n.set(o,[]),"function"==typeof i&&(n.get(o)?.push(i),e[o]=(...e)=>n.get(o)?.map(t=>t(...e)).find(e=>void 0!==e))):e[o]=i)}}let n4=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);var n6=Symbol("NOT_FOUND"),n7=e=>Array.isArray(e)?e:[e],n8=0,n9=class{revision=n8;_value;_lastValue;_isEqual=oe;constructor(e,t=oe){this._value=this._lastValue=e,this._isEqual=t}get value(){return this._value}set value(e){this.value!==e&&(this._value=e,this.revision=++n8)}};function oe(e,t){return e===t}function ot(e){return e instanceof n9||console.warn("Not a valid cell! ",e),e.value}var or=(e,t)=>!1;function on(){return function(e=oe){return new n9(null,e)}(or)}var oo=e=>{let t=e.collectionTag;null===t&&(t=e.collectionTag=on()),ot(t)};Symbol();var oi=0,ol=Object.getPrototypeOf({}),os=class{constructor(e){this.value=e,this.value=e,this.tag.value=e}proxy=new Proxy(this,oa);tag=on();tags={};children={};collectionTag=null;id=oi++},oa={get:(e,t)=>(function(){let{value:r}=e,n=Reflect.get(r,t);if("symbol"==typeof t||t in ol)return n;if("object"==typeof n&&null!==n){var o;let r=e.children[t];return void 0===r&&(r=e.children[t]=Array.isArray(o=n)?new oc(o):new os(o)),r.tag&&ot(r.tag),r.proxy}{let r=e.tags[t];return void 0===r&&((r=e.tags[t]=on()).value=n),ot(r),n}})(),ownKeys:e=>(oo(e),Reflect.ownKeys(e.value)),getOwnPropertyDescriptor:(e,t)=>Reflect.getOwnPropertyDescriptor(e.value,t),has:(e,t)=>Reflect.has(e.value,t)},oc=class{constructor(e){this.value=e,this.value=e,this.tag.value=e}proxy=new Proxy([this],ou);tag=on();tags={};children={};collectionTag=null;id=oi++},ou={get:([e],t)=>("length"===t&&oo(e),oa.get(e,t)),ownKeys:([e])=>oa.ownKeys(e),getOwnPropertyDescriptor:([e],t)=>oa.getOwnPropertyDescriptor(e,t),has:([e],t)=>oa.has(e,t)},od=(e,t)=>e===t,of="u">typeof WeakRef?WeakRef:class{constructor(e){this.value=e}deref(){return this.value}};function op(){return{s:0,v:void 0,o:null,p:null}}function om(e,t={}){let r,n=op(),{resultEqualityCheck:o}=t,i=0;function l(){let t,l=n,{length:s}=arguments;for(let e=0;e<s;e++){let t=arguments[e];if("function"==typeof t||"object"==typeof t&&null!==t){let e=l.o;null===e&&(l.o=e=new WeakMap);let r=e.get(t);void 0===r?(l=op(),e.set(t,l)):l=r}else{let e=l.p;null===e&&(l.p=e=new Map);let r=e.get(t);void 0===r?(l=op(),e.set(t,l)):l=r}}let a=l;if(1===l.s)t=l.v;else if(t=e.apply(null,arguments),i++,o){let e=r?.deref?.()??r;null!=e&&o(e,t)&&(t=e,0!==i&&i--),r="object"==typeof t&&null!==t||"function"==typeof t?new of(t):t}return a.s=1,a.v=t,t}return l.clearCache=()=>{n=op(),l.resetResultsCount()},l.resultsCount=()=>i,l.resetResultsCount=()=>{i=0},l}function oh(e,...t){let r="function"==typeof e?{memoize:e,memoizeOptions:t}:e,n=(...e)=>{let t,n,o=0,i=0,l={},s=e.pop();"object"==typeof s&&(l=s,s=e.pop()),function(e,t=`expected a function, instead received ${typeof e}`){if("function"!=typeof e)throw TypeError(t)}(s,`createSelector expects an output function after the inputs, but received: [${typeof s}]`);let{memoize:a,memoizeOptions:c=[],argsMemoize:u=om,argsMemoizeOptions:d=[],devModeChecks:f={}}={...r,...l},p=n7(c),m=n7(d),h=(!function(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(e=>"function"==typeof e)){let r=e.map(e=>"function"==typeof e?`function ${e.name||"unnamed"}()`:typeof e).join(", ");throw TypeError(`${t}[${r}]`)}}(t=Array.isArray(e[0])?e[0]:e,"createSelector expects all input-selectors to be functions, but received the following types: "),t),g=a(function(){return o++,s.apply(null,arguments)},...p);return Object.assign(u(function(){i++;let e=function(e,t){let r=[],{length:n}=e;for(let o=0;o<n;o++)r.push(e[o].apply(null,t));return r}(h,arguments);return n=g.apply(null,e)},...m),{resultFunc:s,memoizedResultFunc:g,dependencies:h,dependencyRecomputations:()=>i,resetDependencyRecomputations:()=>{i=0},lastResult:()=>n,recomputations:()=>o,resetRecomputations:()=>{o=0},memoize:a,argsMemoize:u})};return Object.assign(n,{withTypes:()=>n}),n}var og=oh(om),ob=Object.assign((e,t=og)=>{!function(e,t=`expected an object, instead received ${typeof e}`){if("object"!=typeof e)throw TypeError(t)}(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);let r=Object.keys(e);return t(r.map(t=>e[t]),(...e)=>e.reduce((e,t,n)=>(e[r[n]]=t,e),{}))},{withTypes:()=>ob});oh({memoize:function(e,t){let r,{equalityCheck:n=od,maxSize:o=1,resultEqualityCheck:i}="object"==typeof t?t:{equalityCheck:t},l=function(e,t){if(null===e||null===t||e.length!==t.length)return!1;let{length:r}=e;for(let o=0;o<r;o++)if(!n(e[o],t[o]))return!1;return!0},s=0,a=o<=1?{get:e=>r&&l(r.key,e)?r.value:n6,put(e,t){r={key:e,value:t}},getEntries:()=>r?[r]:[],clear(){r=void 0}}:function(e,t){let r=[];function n(e){let n=r.findIndex(r=>t(e,r.key));if(n>-1){let e=r[n];return n>0&&(r.splice(n,1),r.unshift(e)),e.value}return n6}return{get:n,put:function(t,o){n(t)===n6&&(r.unshift({key:t,value:o}),r.length>e&&r.pop())},getEntries:function(){return r},clear:function(){r=[]}}}(o,l);function c(){let t=a.get(arguments);if(t===n6){if(t=e.apply(null,arguments),s++,i){let e=a.getEntries().find(e=>i(e.value,t));e&&(t=e.value,0!==s&&s--)}a.put(arguments,t)}return t}return c.clearCache=()=>{a.clear(),c.resetResultsCount()},c.resultsCount=()=>s,c.resetResultsCount=()=>{s=0},c},memoizeOptions:{maxSize:1,equalityCheck:Object.is}});let ov=(e,t,r,n,o,i,...l)=>{let s;if(l.length>0)throw Error(A(1));if(e&&t&&r&&n&&o&&i)s=(l,s,a,c)=>i(e(l,s,a,c),t(l,s,a,c),r(l,s,a,c),n(l,s,a,c),o(l,s,a,c),s,a,c);else if(e&&t&&r&&n&&o)s=(i,l,s,a)=>o(e(i,l,s,a),t(i,l,s,a),r(i,l,s,a),n(i,l,s,a),l,s,a);else if(e&&t&&r&&n)s=(o,i,l,s)=>n(e(o,i,l,s),t(o,i,l,s),r(o,i,l,s),i,l,s);else if(e&&t&&r)s=(n,o,i,l)=>r(e(n,o,i,l),t(n,o,i,l),o,i,l);else if(e&&t)s=(r,n,o,i)=>t(e(r,n,o,i),n,o,i);else if(e)s=e;else throw Error("Missing arguments");return s};var ox=e.i(2239),oy=e.i(30224);let ow=[];function ok(e){let t=(t,n)=>{let o,i=I(oS).current;try{for(let e of(r=i,ow))e.before(i);for(let r of(o=e(t,n),ow))r.after(i);i.didInitialize=!0}finally{r=void 0}return o};return t.displayName=e.displayName||e.name,t}function oS(){return{didInitialize:!1}}let oE=B>=19?function(e,t,n,o,i){let l,s=r;if(!s){let r;return r=b.useCallback(()=>t(e.getSnapshot(),n,o,i),[e,t,n,o,i]),(0,ox.useSyncExternalStore)(e.subscribe,r,r)}let a=s.syncIndex;return s.syncIndex+=1,s.didInitialize?(l=s.syncHooks[a]).store===e&&l.selector===t&&Object.is(l.a1,n)&&Object.is(l.a2,o)&&Object.is(l.a3,i)||(l.store!==e&&(s.didChangeStore=!0),l.store=e,l.selector=t,l.a1=n,l.a2=o,l.a3=i,l.didChange=!0):(l={store:e,selector:t,a1:n,a2:o,a3:i,value:t(e.getSnapshot(),n,o,i),didChange:!1},s.syncHooks.push(l)),l.value}:function(e,t,r,n,o){return(0,oy.useSyncExternalStoreWithSelector)(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,r,n,o))};ow.push({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let r=0;r<e.syncHooks.length;r+=1){let n=e.syncHooks[r],o=n.selector(n.store.state,n.a1,n.a2,n.a3);(n.didChange||!Object.is(n.value,o))&&(t=!0,n.value=o,n.didChange=!1)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{let r=new Set;for(let t of e.syncHooks)r.add(t.store);let n=[];for(let e of r)n.push(e.subscribe(t));return()=>{for(let e of n)e()}}),(0,ox.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot))}});class oC{constructor(e){this.state=e,this.listeners=new Set,this.updateTick=0}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.state;setState(e){if(this.state===e)return;this.state=e,this.updateTick+=1;let t=this.updateTick;for(let r of this.listeners){if(t!==this.updateTick)return;r(e)}}update(e){for(let t in e)if(!Object.is(this.state[t],e[t]))return void this.setState({...this.state,...e})}set(e,t){Object.is(this.state[e],t)||this.setState({...this.state,[e]:t})}notifyAll(){let e={...this.state};this.setState(e)}use(e,t,r,n){return oE(this,e,t,r,n)}}class oj extends oC{constructor(e,t={},r){super(e),this.context=t,this.selectors=r}useSyncedValue(e,t){b.useDebugValue(e),tW(()=>{this.state[e]!==t&&this.set(e,t)},[e,t])}useSyncedValueWithCleanup(e,t){let r=this;tW(()=>(r.state[e]!==t&&r.set(e,t),()=>{r.set(e,void 0)}),[r,e,t])}useSyncedValues(e){let t=this;tW(()=>{t.update(e)},[t,...Object.values(e)])}useControlledProp(e,t){b.useDebugValue(e);let r=void 0!==t;tW(()=>{r&&!Object.is(this.state[e],t)&&super.setState({...this.state,[e]:t})},[e,t,r])}select(e,t,r,n){return(0,this.selectors[e])(this.state,t,r,n)}useState(e,t,r,n){return b.useDebugValue(e),oE(this,this.selectors[e],t,r,n)}useContextCallback(e,t){b.useDebugValue(e);let r=tB(t??H);this.context[e]=r}useStateSetter(e){let t=b.useRef(void 0);return void 0===t.current&&(t.current=t=>{this.set(e,t)}),t.current}observe(e,t){let r,n=(r="function"==typeof e?e:this.selectors[e])(this.state);return t(n,n,this),this.subscribe(e=>{let o=r(e);if(!Object.is(n,o)){let e=n;n=o,t(o,e,this)}})}}let oR={open:ov(e=>e.open),domReferenceElement:ov(e=>e.domReferenceElement),referenceElement:ov(e=>e.positionReference??e.referenceElement),floatingElement:ov(e=>e.floatingElement),floatingId:ov(e=>e.floatingId)};class oT extends oj{constructor(e){const{nested:t,noEmit:r,onOpenChange:n,triggerElements:o,...i}=e;super({...i,positionReference:i.referenceElement,domReferenceElement:i.referenceElement},{onOpenChange:n,dataRef:{current:{}},events:function(){let e=new Map;return{emit(t,r){e.get(t)?.forEach(e=>e(r))},on(t,r){e.has(t)||e.set(t,new Set),e.get(t).add(r)},off(t,r){e.get(t)?.delete(r)}}}(),nested:t,noEmit:r,triggerElements:o},oR)}setOpen=(e,t)=>{if((!e||!this.state.open||r1(t.event))&&(this.context.dataRef.current.openEvent=e?t.event:void 0),!this.context.noEmit){let r={open:e,reason:t.reason,nativeEvent:t.event,nested:this.context.nested,triggerElement:t.trigger};this.context.events.emit("openchange",r)}this.context.onOpenChange?.(e,t)}}function oN(e){let{popupStore:t,noEmit:r=!1,treatPopupAsFloatingElement:n=!1,onOpenChange:o}=e,i=tQ(),l=null!=nS(),s=t.useState("open"),a=t.useState("activeTriggerElement"),c=t.useState(n?"popupElement":"positionerElement"),u=t.context.triggerElements,d=I(()=>new oT({open:s,referenceElement:a,floatingElement:c,triggerElements:u,onOpenChange:o,floatingId:i,nested:l,noEmit:r})).current;return tW(()=>{let e={open:s,floatingId:i,referenceElement:a,floatingElement:c};tk(a)&&(e.domReferenceElement=a),d.state.positionReference===d.state.referenceElement&&(e.positionReference=a),d.update(e)},[s,i,a,c,d]),d.context.onOpenChange=o,d.context.nested=l,d.context.noEmit=r,d}var tX=tX;function oO(e,t,r,n){let o,i,l=r.useState("isMountedByTrigger",e),s=(o=b.useRef(null),i=b.useRef(null),b.useCallback(t=>{if(void 0!==e){if(null!==o.current){let e=o.current,t=i.current,n=r.context.triggerElements.getById(e);t&&n===t&&r.context.triggerElements.delete(e),o.current=null,i.current=null}null!==t&&(o.current=e,i.current=t,r.context.triggerElements.add(e,t))}},[r,e])),a=tB(t=>{if(s(t),!t||!r.select("open"))return;let o=r.select("activeTriggerId");o===e?r.update({activeTriggerElement:t,...n}):null==o&&r.update({activeTriggerId:e,activeTriggerElement:t,...n})});return tW(()=>{l&&r.update({activeTriggerElement:t.current,...n})},[l,r,t,...Object.values(n)]),{registerTrigger:a,isMountedByThisTrigger:l}}function oP(e){let t=e.useState("open");tW(()=>{if(t&&!e.select("activeTriggerId")&&1===e.context.triggerElements.size){let t=e.context.triggerElements.entries().next();if(!t.done){let[r,n]=t.value;e.update({activeTriggerId:r,activeTriggerElement:n})}}},[t,e])}function oM(e,t,r){let{mounted:n,setMounted:o,transitionStatus:i}=function(e,t=!1,r=!1){let[n,o]=b.useState(e&&t?"idle":void 0),[i,l]=b.useState(e);return e&&!i&&(l(!0),o("starting")),e||!i||"ending"===n||r||o("ending"),e||i||"ending"!==n||o(void 0),tW(()=>{if(!e&&i&&"ending"!==n&&r){let e=rI.request(()=>{o("ending")});return()=>{rI.cancel(e)}}},[e,i,n,r]),tW(()=>{if(!e||t)return;let r=rI.request(()=>{o(void 0)});return()=>{rI.cancel(r)}},[t,e]),tW(()=>{if(!e||!t)return;e&&i&&"idle"!==n&&o("starting");let r=rI.request(()=>{o("idle")});return()=>{rI.cancel(r)}},[t,e,i,o,n]),b.useMemo(()=>({mounted:i,setMounted:l,transitionStatus:n}),[i,n])}(e);t.useSyncedValues({mounted:n,transitionStatus:i});let l=tB(()=>{o(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1}),r?.(),t.context.onOpenChangeComplete?.(!1)});return nI({enabled:!t.useState("preventUnmountingOnClose"),open:e,ref:t.context.popupRef,onComplete(){e||l()}}),{forceUnmount:l,transitionStatus:i}}class oL{constructor(){this.elementsSet=new Set,this.idMap=new Map}add(e,t){let r=this.idMap.get(e);r!==t&&(void 0!==r&&this.elementsSet.delete(r),this.elementsSet.add(t),this.idMap.set(e,t))}delete(e){let t=this.idMap.get(e);t&&(this.elementsSet.delete(t),this.idMap.delete(e))}hasElement(e){return this.elementsSet.has(e)}hasMatchingElement(e){for(let t of this.elementsSet)if(e(t))return!0;return!1}getById(e){return this.idMap.get(e)}entries(){return this.idMap.entries()}elements(){return this.elementsSet.values()}get size(){return this.idMap.size}}function oA(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:"idle",floatingRootContext:new oT({open:!1,floatingElement:null,referenceElement:null,triggerElements:new oL,floatingId:"",nested:!1,noEmit:!1,onOpenChange:void 0}),preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:W,inactiveTriggerProps:W,popupProps:W}}let oz=ov(e=>e.triggerIdProp??e.activeTriggerId),oI={open:ov(e=>e.openProp??e.open),mounted:ov(e=>e.mounted),transitionStatus:ov(e=>e.transitionStatus),floatingRootContext:ov(e=>e.floatingRootContext),preventUnmountingOnClose:ov(e=>e.preventUnmountingOnClose),payload:ov(e=>e.payload),activeTriggerId:oz,activeTriggerElement:ov(e=>e.mounted?e.activeTriggerElement:null),isTriggerActive:ov((e,t)=>void 0!==t&&oz(e)===t),isOpenedByTrigger:ov((e,t)=>void 0!==t&&oz(e)===t&&e.open),isMountedByTrigger:ov((e,t)=>void 0!==t&&oz(e)===t&&e.mounted),triggerProps:ov((e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps),popupProps:ov(e=>e.popupProps),popupElement:ov(e=>e.popupElement),positionerElement:ov(e=>e.positionerElement)},oD={...oI,modal:ov(e=>e.modal),nested:ov(e=>e.nested),nestedOpenDialogCount:ov(e=>e.nestedOpenDialogCount),disablePointerDismissal:ov(e=>e.disablePointerDismissal),openMethod:ov(e=>e.openMethod),descriptionElementId:ov(e=>e.descriptionElementId),titleElementId:ov(e=>e.titleElementId),viewportElement:ov(e=>e.viewportElement),role:ov(e=>e.role)};class o_ extends oj{constructor(e){super(function(e={}){return{...oA(),modal:!0,disablePointerDismissal:!1,popupElement:null,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,role:"dialog",...e}}(e),{popupRef:b.createRef(),backdropRef:b.createRef(),internalBackdropRef:b.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:new oL,onOpenChange:void 0,onOpenChangeComplete:void 0},oD)}setOpen=(e,t)=>{if(t.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},e||null!=t.trigger||null==this.state.activeTriggerId||(t.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(e,t),t.isCanceled)return;let r={open:e,nativeEvent:t.event,reason:t.reason,nested:this.state.nested};this.state.floatingRootContext.context.events?.emit("openchange",r);let n={open:e},o=t.trigger?.id??null;(o||e)&&(n.activeTriggerId=o,n.activeTriggerElement=t.trigger??null),this.update(n)}}let o$=((c={})[c.open=ts.open]="open",c[c.closed=ts.closed]="closed",c[c.startingStyle=ts.startingStyle]="startingStyle",c[c.endingStyle=ts.endingStyle]="endingStyle",c.nested="data-nested",c.nestedDialogOpen="data-nested-dialog-open",c),oB={...tm,...tl,nested:e=>e?{[o$.nested]:""}:null,nestedDialogOpen:e=>e?{[o$.nestedDialogOpen]:""}:null},oF=b.forwardRef(function(e,t){let{className:r,render:n,children:o,...i}=e,l=nA(),{store:s}=tr(),a=s.useState("open"),c=s.useState("nested"),u=s.useState("transitionStatus"),d=s.useState("nestedOpenDialogCount"),f=s.useState("mounted");return V("div",e,{enabled:l||f,state:{open:a,nested:c,transitionStatus:u,nestedDialogOpen:d>0},ref:[t,s.useStateSetter("viewportElement")],stateAttributesMapping:oB,props:[{role:"presentation",hidden:!f,style:{pointerEvents:a?void 0:"none"},children:o},i]})}),oH=b.forwardRef(function(e,t){let{render:r,className:n,id:o,...i}=e,{store:l}=tr(),s=t0(o);return l.useSyncedValueWithCleanup("titleElementId",s),V("h2",e,{ref:t,props:[{id:s},i]})});var tX=tX;let oW=b.forwardRef(function(e,t){let{render:r,className:n,disabled:o=!1,nativeButton:i=!0,id:l,payload:s,handle:a,...c}=e,u=tr(!0),d=a?.store??u?.store;if(!d)throw Error(A(79));let f=t0(l),p=d.useState("floatingRootContext"),m=d.useState("isOpenedByTrigger",f),h=b.useRef(null),{registerTrigger:g,isMountedByThisTrigger:v}=oO(f,h,d,{payload:s}),{getButtonProps:x,buttonRef:y}=tU({disabled:o,native:i}),w=n2([function(e,t={}){let r="rootStore"in e?e.rootStore:e,n=r.context.dataRef,{enabled:o=!0,event:i="click",toggle:l=!0,ignoreMouse:s=!1,stickIfOpen:a=!0,touchOpenDelay:c=0,reason:u=tX.triggerPress}=t,d=b.useRef(void 0),f=rD(),p=rE(),m=b.useMemo(()=>({onPointerDown(e){d.current=e.pointerType},onMouseDown(e){let t=d.current,o=e.nativeEvent,m=r.select("open");if(0!==e.button||"click"===i||r0(t,!0)&&s)return;let h=n.current.openEvent,g=h?.type,b=r.select("domReferenceElement")!==e.currentTarget,v=m&&b||!(m&&l&&(!h||!a||"click"===g||"mousedown"===g));if(rZ(o.target)){let e=tK(u,o,o.target);v&&"touch"===t&&c>0?p.start(c,()=>{r.setOpen(!0,e)}):r.setOpen(v,e);return}let x=e.currentTarget;f.request(()=>{let e=tK(u,o,x);v&&"touch"===t&&c>0?p.start(c,()=>{r.setOpen(!0,e)}):r.setOpen(v,e)})},onClick(e){if("mousedown-only"===i)return;let t=d.current;if("mousedown"===i&&t){d.current=void 0;return}if(r0(t,!0)&&s)return;let o=r.select("open"),f=n.current.openEvent,m=r.select("domReferenceElement")!==e.currentTarget,h=o&&m||!(o&&l&&(!f||!a||r1(f))),g=tK(u,e.nativeEvent,e.currentTarget);h&&"touch"===t&&c>0?p.start(c,()=>{r.setOpen(!0,g)}):r.setOpen(h,g)},onKeyDown(){d.current=void 0}}),[n,i,s,r,a,l,f,p,c,u]);return b.useMemo(()=>o?{reference:m}:W,[o,m])}(p,{enabled:null!=p})]),k=d.useState("triggerProps",v);return V("button",e,{state:{disabled:o,open:m},ref:[y,t,g,h],props:[w.getReferenceProps(),k,{[nm]:"",id:f},c,x],stateAttributesMapping:tp})});var tX=tX;class oV{constructor(e){this.store=e??new o_}open(e){let t=e?this.store.context.triggerElements.getById(e):void 0;this.store.setOpen(!0,tK(tX.imperativeAction,void 0,t))}openWithPayload(e){this.store.set("payload",e),this.store.setOpen(!0,tK(tX.imperativeAction,void 0,void 0))}close(){this.store.setOpen(!1,tK(tX.imperativeAction,void 0,void 0))}get isOpen(){return this.store.state.open}}e.s(["Backdrop",0,tg,"Close",0,tY,"Description",0,t1,"Handle",0,oV,"Popup",0,nW,"Portal",0,nq,"Root",0,function(e){let{children:t,open:r,defaultOpen:n=!1,onOpenChange:o,onOpenChangeComplete:i,disablePointerDismissal:l=!1,modal:s=!0,actionsRef:a,handle:c,triggerId:u,defaultTriggerId:d=null}=e,f=tr(!0),p=!!f,h=I(()=>c?.store??new o_({open:n,openProp:r,activeTriggerId:d,triggerIdProp:u,modal:s,disablePointerDismissal:l,nested:p})).current;nK(()=>{void 0===r&&!1===h.state.open&&!0===n&&h.update({open:!0,activeTriggerId:d})}),h.useControlledProp("openProp",r),h.useControlledProp("triggerIdProp",u),h.useSyncedValues({disablePointerDismissal:l,nested:p,modal:s}),h.useContextCallback("onOpenChange",o),h.useContextCallback("onOpenChangeComplete",i);let g=h.useState("payload");!function(e){let{store:t,parentContext:r,actionsRef:n}=e,o=t.useState("open"),i=t.useState("disablePointerDismissal"),l=t.useState("modal"),s=t.useState("popupElement"),{openMethod:a,triggerProps:c}=function(e){let t,r,n,o,[i,l]=b.useState(null),s=tB((t,r)=>{e||l(r||(rO?"touch":""))});t=b.useRef(e),tW(()=>{t.current!==e&&r(t.current)},[e,r=tB(t=>{t&&!e&&l(null)})]),tW(()=>{t.current=e},[e]);let{onClick:a,onPointerDown:c}=(n=b.useRef(""),o=b.useCallback(e=>{e.defaultPrevented||(n.current=e.pointerType,s(e,e.pointerType))},[s]),{onClick:b.useCallback(e=>{0===e.detail?s(e,"keyboard"):(s(e,"pointerType"in e?e.pointerType:n.current),n.current="")},[s]),onPointerDown:o});return b.useMemo(()=>({openMethod:i,triggerProps:{onClick:a,onPointerDown:c}}),[i,a,c])}(o);oP(t);let{forceUnmount:u}=oM(o,t),d=tB(e=>{let r=tK(e);return r.preventUnmountOnClose=()=>{t.set("preventUnmountingOnClose",!0)},r}),f=b.useCallback(()=>{t.setOpen(!1,d(tX.imperativeAction))},[t,d]);b.useImperativeHandle(n,()=>({unmount:u,close:f}),[u,f]);let p=oN({popupStore:t,onOpenChange:t.setOpen,treatPopupAsFloatingElement:!0,noEmit:!0}),[m,h]=b.useState(0),g=0===m,v=function(e,t={}){let r="rootStore"in e?e.rootStore:e,n=r.useState("open"),o=r.useState("floatingId"),i=r.useState("domReferenceElement"),l=r.useState("floatingElement"),{role:s="dialog"}=t,a=tQ(),c=i?.id||a,u=b.useMemo(()=>rQ(l)?.id||o,[l,o]),d=n4.get(s)??s,f=null!=nS(),p=b.useMemo(()=>"tooltip"===d||"label"===s?W:{"aria-haspopup":"alertdialog"===d?"dialog":d,"aria-expanded":"false",..."listbox"===d&&{role:"combobox"},..."menu"===d&&f&&{role:"menuitem"},..."select"===s&&{"aria-autocomplete":"none"},..."combobox"===s&&{"aria-autocomplete":"list"}},[d,f,s]),m=b.useMemo(()=>"tooltip"===d||"label"===s?{[`aria-${"label"===s?"labelledby":"describedby"}`]:n?u:void 0}:{...p,"aria-expanded":n?"true":"false","aria-controls":n?u:void 0,..."menu"===d&&{id:c}},[d,u,n,c,s,p]),h=b.useMemo(()=>{let e={id:u,...d&&{role:d}};return"tooltip"===d||"label"===s?e:{...e,..."menu"===d&&{"aria-labelledby":c}}},[d,u,c,s]),g=b.useCallback(({active:e,selected:t})=>{let r={role:"option",...e&&{id:`${u}-fui-option`}};switch(s){case"select":case"combobox":return{...r,"aria-selected":t}}return{}},[u,s]);return b.useMemo(()=>({reference:m,floating:h,item:g,trigger:p}),[m,h,p,g])}(p),x=n1(p,{outsidePressEvent:()=>t.context.internalBackdropRef.current||t.context.backdropRef.current?"intentional":{mouse:"trap-focus"===l?"sloppy":"intentional",touch:"sloppy"},outsidePress(e){if(!t.context.outsidePressEnabledRef.current||"button"in e&&0!==e.button||"touches"in e&&1!==e.touches.length)return!1;let r=rY(e);return!!g&&!i&&(!l||!t.context.internalBackdropRef.current&&!t.context.backdropRef.current||t.context.internalBackdropRef.current===r||t.context.backdropRef.current===r||rK(r,s)&&!r?.hasAttribute("data-base-ui-portal"))},escapeKey:g});!function(e=!0,t=null){tW(()=>{if(e)return nJ.acquire(t)},[e,t])}(o&&!0===l,s);let{getReferenceProps:y,getFloatingProps:w,getTriggerProps:k}=n2([v,x]);t.useContextCallback("onNestedDialogOpen",e=>{h(e+1)}),t.useContextCallback("onNestedDialogClose",()=>{h(0)}),b.useEffect(()=>(r?.onNestedDialogOpen&&o&&r.onNestedDialogOpen(m),r?.onNestedDialogClose&&!o&&r.onNestedDialogClose(),()=>{r?.onNestedDialogClose&&o&&r.onNestedDialogClose()}),[o,r,m]);let S=b.useMemo(()=>y(c),[y,c]),E=b.useMemo(()=>k(c),[k,c]),C=b.useMemo(()=>w(),[w]);t.useSyncedValues({openMethod:a,activeTriggerProps:S,inactiveTriggerProps:E,popupProps:C,floatingRootContext:p,nestedOpenDialogCount:m})}({store:h,actionsRef:a,parentContext:f?.store.context,onOpenChange:o,triggerIdProp:u});let v=b.useMemo(()=>({store:h}),[h]);return(0,m.jsx)(tt.Provider,{value:v,children:"function"==typeof t?t({payload:g}):t})},"Title",0,oH,"Trigger",0,oW,"Viewport",0,oF,"createHandle",0,function(){return new oV}],87913);var oU=e.i(87913),oU=oU;let oq=(...e)=>e.filter((e,t,r)=>!!e&&""!==e.trim()&&r.indexOf(e)===t).join(" ").trim(),oK=e=>{let t=e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,r)=>r?r.toUpperCase():t.toLowerCase());return t.charAt(0).toUpperCase()+t.slice(1)};var oX={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let oY=(0,b.createContext)({}),oG=(0,b.forwardRef)(({color:e,size:t,strokeWidth:r,absoluteStrokeWidth:n,className:o="",children:i,iconNode:l,...s},a)=>{let{size:c=24,strokeWidth:u=2,absoluteStrokeWidth:d=!1,color:f="currentColor",className:p=""}=(0,b.useContext)(oY)??{},m=n??d?24*Number(r??u)/Number(t??c):r??u;return(0,b.createElement)("svg",{ref:a,...oX,width:t??c??oX.width,height:t??c??oX.height,stroke:e??f,strokeWidth:m,className:oq("lucide",p,o),...!i&&!(e=>{for(let t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0;return!1})(s)&&{"aria-hidden":"true"},...s},[...l.map(([e,t])=>(0,b.createElement)(e,t)),...Array.isArray(i)?i:[i]])}),oZ=(u=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],(n=(0,b.forwardRef)(({className:e,...t},r)=>(0,b.createElement)(oG,{ref:r,iconNode:u,className:oq(`lucide-${oK("x").replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,"lucide-x",e),...t}))).displayName=oK("x"),n),oJ=e=>{let t,r,n=(0,h.c)(4);return n[0]!==e?({...t}=e,n[0]=e,n[1]=t):t=n[1],n[2]!==t?(r=(0,m.jsx)(oU.Root,{"data-slot":"sheet",...t}),n[2]=t,n[3]=r):r=n[3],r},oQ=e=>{let t,r,n=(0,h.c)(4);return n[0]!==e?({...t}=e,n[0]=e,n[1]=t):t=n[1],n[2]!==t?(r=(0,m.jsx)(oU.Portal,{"data-slot":"sheet-portal",...t}),n[2]=t,n[3]=r):r=n[3],r},o0=e=>{let t,r,n,o,i=(0,h.c)(8);return i[0]!==e?({className:t,...r}=e,i[0]=e,i[1]=t,i[2]=r):(t=i[1],r=i[2]),i[3]!==t?(n=((...e)=>e4(K(e)))("fixed inset-0 z-50 bg-black/10 transition-opacity duration-150 data-ending-style:opacity-0 data-starting-style:opacity-0 supports-backdrop-filter:backdrop-blur-xs",t),i[3]=t,i[4]=n):n=i[4],i[5]!==r||i[6]!==n?(o=(0,m.jsx)(oU.Backdrop,{"data-slot":"sheet-overlay",className:n,...r}),i[5]=r,i[6]=n,i[7]=o):o=i[7],o},o1=e=>{let t,r,n,o,i,l,s,a,c,u=(0,h.c)(17);u[0]!==e?({className:r,children:t,side:o,showCloseButton:i,...n}=e,u[0]=e,u[1]=t,u[2]=r,u[3]=n,u[4]=o,u[5]=i):(t=u[1],r=u[2],n=u[3],o=u[4],i=u[5]);let d=void 0===o?"right":o,f=void 0===i||i;return u[6]===Symbol.for("react.memo_cache_sentinel")?(l=(0,m.jsx)(o0,{}),u[6]=l):l=u[6],u[7]!==r?(s=((...e)=>e4(K(e)))("fixed z-50 flex flex-col gap-4 bg-popover bg-clip-padding text-sm text-popover-foreground shadow-lg transition duration-200 ease-in-out data-ending-style:opacity-0 data-starting-style:opacity-0 data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=bottom]:data-ending-style:translate-y-[2.5rem] data-[side=bottom]:data-starting-style:translate-y-[2.5rem] data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=left]:data-ending-style:translate-x-[-2.5rem] data-[side=left]:data-starting-style:translate-x-[-2.5rem] data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=right]:data-ending-style:translate-x-[2.5rem] data-[side=right]:data-starting-style:translate-x-[2.5rem] data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=top]:data-ending-style:translate-y-[-2.5rem] data-[side=top]:data-starting-style:translate-y-[-2.5rem] data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm",r),u[7]=r,u[8]=s):s=u[8],u[9]!==f?(a=f&&(0,m.jsxs)(oU.Close,{"data-slot":"sheet-close",render:(0,m.jsx)(e8,{variant:"ghost",className:"absolute top-3 right-3",size:"icon-sm"}),children:[(0,m.jsx)(oZ,{}),(0,m.jsx)("span",{className:"sr-only",children:"Close"})]}),u[9]=f,u[10]=a):a=u[10],u[11]!==t||u[12]!==n||u[13]!==d||u[14]!==s||u[15]!==a?(c=(0,m.jsxs)(oQ,{children:[l,(0,m.jsxs)(oU.Popup,{"data-slot":"sheet-content","data-side":d,className:s,...n,children:[t,a]})]}),u[11]=t,u[12]=n,u[13]=d,u[14]=s,u[15]=a,u[16]=c):c=u[16],c},o2=e=>{let t,r,n,o,i=(0,h.c)(8);return i[0]!==e?({className:t,...r}=e,i[0]=e,i[1]=t,i[2]=r):(t=i[1],r=i[2]),i[3]!==t?(n=((...e)=>e4(K(e)))("flex flex-col gap-0.5 p-4",t),i[3]=t,i[4]=n):n=i[4],i[5]!==r||i[6]!==n?(o=(0,m.jsx)("div",{"data-slot":"sheet-header",className:n,...r}),i[5]=r,i[6]=n,i[7]=o):o=i[7],o},o5=e=>{let t,r,n,o,i=(0,h.c)(8);return i[0]!==e?({className:t,...r}=e,i[0]=e,i[1]=t,i[2]=r):(t=i[1],r=i[2]),i[3]!==t?(n=((...e)=>e4(K(e)))("font-heading text-base font-medium text-foreground",t),i[3]=t,i[4]=n):n=i[4],i[5]!==r||i[6]!==n?(o=(0,m.jsx)(oU.Title,{"data-slot":"sheet-title",className:n,...r}),i[5]=r,i[6]=n,i[7]=o):o=i[7],o},o3=e=>{let t,r,n,o,i=(0,h.c)(8);return i[0]!==e?({className:t,...r}=e,i[0]=e,i[1]=t,i[2]=r):(t=i[1],r=i[2]),i[3]!==t?(n=((...e)=>e4(K(e)))("text-sm text-muted-foreground",t),i[3]=t,i[4]=n):n=i[4],i[5]!==r||i[6]!==n?(o=(0,m.jsx)(oU.Description,{"data-slot":"sheet-description",className:n,...r}),i[5]=r,i[6]=n,i[7]=o):o=i[7],o};e.s([],13136),e.i(13136);let o4=b.createContext(void 0);function o6(e){let t=b.useContext(o4);if(void 0===t&&!e)throw Error(A(72));return t}function o7(e){return null!=e&&null!=e.clientX}var tX=tX;let o8={...oI,disabled:ov(e=>e.disabled),instantType:ov(e=>e.instantType),isInstantPhase:ov(e=>e.isInstantPhase),trackCursorAxis:ov(e=>e.trackCursorAxis),disableHoverablePopup:ov(e=>e.disableHoverablePopup),lastOpenChangeReason:ov(e=>e.openChangeReason),closeOnClick:ov(e=>e.closeOnClick),closeDelay:ov(e=>e.closeDelay),hasViewport:ov(e=>e.hasViewport)};class o9 extends oj{constructor(e){super({...oA(),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:"none",disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,hasViewport:!1,...e},{popupRef:b.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:new oL},o8)}setOpen=(e,t)=>{let r=t.reason,n=r===tX.triggerHover,o=e&&r===tX.triggerFocus,i=!e&&(r===tX.triggerPress||r===tX.escapeKey);if(t.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},this.context.onOpenChange?.(e,t),t.isCanceled)return;let l=()=>{let n={open:e,openChangeReason:r};o?n.instantType="focus":i?n.instantType="dismiss":r===tX.triggerHover&&(n.instantType=void 0);let l=t.trigger?.id??null;(l||e)&&(n.activeTriggerId=l,n.activeTriggerElement=t.trigger??null),this.update(n)};n?nf.flushSync(l):l()};static useStore(e,t){let r=I(()=>new o9(t)).current,n=e??r,o=oN({popupStore:n,onOpenChange:n.setOpen});return n.state.floatingRootContext=o,n}}var tX=tX;let ie=ok(function(e){let{disabled:t=!1,defaultOpen:r=!1,open:n,disableHoverablePopup:o=!1,trackCursorAxis:i="none",actionsRef:l,onOpenChange:s,onOpenChangeComplete:a,handle:c,triggerId:u,defaultTriggerId:d=null,children:f}=e,p=o9.useStore(c?.store,{open:r,openProp:n,activeTriggerId:d,triggerIdProp:u});nK(()=>{void 0===n&&!1===p.state.open&&!0===r&&p.update({open:!0,activeTriggerId:d})}),p.useControlledProp("openProp",n),p.useControlledProp("triggerIdProp",u),p.useContextCallback("onOpenChange",s),p.useContextCallback("onOpenChangeComplete",a);let h=p.useState("open"),g=!t&&h,v=p.useState("activeTriggerId"),x=p.useState("payload");p.useSyncedValues({trackCursorAxis:i,disableHoverablePopup:o}),tW(()=>{h&&t&&p.setOpen(!1,tK(tX.disabled))},[h,t,p]),p.useSyncedValue("disabled",t),oP(p);let{forceUnmount:y,transitionStatus:w}=oM(g,p),k=p.useState("isInstantPhase"),S=p.useState("instantType"),E=p.useState("lastOpenChangeReason"),C=b.useRef(null);tW(()=>{"ending"===w&&E===tX.none||"ending"!==w&&k?("delay"!==S&&(C.current=S),p.set("instantType","delay")):null!==C.current&&(p.set("instantType",C.current),C.current=null)},[w,k,E,S,p]),tW(()=>{g&&null==v&&p.set("payload",void 0)},[p,v,g]);let j=b.useCallback(()=>{var e;let t;p.setOpen(!1,(e=p,(t=tK(tX.imperativeAction)).preventUnmountOnClose=()=>{e.set("preventUnmountingOnClose",!0)},t))},[p]);b.useImperativeHandle(l,()=>({unmount:y,close:j}),[y,j]);let R=p.useState("floatingRootContext"),{getReferenceProps:T,getFloatingProps:N,getTriggerProps:O}=n2([n1(R,{enabled:!t,referencePress:()=>p.select("closeOnClick")}),function(e,t={}){let r="rootStore"in e?e.rootStore:e,n=r.useState("open"),o=r.useState("floatingElement"),i=r.useState("domReferenceElement"),l=r.context.dataRef,{enabled:s=!0,axis:a="both"}=t,c=b.useRef(!1),u=b.useRef(null),[d,f]=b.useState(),[p,m]=b.useState([]),h=tB((e,t,n)=>{if(!c.current&&(!l.current.openEvent||o7(l.current.openEvent))){var o,s;let c,u,f;r.set("positionReference",(o=n??i,s={x:e,y:t,axis:a,dataRef:l,pointerType:d},c=null,u=null,f=!1,{contextElement:o||void 0,getBoundingClientRect(){let e=o?.getBoundingClientRect()||{width:0,height:0,x:0,y:0},t="x"===s.axis||"both"===s.axis,r="y"===s.axis||"both"===s.axis,n=["mouseenter","mousemove"].includes(s.dataRef.current.openEvent?.type||"")&&"touch"!==s.pointerType,i=e.width,l=e.height,a=e.x,d=e.y;return null==c&&s.x&&t&&(c=e.x-s.x),null==u&&s.y&&r&&(u=e.y-s.y),a-=c||0,d-=u||0,i=0,l=0,!f||n?(i="y"===s.axis?e.width:0,l="x"===s.axis?e.height:0,a=t&&null!=s.x?s.x:a,d=r&&null!=s.y?s.y:d):f&&!n&&(l="x"===s.axis?e.height:l,i="y"===s.axis?e.width:i),f=!0,{width:i,height:l,x:a,y:d,top:d,right:a+i,bottom:d+l,left:a}}}))}}),g=tB(e=>{n?u.current||m([]):h(e.clientX,e.clientY,e.currentTarget)}),v=r0(d)?o:n,x=b.useCallback(()=>{if(!v||!s)return;let e=tx(o);function t(r){rK(o,rY(r))?(e.removeEventListener("mousemove",t),u.current=null):h(r.clientX,r.clientY)}if(!l.current.openEvent||o7(l.current.openEvent)){e.addEventListener("mousemove",t);let r=()=>{e.removeEventListener("mousemove",t),u.current=null};return u.current=r,r}r.set("positionReference",i)},[v,s,o,l,i,r,h]);b.useEffect(()=>x(),[x,p]),b.useEffect(()=>{s&&!o&&(c.current=!1)},[s,o]),b.useEffect(()=>{!s&&n&&(c.current=!0)},[s,n]);let y=b.useMemo(()=>{function e(e){f(e.pointerType)}return{onPointerDown:e,onPointerEnter:e,onMouseMove:g,onMouseEnter:g}},[g]);return b.useMemo(()=>s?{reference:y,trigger:y}:{},[s,y])}(R,{enabled:!t&&"none"!==i,axis:"none"===i?void 0:i})]),P=b.useMemo(()=>T(),[T]),M=b.useMemo(()=>O(),[O]),L=b.useMemo(()=>N(),[N]);return p.useSyncedValues({activeTriggerProps:P,inactiveTriggerProps:M,popupProps:L}),(0,m.jsx)(o4.Provider,{value:p,children:"function"==typeof f?f({payload:x}):f})}),it=b.createContext(void 0),ir=.1*.1;function io(e,t,r,n,o,i){return n>=t!=i>=t&&e<=(o-r)*(t-n)/(i-n)+r}function ii(e,t,r,n,o,i,l,s,a,c){let u=!1;return io(e,t,r,n,o,i)&&(u=!u),io(e,t,o,i,l,s)&&(u=!u),io(e,t,l,s,a,c)&&(u=!u),io(e,t,a,c,r,n)&&(u=!u),u}function il(e,t,r,n,o,i){let l=Math.min(r,o),s=Math.max(r,o),a=Math.min(n,i),c=Math.max(n,i);return e>=l&&e<=s&&t>=a&&t<=c}function is(e,t,r){let n=null==r||r0(r)?"function"==typeof e?e():e:0;return"number"==typeof n?n:n?.[t]}function ia(e){return"function"==typeof e?e():e}function ic(e,t){return t||"click"===e||"mousedown"===e}var tX=tX;let iu=b.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new rS,currentIdRef:{current:null},currentContextRef:{current:null}});function id(e){let{children:t,delay:r,timeoutMs:n=0}=e,o=b.useRef(r),i=b.useRef(r),l=b.useRef(null),s=b.useRef(null),a=rE();return(0,m.jsx)(iu.Provider,{value:b.useMemo(()=>({hasProvider:!0,delayRef:o,initialDelayRef:i,currentIdRef:l,timeoutMs:n,currentContextRef:s,timeout:a}),[n,a]),children:t})}var tX=tX;let ip=rL&&rP;var tX=tX;let im=`button,a,[role="button"],select,[tabindex]:not([tabindex="-1"]),${rU}`;class ih{constructor(){this.pointerType=void 0,this.interactedInside=!1,this.handler=void 0,this.blockMouseMove=!0,this.performedPointerEventsMutation=!1,this.pointerEventsScopeElement=null,this.pointerEventsReferenceElement=null,this.pointerEventsFloatingElement=null,this.restTimeoutPending=!1,this.openChangeTimeout=new rS,this.restTimeout=new rS,this.handleCloseOptions=void 0}static create(){return new ih}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose}function ig(e){e.performedPointerEventsMutation&&(e.pointerEventsScopeElement?.style.removeProperty("pointer-events"),e.pointerEventsReferenceElement?.style.removeProperty("pointer-events"),e.pointerEventsFloatingElement?.style.removeProperty("pointer-events"),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null)}function ib(e){let t=I(ih.create).current,r=e.context.dataRef.current;return r.hoverInteractionState||(r.hoverInteractionState=t),rk(r.hoverInteractionState.disposeEffect),r.hoverInteractionState}let iv={current:null},ix=((d={})[d.popupOpen=ta.popupOpen]="popupOpen",d.triggerDisabled="data-trigger-disabled",d),iy=(f=function(e,t){let{className:r,render:n,handle:o,payload:i,disabled:l,delay:s,closeOnClick:a=!0,closeDelay:c,id:u,...d}=e,f=o6(!0),p=o?.store??f;if(!p)throw Error(A(82));let m=t0(u),h=p.useState("isTriggerActive",m),g=p.useState("isOpenedByTrigger",m),v=p.useState("floatingRootContext"),x=b.useRef(null),y=s??600,w=c??0,{registerTrigger:k,isMountedByThisTrigger:S}=oO(m,x,p,{payload:i,closeOnClick:a,closeDelay:w}),E=b.useContext(it),{delayRef:C,isInstantPhase:j,hasProvider:R}=function(e,t={open:!1}){let r="rootStore"in e?e.rootStore:e,n=r.useState("floatingId"),{open:o}=t,{currentIdRef:i,delayRef:l,timeoutMs:s,initialDelayRef:a,currentContextRef:c,hasProvider:u,timeout:d}=b.useContext(iu),[f,p]=b.useState(!1);return tW(()=>{function e(){p(!1),c.current?.setIsInstantPhase(!1),i.current=null,c.current=null,l.current=a.current}if(i.current&&!o&&i.current===n){if(p(!1),s)return d.start(s,()=>{r.select("open")||i.current&&i.current!==n||e()}),()=>{d.clear()};e()}},[o,n,i,l,s,a,c,d,r]),tW(()=>{if(!o)return;let e=c.current,t=i.current;d.clear(),c.current={onOpenChange:r.setOpen,setIsInstantPhase:p},i.current=n,l.current={open:0,close:is(a.current,"close")},null!==t&&t!==n?(p(!0),e?.setIsInstantPhase(!0),e?.onOpenChange(!1,tK(tX.none))):(p(!1),e?.setIsInstantPhase(!1))},[o,n,r,i,l,s,a,c,d]),tW(()=>()=>{c.current=null},[c]),b.useMemo(()=>({hasProvider:u,delayRef:l,isInstantPhase:f}),[u,l,f])}(v,{open:g});p.useSyncedValue("isInstantPhase",j);let T=p.useState("disabled"),N=l??T,O=p.useState("trackCursorAxis"),P=function(e,t={}){let r="rootStore"in e?e.rootStore:e,{dataRef:n,events:o}=r.context,{enabled:i=!0,delay:l=0,handleClose:s=null,mouseOnly:a=!1,restMs:c=0,move:u=!0,triggerElementRef:d=iv,externalTree:f,isActiveTrigger:p=!0,getHandleCloseContext:m}=t,h=nE(f),g=ib(r),v=rx(s),x=rx(l),y=rx(c),w=rx(i);p&&(g.handleCloseOptions=v.current?.__options);let k=tB(()=>ic(n.current.openEvent?.type,g.interactedInside)),S=tB(e=>rX(e,r.context.triggerElements)),E=tB((e,t,n)=>{let o=r.context.triggerElements;return o.hasElement(t)?!e||!rK(e,t):!!tk(n)&&o.hasMatchingElement(e=>rK(e,n))&&(!e||!rK(e,n))}),C=b.useCallback((e,t=!0)=>{let n=is(x.current,"close",g.pointerType);n?g.openChangeTimeout.start(n,()=>{r.setOpen(!1,tK(tX.triggerHover,e)),h?.events.emit("floating.closed",e)}):t&&(g.openChangeTimeout.clear(),r.setOpen(!1,tK(tX.triggerHover,e)),h?.events.emit("floating.closed",e))},[x,r,g,h]),j=tB(()=>{g.handler&&(r_(r.select("domReferenceElement")).removeEventListener("mousemove",g.handler),g.handler=void 0)});b.useEffect(()=>j,[j]);let R=tB(()=>{ig(g)});return b.useEffect(()=>{if(i)return o.on("openchange",e),()=>{o.off("openchange",e)};function e(e){e.open||(j(),g.openChangeTimeout.clear(),g.restTimeout.clear(),g.blockMouseMove=!0,g.restTimeoutPending=!1)}},[i,o,g,j]),b.useEffect(()=>{if(!i)return;let e=d.current??(p?r.select("domReferenceElement"):null);if(tk(e))return u&&e.addEventListener("mousemove",t,{once:!0}),e.addEventListener("mouseenter",t),e.addEventListener("mouseleave",o),()=>{u&&e.removeEventListener("mousemove",t),e.removeEventListener("mouseenter",t),e.removeEventListener("mouseleave",o)};function t(e){if(g.openChangeTimeout.clear(),g.blockMouseMove=!1,a&&!r0(g.pointerType)||ia(y.current)>0&&!is(x.current,"open"))return;let t=is(x.current,"open",g.pointerType),n=e.currentTarget??null,o=r.select("domReferenceElement"),i=null!=n&&E(o,n,e.target),l=r.select("open"),s=!l||i;i&&l?r.setOpen(!0,tK(tX.triggerHover,e,n)):t?g.openChangeTimeout.start(t,()=>{s&&r.setOpen(!0,tK(tX.triggerHover,e,n))}):s&&r.setOpen(!0,tK(tX.triggerHover,e,n))}function o(e){if(k())return void R();j();let t=r_(r.select("domReferenceElement"));g.restTimeout.clear(),g.restTimeoutPending=!1;let o=n.current.floatingContext??m?.();if(!S(e.relatedTarget)){if(v.current&&o){r.select("open")||g.openChangeTimeout.clear();let n=d.current;g.handler=v.current({...o,tree:h,x:e.clientX,y:e.clientY,onClose(){R(),j(),w.current&&!k()&&n===r.select("domReferenceElement")&&C(e,!0)}}),t.addEventListener("mousemove",g.handler),g.handler(e);return}"touch"===g.pointerType&&rK(r.select("floatingElement"),e.relatedTarget)||C(e)}}},[j,R,n,x,C,r,i,v,g,p,E,k,S,a,u,y,d,h,w,m]),b.useMemo(()=>{if(i)return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){let{nativeEvent:t}=e,n=e.currentTarget,o=r.select("domReferenceElement"),i=r.select("open"),l=E(o,n,e.target);if(a&&!r0(g.pointerType))return;let s=ia(y.current);function c(){if(g.restTimeoutPending=!1,k())return;let e=r.select("open");g.blockMouseMove||e&&!l||r.setOpen(!0,tK(tX.triggerHover,t,n))}(!i||l)&&0!==s&&(!l&&g.restTimeoutPending&&e.movementX**2+e.movementY**2<2||(g.restTimeout.clear(),"touch"===g.pointerType?nf.flushSync(()=>{c()}):l&&i?c():(g.restTimeoutPending=!0,g.restTimeout.start(s,c))))}};function e(e){g.pointerType=e.pointerType}},[i,g,k,E,a,r,y])}(v,{enabled:!N,mouseOnly:!0,move:!1,handleClose:p.useState("disableHoverablePopup")||"both"===O?null:function(e={}){let{blockPointerEvents:t=!1}=e,r=new rS,n=({x:e,y:t,placement:n,elements:o,onClose:i,nodeId:l,tree:s})=>{let a=n?.split("-")[0],c=!1,u=null,d=null,f="u">typeof performance?performance.now():0;return function(n){r.clear();let p=o.domReference,m=o.floating;if(!p||!m||null==a||null==e||null==t)return;let{clientX:h,clientY:g}=n,b=rY(n),v="mouseleave"===n.type,x=rK(m,b),y=rK(p,b);if(x&&(c=!0,!v))return;if(y&&(c=!1,!v)){c=!0;return}if(v&&tk(n.relatedTarget)&&rK(m,n.relatedTarget))return;function w(){return!!(s&&r2(s.nodesRef.current,l).length>0)}function k(){w()||(r.clear(),i())}if(w())return;let S=p.getBoundingClientRect(),E=m.getBoundingClientRect(),C=e>E.right-E.width/2,j=t>E.bottom-E.height/2,R=E.width>S.width,T=E.height>S.height,N=(R?S:E).left,O=(R?S:E).right,P=(T?S:E).top,M=(T?S:E).bottom;if("top"===a&&t>=S.bottom-1||"bottom"===a&&t<=S.top+1||"left"===a&&e>=S.right-1||"right"===a&&e<=S.left+1)return void k();let L=!1;switch(a){case"top":L=il(h,g,N,S.top+1,O,E.bottom-1);break;case"bottom":L=il(h,g,N,E.top+1,O,S.bottom-1);break;case"left":L=il(h,g,E.right-1,M,S.left+1,P);break;case"right":L=il(h,g,S.right-1,M,E.left+1,P)}if(L)return;if(c&&(!(h>=S.x)||!(h<=S.x+S.width)||!(g>=S.y)||!(g<=S.y+S.height))||!v&&function(e,t){let r=performance.now(),n=r-f;if(null===u||null===d||0===n)return u=e,d=t,f=r,!1;let o=e-u,i=t-d;return u=e,d=t,f=r,o*o+i*i<n*n*ir}(h,g))return void k();let A=!1;switch(a){case"top":{let r=R?.25:2,n=t+.5+1,o=C||R?E.bottom-.5:E.top,i=C?R?E.bottom-.5:E.top:E.bottom-.5;A=ii(h,g,R||C?e+r:e-r,n,R?e-r:C?e+r:e-r,n,E.left,o,E.right,i);break}case"bottom":{let r=R?.25:2,n=t-.5,o=C||R?E.top+.5:E.bottom,i=C?R?E.top+.5:E.bottom:E.top+.5;A=ii(h,g,R||C?e+r:e-r,n,R?e-r:C?e+r:e-r,n,E.left,o,E.right,i);break}case"left":{let r=T?.25:2,n=e+.5+1,o=j||T?E.right-.5:E.left,i=j?T?E.right-.5:E.left:E.right-.5;A=ii(h,g,o,E.top,i,E.bottom,n,T||j?t+r:t-r,n,T?t-r:j?t+r:t-r);break}case"right":{let r=T?.25:2,n=e-.5,o=j||T?E.left+.5:E.right,i=j?T?E.left+.5:E.right:E.left+.5;A=ii(h,g,n,T||j?t+r:t-r,n,T?t-r:j?t+r:t-r,o,E.top,i,E.bottom)}}A?c||r.start(40,k):k()}};return n.__options={blockPointerEvents:t},n}(),restMs(){let e=E?.delay,t="object"==typeof C.current?C.current.open:void 0,r=y;return R&&(r=0!==t?s??e??y:0),r},delay(){let e="object"==typeof C.current?C.current.close:void 0,t=w;return null==c&&R&&(t=e),{close:t}},triggerElementRef:x,isActiveTrigger:h});return V("button",e,{state:{open:g},ref:[t,k,x],props:[P,function(e,t={}){let r="rootStore"in e?e.rootStore:e,{events:n,dataRef:o}=r.context,{enabled:i=!0,delay:l}=t,s=b.useRef(!1),a=b.useRef(null),c=rE(),u=b.useRef(!0);b.useEffect(()=>{let e=r.select("domReferenceElement");if(!i)return;let t=tx(e);function n(){let e=r.select("domReferenceElement");!r.select("open")&&tS(e)&&e===rq(r_(e))&&(s.current=!0)}function o(){u.current=!0}function l(){u.current=!1}return t.addEventListener("blur",n),ip&&(t.addEventListener("keydown",o,!0),t.addEventListener("pointerdown",l,!0)),()=>{t.removeEventListener("blur",n),ip&&(t.removeEventListener("keydown",o,!0),t.removeEventListener("pointerdown",l,!0))}},[r,i]),b.useEffect(()=>{if(i)return n.on("openchange",e),()=>{n.off("openchange",e)};function e(e){if(e.reason===tX.triggerPress||e.reason===tX.escapeKey){let e=r.select("domReferenceElement");tk(e)&&(a.current=e,s.current=!0)}}},[n,i,r]);let d=b.useMemo(()=>({onMouseLeave(){s.current=!1,a.current=null},onFocus(e){let t=e.currentTarget;if(s.current){if(a.current===t)return;s.current=!1,a.current=null}let n=rY(e.nativeEvent);if(tk(n)){if(ip&&!e.relatedTarget){if(!u.current&&!rZ(n))return}else if(!function(e){if(!e||rA)return!0;try{return e.matches(":focus-visible")}catch(e){return!0}}(n))return}let o=rX(e.relatedTarget,r.context.triggerElements),{nativeEvent:i,currentTarget:d}=e,f="function"==typeof l?l():l;r.select("open")&&o||0===f||void 0===f?r.setOpen(!0,tK(tX.triggerFocus,i,d)):c.start(f,()=>{s.current||r.setOpen(!0,tK(tX.triggerFocus,i,d))})},onBlur(e){s.current=!1,a.current=null;let t=e.relatedTarget,n=e.nativeEvent,i=tk(t)&&t.hasAttribute(ne("focus-guard"))&&"outside"===t.getAttribute("data-type");c.start(0,()=>{let e=r.select("domReferenceElement"),l=rq(e?e.ownerDocument:document);!t&&l===e||rK(o.current.floatingContext?.refs.floating.current,l)||rK(e,l)||i||rX(t??l,r.context.triggerElements)||r.setOpen(!1,tK(tX.triggerFocus,n))})}}),[o,r,c,l]);return b.useMemo(()=>i?{reference:d,trigger:d}:{},[i,d])}(v,{enabled:!N}).reference,p.useState("triggerProps",S),{onPointerDown(){p.set("closeOnClick",a)},id:m,[ix.triggerDisabled]:N?"":void 0},d],stateAttributesMapping:tp})},b.forwardRef(ok(f))),iw=b.createContext(void 0),ik=b.forwardRef(function(e,t){let{children:r,container:n,className:o,render:i,...l}=e,{portalNode:s,portalSubtree:a}=nx({container:n,ref:t,componentProps:e,elementProps:l});return a||s?(0,m.jsxs)(b.Fragment,{children:[a,s&&nf.createPortal(r,s)]}):null}),iS=b.forwardRef(function(e,t){let{keepMounted:r=!1,...n}=e;return o6().useState("mounted")||r?(0,m.jsx)(iw.Provider,{value:r,children:(0,m.jsx)(ik,{ref:t,...n})}):null}),iE=b.createContext(void 0);function iC(){let e=b.useContext(iE);if(void 0===e)throw Error(A(71));return e}let ij=["top","right","bottom","left"],iR=Math.min,iT=Math.max,iN=Math.round,iO=Math.floor,iP=e=>({x:e,y:e}),iM={left:"right",right:"left",bottom:"top",top:"bottom"};function iL(e,t){return"function"==typeof e?e(t):e}function iA(e){return e.split("-")[0]}function iz(e){return e.split("-")[1]}function iI(e){return"x"===e?"y":"x"}function iD(e){return"y"===e?"height":"width"}function i_(e){let t=e[0];return"t"===t||"b"===t?"y":"x"}function i$(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}let iB=["left","right"],iF=["right","left"],iH=["top","bottom"],iW=["bottom","top"];function iV(e){let t=iA(e);return iM[t]+e.slice(t.length)}function iU(e){return"number"!=typeof e?{top:0,right:0,bottom:0,left:0,...e}:{top:e,right:e,bottom:e,left:e}}function iq(e){let{x:t,y:r,width:n,height:o}=e;return{width:n,height:o,top:r,left:t,right:t+n,bottom:r+o,x:t,y:r}}function iK(e,t,r){let n,{reference:o,floating:i}=e,l=i_(t),s=iI(i_(t)),a=iD(s),c=iA(t),u="y"===l,d=o.x+o.width/2-i.width/2,f=o.y+o.height/2-i.height/2,p=o[a]/2-i[a]/2;switch(c){case"top":n={x:d,y:o.y-i.height};break;case"bottom":n={x:d,y:o.y+o.height};break;case"right":n={x:o.x+o.width,y:f};break;case"left":n={x:o.x-i.width,y:f};break;default:n={x:o.x,y:o.y}}switch(iz(t)){case"start":n[s]-=p*(r&&u?-1:1);break;case"end":n[s]+=p*(r&&u?-1:1)}return n}async function iX(e,t){var r;void 0===t&&(t={});let{x:n,y:o,platform:i,rects:l,elements:s,strategy:a}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:f=!1,padding:p=0}=iL(t,e),m=iU(p),h=s[f?"floating"===d?"reference":"floating":d],g=iq(await i.getClippingRect({element:null==(r=await (null==i.isElement?void 0:i.isElement(h)))||r?h:h.contextElement||await (null==i.getDocumentElement?void 0:i.getDocumentElement(s.floating)),boundary:c,rootBoundary:u,strategy:a})),b="floating"===d?{x:n,y:o,width:l.floating.width,height:l.floating.height}:l.reference,v=await (null==i.getOffsetParent?void 0:i.getOffsetParent(s.floating)),x=await (null==i.isElement?void 0:i.isElement(v))&&await (null==i.getScale?void 0:i.getScale(v))||{x:1,y:1},y=iq(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:b,offsetParent:v,strategy:a}):b);return{top:(g.top-y.top+m.top)/x.y,bottom:(y.bottom-g.bottom+m.bottom)/x.y,left:(g.left-y.left+m.left)/x.x,right:(y.right-g.right+m.right)/x.x}}let iY=async(e,t,r)=>{let{placement:n="bottom",strategy:o="absolute",middleware:i=[],platform:l}=r,s=l.detectOverflow?l:{...l,detectOverflow:iX},a=await (null==l.isRTL?void 0:l.isRTL(t)),c=await l.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=iK(c,n,a),f=n,p=0,m={};for(let r=0;r<i.length;r++){let h=i[r];if(!h)continue;let{name:g,fn:b}=h,{x:v,y:x,data:y,reset:w}=await b({x:u,y:d,initialPlacement:n,placement:f,strategy:o,middlewareData:m,rects:c,platform:s,elements:{reference:e,floating:t}});u=null!=v?v:u,d=null!=x?x:d,m[g]={...m[g],...y},w&&p<50&&(p++,"object"==typeof w&&(w.placement&&(f=w.placement),w.rects&&(c=!0===w.rects?await l.getElementRects({reference:e,floating:t,strategy:o}):w.rects),{x:u,y:d}=iK(c,f,a)),r=-1)}return{x:u,y:d,placement:f,strategy:o,middlewareData:m}};function iG(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function iZ(e){return ij.some(t=>e[t]>=0)}let iJ=new Set(["left","top"]);async function iQ(e,t){let{placement:r,platform:n,elements:o}=e,i=await (null==n.isRTL?void 0:n.isRTL(o.floating)),l=iA(r),s=iz(r),a="y"===i_(r),c=iJ.has(l)?-1:1,u=i&&a?-1:1,d=iL(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&"number"==typeof m&&(p="end"===s?-1*m:m),a?{x:p*u,y:f*c}:{x:f*c,y:p*u}}function i0(e){let t=tL(e),r=parseFloat(t.width)||0,n=parseFloat(t.height)||0,o=tS(e),i=o?e.offsetWidth:r,l=o?e.offsetHeight:n,s=iN(r)!==i||iN(n)!==l;return s&&(r=i,n=l),{width:r,height:n,$:s}}function i1(e){return tk(e)?e:e.contextElement}function i2(e){let t=i1(e);if(!tS(t))return iP(1);let r=t.getBoundingClientRect(),{width:n,height:o,$:i}=i0(t),l=(i?iN(r.width):r.width)/n,s=(i?iN(r.height):r.height)/o;return l&&Number.isFinite(l)||(l=1),s&&Number.isFinite(s)||(s=1),{x:l,y:s}}let i5=iP(0);function i3(e){let t=tx(e);return tP()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:i5}function i4(e,t,r,n){var o;void 0===t&&(t=!1),void 0===r&&(r=!1);let i=e.getBoundingClientRect(),l=i1(e),s=iP(1);t&&(n?tk(n)&&(s=i2(n)):s=i2(e));let a=(void 0===(o=r)&&(o=!1),n&&(!o||n===tx(l))&&o)?i3(l):iP(0),c=(i.left+a.x)/s.x,u=(i.top+a.y)/s.y,d=i.width/s.x,f=i.height/s.y;if(l){let e=tx(l),t=n&&tk(n)?tx(n):n,r=e,o=tD(r);for(;o&&n&&t!==r;){let e=i2(o),t=o.getBoundingClientRect(),n=tL(o),i=t.left+(o.clientLeft+parseFloat(n.paddingLeft))*e.x,l=t.top+(o.clientTop+parseFloat(n.paddingTop))*e.y;c*=e.x,u*=e.y,d*=e.x,f*=e.y,c+=i,u+=l,o=tD(r=tx(o))}}return iq({width:d,height:f,x:c,y:u})}function i6(e,t){let r=tA(e).scrollLeft;return t?t.left+r:i4(ty(e)).left+r}function i7(e,t){let r=e.getBoundingClientRect();return{x:r.left+t.scrollLeft-i6(e,r),y:r.top+t.scrollTop}}function i8(e,t,r){var n;let o;if("viewport"===t)o=function(e,t){let r=tx(e),n=ty(e),o=r.visualViewport,i=n.clientWidth,l=n.clientHeight,s=0,a=0;if(o){i=o.width,l=o.height;let e=tP();(!e||e&&"fixed"===t)&&(s=o.offsetLeft,a=o.offsetTop)}let c=i6(n);if(c<=0){let e=n.ownerDocument,t=e.body,r=getComputedStyle(t),o="CSS1Compat"===e.compatMode&&parseFloat(r.marginLeft)+parseFloat(r.marginRight)||0,l=Math.abs(n.clientWidth-t.clientWidth-o);l<=25&&(i-=l)}else c<=25&&(i+=c);return{width:i,height:l,x:s,y:a}}(e,r);else if("document"===t){let t,r,i,l,s,a,c;n=ty(e),t=ty(n),r=tA(n),i=n.ownerDocument.body,l=iT(t.scrollWidth,t.clientWidth,i.scrollWidth,i.clientWidth),s=iT(t.scrollHeight,t.clientHeight,i.scrollHeight,i.clientHeight),a=-r.scrollLeft+i6(n),c=-r.scrollTop,"rtl"===tL(i).direction&&(a+=iT(t.clientWidth,i.clientWidth)-l),o={width:l,height:s,x:a,y:c}}else if(tk(t)){let e,n,i,l,s,a;n=(e=i4(t,!0,"fixed"===r)).top+t.clientTop,i=e.left+t.clientLeft,l=tS(t)?i2(t):iP(1),s=t.clientWidth*l.x,a=t.clientHeight*l.y,o={width:s,height:a,x:i*l.x,y:n*l.y}}else{let r=i3(e);o={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return iq(o)}function i9(e){return"static"===tL(e).position}function le(e,t){if(!tS(e)||"fixed"===tL(e).position)return null;if(t)return t(e);let r=e.offsetParent;return ty(e)===r&&(r=r.ownerDocument.body),r}function lt(e,t){var r;let n=tx(e);if(tj(e))return n;if(!tS(e)){let t=tz(e);for(;t&&!tM(t);){if(tk(t)&&!i9(t))return t;t=tz(t)}return n}let o=le(e,t);for(;o&&(r=o,/^(table|td|th)$/.test(tv(r)))&&i9(o);)o=le(o,t);return o&&tM(o)&&i9(o)&&!tO(o)?n:o||function(e){let t=tz(e);for(;tS(t)&&!tM(t);){if(tO(t))return t;if(tj(t))break;t=tz(t)}return null}(e)||n}let lr=async function(e){let t=this.getOffsetParent||lt,r=this.getDimensions,n=await r(e.floating);return{reference:function(e,t,r){let n=tS(t),o=ty(t),i="fixed"===r,l=i4(e,!0,i,t),s={scrollLeft:0,scrollTop:0},a=iP(0);if(n||!n&&!i)if(("body"!==tv(t)||tC(o))&&(s=tA(t)),n){let e=i4(t,!0,i,t);a.x=e.x+t.clientLeft,a.y=e.y+t.clientTop}else o&&(a.x=i6(o));i&&!n&&o&&(a.x=i6(o));let c=!o||n||i?iP(0):i7(o,s);return{x:l.left+s.scrollLeft-a.x-c.x,y:l.top+s.scrollTop-a.y-c.y,width:l.width,height:l.height}}(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}},ln={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:r,offsetParent:n,strategy:o}=e,i="fixed"===o,l=ty(n),s=!!t&&tj(t.floating);if(n===l||s&&i)return r;let a={scrollLeft:0,scrollTop:0},c=iP(1),u=iP(0),d=tS(n);if((d||!d&&!i)&&(("body"!==tv(n)||tC(l))&&(a=tA(n)),d)){let e=i4(n);c=i2(n),u.x=e.x+n.clientLeft,u.y=e.y+n.clientTop}let f=!l||d||i?iP(0):i7(l,a);return{width:r.width*c.x,height:r.height*c.y,x:r.x*c.x-a.scrollLeft*c.x+u.x+f.x,y:r.y*c.y-a.scrollTop*c.y+u.y+f.y}},getDocumentElement:ty,getClippingRect:function(e){let{element:t,boundary:r,rootBoundary:n,strategy:o}=e,i=[..."clippingAncestors"===r?tj(t)?[]:function(e,t){let r=t.get(e);if(r)return r;let n=tI(e,[],!1).filter(e=>tk(e)&&"body"!==tv(e)),o=null,i="fixed"===tL(e).position,l=i?tz(e):e;for(;tk(l)&&!tM(l);){let t=tL(l),r=tO(l);r||"fixed"!==t.position||(o=null),(i?r||o:!(!r&&"static"===t.position&&o&&("absolute"===o.position||"fixed"===o.position)||tC(l)&&!r&&function e(t,r){let n=tz(t);return!(n===r||!tk(n)||tM(n))&&("fixed"===tL(n).position||e(n,r))}(e,l)))?o=t:n=n.filter(e=>e!==l),l=tz(l)}return t.set(e,n),n}(t,this._c):[].concat(r),n],l=i8(t,i[0],o),s=l.top,a=l.right,c=l.bottom,u=l.left;for(let e=1;e<i.length;e++){let r=i8(t,i[e],o);s=iT(r.top,s),a=iR(r.right,a),c=iR(r.bottom,c),u=iT(r.left,u)}return{width:a-u,height:c-s,x:u,y:s}},getOffsetParent:lt,getElementRects:lr,getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){let{width:t,height:r}=i0(e);return{width:t,height:r}},getScale:i2,isElement:tk,isRTL:function(e){return"rtl"===tL(e).direction}};function lo(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function li(e,t,r,n){let o;void 0===n&&(n={});let{ancestorScroll:i=!0,ancestorResize:l=!0,elementResize:s="function"==typeof ResizeObserver,layoutShift:a="function"==typeof IntersectionObserver,animationFrame:c=!1}=n,u=i1(e),d=i||l?[...u?tI(u):[],...t?tI(t):[]]:[];d.forEach(e=>{i&&e.addEventListener("scroll",r,{passive:!0}),l&&e.addEventListener("resize",r)});let f=u&&a?function(e,t){let r,n=null,o=ty(e);function i(){var e;clearTimeout(r),null==(e=n)||e.disconnect(),n=null}return!function l(s,a){void 0===s&&(s=!1),void 0===a&&(a=1),i();let c=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=c;if(s||t(),!f||!p)return;let m={rootMargin:-iO(d)+"px "+-iO(o.clientWidth-(u+f))+"px "+-iO(o.clientHeight-(d+p))+"px "+-iO(u)+"px",threshold:iT(0,iR(1,a))||1},h=!0;function g(t){let n=t[0].intersectionRatio;if(n!==a){if(!h)return l();n?l(!1,n):r=setTimeout(()=>{l(!1,1e-7)},1e3)}1!==n||lo(c,e.getBoundingClientRect())||l(),h=!1}try{n=new IntersectionObserver(g,{...m,root:o.ownerDocument})}catch(e){n=new IntersectionObserver(g,m)}n.observe(e)}(!0),i}(u,r):null,p=-1,m=null;s&&(m=new ResizeObserver(e=>{let[n]=e;n&&n.target===u&&m&&t&&(m.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var e;null==(e=m)||e.observe(t)})),r()}),u&&!c&&m.observe(u),t&&m.observe(t));let h=c?i4(e):null;return c&&function t(){let n=i4(e);h&&!lo(h,n)&&r(),h=n,o=requestAnimationFrame(t)}(),r(),()=>{var e;d.forEach(e=>{i&&e.removeEventListener("scroll",r),l&&e.removeEventListener("resize",r)}),null==f||f(),null==(e=m)||e.disconnect(),m=null,c&&cancelAnimationFrame(o)}}var ll="u">typeof document?b.useLayoutEffect:function(){};function ls(e,t){let r,n,o;if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if((r=e.length)!==t.length)return!1;for(n=r;0!=n--;)if(!ls(e[n],t[n]))return!1;return!0}if((r=(o=Object.keys(e)).length)!==Object.keys(t).length)return!1;for(n=r;0!=n--;)if(!({}).hasOwnProperty.call(t,o[n]))return!1;for(n=r;0!=n--;){let r=o[n];if(("_owner"!==r||!e.$$typeof)&&!ls(e[r],t[r]))return!1}return!0}return e!=e&&t!=t}function la(e){return"u"<typeof window?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function lc(e,t){let r=la(e);return Math.round(t*r)/r}function lu(e){let t=b.useRef(e);return ll(()=>{t.current=e}),t}let ld=b.createContext(void 0);function lf(){let e=b.useContext(ld);return e?.direction??"ltr"}let lp={name:"hide",async fn(e){var t,r,n;let o,{width:i,height:l,x:s,y:a}=e.rects.reference,c=await (void 0===(n=t)&&(n={}),{name:(o={name:"hide",options:n,async fn(e){let{rects:t,platform:r}=e,{strategy:o="referenceHidden",...i}=iL(n,e);switch(o){case"referenceHidden":{let n=iG(await r.detectOverflow(e,{...i,elementContext:"reference"}),t.reference);return{data:{referenceHiddenOffsets:n,referenceHidden:iZ(n)}}}case"escaped":{let n=iG(await r.detectOverflow(e,{...i,altBoundary:!0}),t.floating);return{data:{escapedOffsets:n,escaped:iZ(n)}}}default:return{}}}}).name,fn:o.fn,options:[t,r]}).fn(e);return{data:{referenceHidden:c.data?.referenceHidden||0===i&&0===l&&0===s&&0===a}}}},lm={sideX:"left",sideY:"top"},lh={name:"adaptiveOrigin",async fn(e){let{x:t,y:r,rects:{floating:n},elements:{floating:o},platform:i,strategy:l,placement:s}=e,a=tx(o),c=a.getComputedStyle(o);if("0s"===c.transitionDuration||""===c.transitionDuration)return{x:t,y:r,data:lm};let u=await i.getOffsetParent?.(o),d={width:0,height:0};if("fixed"===l&&a?.visualViewport)d={width:a.visualViewport.width,height:a.visualViewport.height};else if(u===a){let e=r_(o);d={width:e.documentElement.clientWidth,height:e.documentElement.clientHeight}}else await i.isElement?.(u)&&(d=await i.getDimensions(u));let f=iA(s),p=t,m=r;return"left"===f&&(p=d.width-(t+n.width)),"top"===f&&(m=d.height-(r+n.height)),{x:p,y:m,data:{sideX:"left"===f?"right":lm.sideX,sideY:"top"===f?"bottom":lm.sideY}}}};function lg(e,t,r){let n="inline-start"===e||"inline-end"===e;return({top:"top",right:n?r?"inline-start":"inline-end":"right",bottom:"bottom",left:n?r?"inline-end":"inline-start":"left"})[t]}function lb(e,t,r){let{rects:n,placement:o}=e;return{side:lg(t,iA(o),r),align:iz(o)||"center",anchor:{width:n.reference.width,height:n.reference.height},positioner:{width:n.floating.width,height:n.floating.height}}}function lv(e){return null!=e&&"current"in e}function lx(e){return"starting"===e?np:W}let ly=b.forwardRef(function(e,t){let{render:r,className:n,anchor:o,positionMethod:i="absolute",side:l="top",align:s="center",sideOffset:a=0,alignOffset:c=0,collisionBoundary:u="clipping-ancestors",collisionPadding:d=5,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:h=!1,collisionAvoidance:g=nh,...v}=e,x=o6(),y=function(){let e=b.useContext(iw);if(void 0===e)throw Error(A(70));return e}(),w=x.useState("open"),k=x.useState("mounted"),S=x.useState("trackCursorAxis"),E=x.useState("disableHoverablePopup"),C=x.useState("floatingRootContext"),j=x.useState("instantType"),R=x.useState("transitionStatus"),T=function(e){var t,r,n,o,i,l,s,a,c,u,d,f,p,m;let h,g,v,x,{anchor:y,positionMethod:w="absolute",side:k="bottom",sideOffset:S=0,align:E="center",alignOffset:C=0,collisionBoundary:j,collisionPadding:R=5,sticky:T=!1,arrowPadding:N=5,disableAnchorTracking:O=!1,keepMounted:P=!1,floatingRootContext:M,mounted:L,collisionAvoidance:A,shiftCrossAxis:z=!1,nodeId:D,adaptiveOrigin:_,lazyFlip:$=!1,externalTree:B}=e,[F,H]=b.useState(null);L||null===F||H(null);let W=A.side||"flip",V=A.align||"flip",U=A.fallbackAxisSide||"end",q="function"==typeof y?y:void 0,K=tB(q),X=q?K:y,Y=rx(y),G="rtl"===lf(),Z=F||({top:"top",right:"right",bottom:"bottom",left:"left","inline-end":G?"left":"right","inline-start":G?"right":"left"})[k],J="center"===E?Z:`${Z}-${E}`,Q=R,ee=+("bottom"===k),et=+("top"===k),er=+("right"===k),en=+("left"===k);"number"==typeof Q?Q={top:Q+ee,right:Q+en,bottom:Q+et,left:Q+er}:Q&&(Q={top:(Q.top||0)+ee,right:(Q.right||0)+en,bottom:(Q.bottom||0)+et,left:(Q.left||0)+er});let eo={boundary:"clipping-ancestors"===j?"clippingAncestors":j,padding:Q},ei=b.useRef(null),el=rx(S),es=rx(C),ea=[(t=e=>{let t=lb(e,k,G),r="function"==typeof el.current?el.current(t):el.current,n="function"==typeof es.current?es.current(t):es.current;return{mainAxis:r,crossAxis:n,alignmentAxis:n}},r=["function"!=typeof S?S:0,"function"!=typeof C?C:0,G,k],void 0===(n=t)&&(n=0),{name:(h={name:"offset",options:n,async fn(e){var t,r;let{x:o,y:i,placement:l,middlewareData:s}=e,a=await iQ(e,n);return l===(null==(t=s.offset)?void 0:t.placement)&&null!=(r=s.arrow)&&r.alignmentOffset?{}:{x:o+a.x,y:i+a.y,data:{...a,placement:l}}}}).name,fn:h.fn,options:[t,r]})],ec="none"===V&&"shift"!==W,eu=!ec&&(T||z||"shift"===W),ed="none"===W?null:{name:(g={name:"flip",options:l=o={...eo,padding:{top:Q.top+1,right:Q.right+1,bottom:Q.bottom+1,left:Q.left+1},mainAxis:!z&&"flip"===W,crossAxis:"flip"===V&&"alignment",fallbackAxisSideDirection:U},async fn(e){var t,r,n,o,i,s,a,c;let u,d,f,{placement:p,middlewareData:m,rects:h,initialPlacement:g,platform:b,elements:v}=e,{mainAxis:x=!0,crossAxis:y=!0,fallbackPlacements:w,fallbackStrategy:k="bestFit",fallbackAxisSideDirection:S="none",flipAlignment:E=!0,...C}=iL(l,e);if(null!=(t=m.arrow)&&t.alignmentOffset)return{};let j=iA(p),R=i_(g),T=iA(g)===g,N=await (null==b.isRTL?void 0:b.isRTL(v.floating)),O=w||(T||!E?[iV(g)]:(u=iV(g),[i$(g),u,i$(u)])),P="none"!==S;!w&&P&&O.push(...(d=iz(g),f=function(e,t,r){switch(e){case"top":case"bottom":if(r)return t?iF:iB;return t?iB:iF;case"left":case"right":return t?iH:iW;default:return[]}}(iA(g),"start"===S,N),d&&(f=f.map(e=>e+"-"+d),E&&(f=f.concat(f.map(i$)))),f));let M=[g,...O],L=await b.detectOverflow(e,C),A=[],z=(null==(r=m.flip)?void 0:r.overflows)||[];if(x&&A.push(L[j]),y){let e,t,r,n,o=(s=p,a=h,void 0===(c=N)&&(c=!1),e=iz(s),r=iD(t=iI(i_(s))),n="x"===t?e===(c?"end":"start")?"right":"left":"start"===e?"bottom":"top",a.reference[r]>a.floating[r]&&(n=iV(n)),[n,iV(n)]);A.push(L[o[0]],L[o[1]])}if(z=[...z,{placement:p,overflows:A}],!A.every(e=>e<=0)){let e=((null==(n=m.flip)?void 0:n.index)||0)+1,t=M[e];if(t&&("alignment"!==y||R===i_(t)||z.every(e=>i_(e.placement)!==R||e.overflows[0]>0)))return{data:{index:e,overflows:z},reset:{placement:t}};let r=null==(o=z.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:o.placement;if(!r)switch(k){case"bestFit":{let e=null==(i=z.filter(e=>{if(P){let t=i_(e.placement);return t===R||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:i[0];e&&(r=e);break}case"initialPlacement":r=g}if(p!==r)return{reset:{placement:r}}}return{}}}).name,fn:g.fn,options:[o,i]},ef=ec?null:(s=e=>{var t,r,n;let o=r_(e.elements.floating).documentElement;return{...eo,rootBoundary:z?{x:0,y:0,width:o.clientWidth,height:o.clientHeight}:void 0,mainAxis:"none"!==V,crossAxis:eu,limiter:T||z?void 0:{fn:(void 0===(n=t=e=>{if(!ei.current)return{};let{width:t,height:r}=ei.current.getBoundingClientRect(),n=i_(iA(e.placement)),o="y"===n?Q.left+Q.right:Q.top+Q.bottom;return{offset:("y"===n?t:r)/2+o/2}})&&(n={}),{options:n,fn(e){let{x:t,y:r,placement:o,rects:i,middlewareData:l}=e,{offset:s=0,mainAxis:a=!0,crossAxis:c=!0}=iL(n,e),u={x:t,y:r},d=i_(o),f=iI(d),p=u[f],m=u[d],h=iL(s,e),g="number"==typeof h?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(a){let e="y"===f?"height":"width",t=i.reference[f]-i.floating[e]+g.mainAxis,r=i.reference[f]+i.reference[e]-g.mainAxis;p<t?p=t:p>r&&(p=r)}if(c){var b,v;let e="y"===f?"width":"height",t=iJ.has(iA(o)),r=i.reference[d]-i.floating[e]+(t&&(null==(b=l.offset)?void 0:b[d])||0)+(t?0:g.crossAxis),n=i.reference[d]+i.reference[e]+(t?0:(null==(v=l.offset)?void 0:v[d])||0)-(t?g.crossAxis:0);m<r?m=r:m>n&&(m=n)}return{[f]:p,[d]:m}}}).fn,options:[t,r]}}},a=[eo,T,z,Q,V],void 0===(c=s)&&(c={}),{name:(v={name:"shift",options:c,async fn(e){let{x:t,y:r,placement:n,platform:o}=e,{mainAxis:i=!0,crossAxis:l=!1,limiter:s={fn:e=>{let{x:t,y:r}=e;return{x:t,y:r}}},...a}=iL(c,e),u={x:t,y:r},d=await o.detectOverflow(e,a),f=i_(iA(n)),p=iI(f),m=u[p],h=u[f];if(i){let e="y"===p?"top":"left",t="y"===p?"bottom":"right",r=m+d[e],n=m-d[t];m=iT(r,iR(m,n))}if(l){let e="y"===f?"top":"left",t="y"===f?"bottom":"right",r=h+d[e],n=h-d[t];h=iT(r,iR(h,n))}let g=s.fn({...e,[p]:m,[f]:h});return{...g,data:{x:g.x-t,y:g.y-r,enabled:{[p]:i,[f]:l}}}}}).name,fn:v.fn,options:[s,a]});"shift"===W||"shift"===V||"center"===E?ea.push(ef,ed):ea.push(ed,ef),ea.push({name:(x={name:"size",options:f=u={...eo,apply({elements:{floating:e},availableWidth:t,availableHeight:r,rects:n}){let o=e.style;o.setProperty("--available-width",`${t}px`),o.setProperty("--available-height",`${r}px`);let i=window.devicePixelRatio||1,{x:l,y:s,width:a,height:c}=n.reference,u=(Math.round((l+a)*i)-Math.round(l*i))/i,d=(Math.round((s+c)*i)-Math.round(s*i))/i;o.setProperty("--anchor-width",`${u}px`),o.setProperty("--anchor-height",`${d}px`)}},async fn(e){var t,r;let n,o,{placement:i,rects:l,platform:s,elements:a}=e,{apply:c=()=>{},...u}=iL(f,e),d=await s.detectOverflow(e,u),p=iA(i),m=iz(i),h="y"===i_(i),{width:g,height:b}=l.floating;"top"===p||"bottom"===p?(n=p,o=m===(await (null==s.isRTL?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(o=p,n="end"===m?"top":"bottom");let v=b-d.top-d.bottom,x=g-d.left-d.right,y=iR(b-d[n],v),w=iR(g-d[o],x),k=!e.middlewareData.shift,S=y,E=w;if(null!=(t=e.middlewareData.shift)&&t.enabled.x&&(E=x),null!=(r=e.middlewareData.shift)&&r.enabled.y&&(S=v),k&&!m){let e=iT(d.left,0),t=iT(d.right,0),r=iT(d.top,0),n=iT(d.bottom,0);h?E=g-2*(0!==e||0!==t?e+t:iT(d.left,d.right)):S=b-2*(0!==r||0!==n?r+n:iT(d.top,d.bottom))}await c({...e,availableWidth:E,availableHeight:S});let C=await s.getDimensions(a.floating);return g!==C.width||b!==C.height?{reset:{rects:!0}}:{}}}).name,fn:x.fn,options:[u,d]},(p=()=>({element:ei.current||document.createElement("div"),padding:N,offsetParent:"floating"}),m=[N],{name:"arrow",options:p,async fn(e){let{x:t,y:r,placement:n,rects:o,platform:i,elements:l,middlewareData:s}=e,{element:a,padding:c=0,offsetParent:u="real"}=iL(p,e)||{};if(null==a)return{};let d=iU(c),f={x:t,y:r},m=iI(i_(n)),h=iD(m),g=await i.getDimensions(a),b="y"===m,v=b?"clientHeight":"clientWidth",x=o.reference[h]+o.reference[m]-f[m]-o.floating[h],y=f[m]-o.reference[m],w="real"===u?await i.getOffsetParent?.(a):l.floating,k=l.floating[v]||o.floating[h];k&&await i.isElement?.(w)||(k=l.floating[v]||o.floating[h]);let S=k/2-g[h]/2-1,E=Math.min(d[b?"top":"left"],S),C=Math.min(d[b?"bottom":"right"],S),j=k-g[h]-C,R=k/2-g[h]/2+(x/2-y/2),T=iT(E,iR(R,j)),N=!s.arrow&&null!=iz(n)&&R!==T&&o.reference[h]/2-(R<E?E:C)-g[h]/2<0,O=N?R<E?R-E:R-j:0;return{[m]:f[m]+O,data:{[m]:T,centerOffset:R-T-O,...N&&{alignmentOffset:O}},reset:N}},options:[p,m]}),{name:"transformOrigin",fn(e){let{elements:t,middlewareData:r,placement:n,rects:o,y:i}=e,l=iA(n),s=i_(l),a=ei.current,c=r.arrow?.x||0,u=r.arrow?.y||0,d=a?.clientWidth||0,f=a?.clientHeight||0,p=c+d/2,m=u+f/2,h=Math.abs(r.shift?.y||0),g=o.reference.height/2,b="function"==typeof S?S(lb(e,k,G)):S,v=h>b,x={top:`${p}px calc(100% + ${b}px)`,bottom:`${p}px ${-b}px`,left:`calc(100% + ${b}px) ${m}px`,right:`${-b}px ${m}px`}[l],y=`${p}px ${o.reference.y+g-i}px`;return t.floating.style.setProperty("--transform-origin",eu&&"y"===s&&v?y:x),{}}},lp,_),tW(()=>{!L&&M&&M.update({referenceElement:null,floatingElement:null,domReferenceElement:null})},[L,M]);let ep=b.useMemo(()=>({elementResize:!O&&"u">typeof ResizeObserver,layoutShift:!O&&"u">typeof IntersectionObserver}),[O]),{refs:em,elements:eh,x:eg,y:eb,middlewareData:ev,update:ex,placement:ey,context:ew,isPositioned:ek,floatingStyles:eS}=function(e={}){let{nodeId:t,externalTree:r}=e,n=function(e){let{open:t=!1,onOpenChange:r,elements:n={}}=e,o=tQ(),i=null!=nS(),l=I(()=>new oT({open:t,onOpenChange:r,referenceElement:n.reference??null,floatingElement:n.floating??null,triggerElements:new oL,floatingId:o,nested:i,noEmit:!1})).current;return tW(()=>{let e={open:t,floatingId:o};void 0!==n.reference&&(e.referenceElement=n.reference,e.domReferenceElement=tk(n.reference)?n.reference:null),void 0!==n.floating&&(e.floatingElement=n.floating),l.update(e)},[t,o,n.reference,n.floating,l]),l.context.onOpenChange=r,l.context.nested=i,l.context.noEmit=!1,l}(e),o=e.rootContext||n,i={reference:o.useState("referenceElement"),floating:o.useState("floatingElement"),domReference:o.useState("domReferenceElement")},[l,s]=b.useState(null),a=b.useRef(null),c=nE(r);tW(()=>{i.domReference&&(a.current=i.domReference)},[i.domReference]);let u=function(e){void 0===e&&(e={});let{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:o,elements:{reference:i,floating:l}={},transform:s=!0,whileElementsMounted:a,open:c}=e,[u,d]=b.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=b.useState(n);ls(f,n)||p(n);let[m,h]=b.useState(null),[g,v]=b.useState(null),x=b.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=b.useCallback(e=>{e!==E.current&&(E.current=e,v(e))},[]),w=i||m,k=l||g,S=b.useRef(null),E=b.useRef(null),C=b.useRef(u),j=null!=a,R=lu(a),T=lu(o),N=lu(c),O=b.useCallback(()=>{var e,n;let o,i,l;if(!S.current||!E.current)return;let s={placement:t,strategy:r,middleware:f};T.current&&(s.platform=T.current),(e=S.current,n=E.current,o=new Map,l={...(i={platform:ln,...s}).platform,_c:o},iY(e,n,{...i,platform:l})).then(e=>{let t={...e,isPositioned:!1!==N.current};P.current&&!ls(C.current,t)&&(C.current=t,nf.flushSync(()=>{d(t)}))})},[f,t,r,T,N]);ll(()=>{!1===c&&C.current.isPositioned&&(C.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[c]);let P=b.useRef(!1);ll(()=>(P.current=!0,()=>{P.current=!1}),[]),ll(()=>{if(w&&(S.current=w),k&&(E.current=k),w&&k){if(R.current)return R.current(w,k,O);O()}},[w,k,O,R,j]);let M=b.useMemo(()=>({reference:S,floating:E,setReference:x,setFloating:y}),[x,y]),L=b.useMemo(()=>({reference:w,floating:k}),[w,k]),A=b.useMemo(()=>{let e={position:r,left:0,top:0};if(!L.floating)return e;let t=lc(L.floating,u.x),n=lc(L.floating,u.y);return s?{...e,transform:"translate("+t+"px, "+n+"px)",...la(L.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:t,top:n}},[r,s,L.floating,u.x,u.y]);return b.useMemo(()=>({...u,update:O,refs:M,elements:L,floatingStyles:A}),[u,O,M,L,A])}({...e,elements:{...i,...l&&{reference:l}}}),d=b.useCallback(e=>{let t=tk(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;s(t),u.refs.setReference(t)},[u.refs]),[f,p]=b.useState(null),[m,h]=b.useState(null);o.useSyncedValue("referenceElement",f),o.useSyncedValue("domReferenceElement",tk(f)?f:null),o.useSyncedValue("floatingElement",m);let g=b.useCallback(e=>{(tk(e)||null===e)&&(a.current=e,p(e)),(tk(u.refs.reference.current)||null===u.refs.reference.current||null!==e&&!tk(e))&&u.refs.setReference(e)},[u.refs,p]),v=b.useCallback(e=>{h(e),u.refs.setFloating(e)},[u.refs]),x=b.useMemo(()=>({...u.refs,setReference:g,setFloating:v,setPositionReference:d,domReference:a}),[u.refs,g,v,d]),y=b.useMemo(()=>({...u.elements,domReference:i.domReference}),[u.elements,i.domReference]),w=o.useState("open"),k=o.useState("floatingId"),S=b.useMemo(()=>({...u,dataRef:o.context.dataRef,open:w,onOpenChange:o.setOpen,events:o.context.events,floatingId:k,refs:x,elements:y,nodeId:t,rootStore:o}),[u,x,y,t,o,w,k]);return tW(()=>{o.context.dataRef.current.floatingContext=S;let e=c?.nodesRef.current.find(e=>e.id===t);e&&(e.context=S)}),b.useMemo(()=>({...u,context:S,refs:x,elements:y,rootStore:o}),[u,x,y,S,o])}({rootContext:M,placement:J,middleware:ea,strategy:w,whileElementsMounted:P?void 0:(...e)=>li(...e,ep),nodeId:D,externalTree:B}),{sideX:eE,sideY:eC}=ev.adaptiveOrigin||lm,ej=ek?w:"fixed",eR=b.useMemo(()=>{let e=_?{position:ej,[eE]:eg,[eC]:eb}:{position:ej,...eS};return ek||(e.opacity=0),e},[_,ej,eE,eg,eC,eb,eS,ek]),eT=b.useRef(null);tW(()=>{if(!L)return;let e=Y.current,t="function"==typeof e?e():e,r=(lv(t)?t.current:t)||null;r!==eT.current&&(em.setPositionReference(r),eT.current=r)},[L,em,X,Y]),b.useEffect(()=>{if(!L)return;let e=Y.current;"function"!=typeof e&&lv(e)&&e.current!==eT.current&&(em.setPositionReference(e.current),eT.current=e.current)},[L,em,X,Y]),b.useEffect(()=>{if(P&&L&&eh.domReference&&eh.floating)return li(eh.domReference,eh.floating,ex,ep)},[P,L,eh,ex,ep]);let eN=iA(ey),eO=lg(k,eN,G),eP=iz(ey)||"center",eM=!!ev.hide?.referenceHidden;tW(()=>{$&&L&&ek&&H(eN)},[$,L,ek,eN]);let eL=b.useMemo(()=>({position:"absolute",top:ev.arrow?.y,left:ev.arrow?.x}),[ev.arrow]),eA=ev.arrow?.centerOffset!==0;return b.useMemo(()=>({positionerStyles:eR,arrowStyles:eL,arrowRef:ei,arrowUncentered:eA,side:eO,align:eP,physicalSide:eN,anchorHidden:eM,refs:em,context:ew,isPositioned:ek,update:ex}),[eR,eL,ei,eA,eO,eP,eN,eM,em,ew,ek,ex])}({anchor:o,positionMethod:i,floatingRootContext:C,mounted:k,side:l,sideOffset:a,align:s,alignOffset:c,collisionBoundary:u,collisionPadding:d,sticky:p,arrowPadding:f,disableAnchorTracking:h,keepMounted:y,collisionAvoidance:g,adaptiveOrigin:x.useState("hasViewport")?lh:void 0}),N=b.useMemo(()=>{let e={};return(!w||"both"===S||E)&&(e.pointerEvents="none"),{role:"presentation",hidden:!k,style:{...T.positionerStyles,...e}}},[w,S,E,k,T.positionerStyles]),O=b.useMemo(()=>({open:w,side:T.side,align:T.align,anchorHidden:T.anchorHidden,instant:"none"!==S?"tracking-cursor":j}),[w,T.side,T.align,T.anchorHidden,S,j]),P=b.useMemo(()=>({...O,arrowRef:T.arrowRef,arrowStyles:T.arrowStyles,arrowUncentered:T.arrowUncentered}),[O,T.arrowRef,T.arrowStyles,T.arrowUncentered]),M=V("div",e,{state:O,props:[N,lx(R),v],ref:[t,x.useStateSetter("positionerElement")],stateAttributesMapping:tm});return(0,m.jsx)(iE.Provider,{value:P,children:M})});var tX=tX;let lw={...tm,...tl},lk=b.forwardRef(function(e,t){let{className:r,render:n,...o}=e,i=o6(),{side:l,align:s}=iC(),a=i.useState("open"),c=i.useState("instantType"),u=i.useState("transitionStatus"),d=i.useState("popupProps"),f=i.useState("floatingRootContext");return nI({open:a,ref:i.context.popupRef,onComplete(){a&&i.context.onOpenChangeComplete?.(!0)}}),!function(e,t={}){let r="rootStore"in e?e.rootStore:e,n=r.useState("open"),o=r.useState("floatingElement"),i=r.useState("domReferenceElement"),{dataRef:l}=r.context,{enabled:s=!0,closeDelay:a=0}=t,c=ib(r),u=nE(),d=nS(),f=tB(()=>ic(l.current.openEvent?.type,c.interactedInside)),p=tB(()=>{let e=l.current.openEvent?.type;return e?.includes("mouse")&&"mousedown"!==e}),m=tB(e=>rX(e,r.context.triggerElements)),h=b.useCallback(e=>{let t=is(a,"close",c.pointerType),n=()=>{r.setOpen(!1,tK(tX.triggerHover,e)),u?.events.emit("floating.closed",e)};t?c.openChangeTimeout.start(t,n):(c.openChangeTimeout.clear(),n())},[a,r,c,u]),g=tB(()=>{ig(c)}),v=tB(e=>{let t=rY(e);if(!(t&&t.closest(im))){c.interactedInside=!1;return}c.interactedInside=t?.closest("[aria-haspopup]")!=null});tW(()=>{n||(c.pointerType=void 0,c.restTimeoutPending=!1,c.interactedInside=!1,g())},[n,c,g]),b.useEffect(()=>g,[g]),tW(()=>{if(s&&n&&c.handleCloseOptions?.blockPointerEvents&&p()&&tk(i)&&o){let e=r_(o),t=u?.nodesRef.current.find(e=>e.id===d)?.context?.elements.floating;t&&(t.style.pointerEvents="");let r=c.handleCloseOptions?.getScope?.()??c.pointerEventsScopeElement??t??i.closest("[data-rootownerid]")??e.body;return!function(e,t){let{scopeElement:r,referenceElement:n,floatingElement:o}=t;ig(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=r,e.pointerEventsReferenceElement=n,e.pointerEventsFloatingElement=o,r.style.pointerEvents="none",n.style.pointerEvents="auto",o.style.pointerEvents="auto"}(c,{scopeElement:r,referenceElement:i,floatingElement:o}),()=>{g()}}},[s,n,i,o,c,p,u,d,g]);let x=rE();b.useEffect(()=>{if(s)return o&&(o.addEventListener("mouseenter",e),o.addEventListener("mouseleave",t),o.addEventListener("pointerdown",v,!0)),()=>{o&&(o.removeEventListener("mouseenter",e),o.removeEventListener("mouseleave",t),o.removeEventListener("pointerdown",v,!0)),u?.events.off("floating.closed",n)};function e(){c.openChangeTimeout.clear(),x.clear(),u?.events.off("floating.closed",n),g()}function t(e){if(u&&d&&r2(u.nodesRef.current,d).length>0)return void u.events.on("floating.closed",n);if(!m(e.relatedTarget)){if(c.handler)return void c.handler(e);g(),f()||h(e)}}function n(e){u&&d&&!(r2(u.nodesRef.current,d).length>0)&&x.start(0,()=>{u.events.off("floating.closed",n),r.setOpen(!1,tK(tX.triggerHover,e)),u.events.emit("floating.closed",e)})}},[s,o,r,l,f,m,h,g,v,c,u,d,x])}(f,{enabled:!i.useState("disabled"),closeDelay:i.useState("closeDelay")}),V("div",e,{state:{open:a,side:l,align:s,instant:c,transitionStatus:u},ref:[t,i.context.popupRef,i.useStateSetter("popupElement")],props:[d,lx(u),o],stateAttributesMapping:lw})}),lS=b.forwardRef(function(e,t){let{className:r,render:n,...o}=e,i=o6().useState("instantType"),{open:l,arrowRef:s,side:a,align:c,arrowUncentered:u,arrowStyles:d}=iC();return V("div",e,{state:{open:l,side:a,align:c,uncentered:u,instant:i},ref:[t,s],props:[{style:d,"aria-hidden":!0},o],stateAttributesMapping:tm})}),lE=((p={}).popupWidth="--popup-width",p.popupHeight="--popup-height",p);function lC(e){let t=tL(e),r=parseFloat(t.width)||0,n=parseFloat(t.height)||0,o=tS(e),i=o?e.offsetWidth:r,l=o?e.offsetHeight:n;return(iN(r)!==i||iN(n)!==l)&&(r=i,n=l),{width:r,height:n}}let lj=()=>!0;function lR(e,t,r){let n=e.style.getPropertyValue(t);return e.style.setProperty(t,r),()=>{e.style.setProperty(t,n)}}function lT(e,t){let r=[];for(let[n,o]of Object.entries(t))r.push(lR(e,n,o));return r.length?()=>{r.forEach(e=>e())}:H}function lN(e,t){let r="auto"===t?"auto":`${t.width}px`,n="auto"===t?"auto":`${t.height}px`;e.style.setProperty("--popup-width",r),e.style.setProperty("--popup-height",n)}function lO(e,t){let r="max-content"===t?"max-content":`${t.width}px`,n="max-content"===t?"max-content":`${t.height}px`;e.style.setProperty("--positioner-width",r),e.style.setProperty("--positioner-height",n)}let lP={activationDirection:e=>e?{"data-activation-direction":e}:null},lM=b.forwardRef(function(e,t){let{render:r,className:n,children:o,...i}=e,l=o6(),s=iC(),a=l.useState("instantType"),{children:c,state:u}=function(e){let t,{store:r,side:n,cssVars:o,children:i}=e,l=lf(),s=r.useState("activeTriggerElement"),a=r.useState("activeTriggerId"),c=r.useState("open"),u=r.useState("payload"),d=r.useState("mounted"),f=r.useState("popupElement"),p=r.useState("positionerElement"),h=function(e){let[t,r]=b.useState({current:e,previous:null});return e!==t.current&&r({current:e,previous:t.current}),t.previous}(c?s:null),g=function(e,t){let[r,n]=b.useState(0),o=b.useRef(e),i=b.useRef(t),l=b.useRef(!1);return tW(()=>{let r=o.current,s=t!==i.current;e!==r?(n(e=>e+1),l.current=!s):l.current&&s&&(n(e=>e+1),l.current=!1),o.current=e,i.current=t},[e,t]),`${e??"current"}-${r}`}(a,u),v=b.useRef(null),[x,y]=b.useState(null),[w,k]=b.useState(null),S=b.useRef(null),E=b.useRef(null),C=nz(S,!0,!1),j=rD(),[R,T]=b.useState(null),[N,O]=b.useState(!1);tW(()=>(r.set("hasViewport",!0),()=>{r.set("hasViewport",!1)}),[r]);let P=tB(()=>{S.current?.style.setProperty("animation","none"),S.current?.style.setProperty("transition","none"),E.current?.style.setProperty("display","none")}),M=tB(e=>{S.current?.style.removeProperty("animation"),S.current?.style.removeProperty("transition"),E.current?.style.removeProperty("display"),e&&T(e)}),L=b.useRef(null);tW(()=>{var e,t;let r,n,o,i;s&&h&&s!==h&&L.current!==s&&v.current&&(y(v.current),O(!0),k((e=h,t=s,r=e.getBoundingClientRect(),n=t.getBoundingClientRect(),o={x:r.left+r.width/2,y:r.top+r.height/2},{horizontal:(i={x:n.left+n.width/2,y:n.top+n.height/2}).x-o.x,vertical:i.y-o.y})),j.request(()=>{nf.flushSync(()=>{O(!1)}),C(()=>{y(null),T(null),v.current=null})}),L.current=s)},[s,h,x,C,j]),tW(()=>{let e=S.current;if(!e)return;let t=document.createElement("div");for(let r of Array.from(e.childNodes))t.appendChild(r.cloneNode(!0));v.current=t});let A=null!=x;return t=A?(0,m.jsxs)(b.Fragment,{children:[(0,m.jsx)("div",{"data-previous":!0,inert:nV(!0),ref:E,style:{...R?{[o.popupWidth]:`${R.width}px`,[o.popupHeight]:`${R.height}px`}:null,position:"absolute"},"data-ending-style":N?void 0:""},"previous"),(0,m.jsx)("div",{"data-current":!0,ref:S,"data-starting-style":N?"":void 0,children:i},g)]}):(0,m.jsx)("div",{"data-current":!0,ref:S,children:i},g),tW(()=>{let e=E.current;e&&x&&e.replaceChildren(...Array.from(x.childNodes))},[x]),!function(e){let{popupElement:t,positionerElement:r,content:n,mounted:o,enabled:i=lj,onMeasureLayout:l,onMeasureLayoutComplete:s,side:a,direction:c}=e,u=nz(t,!0,!1),d=rD(),f=b.useRef(null),p=b.useRef(null),m=b.useRef(!0),h=b.useRef(H),g=tB(l),v=tB(s),x=b.useMemo(()=>{let e="top"===a,t="left"===a;return"rtl"===c?(e=e||"inline-end"===a,t=t||"inline-end"===a):(e=e||"inline-start"===a,t=t||"inline-start"===a),e?{position:"absolute",["top"===a?"bottom":"top"]:"0",[t?"right":"left"]:"0"}:W},[a,c]);tW(()=>{if(!o||!i()||"function"!=typeof ResizeObserver){h.current=H,m.current=!0,f.current=null,p.current=null;return}if(!t||!r)return;h.current=lT(t,x);let e=new ResizeObserver(e=>{let t=e[0];t&&(p.current={width:Math.ceil(t.borderBoxSize[0].inlineSize),height:Math.ceil(t.borderBoxSize[0].blockSize)})});e.observe(t),lN(t,"auto");let n=lR(t,"position","static"),l=lR(t,"transform","none"),s=lR(t,"scale","1"),a=lT(r,{"--available-width":"max-content","--available-height":"max-content"});function c(){n(),l(),a(),s()}if(g?.(),m.current||null===f.current){lO(r,"max-content");let n=lC(t);return f.current=n,lO(r,n),c(),v?.(null,n),m.current=!1,()=>{e.disconnect(),h.current(),h.current=H}}lN(t,"auto"),lO(r,"max-content");let b=f.current??p.current,y=lC(t);if(f.current=y,!b)return lO(r,y),c(),v?.(null,y),()=>{e.disconnect(),d.cancel(),h.current(),h.current=H};lN(t,b),c(),v?.(b,y),lO(r,y);let w=new AbortController;return d.request(()=>{lN(t,y),u(()=>{t.style.setProperty("--popup-width","auto"),t.style.setProperty("--popup-height","auto")},w.signal)}),()=>{e.disconnect(),w.abort(),d.cancel(),h.current(),h.current=H}},[n,t,r,u,d,i,o,g,v,x])}({popupElement:f,positionerElement:p,mounted:d,content:u,onMeasureLayout:P,onMeasureLayoutComplete:M,side:n,direction:l}),{children:t,state:{activationDirection:function(e){if(e){var t,r;return`${(t=e.horizontal)>5?"right":t<-5?"left":""} ${(r=e.vertical)>5?"down":r<-5?"up":""}`}}(w),transitioning:A}}}({store:l,side:s.side,cssVars:lE,children:o});return V("div",e,{state:{activationDirection:u.activationDirection,transitioning:u.transitioning,instant:a},ref:t,props:[i,{children:c}],stateAttributesMapping:lP})});var tX=tX;class lL{constructor(){this.store=new o9}open(e){let t=e?this.store.context.triggerElements.getById(e):void 0;if(e&&!t)throw Error(A(81,e));this.store.setOpen(!0,tK(tX.imperativeAction,void 0,t))}close(){this.store.setOpen(!1,tK(tX.imperativeAction,void 0,void 0))}get isOpen(){return this.store.state.open}}e.s(["Arrow",0,lS,"Handle",0,lL,"Popup",0,lk,"Portal",0,iS,"Positioner",0,ly,"Provider",0,function(e){let{delay:t,closeDelay:r,timeout:n=400}=e,o=b.useMemo(()=>({delay:t,closeDelay:r}),[t,r]),i=b.useMemo(()=>({open:t,close:r}),[t,r]);return(0,m.jsx)(it.Provider,{value:o,children:(0,m.jsx)(id,{delay:i,timeoutMs:n,children:e.children})})},"Root",0,ie,"Trigger",0,iy,"Viewport",0,lM,"createHandle",0,function(){return new lL}],27486);var lA=e.i(27486),lA=lA;let lz=e=>{let t,r,n,o=(0,h.c)(6);o[0]!==e?({delay:r,...t}=e,o[0]=e,o[1]=t,o[2]=r):(t=o[1],r=o[2]);let i=void 0===r?0:r;return o[3]!==i||o[4]!==t?(n=(0,m.jsx)(lA.Provider,{"data-slot":"tooltip-provider",delay:i,...t}),o[3]=i,o[4]=t,o[5]=n):n=o[5],n},lI=e=>{let t,r,n=(0,h.c)(4);return n[0]!==e?({...t}=e,n[0]=e,n[1]=t):t=n[1],n[2]!==t?(r=(0,m.jsx)(lA.Root,{"data-slot":"tooltip",...t}),n[2]=t,n[3]=r):r=n[3],r},lD=e=>{let t,r,n=(0,h.c)(4);return n[0]!==e?({...t}=e,n[0]=e,n[1]=t):t=n[1],n[2]!==t?(r=(0,m.jsx)(lA.Trigger,{"data-slot":"tooltip-trigger",...t}),n[2]=t,n[3]=r):r=n[3],r},l_=e=>{let t,r,n,o,i,l,s,a,c,u,d,f=(0,h.c)(21);f[0]!==e?({className:r,side:o,sideOffset:i,align:l,alignOffset:s,children:t,...n}=e,f[0]=e,f[1]=t,f[2]=r,f[3]=n,f[4]=o,f[5]=i,f[6]=l,f[7]=s):(t=f[1],r=f[2],n=f[3],o=f[4],i=f[5],l=f[6],s=f[7]);let p=void 0===o?"top":o,g=void 0===i?4:i,b=void 0===l?"center":l,v=void 0===s?0:s;return f[8]!==r?(a=((...e)=>e4(K(e)))("z-50 inline-flex w-fit max-w-xs origin-(--transform-origin) items-center gap-1.5 rounded-md bg-foreground px-3 py-1.5 text-xs text-background has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-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 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",r),f[8]=r,f[9]=a):a=f[9],f[10]===Symbol.for("react.memo_cache_sentinel")?(c=(0,m.jsx)(lA.Arrow,{className:"z-50 size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground data-[side=bottom]:top-1 data-[side=inline-end]:top-1/2! data-[side=inline-end]:-left-1 data-[side=inline-end]:-translate-y-1/2 data-[side=inline-start]:top-1/2! data-[side=inline-start]:-right-1 data-[side=inline-start]:-translate-y-1/2 data-[side=left]:top-1/2! data-[side=left]:-right-1 data-[side=left]:-translate-y-1/2 data-[side=right]:top-1/2! data-[side=right]:-left-1 data-[side=right]:-translate-y-1/2 data-[side=top]:-bottom-2.5"}),f[10]=c):c=f[10],f[11]!==t||f[12]!==n||f[13]!==a?(u=(0,m.jsxs)(lA.Popup,{"data-slot":"tooltip-content",className:a,...n,children:[t,c]}),f[11]=t,f[12]=n,f[13]=a,f[14]=u):u=f[14],f[15]!==b||f[16]!==v||f[17]!==p||f[18]!==g||f[19]!==u?(d=(0,m.jsx)(lA.Portal,{children:(0,m.jsx)(lA.Positioner,{align:b,alignOffset:v,side:p,sideOffset:g,className:"isolate z-50",children:u})}),f[15]=b,f[16]=v,f[17]=p,f[18]=g,f[19]=u,f[20]=d):d=f[20],d},l$=(0,b.createContext)(null),lB=()=>{let e=(0,b.useContext)(l$);if(!e)throw Error("useSidebar must be used within a SidebarProvider.");return e},lF=e=>{let t,r,n,o,i,l,s,a,c,u,d,f,p,g,v,x,y=(0,h.c)(36);y[0]!==e?({defaultOpen:s,open:n,onOpenChange:i,className:r,style:l,children:t,...o}=e,y[0]=e,y[1]=t,y[2]=r,y[3]=n,y[4]=o,y[5]=i,y[6]=l,y[7]=s):(t=y[1],r=y[2],n=y[3],o=y[4],i=y[5],l=y[6],s=y[7]);let w=void 0===s||s,k=(()=>{let e,t,r=(0,h.c)(2),[n,o]=(0,b.useState)();return r[0]===Symbol.for("react.memo_cache_sentinel")?(e=()=>{let e=window.matchMedia("(max-width: 767px)"),t=()=>{o(window.innerWidth<768)};return e.addEventListener("change",t),o(window.innerWidth<768),()=>e.removeEventListener("change",t)},t=[],r[0]=e,r[1]=t):(e=r[0],t=r[1]),(0,b.useEffect)(e,t),!!n})(),[S,E]=(0,b.useState)(!1),[C,j]=(0,b.useState)(w),R=n??C;y[8]!==R||y[9]!==i?(a=e=>{let t="function"==typeof e?e(R):e;i?i(t):j(t),cookieStore.set({expires:Date.now()+6048e5,name:"sidebar_state",path:"/",value:String(t)})},y[8]=R,y[9]=i,y[10]=a):a=y[10];let T=a;y[11]!==k||y[12]!==T?(c=()=>k?E(lX):T(lY),y[11]=k,y[12]=T,y[13]=c):c=y[13];let N=c;y[14]!==N?(u=()=>{let e=e=>{"b"===e.key&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),N())};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},d=[N],y[14]=N,y[15]=u,y[16]=d):(u=y[15],d=y[16]),(0,b.useEffect)(u,d);let O=R?"expanded":"collapsed";y[17]!==k||y[18]!==R||y[19]!==S||y[20]!==T||y[21]!==O||y[22]!==N?(f={isMobile:k,open:R,openMobile:S,setOpen:T,setOpenMobile:E,state:O,toggleSidebar:N},y[17]=k,y[18]=R,y[19]=S,y[20]=T,y[21]=O,y[22]=N,y[23]=f):f=y[23];let P=f;y[24]!==r?(p=((...e)=>e4(K(e)))("group/sidebar-wrapper flex min-h-svh w-full has-data-[variant=inset]:bg-sidebar",r),y[24]=r,y[25]=p):p=y[25],y[26]!==l?(g={"--sidebar-width":"16rem","--sidebar-width-icon":"3rem",...l},y[26]=l,y[27]=g):g=y[27];let M=g;return y[28]!==t||y[29]!==o||y[30]!==p||y[31]!==M?(v=(0,m.jsx)(lz,{delay:0,children:(0,m.jsx)("div",{className:p,"data-slot":"sidebar-wrapper",style:M,...o,children:t})}),y[28]=t,y[29]=o,y[30]=p,y[31]=M,y[32]=v):v=y[32],y[33]!==P||y[34]!==v?(x=(0,m.jsx)(l$.Provider,{value:P,children:v}),y[33]=P,y[34]=v,y[35]=x):x=y[35],x},lH=e=>{let t,r,n,o,i,l,s,a,c,u,d,f,p=(0,h.c)(46);p[0]!==e?({side:o,variant:i,collapsible:l,className:r,children:t,...n}=e,p[0]=e,p[1]=t,p[2]=r,p[3]=n,p[4]=o,p[5]=i,p[6]=l):(t=p[1],r=p[2],n=p[3],o=p[4],i=p[5],l=p[6]);let g=void 0===o?"left":o,b=void 0===i?"sidebar":i,v=void 0===l?"offcanvas":l,{isMobile:x,state:y,openMobile:w,setOpenMobile:k}=lB();if("none"===v){let e,o;return p[7]!==r?(e=((...e)=>e4(K(e)))("flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground",r),p[7]=r,p[8]=e):e=p[8],p[9]!==t||p[10]!==n||p[11]!==e?(o=(0,m.jsx)("div",{className:e,"data-slot":"sidebar",...n,children:t}),p[9]=t,p[10]=n,p[11]=e,p[12]=o):o=p[12],o}if(x){let e,r,o,i,l;return p[13]===Symbol.for("react.memo_cache_sentinel")?(e={"--sidebar-width":"18rem"},p[13]=e):e=p[13],p[14]===Symbol.for("react.memo_cache_sentinel")?(r=(0,m.jsxs)(o2,{className:"sr-only",children:[(0,m.jsx)(o5,{children:"Sidebar"}),(0,m.jsx)(o3,{children:"Displays the mobile sidebar."})]}),p[14]=r):r=p[14],p[15]!==t?(o=(0,m.jsx)("div",{className:"flex h-full w-full flex-col",children:t}),p[15]=t,p[16]=o):o=p[16],p[17]!==g||p[18]!==o?(i=(0,m.jsxs)(o1,{className:"w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden","data-mobile":"true","data-sidebar":"sidebar","data-slot":"sidebar",side:g,style:e,children:[r,o]}),p[17]=g,p[18]=o,p[19]=i):i=p[19],p[20]!==w||p[21]!==n||p[22]!==k||p[23]!==i?(l=(0,m.jsx)(oJ,{onOpenChange:k,open:w,...n,children:i}),p[20]=w,p[21]=n,p[22]=k,p[23]=i,p[24]=l):l=p[24],l}let S="collapsed"===y?v:"",E="floating"===b||"inset"===b?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)";p[25]!==E?(s=((...e)=>e4(K(e)))("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",E),p[25]=E,p[26]=s):s=p[26],p[27]!==s?(a=(0,m.jsx)("div",{className:s,"data-slot":"sidebar-gap"}),p[27]=s,p[28]=a):a=p[28];let C="left"===g?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",j="floating"===b||"inset"===b?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l";return p[29]!==r||p[30]!==C||p[31]!==j?(c=((...e)=>e4(K(e)))("fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex",C,j,r),p[29]=r,p[30]=C,p[31]=j,p[32]=c):c=p[32],p[33]!==t?(u=(0,m.jsx)("div",{className:"flex h-full w-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow-sm","data-sidebar":"sidebar","data-slot":"sidebar-inner",children:t}),p[33]=t,p[34]=u):u=p[34],p[35]!==n||p[36]!==c||p[37]!==u?(d=(0,m.jsx)("div",{className:c,"data-slot":"sidebar-container",...n,children:u}),p[35]=n,p[36]=c,p[37]=u,p[38]=d):d=p[38],p[39]!==g||p[40]!==y||p[41]!==d||p[42]!==S||p[43]!==a||p[44]!==b?(f=(0,m.jsxs)("div",{className:"group peer hidden text-sidebar-foreground md:block","data-collapsible":S,"data-side":g,"data-slot":"sidebar","data-state":y,"data-variant":b,children:[a,d]}),p[39]=g,p[40]=y,p[41]=d,p[42]=S,p[43]=a,p[44]=b,p[45]=f):f=p[45],f},lW=e=>{let t,r,n,o,i,l,s,a=(0,h.c)(15);a[0]!==e?({className:t,onClick:r,...n}=e,a[0]=e,a[1]=t,a[2]=r,a[3]=n):(t=a[1],r=a[2],n=a[3]);let{state:c,toggleSidebar:u}=lB();a[4]!==r||a[5]!==u?(o=e=>{r?.(e),u()},a[4]=r,a[5]=u,a[6]=o):o=a[6];let d=o,f="expanded"===c;return a[7]!==t?(i=((...e)=>e4(K(e)))("text-muted-foreground hover:text-foreground hover:bg-secondary",t),a[7]=t,a[8]=i):i=a[8],a[9]===Symbol.for("react.memo_cache_sentinel")?(l=(0,m.jsx)(te,{size:14}),a[9]=l):l=a[9],a[10]!==d||a[11]!==n||a[12]!==f||a[13]!==i?(s=(0,m.jsx)(e8,{"data-slot":"sidebar-trigger","data-sidebar":"trigger",variant:"ghost",size:"icon-xs","aria-label":"Toggle sidebar","aria-expanded":f,className:i,...n,onClick:d,children:l}),a[10]=d,a[11]=n,a[12]=f,a[13]=i,a[14]=s):s=a[14],s},lV=e=>{let t,r,n,o,i=(0,h.c)(8);return i[0]!==e?({className:t,...r}=e,i[0]=e,i[1]=t,i[2]=r):(t=i[1],r=i[2]),i[3]!==t?(n=((...e)=>e4(K(e)))("relative flex w-full flex-1 flex-col bg-background","md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2 md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm",t),i[3]=t,i[4]=n):n=i[4],i[5]!==r||i[6]!==n?(o=(0,m.jsx)("main",{className:n,"data-slot":"sidebar-inset",...r}),i[5]=r,i[6]=n,i[7]=o):o=i[7],o},lU=e=>{let t,r,n,o,i=(0,h.c)(8);return i[0]!==e?({className:t,...r}=e,i[0]=e,i[1]=t,i[2]=r):(t=i[1],r=i[2]),i[3]!==t?(n=((...e)=>e4(K(e)))("flex flex-col gap-2 p-2",t),i[3]=t,i[4]=n):n=i[4],i[5]!==r||i[6]!==n?(o=(0,m.jsx)("div",{className:n,"data-sidebar":"header","data-slot":"sidebar-header",...r}),i[5]=r,i[6]=n,i[7]=o):o=i[7],o},lq=e=>{let t,r,n,o,i=(0,h.c)(8);return i[0]!==e?({className:t,...r}=e,i[0]=e,i[1]=t,i[2]=r):(t=i[1],r=i[2]),i[3]!==t?(n=((...e)=>e4(K(e)))("flex flex-col gap-2 p-2",t),i[3]=t,i[4]=n):n=i[4],i[5]!==r||i[6]!==n?(o=(0,m.jsx)("div",{className:n,"data-sidebar":"footer","data-slot":"sidebar-footer",...r}),i[5]=r,i[6]=n,i[7]=o):o=i[7],o},lK=e=>{let t,r,n,o,i=(0,h.c)(8);return i[0]!==e?({className:t,...r}=e,i[0]=e,i[1]=t,i[2]=r):(t=i[1],r=i[2]),i[3]!==t?(n=((...e)=>e4(K(e)))("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",t),i[3]=t,i[4]=n):n=i[4],i[5]!==r||i[6]!==n?(o=(0,m.jsx)("div",{className:n,"data-sidebar":"content","data-slot":"sidebar-content",...r}),i[5]=r,i[6]=n,i[7]=o):o=i[7],o};function lX(e){return!e}function lY(e){return!e}let lG=[{label:"All",value:"all"},{label:"Uncommitted changes",value:"uncommitted"}],lZ=(e,t=24)=>{if(e.length<=t)return e;let r=Math.floor((t-1)/2);return`${e.slice(0,r)}…${e.slice(-r)}`},lJ=e=>{let t,r,n=(0,h.c)(5),{syncNotice:o}=e;if(!o)return null;if(n[0]!==o.tone){var i;t=((...e)=>e4(K(e)))("rounded-full border px-2 py-1 text-[11px] leading-none","destructive"===(i=o.tone)?"border-destructive/30 bg-destructive/10 text-destructive":"warning"===i?"border-amber-500/30 bg-amber-500/10 text-amber-600 dark:text-amber-400":"border-border bg-muted/40 text-muted-foreground"),n[0]=o.tone,n[1]=t}else t=n[1];return n[2]!==o.label||n[3]!==t?(r=(0,m.jsx)("div",{className:t,children:o.label}),n[2]=o.label,n[3]=t,n[4]=r):r=n[4],r},lQ=()=>null,l0=e=>{var t;let r,n,o,i,l,s,a,c,u,d,f,p,v,j,R,T,N,O,P,M,L,A,z,I,D,_,$,B,F,H,W,V,U,q,X,Y,G,Z,J,Q=(0,h.c)(141),{branch:ee,baseBranch:et,refreshing:er,fileWatchState:en,syncNotice:eo,comments:ei,diffMode:el,onDiffModeChange:es,layout:ea,onLayoutChange:ec}=e,[eu,ed]=(0,b.useState)(!1),[ef,ep]=(0,b.useState)(null),[em,eh]=(0,b.useState)(!1),eg=(0,b.useSyncExternalStore)(l1,l2,l5),eb=(0,b.useRef)(null),{resolvedTheme:ev,setTheme:ex}=(0,g.useTheme)(),ey=(0,b.useRef)(null),ew=(0,b.useRef)(null);Q[0]===Symbol.for("react.memo_cache_sentinel")?(r=async(e,t)=>{try{await navigator.clipboard.writeText(e),ew.current&&clearTimeout(ew.current),ep(t),ew.current=setTimeout(()=>ep(null),1500)}catch{}},Q[0]=r):r=Q[0];let ek=r;Q[1]!==ei?(n=async()=>{try{let e=(e=>{if(0===e.length)return"No comments.";let t=e.map(e=>{let t=e.tag?`${e.tag} `:"",r=e.lineNumber>0?`:${e.lineNumber}`:"";return`- ${t}**${e.file}${r}**: ${e.body}`});return`## Code Review Comments
13
+
14
+ Please address the following:
15
+
16
+ ${t.join("\n")}`})(ei);await navigator.clipboard.writeText(e),ey.current&&clearTimeout(ey.current),ed(!0),ey.current=setTimeout(()=>ed(!1),2e3)}catch{}},Q[1]=ei,Q[2]=n):n=Q[2];let eS=n;if(Q[3]===Symbol.for("react.memo_cache_sentinel")?(o=()=>eh(!1),Q[3]=o):o=Q[3],t=o,(J=(0,h.c)(5))[0]!==eb||J[1]!==t||J[2]!==em?(G=()=>{if(!em)return;let e=e=>{eb.current&&!eb.current.contains(e.target)&&t()};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},Z=[eb,t,em],J[0]=eb,J[1]=t,J[2]=em,J[3]=G,J[4]=Z):(G=J[3],Z=J[4]),(0,b.useEffect)(G,Z),Q[4]!==et||Q[5]!==ee||Q[6]!==ef||Q[7]!==en||Q[8]!==er){let e,t,r,n,o,h,g,b,y,w,k,S,E,T,N,O,P,M,L,A,z,I,{className:D,label:_}="connecting"===en?{className:"bg-muted-foreground/50",label:"Connecting"}:"live"===en?{className:"bg-diff-green",label:"Live"}:{className:"bg-amber-500",label:"Polling"};R=_,s=lz,c=400,p="flex h-[52px] items-center gap-2 border-b border-border bg-card px-4 text-sm",Q[21]===Symbol.for("react.memo_cache_sentinel")?(e=(0,m.jsx)(lD,{render:(0,m.jsx)(lW,{className:"-ml-1"})}),Q[21]=e):e=Q[21],Q[22]===Symbol.for("react.memo_cache_sentinel")?(v=(0,m.jsxs)(lI,{children:[e,(0,m.jsxs)(l_,{side:"bottom",className:"flex items-center gap-2",children:[(0,m.jsx)("span",{children:"Toggle sidebar"}),(0,m.jsx)(e9,{children:"⌘B"})]})]}),Q[22]=v):v=Q[22],Q[23]!==ee?(t=(0,m.jsx)("button",{type:"button",onClick:()=>ek(ee,"branch"),className:"relative whitespace-nowrap rounded-md border border-border bg-background px-2.5 py-1 font-mono text-xs text-muted-foreground cursor-pointer hover:bg-secondary"}),Q[23]=ee,Q[24]=t):t=Q[24];let $="branch"===ef?"opacity-0":"opacity-100";Q[25]!==$?(r=((...e)=>e4(K(e)))("transition-opacity duration-150",$),Q[25]=$,Q[26]=r):r=Q[26],Q[27]!==ee?(n=lZ(ee),Q[27]=ee,Q[28]=n):n=Q[28],Q[29]!==r||Q[30]!==n?(o=(0,m.jsx)("span",{className:r,children:n}),Q[29]=r,Q[30]=n,Q[31]=o):o=Q[31];let B="branch"===ef?"opacity-100":"opacity-0";Q[32]!==B?(h=((...e)=>e4(K(e)))("absolute inset-0 flex items-center justify-center text-diff-green transition-opacity duration-150",B),Q[32]=B,Q[33]=h):h=Q[33],Q[34]===Symbol.for("react.memo_cache_sentinel")?(g=(0,m.jsx)(x,{size:14}),Q[34]=g):g=Q[34],Q[35]!==h?(b=(0,m.jsx)("span",{className:h,children:g}),Q[35]=h,Q[36]=b):b=Q[36],Q[37]!==t||Q[38]!==o||Q[39]!==b?(y=(0,m.jsxs)(lD,{render:t,children:[o,b]}),Q[37]=t,Q[38]=o,Q[39]=b,Q[40]=y):y=Q[40];let F="branch"===ef?"Copied!":"Click to copy";Q[41]!==F?(w=(0,m.jsx)(l_,{side:"bottom",children:F}),Q[41]=F,Q[42]=w):w=Q[42],Q[43]!==y||Q[44]!==w?(k=(0,m.jsxs)(lI,{children:[y,w]}),Q[43]=y,Q[44]=w,Q[45]=k):k=Q[45],Q[46]===Symbol.for("react.memo_cache_sentinel")?(S=(0,m.jsx)(C,{size:12,className:"text-muted-foreground/50 shrink-0"}),Q[46]=S):S=Q[46],Q[47]!==et?(E=(0,m.jsx)("button",{type:"button",onClick:()=>ek(et,"base"),className:"relative whitespace-nowrap rounded-md border border-border bg-background px-2.5 py-1 font-mono text-xs text-muted-foreground cursor-pointer hover:bg-secondary"}),Q[47]=et,Q[48]=E):E=Q[48];let H="base"===ef?"opacity-0":"opacity-100";Q[49]!==H?(T=((...e)=>e4(K(e)))("transition-opacity duration-150",H),Q[49]=H,Q[50]=T):T=Q[50],Q[51]!==et?(N=lZ(et),Q[51]=et,Q[52]=N):N=Q[52],Q[53]!==T||Q[54]!==N?(O=(0,m.jsx)("span",{className:T,children:N}),Q[53]=T,Q[54]=N,Q[55]=O):O=Q[55];let W="base"===ef?"opacity-100":"opacity-0";Q[56]!==W?(P=((...e)=>e4(K(e)))("absolute inset-0 flex items-center justify-center text-diff-green transition-opacity duration-150",W),Q[56]=W,Q[57]=P):P=Q[57],Q[58]===Symbol.for("react.memo_cache_sentinel")?(M=(0,m.jsx)(x,{size:14}),Q[58]=M):M=Q[58],Q[59]!==P?(L=(0,m.jsx)("span",{className:P,children:M}),Q[59]=P,Q[60]=L):L=Q[60],Q[61]!==E||Q[62]!==O||Q[63]!==L?(A=(0,m.jsxs)(lD,{render:E,children:[O,L]}),Q[61]=E,Q[62]=O,Q[63]=L,Q[64]=A):A=Q[64];let V="base"===ef?"Copied!":"Click to copy";Q[65]!==V?(z=(0,m.jsx)(l_,{side:"bottom",children:V}),Q[65]=V,Q[66]=z):z=Q[66],Q[67]!==A||Q[68]!==z?(I=(0,m.jsxs)(lI,{children:[A,z]}),Q[67]=A,Q[68]=z,Q[69]=I):I=Q[69],Q[70]!==k||Q[71]!==I?(j=(0,m.jsxs)("div",{className:"flex items-center gap-1.5",children:[k,S,I]}),Q[70]=k,Q[71]=I,Q[72]=j):j=Q[72],Q[73]===Symbol.for("react.memo_cache_sentinel")?(a=(0,m.jsx)("div",{className:"flex-1"}),Q[73]=a):a=Q[73],f="flex items-center gap-0.5",l=lI,i=lD,Q[74]===Symbol.for("react.memo_cache_sentinel")?(d=(0,m.jsx)("div",{className:"flex items-center pr-1.5"}),Q[74]=d):d=Q[74],u=((...e)=>e4(K(e)))("mx-1 size-1.5 rounded-full",D,er&&"animate-pulse"),Q[4]=et,Q[5]=ee,Q[6]=ef,Q[7]=en,Q[8]=er,Q[9]=i,Q[10]=l,Q[11]=s,Q[12]=a,Q[13]=c,Q[14]=u,Q[15]=d,Q[16]=f,Q[17]=p,Q[18]=v,Q[19]=j,Q[20]=R}else i=Q[9],l=Q[10],s=Q[11],a=Q[12],c=Q[13],u=Q[14],d=Q[15],f=Q[16],p=Q[17],v=Q[18],j=Q[19],R=Q[20];Q[75]!==u?(T=(0,m.jsx)("span",{className:u}),Q[75]=u,Q[76]=T):T=Q[76],Q[77]!==i||Q[78]!==T||Q[79]!==d?(N=(0,m.jsx)(i,{render:d,children:T}),Q[77]=i,Q[78]=T,Q[79]=d,Q[80]=N):N=Q[80],Q[81]!==R?(O=(0,m.jsx)(l_,{side:"bottom",children:R}),Q[81]=R,Q[82]=O):O=Q[82],Q[83]!==l||Q[84]!==N||Q[85]!==O?(P=(0,m.jsxs)(l,{children:[N,O]}),Q[83]=l,Q[84]=N,Q[85]=O,Q[86]=P):P=Q[86],Q[87]!==eo?(M=(0,m.jsx)(lJ,{syncNotice:eo}),Q[87]=eo,Q[88]=M):M=Q[88],Q[89]===Symbol.for("react.memo_cache_sentinel")?(L=()=>eh(l3),Q[89]=L):L=Q[89];let eE="uncommitted"===el?"Uncommitted":"All",eC=em&&"rotate-180";Q[90]!==eC?(A=((...e)=>e4(K(e)))("transition-transform duration-150",eC),Q[90]=eC,Q[91]=A):A=Q[91],Q[92]!==A?(z=(0,m.jsx)(y,{size:10,className:A}),Q[92]=A,Q[93]=z):z=Q[93],Q[94]!==eE||Q[95]!==z?(I=(0,m.jsxs)(e8,{variant:"ghost",size:"xs",onClick:L,className:"text-muted-foreground hover:text-foreground hover:bg-secondary gap-1",children:[eE,z]}),Q[94]=eE,Q[95]=z,Q[96]=I):I=Q[96],Q[97]!==el||Q[98]!==em||Q[99]!==es?(D=em&&(0,m.jsx)("div",{className:"absolute right-0 top-full mt-1 z-50 min-w-[200px] rounded-lg border border-border bg-card shadow-lg dark:shadow-none py-1 overflow-hidden",children:lG.map(e=>{let{value:t,label:r}=e;return(0,m.jsxs)("button",{type:"button",className:"flex w-full items-center justify-between px-3 py-2 text-sm text-left hover:bg-secondary/50 transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring/50",onClick:()=>{es(t),eh(!1)},children:[(0,m.jsx)("span",{className:((...e)=>e4(K(e)))("text-foreground",el===t&&"font-medium"),children:r}),el===t&&(0,m.jsx)(x,{size:14,className:"text-diff-green shrink-0"})]},t)})}),Q[97]=el,Q[98]=em,Q[99]=es,Q[100]=D):D=Q[100],Q[101]!==I||Q[102]!==D?(_=(0,m.jsxs)("div",{className:"relative",ref:eb,children:[I,D]}),Q[101]=I,Q[102]=D,Q[103]=_):_=Q[103],Q[104]!==ei.length||Q[105]!==eu||Q[106]!==eS?($=ei.length>0&&(0,m.jsxs)(lI,{children:[(0,m.jsxs)(lD,{render:(0,m.jsx)(e8,{variant:"ghost",size:"xs",onClick:eS,className:"text-muted-foreground hover:text-foreground hover:bg-secondary"}),children:[eu?(0,m.jsx)(x,{"data-icon":"inline-start"}):(0,m.jsx)(w,{"data-icon":"inline-start"}),eu?"Copied!":`Copy ${ei.length} comment${1===ei.length?"":"s"}`]}),(0,m.jsx)(l_,{side:"bottom",children:"Copy all comments as AI prompt"})]}),Q[104]=ei.length,Q[105]=eu,Q[106]=eS,Q[107]=$):$=Q[107],Q[108]!==ea||Q[109]!==ec?(B=(0,m.jsx)(e8,{variant:"ghost",size:"icon-xs",onClick:()=>ec("split"===ea?"stacked":"split"),className:"text-muted-foreground hover:text-foreground hover:bg-secondary"}),Q[108]=ea,Q[109]=ec,Q[110]=B):B=Q[110],Q[111]===Symbol.for("react.memo_cache_sentinel")?(F=(0,m.jsx)(E,{size:14}),Q[111]=F):F=Q[111],Q[112]!==B?(H=(0,m.jsx)(lD,{render:B,children:F}),Q[112]=B,Q[113]=H):H=Q[113];let ej="split"===ea?"Switch to unified view (S)":"Switch to split view (S)";return Q[114]!==ej?(W=(0,m.jsx)(l_,{side:"bottom",children:ej}),Q[114]=ej,Q[115]=W):W=Q[115],Q[116]!==H||Q[117]!==W?(V=(0,m.jsxs)(lI,{children:[H,W]}),Q[116]=H,Q[117]=W,Q[118]=V):V=Q[118],Q[119]!==eg||Q[120]!==ev||Q[121]!==ex?(U=eg&&(0,m.jsxs)(lI,{children:[(0,m.jsx)(lD,{render:(0,m.jsx)(e8,{variant:"ghost",size:"icon-xs",onClick:()=>ex("dark"===ev?"light":"dark"),className:"text-muted-foreground hover:text-foreground hover:bg-secondary"}),children:"dark"===ev?(0,m.jsx)(k,{size:14}):(0,m.jsx)(S,{size:14})}),(0,m.jsx)(l_,{side:"bottom",children:"dark"===ev?"Switch to light mode":"Switch to dark mode"})]}),Q[119]=eg,Q[120]=ev,Q[121]=ex,Q[122]=U):U=Q[122],Q[123]!==P||Q[124]!==M||Q[125]!==_||Q[126]!==$||Q[127]!==V||Q[128]!==U||Q[129]!==f?(q=(0,m.jsxs)("div",{className:f,children:[P,M,_,$,V,U]}),Q[123]=P,Q[124]=M,Q[125]=_,Q[126]=$,Q[127]=V,Q[128]=U,Q[129]=f,Q[130]=q):q=Q[130],Q[131]!==a||Q[132]!==q||Q[133]!==p||Q[134]!==v||Q[135]!==j?(X=(0,m.jsxs)("header",{className:p,children:[v,j,a,q]}),Q[131]=a,Q[132]=q,Q[133]=p,Q[134]=v,Q[135]=j,Q[136]=X):X=Q[136],Q[137]!==s||Q[138]!==c||Q[139]!==X?(Y=(0,m.jsx)(s,{delay:c,children:X}),Q[137]=s,Q[138]=c,Q[139]=X,Q[140]=Y):Y=Q[140],Y};function l1(){return lQ}function l2(){return!0}function l5(){return!1}function l3(e){return!e}let l4=v("BubbleDotsIcon",(0,b.forwardRef)((e,t)=>b.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",viewBox:"0 0 24 24",ref:t,...e},b.createElement("path",{stroke:"currentColor",strokeLinejoin:"round",strokeWidth:2,d:"M4.002 7c0-1.6568 1.3431-3 3-3h9.9999c1.6569 0 3.0001 1.3431 3.0001 3v8.0358c0 1.6568-1.3432 3-3 3h-1.6263a1 1 0 0 0-.638.2299l-2.74 2.2701-2.7037-2.2664a1 1 0 0 0-.6424-.2336H7.0019c-1.6568 0-3-1.3432-3-3z"}),b.createElement("path",{fill:"currentColor",stroke:"currentColor",strokeLinecap:"square",strokeWidth:.75,d:"M6.875 11.25a.875.875 0 1 0 1.75 0 .875.875 0 0 0-1.75 0Zm4.25 0a.875.875 0 1 0 1.7501-.0001.875.875 0 0 0-1.7501.0001Zm4.25 0a.875.875 0 1 0 1.7501-.0001.875.875 0 0 0-1.7501.0001Z"})))),l6=v("Folder1Icon",(0,b.forwardRef)((e,t)=>b.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",viewBox:"0 0 24 24",ref:t,...e},b.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 7v9c0 1.6569 1.3431 3 3 3h12c1.6569 0 3-1.3431 3-3v-6c0-1.6569-1.3431-3-3-3h-4.9296a2 2 0 0 1-1.6641-.8906l-.8126-1.2188A2 2 0 0 0 8.9297 4H6C4.3431 4 3 5.3431 3 7"})))),l7=v("FolderOpenFilledIcon",(0,b.forwardRef)((e,t)=>b.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",viewBox:"0 0 24 24",ref:t,...e},b.createElement("path",{fill:"currentColor",fillRule:"evenodd",d:"M6 3C3.7909 3 2 4.7909 2 7v10.5592C2 18.9072 3.0928 20 4.4408 20H18.045a3.0002 3.0002 0 0 0 2.8487-2.1052l1.6557-5.2983c.3657-1.1701-.3952-2.3574-1.5494-2.5647V9c0-1.6569-1.3431-3-3-3h-4.9296a1 1 0 0 1-.8321-.4453l-.5157-.7735A4 4 0 0 0 8.3945 3zm13 7V9c0-.5523-.4477-1-1-1h-4.9296a3 3 0 0 1-2.4962-1.3359l-.5157-.7735A2 2 0 0 0 8.3945 5H6c-1.1046 0-2 .8954-2 2v10.5592a.4407.4407 0 0 0 .8615.1315l1.7454-5.5855A3 3 0 0 1 9.4704 10z",clipRule:"evenodd"})))),l8=v("MagnifyingGlassIcon",(0,b.forwardRef)((e,t)=>b.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",viewBox:"0 0 24 24",ref:t,...e},b.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeWidth:2,d:"m20 20-3.95-3.95M18 11c0 3.866-3.134 7-7 7s-7-3.134-7-7 3.134-7 7-7 7 3.134 7 7Z"})))),l9=e=>{let t,r,n,o,i=(0,h.c)(7);i[0]!==e?({size:r,...t}=e,i[0]=e,i[1]=t,i[2]=r):(t=i[1],r=i[2]);let l=void 0===r?16:r;return i[3]===Symbol.for("react.memo_cache_sentinel")?(n=(0,m.jsx)("path",{d:"M1 1.75C1 .784 1.784 0 2.75 0h7.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16H2.75A1.75 1.75 0 0 1 1 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h10.5a.25.25 0 0 0 .25-.25V4.664a.25.25 0 0 0-.073-.177l-2.914-2.914a.25.25 0 0 0-.177-.073ZM8 3.25a.75.75 0 0 1 .75.75v1.5h1.5a.75.75 0 0 1 0 1.5h-1.5v1.5a.75.75 0 0 1-1.5 0V7h-1.5a.75.75 0 0 1 0-1.5h1.5V4A.75.75 0 0 1 8 3.25Zm-3 8a.75.75 0 0 1 .75-.75h4.5a.75.75 0 0 1 0 1.5h-4.5a.75.75 0 0 1-.75-.75Z"}),i[3]=n):n=i[3],i[4]!==t||i[5]!==l?(o=(0,m.jsx)("svg",{viewBox:"0 0 16 16",width:l,height:l,fill:"currentColor","aria-hidden":"true",focusable:"false",...t,children:n}),i[4]=t,i[5]=l,i[6]=o):o=i[6],o},se=e=>{let t,r,n,o,i=(0,h.c)(7);i[0]!==e?({size:r,...t}=e,i[0]=e,i[1]=t,i[2]=r):(t=i[1],r=i[2]);let l=void 0===r?16:r;return i[3]===Symbol.for("react.memo_cache_sentinel")?(n=(0,m.jsx)("path",{d:"M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V4.664a.25.25 0 0 0-.073-.177l-2.914-2.914a.25.25 0 0 0-.177-.073Zm4.48 3.758a.75.75 0 0 1 .755.745l.01 1.497h1.497a.75.75 0 0 1 0 1.5H9v1.507a.75.75 0 0 1-1.5 0V9.005l-1.502.01a.75.75 0 0 1-.01-1.5l1.507-.01-.01-1.492a.75.75 0 0 1 .745-.755Z"}),i[3]=n):n=i[3],i[4]!==t||i[5]!==l?(o=(0,m.jsx)("svg",{viewBox:"0 0 16 16",width:l,height:l,fill:"currentColor","aria-hidden":"true",focusable:"false",...t,children:n}),i[4]=t,i[5]=l,i[6]=o):o=i[6],o},st=e=>{let t,r,n,o,i=(0,h.c)(7);i[0]!==e?({size:r,...t}=e,i[0]=e,i[1]=t,i[2]=r):(t=i[1],r=i[2]);let l=void 0===r?16:r;return i[3]===Symbol.for("react.memo_cache_sentinel")?(n=(0,m.jsx)("path",{d:"M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V4.664a.25.25 0 0 0-.073-.177l-2.914-2.914a.25.25 0 0 0-.177-.073Zm4.5 6h2.242a.75.75 0 0 1 0 1.5h-2.24l-2.254.015a.75.75 0 0 1-.01-1.5Z"}),i[3]=n):n=i[3],i[4]!==t||i[5]!==l?(o=(0,m.jsx)("svg",{viewBox:"0 0 16 16",width:l,height:l,fill:"currentColor","aria-hidden":"true",focusable:"false",...t,children:n}),i[4]=t,i[5]=l,i[6]=o):o=i[6],o},sr="diffhub:file-tree:expand-all",sn="diffhub:file-tree:collapse-all",so=e=>e.map(e=>{if("file"===e.type)return e;let t=so(e.children);if(1===t.length&&"folder"===t[0].type){let r=t[0];return{...r,name:`${e.name}/${r.name}`}}return{...e,children:t}}),si=(e,t=[])=>{for(let r of e)"folder"===r.type&&(t.push(r.path),si(r.children,t));return t},sl=(0,b.memo)(function(e){let t,r,n,o,i,l,s,a,c,u,d=(0,h.c)(30),{node:f,depth:p,isSelected:g,commentCount:b,onNavigate:v}=e,x=16*p+8,{insertions:y,deletions:w}=f.fileStat,k=l9;y>0&&0===w?k=se:w>0&&0===y&&(k=st);let S="shrink-0 text-sidebar-foreground/40";y>0&&0===w?S="shrink-0 text-diff-green":w>0&&0===y&&(S="shrink-0 text-destructive");let E=g?"true":void 0,C=g?"bg-sidebar-accent text-sidebar-accent-foreground":"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground";d[0]!==C?(t=((...e)=>e4(K(e)))("flex w-full cursor-pointer items-center gap-1.5 py-1 text-left transition-colors",C),d[0]=C,d[1]=t):t=d[1];let j=g?"true":void 0;return d[2]!==x?(r={containIntrinsicBlockSize:"26px",contentVisibility:"auto",paddingLeft:x,paddingRight:8},d[2]=x,d[3]=r):r=d[3],d[4]!==f.path||d[5]!==v?(n=()=>v(f.path),d[4]=f.path,d[5]=v,d[6]=n):n=d[6],d[7]!==k||d[8]!==S?(o=(0,m.jsx)(k,{size:16,className:S}),d[7]=k,d[8]=S,d[9]=o):o=d[9],d[10]===Symbol.for("react.memo_cache_sentinel")?(i=(0,m.jsx)("span",{className:"flex-1 truncate text-[12px] leading-tight text-muted-foreground"}),d[10]=i):i=d[10],d[11]!==f.name?(l=(0,m.jsx)(lD,{render:i,children:f.name}),d[11]=f.name,d[12]=l):l=d[12],d[13]!==f.path?(s=(0,m.jsx)(l_,{side:"right",children:f.path}),d[13]=f.path,d[14]=s):s=d[14],d[15]!==s||d[16]!==l?(a=(0,m.jsxs)(lI,{children:[l,s]}),d[15]=s,d[16]=l,d[17]=a):a=d[17],d[18]!==b?(c=b>0&&(0,m.jsxs)("span",{className:"flex shrink-0 items-center gap-0.5 text-[10px] text-sidebar-foreground/50",children:[(0,m.jsx)(l4,{size:10}),b]}),d[18]=b,d[19]=c):c=d[19],d[20]!==f.path||d[21]!==E||d[22]!==a||d[23]!==c||d[24]!==t||d[25]!==j||d[26]!==r||d[27]!==n||d[28]!==o?(u=(0,m.jsxs)("button",{type:"button","aria-current":E,className:t,"data-file-path":f.path,"data-selected":j,style:r,onClick:n,children:[o,a,c]}),d[20]=f.path,d[21]=E,d[22]=a,d[23]=c,d[24]=t,d[25]=j,d[26]=r,d[27]=n,d[28]=o,d[29]=u):u=d[29],u}),ss=(0,b.memo)(function(e){let t,r,n,o,i,l,s,a,c,u,d,f,p,g,v,x,y,w=(0,h.c)(50),{node:k,depth:S,isCollapsed:E,onToggle:C,children:j}=e,R=16*S+8;if(w[0]!==R||w[1]!==E||w[2]!==k.name||w[3]!==k.path||w[4]!==C){let e=(d=e6(k.name)).split("/");i="button",l=!E,s="flex w-full items-center gap-1.5 py-1 text-left transition-colors hover:bg-sidebar-accent focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-sidebar-ring",w[16]!==R?(a={paddingLeft:R,paddingRight:8},w[16]=R,w[17]=a):a=w[17],w[18]!==k.path||w[19]!==C?(c=()=>C(k.path),w[18]=k.path,w[19]=C,w[20]=c):c=w[20],w[21]!==E?(u=E?(0,m.jsx)(l6,{size:16,className:"shrink-0 text-sidebar-foreground/50"}):(0,m.jsx)(l7,{size:16,className:"shrink-0 text-sidebar-foreground/50"}),w[21]=E,w[22]=u):u=w[22],r=lI,t=lD,w[23]===Symbol.for("react.memo_cache_sentinel")?(n=(0,m.jsx)("span",{className:"truncate text-[12px] text-muted-foreground"}),w[23]=n):n=w[23],o=e.map((t,r)=>{let n=e.slice(0,r+1).join("/");return(0,m.jsxs)(b.Fragment,{children:[t,r<e.length-1&&(0,m.jsx)("span",{className:"text-sidebar-foreground/30",children:"/"})]},n)}),w[0]=R,w[1]=E,w[2]=k.name,w[3]=k.path,w[4]=C,w[5]=t,w[6]=r,w[7]=n,w[8]=o,w[9]=i,w[10]=l,w[11]=s,w[12]=a,w[13]=c,w[14]=u,w[15]=d}else t=w[5],r=w[6],n=w[7],o=w[8],i=w[9],l=w[10],s=w[11],a=w[12],c=w[13],u=w[14],d=w[15];return w[24]!==t||w[25]!==n||w[26]!==o?(f=(0,m.jsx)(t,{render:n,children:o}),w[24]=t,w[25]=n,w[26]=o,w[27]=f):f=w[27],w[28]!==k.name||w[29]!==d?(p=k.name!==d&&(0,m.jsx)(l_,{side:"right",children:k.name}),w[28]=k.name,w[29]=d,w[30]=p):p=w[30],w[31]!==r||w[32]!==p||w[33]!==f?(g=(0,m.jsxs)(r,{children:[f,p]}),w[31]=r,w[32]=p,w[33]=f,w[34]=g):g=w[34],w[35]!==g||w[36]!==i||w[37]!==l||w[38]!==s||w[39]!==a||w[40]!==c||w[41]!==u?(v=(0,m.jsxs)("button",{type:i,"aria-expanded":l,className:s,style:a,onClick:c,children:[u,g]}),w[35]=g,w[36]=i,w[37]=l,w[38]=s,w[39]=a,w[40]=c,w[41]=u,w[42]=v):v=w[42],w[43]!==j||w[44]!==R||w[45]!==E?(x=!E&&(0,m.jsxs)("div",{className:"relative",children:[(0,m.jsx)("div",{className:"pointer-events-none absolute inset-y-0 border-l border-sidebar-border/60",style:{left:R+8}}),j]}),w[43]=j,w[44]=R,w[45]=E,w[46]=x):x=w[46],w[47]!==v||w[48]!==x?(y=(0,m.jsxs)(m.Fragment,{children:[v,x]}),w[47]=v,w[48]=x,w[49]=y):y=w[49],y}),sa=(0,b.memo)(function e({nodes:t,depth:r,selectedFile:n,commentsByFile:o,collapsedFolders:i,onToggleFolder:l,onNavigate:s}){return t.map(t=>"folder"===t.type?(0,m.jsx)(ss,{node:t,depth:r,isCollapsed:i.has(t.path),onToggle:l,children:(0,m.jsx)(e,{nodes:t.children,depth:r+1,selectedFile:n,commentsByFile:o,collapsedFolders:i,onToggleFolder:l,onNavigate:s})},t.path):(0,m.jsx)(sl,{node:t,depth:r,isSelected:n===t.path,commentCount:o.get(t.path)??0,onNavigate:s},t.path))}),sc=e=>{let t,r,n,o,i,l,s,a,c,u,d,f,p,g,v,x,y,w,k,S,E,C,j,R,T,N=(0,h.c)(65),{files:O,selectedFile:P,onSelectFile:M,comments:L,filterQuery:A,onFilterChange:z,isLoading:I,insertions:D,deletions:_,sidebarWidth:$,onSidebarWidthChange:B}=e;N[0]===Symbol.for("react.memo_cache_sentinel")?(t=new Set,N[0]=t):t=N[0];let[F,H]=(0,b.useState)(t),W=(0,b.useRef)(null);N[1]!==B?(r=()=>{let e=()=>{W.current=null,document.body.style.cursor="",document.body.style.userSelect=""},t=e=>{W.current&&B(Math.max(8,W.current.startWidth+e.clientX-W.current.startX))},r=()=>{W.current&&e()};return document.addEventListener("mousemove",t),document.addEventListener("mouseup",r),window.addEventListener("blur",r),()=>{e(),document.removeEventListener("mousemove",t),document.removeEventListener("mouseup",r),window.removeEventListener("blur",r)}},n=[B],N[1]=B,N[2]=r,N[3]=n):(r=N[2],n=N[3]),(0,b.useEffect)(r,n),N[4]!==$?(o=e=>{e.preventDefault(),W.current={startWidth:$,startX:e.clientX},document.body.style.cursor="col-resize",document.body.style.userSelect="none"},N[4]=$,N[5]=o):o=N[5];let V=o;N[6]!==O||N[7]!==A?(i=A?O.filter(e=>e.file.toLowerCase().includes(A.toLowerCase())):O,N[6]=O,N[7]=A,N[8]=i):i=N[8];let U=i;N[9]!==U?(l=so((e=>{let t={files:[],folders:{}};for(let r of e){let e=r.file.split("/"),n=t;for(let t=0;t<e.length-1;t+=1){let r=e[t];n.folders[r]||(n.folders[r]={files:[],folders:{}}),n=n.folders[r]}n.files.push(r)}let r=(e,t,n)=>{let o=n?`${n}/${e}`:e,i=[];for(let[e,n]of Object.entries(t.folders).toSorted())i.push(r(e,n,o));for(let e of t.files){let t=e.file.split("/");i.push({fileStat:e,name:t.at(-1)??e.file,path:e.file,type:"file"})}return{children:i,name:e,path:o,type:"folder"}},n=[];for(let[e,o]of Object.entries(t.folders).toSorted())n.push(r(e,o,""));for(let e of t.files)n.push({fileStat:e,name:e.file,path:e.file,type:"file"});return n})(U)),N[9]=U,N[10]=l):l=N[10];let q=l;N[11]!==q?(s=si(q),N[11]=q,N[12]=s):s=N[12];let K=s;if(N[13]!==K?(c=()=>{let e=()=>{H(new Set)},t=()=>{H(new Set(K))};return window.addEventListener(sr,e),window.addEventListener(sn,t),()=>{window.removeEventListener(sr,e),window.removeEventListener(sn,t)}},a=[K],N[13]=K,N[14]=a,N[15]=c):(a=N[14],c=N[15]),(0,b.useEffect)(c,a),N[16]!==L){for(let e of(u=new Map,L))u.set(e.file,(u.get(e.file)??0)+1);N[16]=L,N[17]=u}else u=N[17];let X=u;N[18]===Symbol.for("react.memo_cache_sentinel")?(d=e=>{H(t=>{let r=new Set(t);return r.has(e)?r.delete(e):r.add(e),r})},N[18]=d):d=N[18];let Y=d;N[19]!==M?(f=e=>{let t=new CustomEvent("diffhub:file:navigate",{cancelable:!0,detail:{file:e,source:"sidebar"}});window.dispatchEvent(t)&&M(e,"auto")},N[19]=M,N[20]=f):f=N[20];let G=f;if(void 0!==I&&I){let e;N[21]===Symbol.for("react.memo_cache_sentinel")?(e=(0,m.jsx)("div",{className:"flex flex-col items-center gap-2 px-4 py-8 text-center",children:(0,m.jsx)("p",{className:"animate-pulse text-xs text-sidebar-foreground/50",children:"Loading…"})}),N[21]=e):e=N[21],p=e}else if(0===U.length){let e,t,r;N[22]===Symbol.for("react.memo_cache_sentinel")?(e=(0,m.jsx)("p",{className:"text-xs text-sidebar-foreground/50",children:"No changes"}),N[22]=e):e=N[22],N[23]!==A?(t=A&&(0,m.jsxs)("p",{className:"text-[10px] text-sidebar-foreground/30",children:["No files match “",A,"”"]}),N[23]=A,N[24]=t):t=N[24],N[25]!==t?(r=(0,m.jsxs)("div",{className:"flex flex-col items-center gap-2 px-4 py-8 text-center",children:[e,t]}),N[25]=t,N[26]=r):r=N[26],p=r}else{let e;N[27]!==F||N[28]!==X||N[29]!==G||N[30]!==P||N[31]!==q?(e=(0,m.jsx)(sa,{nodes:q,depth:0,selectedFile:P,commentsByFile:X,collapsedFolders:F,onToggleFolder:Y,onNavigate:G}),N[27]=F,N[28]=X,N[29]=G,N[30]=P,N[31]=q,N[32]=e):e=N[32],p=e}N[33]===Symbol.for("react.memo_cache_sentinel")?(g=(0,m.jsx)(l8,{size:12,className:"pointer-events-none absolute left-2.5 text-sidebar-foreground/40"}),N[33]=g):g=N[33],N[34]!==z?(v=e=>z(e.target.value),N[34]=z,N[35]=v):v=N[35],N[36]!==A||N[37]!==v?(x=(0,m.jsx)("input",{type:"text",value:A,onChange:v,placeholder:"Filter files…","aria-label":"Filter files",className:"w-full rounded-md border border-sidebar-border bg-sidebar-accent py-1.5 pl-7 pr-7 text-xs text-sidebar-foreground placeholder:text-sidebar-foreground/40 transition-colors focus:border-sidebar-ring/50 focus:outline-none"}),N[36]=A,N[37]=v,N[38]=x):x=N[38],N[39]!==A||N[40]!==z?(y=A&&(0,m.jsx)("button",{type:"button",onClick:()=>z(""),"aria-label":"Clear filter",className:"absolute right-2 text-sm leading-none text-sidebar-foreground/40 transition-colors hover:text-sidebar-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-sidebar-ring",children:"×"}),N[39]=A,N[40]=z,N[41]=y):y=N[41],N[42]!==x||N[43]!==y?(w=(0,m.jsx)(lU,{className:"border-b border-sidebar-border h-[52px] flex-row items-center py-0 px-2",children:(0,m.jsxs)("div",{className:"relative flex w-full items-center",children:[g,x,y]})}),N[42]=x,N[43]=y,N[44]=w):w=N[44],N[45]!==p?(k=(0,m.jsx)(lK,{className:"gap-0 py-1",children:p}),N[45]=p,N[46]=k):k=N[46];let Z=1===O.length?"file":"files";return N[47]!==O.length||N[48]!==Z?(S=(0,m.jsxs)("span",{children:[O.length," ",Z]}),N[47]=O.length,N[48]=Z,N[49]=S):S=N[49],N[50]!==D?(E=D>0&&(0,m.jsxs)("span",{className:"text-diff-green",children:["+",D]}),N[50]=D,N[51]=E):E=N[51],N[52]!==_?(C=_>0&&(0,m.jsxs)("span",{className:"text-destructive",children:["−",_]}),N[52]=_,N[53]=C):C=N[53],N[54]!==S||N[55]!==E||N[56]!==C?(j=(0,m.jsx)(lq,{className:"border-t border-sidebar-border px-3 py-2",children:(0,m.jsxs)("div",{className:"flex items-center gap-2 text-[12px] font-mono text-sidebar-foreground/60",children:[S,E,C]})}),N[54]=S,N[55]=E,N[56]=C,N[57]=j):j=N[57],N[58]!==V?(R=(0,m.jsx)("div",{"aria-hidden":!0,className:"absolute inset-y-0 right-0 z-20 w-[5px] cursor-col-resize after:absolute after:inset-y-0 after:left-1/2 after:-translate-x-1/2 after:w-px after:transition-colors hover:after:bg-sidebar-border",onMouseDown:V}),N[58]=V,N[59]=R):R=N[59],N[60]!==w||N[61]!==k||N[62]!==j||N[63]!==R?(T=(0,m.jsx)(lz,{delay:400,children:(0,m.jsxs)(lH,{collapsible:"offcanvas",className:"overflow-hidden border-r border-sidebar-border",children:[w,k,j,R]})}),N[60]=w,N[61]=k,N[62]=j,N[63]=R,N[64]=T):T=N[64],T};var su=e.i(70703),sd=b;let sf={dark:{addition:"#3fb950",deletion:"#f85149"},light:{addition:"#1a7f37",deletion:"#d1242f"}},sp={dark:{additionBg:"#2ea04326",additionBgNumber:"#3fb9504d",additionEmphasis:"#2ea04366",deletionBg:"#f851491a",deletionBgNumber:"#f851494d",deletionEmphasis:"#f8514966"},light:{additionBg:"#dafbe1",additionBgNumber:"#aceebb",additionEmphasis:"#aceebb",deletionBg:"#ffebe9",deletionBgNumber:"#ffcecb",deletionEmphasis:"#ffcecb"}},sm=e=>{let t,r,n,o,i,l,s,a,c=(0,h.c)(22),{value:u,label:d,copiedLabel:f,delay:p,className:g}=e,v=void 0===d?"Copy file path":d,y=void 0===f?"Copied!":f,k=void 0===p?400:p,[S,E]=(0,b.useState)(!1);c[0]!==u?(t=async()=>{try{await navigator.clipboard.writeText(u),E(!0),setTimeout(()=>E(!1),1500)}catch{}},c[0]=u,c[1]=t):t=c[1];let C=t,j=S?y:v,R=S?"text-diff-green":"text-muted-foreground hover:text-foreground hover:bg-secondary";c[2]!==g||c[3]!==R?(r=((...e)=>e4(K(e)))("size-6",R,g),c[2]=g,c[3]=R,c[4]=r):r=c[4],c[5]!==C||c[6]!==j||c[7]!==r?(n=(0,m.jsx)(e8,{variant:"ghost",size:"icon-xs",onClick:C,"aria-label":j,className:r}),c[5]=C,c[6]=j,c[7]=r,c[8]=n):n=c[8],c[9]!==S?(o=S?(0,m.jsx)(x,{size:12}):(0,m.jsx)(w,{size:12}),c[9]=S,c[10]=o):o=c[10],c[11]!==n||c[12]!==o?(i=(0,m.jsx)(lD,{render:n,children:o}),c[11]=n,c[12]=o,c[13]=i):i=c[13];let T=S?y:v;return c[14]!==T?(l=(0,m.jsx)(l_,{side:"bottom",children:T}),c[14]=T,c[15]=l):l=c[15],c[16]!==i||c[17]!==l?(s=(0,m.jsxs)(lI,{children:[i,l]}),c[16]=i,c[17]=l,c[18]=s):s=c[18],c[19]!==k||c[20]!==s?(a=(0,m.jsx)(lz,{delay:k,children:s}),c[19]=k,c[20]=s,c[21]=a):a=c[21],a},sh=e=>{let t,r,n,o,i,l,s,a,c,u,d,f,p,g,b,v,x,w,k,S,E,C,j,R,T,N=(0,h.c)(64),{file:O,insertions:P,deletions:M,commentCount:L,repoPath:A,collapsed:z,active:I,onToggleCollapse:D,headingId:_,panelId:$}=e,B=void 0!==z&&z;if(N[0]!==O){let e=(n=e6(O)).lastIndexOf("/");t=-1===e?"":n.slice(0,e),r=-1===e?n:n.slice(e+1),N[0]=O,N[1]=t,N[2]=r,N[3]=n}else t=N[1],r=N[2],n=N[3];let F=r;N[4]!==O||N[5]!==D?(o=()=>{D?D():window.dispatchEvent(new CustomEvent("diffhub:file:toggle-collapse",{detail:{file:O}}))},N[4]=O,N[5]=D,N[6]=o):o=N[6];let H=o,W=void 0!==I&&I?"true":void 0,V=B?"collapsed":"expanded",U=!B,q=B?"Expand file section":"Collapse file section";N[7]!==H||N[8]!==$||N[9]!==U||N[10]!==q?(i=(0,m.jsx)(e8,{variant:"ghost",size:"icon-xs",onClick:H,"aria-expanded":U,"aria-controls":$,"aria-label":q,className:"text-muted-foreground hover:bg-transparent active:bg-transparent aria-expanded:bg-transparent"}),N[7]=H,N[8]=$,N[9]=U,N[10]=q,N[11]=i):i=N[11];let X=B&&"-rotate-90";N[12]!==X?(l=((...e)=>e4(K(e)))("transition-transform duration-150",X),N[12]=X,N[13]=l):l=N[13],N[14]!==l?(s=(0,m.jsx)(y,{size:14,className:l}),N[14]=l,N[15]=s):s=N[15],N[16]!==s||N[17]!==i?(a=(0,m.jsx)(lD,{render:i,children:s}),N[16]=s,N[17]=i,N[18]=a):a=N[18];let Y=B?"Expand file section":"Collapse file section";N[19]!==Y?(c=(0,m.jsx)(l_,{side:"bottom",children:Y}),N[19]=Y,N[20]=c):c=N[20],N[21]!==a||N[22]!==c?(u=(0,m.jsxs)(lI,{children:[a,c]}),N[21]=a,N[22]=c,N[23]=u):u=N[23],N[24]===Symbol.for("react.memo_cache_sentinel")?(d=(0,m.jsx)("span",{className:"flex min-w-0 items-center gap-1"}),N[24]=d):d=N[24],N[25]!==t?(f=t&&(0,m.jsxs)("span",{className:"text-muted-foreground truncate shrink",children:[t,"/"]}),N[25]=t,N[26]=f):f=N[26],N[27]!==F?(p=(0,m.jsx)("span",{className:"text-muted-foreground font-normal shrink-0",children:F}),N[27]=F,N[28]=p):p=N[28],N[29]!==f||N[30]!==p?(g=(0,m.jsxs)("span",{className:"flex min-w-0 items-baseline gap-0 font-mono",children:[f,p]}),N[29]=f,N[30]=p,N[31]=g):g=N[31];let G=`${A}/${O}`;return N[32]!==G?(b=(0,m.jsx)(sm,{value:G}),N[32]=G,N[33]=b):b=N[33],N[34]!==g||N[35]!==b?(v=(0,m.jsxs)(lD,{render:d,children:[g,b]}),N[34]=g,N[35]=b,N[36]=v):v=N[36],N[37]!==O||N[38]!==n?(x=O!==n&&(0,m.jsx)(l_,{side:"bottom",children:O}),N[37]=O,N[38]=n,N[39]=x):x=N[39],N[40]!==v||N[41]!==x?(w=(0,m.jsxs)(lI,{children:[v,x]}),N[40]=v,N[41]=x,N[42]=w):w=N[42],N[43]!==P?(k=P>0&&(0,m.jsxs)("span",{className:"font-mono text-[12px] text-diff-green",children:["+",P]}),N[43]=P,N[44]=k):k=N[44],N[45]!==M?(S=M>0&&(0,m.jsxs)("span",{className:"font-mono text-[12px] text-destructive",children:["−",M]}),N[45]=M,N[46]=S):S=N[46],N[47]!==k||N[48]!==S?(E=(0,m.jsxs)("span",{className:"flex items-center gap-1 shrink-0",children:[k,S]}),N[47]=k,N[48]=S,N[49]=E):E=N[49],N[50]!==w||N[51]!==E?(C=(0,m.jsxs)("span",{className:"flex min-w-0 items-center gap-2",children:[w,E]}),N[50]=w,N[51]=E,N[52]=C):C=N[52],N[53]!==_||N[54]!==u||N[55]!==C?(j=(0,m.jsxs)("h3",{id:_,className:"flex min-w-0 flex-1 items-center gap-2 text-[12px] font-normal",children:[u,C]}),N[53]=_,N[54]=u,N[55]=C,N[56]=j):j=N[56],N[57]!==L?(R=L>0&&(0,m.jsxs)("div",{className:"flex items-center gap-1 px-1.5 py-0.5 rounded-full bg-diff-purple/10 text-diff-purple text-[10px] shrink-0",children:[(0,m.jsx)(l4,{size:10}),L]}),N[57]=L,N[58]=R):R=N[58],N[59]!==j||N[60]!==R||N[61]!==W||N[62]!==V?(T=(0,m.jsx)(lz,{delay:400,children:(0,m.jsxs)("div",{"data-active":W,"data-state":V,className:"flex items-center gap-2 px-3 h-9 border-b border-border bg-card sticky top-[52px] z-10",children:[j,R]})}),N[59]=j,N[60]=R,N[61]=W,N[62]=V,N[63]=T):T=N[63],T},sg=v("BranchIcon",(0,b.forwardRef)((e,t)=>b.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",viewBox:"0 0 24 24",ref:t,...e},b.createElement("circle",{cx:6.5,cy:6,r:2,stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2}),b.createElement("circle",{cx:6.5,cy:18,r:2,stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2}),b.createElement("circle",{cx:17.5,cy:6,r:2,stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2}),b.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6.5 8v8M17.5 8v1c0 1.6569-1.3431 3-3 3h-5c-1.6569 0-3 1.3431-3 3v1"})))),sb=v("TrashCan2Icon",(0,b.forwardRef)((e,t)=>b.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",viewBox:"0 0 24 24",ref:t,...e},b.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 6v12c0 1.6569 1.3431 3 3 3h6c1.6569 0 3-1.3431 3-3V6M6 6h12M6 6H4m14 0h2M9 6c0-1.6569 1.3431-3 3-3s3 1.3431 3 3m-1 5v5m-4-5v5"})))),sv=e=>{let t,r,n,o,i=(0,h.c)(8);return i[0]!==e?({className:t,...r}=e,i[0]=e,i[1]=t,i[2]=r):(t=i[1],r=i[2]),i[3]!==t?(n=((...e)=>e4(K(e)))("flex min-w-0 flex-1 flex-col items-center justify-center gap-6 text-balance rounded-lg border-dashed p-6 text-center md:p-12",t),i[3]=t,i[4]=n):n=i[4],i[5]!==r||i[6]!==n?(o=(0,m.jsx)("div",{className:n,"data-slot":"empty",...r}),i[5]=r,i[6]=n,i[7]=o):o=i[7],o},sx=e=>{let t,r,n,o,i=(0,h.c)(8);return i[0]!==e?({className:t,...r}=e,i[0]=e,i[1]=t,i[2]=r):(t=i[1],r=i[2]),i[3]!==t?(n=((...e)=>e4(K(e)))("flex max-w-sm flex-col items-center gap-2 text-center",t),i[3]=t,i[4]=n):n=i[4],i[5]!==r||i[6]!==n?(o=(0,m.jsx)("div",{className:n,"data-slot":"empty-header",...r}),i[5]=r,i[6]=n,i[7]=o):o=i[7],o},sy=Y("mb-2 flex shrink-0 items-center justify-center [&_svg]:pointer-events-none [&_svg]:shrink-0",{defaultVariants:{variant:"default"},variants:{variant:{default:"bg-transparent",icon:"flex size-10 shrink-0 items-center justify-center rounded-lg bg-muted text-foreground [&_svg:not([class*='size-'])]:size-6"}}}),sw=e=>{let t,r,n,o,i,l=(0,h.c)(11);l[0]!==e?({className:t,variant:n,...r}=e,l[0]=e,l[1]=t,l[2]=r,l[3]=n):(t=l[1],r=l[2],n=l[3]);let s=void 0===n?"default":n;return l[4]!==t||l[5]!==s?(o=((...e)=>e4(K(e)))(sy({className:t,variant:s})),l[4]=t,l[5]=s,l[6]=o):o=l[6],l[7]!==r||l[8]!==o||l[9]!==s?(i=(0,m.jsx)("div",{className:o,"data-slot":"empty-icon","data-variant":s,...r}),l[7]=r,l[8]=o,l[9]=s,l[10]=i):i=l[10],i},sk=e=>{let t,r,n,o,i=(0,h.c)(8);return i[0]!==e?({className:t,...r}=e,i[0]=e,i[1]=t,i[2]=r):(t=i[1],r=i[2]),i[3]!==t?(n=((...e)=>e4(K(e)))("font-medium text-lg tracking-tight",t),i[3]=t,i[4]=n):n=i[4],i[5]!==r||i[6]!==n?(o=(0,m.jsx)("div",{className:n,"data-slot":"empty-title",...r}),i[5]=r,i[6]=n,i[7]=o):o=i[7],o},sS=e=>{let t,r,n,o,i=(0,h.c)(8);return i[0]!==e?({className:t,...r}=e,i[0]=e,i[1]=t,i[2]=r):(t=i[1],r=i[2]),i[3]!==t?(n=((...e)=>e4(K(e)))("text-muted-foreground text-sm/relaxed [&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4",t),i[3]=t,i[4]=n):n=i[4],i[5]!==r||i[6]!==n?(o=(0,m.jsx)("div",{className:n,"data-slot":"empty-description",...r}),i[5]=r,i[6]=n,i[7]=o):o=i[7],o},sE=e=>{let t,r,n,o,i=(0,h.c)(8);return i[0]!==e?({className:t,...r}=e,i[0]=e,i[1]=t,i[2]=r):(t=i[1],r=i[2]),i[3]!==t?(n=((...e)=>e4(K(e)))("flex w-full min-w-0 max-w-sm flex-col items-center gap-4 text-balance text-sm",t),i[3]=t,i[4]=n):n=i[4],i[5]!==r||i[6]!==n?(o=(0,m.jsx)("div",{className:n,"data-slot":"empty-content",...r}),i[5]=r,i[6]=n,i[7]=o):o=i[7],o},sC={"[must-fix]":{border:"border-l-destructive",text:"text-destructive"},"[nit]":{border:"border-l-muted-foreground/40",text:"text-muted-foreground"},"[question]":{border:"border-l-diff-purple",text:"text-diff-purple"},"[suggestion]":{border:"border-l-diff-green",text:"text-diff-green"}},sj=[],sR=null,sT=null,sN=0,sO=()=>{let e,t,r,n,o,i,l,s,a,c,u,d=(0,h.c)(11);return d[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,m.jsx)("div",{className:"h-9 border-b border-border bg-card"}),d[0]=e):e=d[0],d[1]===Symbol.for("react.memo_cache_sentinel")?(t=(0,m.jsx)("div",{className:"h-2 w-6 shrink-0 rounded bg-diff-green/20"}),d[1]=t):t=d[1],d[2]===Symbol.for("react.memo_cache_sentinel")?(r=(0,m.jsxs)("div",{className:"flex h-[22px] items-center gap-3 px-3 bg-diff-green/5",children:[t,(0,m.jsx)("div",{className:"h-2 rounded bg-diff-green/15",style:{width:"67%"}})]}),d[2]=r):r=d[2],d[3]===Symbol.for("react.memo_cache_sentinel")?(n=(0,m.jsx)("div",{className:"h-2 w-6 shrink-0 rounded bg-muted"}),d[3]=n):n=d[3],d[4]===Symbol.for("react.memo_cache_sentinel")?(o=(0,m.jsxs)("div",{className:"flex h-[22px] items-center gap-3 px-3",children:[n,(0,m.jsx)("div",{className:"h-2 rounded bg-muted",style:{width:"82%"}})]}),d[4]=o):o=d[4],d[5]===Symbol.for("react.memo_cache_sentinel")?(i=(0,m.jsx)("div",{className:"h-2 w-6 shrink-0 rounded bg-destructive/20"}),d[5]=i):i=d[5],d[6]===Symbol.for("react.memo_cache_sentinel")?(l=(0,m.jsxs)("div",{className:"flex h-[22px] items-center gap-3 px-3 bg-destructive/5",children:[i,(0,m.jsx)("div",{className:"h-2 rounded bg-destructive/15",style:{width:"54%"}})]}),d[6]=l):l=d[6],d[7]===Symbol.for("react.memo_cache_sentinel")?(s=(0,m.jsx)("div",{className:"h-2 w-6 shrink-0 rounded bg-muted"}),d[7]=s):s=d[7],d[8]===Symbol.for("react.memo_cache_sentinel")?(a=(0,m.jsxs)("div",{className:"flex h-[22px] items-center gap-3 px-3",children:[s,(0,m.jsx)("div",{className:"h-2 rounded bg-muted",style:{width:"78%"}})]}),d[8]=a):a=d[8],d[9]===Symbol.for("react.memo_cache_sentinel")?(c=(0,m.jsx)("div",{className:"h-2 w-6 shrink-0 rounded bg-diff-green/20"}),d[9]=c):c=d[9],d[10]===Symbol.for("react.memo_cache_sentinel")?(u=(0,m.jsxs)("div",{className:"animate-pulse",children:[e,(0,m.jsxs)("div",{children:[r,o,l,a,(0,m.jsxs)("div",{className:"flex h-[22px] items-center gap-3 px-3 bg-diff-green/5",children:[c,(0,m.jsx)("div",{className:"h-2 rounded bg-diff-green/15",style:{width:"91%"}})]})]})]}),d[10]=u):u=d[10],u},sP=e=>{let t,r,n,o,i=(0,h.c)(12),{onRender:l,variant:s,changes:a}=e,c="large"===s;i[0]!==l?(t=(0,m.jsx)(e8,{size:"sm",variant:"default",onClick:l,children:"Load diff"}),i[0]=l,i[1]=t):t=i[1];let u=c?"Large diffs are not rendered by default.":"Diff rendering is deferred until this file becomes active or visible.";return i[2]!==u?(r=(0,m.jsx)("p",{className:"text-sm text-muted-foreground",children:u}),i[2]=u,i[3]=r):r=i[3],i[4]!==a||i[5]!==c?(n=c&&void 0!==a?(0,m.jsxs)("p",{className:"text-xs text-muted-foreground/70",children:[a.toLocaleString()," changed lines"]}):null,i[4]=a,i[5]=c,i[6]=n):n=i[6],i[7]!==t||i[8]!==r||i[9]!==n||i[10]!==s?(o=(0,m.jsxs)("div",{className:"mx-4 my-4 flex flex-col items-center justify-center gap-2 rounded-md border border-dashed border-border bg-muted/20 p-6","data-testid":"deferred-diff-placeholder","data-variant":s,children:[t,r,n]}),i[7]=t,i[8]=r,i[9]=n,i[10]=s,i[11]=o):o=i[11],o};class sM extends sd.Component{constructor(e){super(e),this.state={error:null}}static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){console.error("[diffhub] PatchDiff threw",{componentStack:t.componentStack,error:e.message,file:this.props.file})}render(){return this.state.error?(0,m.jsxs)("div",{className:"px-4 py-6 text-sm text-destructive",children:["Failed to render diff for this file: ",this.state.error.message]}):this.props.children}}let sL=(0,su.default)(()=>e.A(15910).then(e=>({default:e.PatchDiff})).catch(e=>(console.error("[diffhub] Failed to load PatchDiff",e),{default:()=>(0,m.jsxs)("div",{className:"p-4 text-destructive text-sm",children:["Failed to load diff viewer: ",String(e)]})})),{loadableGenerated:{modules:[11251]},loading:()=>(0,m.jsx)(sO,{}),ssr:!1}),sA=e=>{let t,r,n,o,i,l,s,a,c,u,d,f=(0,h.c)(32),{onSubmit:p,onCancel:g}=e,[b,v]=(0,sd.useState)(""),[x,y]=(0,sd.useState)(null),[w,k]=(0,sd.useState)(!1);f[0]!==b||f[1]!==w||f[2]!==p?(t=async()=>{let e=b.trim();!e||w||(y(null),k(!0),await p(e,"").catch(sH)||y("Failed to save comment."),k(!1))},f[0]=b,f[1]=w,f[2]=p,f[3]=t):t=f[3];let S=t;f[4]===Symbol.for("react.memo_cache_sentinel")?(r=e=>v(e.target.value),f[4]=r):r=f[4],f[5]!==b||f[6]!==S||f[7]!==g?(n=e=>{("Enter"===e.key&&e.metaKey||"Return"===e.key)&&b.trim()&&S(),"Escape"===e.key&&g()},f[5]=b,f[6]=S,f[7]=g,f[8]=n):n=f[8],f[9]!==b||f[10]!==n?(o=(0,m.jsx)("textarea",{ref:sF,value:b,onChange:r,placeholder:"Add a comment for the AI",rows:3,onKeyDown:n,className:"w-full resize-none rounded border-0 bg-transparent px-0 py-0 font-sans text-sm text-foreground placeholder:text-muted-foreground focus:outline-none"}),f[9]=b,f[10]=n,f[11]=o):o=f[11],f[12]!==g?(i=(0,m.jsx)(e8,{variant:"ghost",size:"sm",onClick:g,children:"Cancel"}),f[12]=g,f[13]=i):i=f[13],f[14]!==b||f[15]!==w?(l=!b.trim()||w,f[14]=b,f[15]=w,f[16]=l):l=f[16],f[17]!==S?(s=()=>void S(),f[17]=S,f[18]=s):s=f[18];let E=w?"Saving…":"Comment";return f[19]!==l||f[20]!==s||f[21]!==E?(a=(0,m.jsx)(e8,{size:"sm",disabled:l,onClick:s,children:E}),f[19]=l,f[20]=s,f[21]=E,f[22]=a):a=f[22],f[23]!==i||f[24]!==a?(c=(0,m.jsxs)("div",{className:"mt-2 flex justify-end gap-2",children:[i,a]}),f[23]=i,f[24]=a,f[25]=c):c=f[25],f[26]!==x?(u=x&&(0,m.jsx)("p",{className:"mt-2 text-xs text-destructive",children:x}),f[26]=x,f[27]=u):u=f[27],f[28]!==c||f[29]!==u||f[30]!==o?(d=(0,m.jsxs)("div",{className:"my-1 mx-4 rounded-md border border-border bg-background p-3 shadow-lg dark:shadow-none",children:[o,c,u]}),f[28]=c,f[29]=u,f[30]=o,f[31]=d):d=f[31],d},sz=e=>{let t,r,n,o,i,l,s,a,c,u,d,f,p,g,b,v,y,k,S,E,C,j,R,T,N,O=(0,h.c)(60),{comment:P,onDelete:M}=e,[L,A]=(0,sd.useState)(!1),[z,I]=(0,sd.useState)(null),[D,_]=(0,sd.useState)(!1),$=(0,sd.useRef)(null);O[0]===Symbol.for("react.memo_cache_sentinel")?(t=()=>()=>{$.current&&(clearTimeout($.current),$.current=null)},r=[],O[0]=t,O[1]=r):(t=O[0],r=O[1]),(0,sd.useEffect)(t,r),O[2]!==P.body||O[3]!==P.tag?(n=async()=>{let e=P.tag?`${P.tag} ${P.body}`:P.body;try{await navigator.clipboard.writeText(e),$.current&&clearTimeout($.current),A(!0),$.current=setTimeout(()=>{A(!1),$.current=null},1500)}catch{}},O[2]=P.body,O[3]=P.tag,O[4]=n):n=O[4];let B=n;O[5]!==D||O[6]!==M?(o=async()=>{D||(I(null),_(!0),await M().catch(sW)||I("Failed to delete comment."),_(!1))},O[5]=D,O[6]=M,O[7]=o):o=O[7];let F=o,H=P.tag?sC[P.tag]?.border??"border-l-ring/40":"border-l-ring/40";O[8]!==H?(i=((...e)=>e4(K(e)))("group my-1 mx-4 rounded-md border border-border bg-card shadow-sm dark:shadow-none overflow-hidden border-l-2",H),O[8]=H,O[9]=i):i=O[9],O[10]!==P.tag?(l=P.tag&&(0,m.jsx)("span",{className:((...e)=>e4(K(e)))("shrink-0 mt-0.5 text-[11px]",sC[P.tag]?.text??"text-muted-foreground"),children:P.tag}),O[10]=P.tag,O[11]=l):l=O[11],O[12]!==P.body?(s=(0,m.jsx)("p",{className:"flex-1 text-sm text-foreground leading-relaxed",children:P.body}),O[12]=P.body,O[13]=s):s=O[13];let W=L?"Comment copied":"Copy comment",V=L?"text-diff-green":"text-muted-foreground hover:text-foreground hover:bg-secondary";O[14]!==V?(a=((...e)=>e4(K(e)))("rounded p-1 transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring/50",V),O[14]=V,O[15]=a):a=O[15],O[16]!==B||O[17]!==a||O[18]!==W?(c=(0,m.jsx)("button",{type:"button",onClick:B,"aria-label":W,className:a}),O[16]=B,O[17]=a,O[18]=W,O[19]=c):c=O[19],O[20]!==L?(u=L?(0,m.jsx)(x,{size:12}):(0,m.jsx)(w,{size:12}),O[20]=L,O[21]=u):u=O[21],O[22]!==c||O[23]!==u?(d=(0,m.jsx)(lD,{render:c,children:u}),O[22]=c,O[23]=u,O[24]=d):d=O[24];let U=L?"Copied!":"Copy comment";return O[25]!==U?(f=(0,m.jsx)(l_,{side:"top",children:U}),O[25]=U,O[26]=f):f=O[26],O[27]!==d||O[28]!==f?(p=(0,m.jsxs)(lI,{children:[d,f]}),O[27]=d,O[28]=f,O[29]=p):p=O[29],O[30]!==F||O[31]!==D?(g=(0,m.jsx)("button",{type:"button",onClick:F,"aria-label":"Delete comment",disabled:D,className:"rounded p-1 text-muted-foreground transition-colors hover:text-destructive hover:bg-destructive/10 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring/50"}),O[30]=F,O[31]=D,O[32]=g):g=O[32],O[33]===Symbol.for("react.memo_cache_sentinel")?(b=(0,m.jsx)(sb,{size:12}),O[33]=b):b=O[33],O[34]!==g?(v=(0,m.jsx)(lD,{render:g,children:b}),O[34]=g,O[35]=v):v=O[35],O[36]===Symbol.for("react.memo_cache_sentinel")?(y=(0,m.jsx)(l_,{side:"top",children:"Delete comment"}),O[36]=y):y=O[36],O[37]!==v?(k=(0,m.jsxs)(lI,{children:[v,y]}),O[37]=v,O[38]=k):k=O[38],O[39]!==p||O[40]!==k?(S=(0,m.jsx)(lz,{delay:400,children:(0,m.jsxs)("div",{className:"flex shrink-0 items-center gap-0.5 opacity-0 group-hover:opacity-100 transition-opacity duration-150",children:[p,k]})}),O[39]=p,O[40]=k,O[41]=S):S=O[41],O[42]!==S||O[43]!==l||O[44]!==s?(E=(0,m.jsxs)("div",{className:"flex items-start gap-2 px-3 py-2.5",children:[l,s,S]}),O[42]=S,O[43]=l,O[44]=s,O[45]=E):E=O[45],O[46]!==P.lineNumber?(C=(0,m.jsxs)("span",{children:["L",P.lineNumber]}),O[46]=P.lineNumber,O[47]=C):C=O[47],O[48]!==P.createdAt?(j=P.createdAt&&(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)("span",{children:"·"}),(0,m.jsx)("span",{children:(e=>{let t=Math.floor((Date.now()-new Date(e).getTime())/1e3);if(t<60)return"just now";let r=Math.floor(t/60);if(r<60)return`${r}m ago`;let n=Math.floor(r/60);if(n<24)return`${n}h ago`;let o=Math.floor(n/24);return`${o}d ago`})(P.createdAt)})]}),O[48]=P.createdAt,O[49]=j):j=O[49],O[50]!==C||O[51]!==j?(R=(0,m.jsxs)("div",{className:"border-t border-border/40 px-3 py-1 flex items-center gap-2 text-[10px] text-muted-foreground/60",children:[C,j]}),O[50]=C,O[51]=j,O[52]=R):R=O[52],O[53]!==z?(T=z&&(0,m.jsx)("p",{className:"px-3 pb-2 text-xs text-destructive",children:z}),O[53]=z,O[54]=T):T=O[54],O[55]!==E||O[56]!==R||O[57]!==T||O[58]!==i?(N=(0,m.jsxs)("div",{className:i,children:[E,R,T]}),O[55]=E,O[56]=R,O[57]=T,O[58]=i,O[59]=N):N=O[59],N},sI=e=>`diff-${encodeURIComponent(e)}`,sD=(0,sd.memo)(function(e){let t,r,n=(0,h.c)(5),{getHoveredLine:o,onCommentTargetChange:i}=e;n[0]!==o||n[1]!==i?(t=()=>{let e=o();e&&i({lineNumber:e.lineNumber,side:e.side})},n[0]=o,n[1]=i,n[2]=t):t=n[2];let l=t;return n[3]!==l?(r=(0,m.jsx)("button",{type:"button",className:"diffhub-gutter-btn",title:"Add comment for AI",onClick:l,children:"+"}),n[3]=l,n[4]=r):r=n[4],r}),s_=(0,sd.memo)(function(e){let t,r,n,o,i,l,s,a=(0,h.c)(59),{file:c,filePatch:u,layout:d,prerenderedHTML:f,shouldRenderPatch:p,comments:b,fileStat:v,isLargeFile:x,collapsed:y,active:w,sectionId:k,onToggleCollapse:S,repoPath:E,commentTarget:C,onCommentTargetChange:j,onRenderPatch:R,onAddComment:T,onDeleteComment:N}=e,O=void 0!==w&&w,{resolvedTheme:P}=(0,g.useTheme)(),M=`${k}-header`,L=`${k}-panel`;a[0]!==C||a[1]!==c||a[2]!==b?(t=b.map(sV),C&&t.push({lineNumber:C.lineNumber,metadata:{file:c,type:"input"},side:C.side}),a[0]=C,a[1]=c,a[2]=b,a[3]=t):t=a[3];let A=t;a[4]!==c||a[5]!==T||a[6]!==j||a[7]!==N?(r=e=>{let t=e.metadata;return t?"input"===t.type?(0,m.jsx)(sA,{onSubmit:async(t,r)=>{let n=await T(c,e.lineNumber,e.side,t,r);return n&&j(null),n},onCancel:()=>j(null)}):"comment"===t.type?(0,m.jsx)(sz,{comment:t.comment,onDelete:()=>N(t.comment.id)}):null:null},a[4]=c,a[5]=T,a[6]=j,a[7]=N,a[8]=r):r=a[8];let z=r;a[9]!==j?(n=e=>(0,m.jsx)(sD,{getHoveredLine:e,onCommentTargetChange:j}),a[9]=j,a[10]=n):n=a[10];let I=n;a[11]!==R?(o=()=>{R()},a[11]=R,a[12]=o):o=a[12];let D=o,_=y&&null===C,$=null;if(!_)if(u)if(p){let e,t,r,n,o,i,l=f?.["light"===P?"light":"dark"],s="light"===P?"light":"dark";a[14]!==s?(e={colorScheme:s},a[14]=s,a[15]=e):e=a[15];let p="split"===d?"split":"unified";a[16]===Symbol.for("react.memo_cache_sentinel")?(t={dark:"github-dark",light:"github-light"},a[16]=t):t=a[16];let h="light"===P?"light":"dark",g=P??"dark";if(a[17]!==g){let e,t;e=sf[g],t=sp[g],r=`
17
+ [data-diff-span] { border-radius: 0; }
18
+ :host {
19
+ /* Base colors for additions/deletions */
20
+ --diffs-addition-color-override: ${e.addition};
21
+ --diffs-deletion-color-override: ${e.deletion};
22
+
23
+ /* Line background colors */
24
+ --diffs-bg-addition-override: ${t.additionBg};
25
+ --diffs-bg-deletion-override: ${t.deletionBg};
26
+
27
+ /* Line number background colors */
28
+ --diffs-bg-addition-number-override: ${t.additionBgNumber};
29
+ --diffs-bg-deletion-number-override: ${t.deletionBgNumber};
30
+
31
+ /* Character-level emphasis (inline diff highlights) */
32
+ --diffs-bg-addition-emphasis-override: ${t.additionEmphasis};
33
+ --diffs-bg-deletion-emphasis-override: ${t.deletionEmphasis};
34
+
35
+ /* Line number text colors */
36
+ --diffs-fg-number-addition-override: ${e.addition};
37
+ --diffs-fg-number-deletion-override: ${e.deletion};
38
+ }
39
+ `,a[17]=g,a[18]=r}else r=a[18];a[19]!==h||a[20]!==r||a[21]!==p?(n={diffStyle:p,disableFileHeader:!0,disableLineNumbers:!1,enableGutterUtility:!0,expansionLineCount:20,hunkSeparators:"line-info",lineDiffType:"word-alt",lineHoverHighlight:"disabled",maxLineDiffLength:500,overflow:"wrap",theme:t,themeType:h,unsafeCSS:r},a[19]=h,a[20]=r,a[21]=p,a[22]=n):n=a[22],a[23]!==c||a[24]!==u||a[25]!==A||a[26]!==z||a[27]!==I||a[28]!==n||a[29]!==l||a[30]!==e?(o=(0,m.jsx)(sL,{patch:u,prerenderedHTML:l,disableWorkerPool:!0,style:e,options:n,lineAnnotations:A,renderAnnotation:z,renderGutterUtility:I},c),a[23]=c,a[24]=u,a[25]=A,a[26]=z,a[27]=I,a[28]=n,a[29]=l,a[30]=e,a[31]=o):o=a[31],a[32]!==c||a[33]!==o?(i=(0,m.jsx)(sM,{file:c,children:o}),a[32]=c,a[33]=o,a[34]=i):i=a[34],$=i}else{let e,t=x?"large":"auto",r=v?.changes;a[35]!==D||a[36]!==t||a[37]!==r?(e=(0,m.jsx)(sP,{onRender:D,variant:t,changes:r}),a[35]=D,a[36]=t,a[37]=r,a[38]=e):e=a[38],$=e}else{let e;a[13]===Symbol.for("react.memo_cache_sentinel")?(e=(0,m.jsx)("div",{className:"px-4 py-6 text-sm text-muted-foreground",children:"No textual patch available for this file."}),a[13]=e):e=a[13],$=e}let B=v?.insertions??0,F=v?.deletions??0;return a[39]!==O||a[40]!==y||a[41]!==c||a[42]!==b.length||a[43]!==M||a[44]!==S||a[45]!==L||a[46]!==E||a[47]!==B||a[48]!==F?(i=(0,m.jsx)(sh,{file:c,insertions:B,deletions:F,commentCount:b.length,repoPath:E,collapsed:y,active:O,onToggleCollapse:S,headingId:M,panelId:L}),a[39]=O,a[40]=y,a[41]=c,a[42]=b.length,a[43]=M,a[44]=S,a[45]=L,a[46]=E,a[47]=B,a[48]=F,a[49]=i):i=a[49],a[50]!==M||a[51]!==_||a[52]!==$||a[53]!==L?(l=(0,m.jsx)("div",{id:L,role:"region","aria-labelledby":M,hidden:_,children:$}),a[50]=M,a[51]=_,a[52]=$,a[53]=L,a[54]=l):l=a[54],a[55]!==c||a[56]!==i||a[57]!==l?(s=(0,m.jsxs)("div",{"data-filename":c,className:"font-sans",children:[i,l]}),a[55]=c,a[56]=i,a[57]=l,a[58]=s):s=a[58],s}),s$=(0,sd.memo)(function(e){let t,r,n,o,i,l,s,a,c,u=(0,h.c)(33),{file:d,filePatch:f,layout:p,prerenderedHTML:g,deferPatchRendering:b,isLargeFile:v,comments:x,fileStat:y,collapsed:w,active:k,onToggleCollapse:S,onVisible:E,repoPath:C,onAddComment:j,onDeleteComment:R}=e,T=(0,sd.useRef)(null),[N,O]=(0,sd.useState)(null),P=b||v;u[0]!==k||u[1]!==P?(t=()=>!P||k,u[0]=k,u[1]=P,u[2]=t):t=u[2];let[M,L]=(0,sd.useState)(t);!M&&(k||null!==N)&&L(!0),u[3]===Symbol.for("react.memo_cache_sentinel")?(r=()=>{L(!0)},u[3]=r):r=u[3];let A=r,z=M||!P,I=(0,sd.useRef)(E);u[4]!==E?(n=()=>{I.current=E},o=[E],u[4]=E,u[5]=n,u[6]=o):(n=u[5],o=u[6]),(0,sd.useEffect)(n,o),u[7]!==d?(i=()=>{let e=T.current;if(!e||"u"<typeof IntersectionObserver)return;let t=new IntersectionObserver(e=>{let[t]=e;if(t){var r;t.isIntersecting&&t.intersectionRatio>=.35&&(r=I.current,sR=d,sT=r,0===sN&&(sN=requestAnimationFrame(()=>{sN=0;let e=sR,t=sT;sR=null,sT=null,e&&t&&t(e)})))}},{rootMargin:"-52px 0px -55% 0px",threshold:[.35,.6]});return t.observe(e),()=>t.disconnect()},l=[d],u[7]=d,u[8]=i,u[9]=l):(i=u[8],l=u[9]),(0,sd.useEffect)(i,l),u[10]!==d?(s=sI(d),u[10]=d,u[11]=s):s=u[11];let D=s,_=g?.[p];return u[12]!==k||u[13]!==w||u[14]!==N||u[15]!==x||u[16]!==d||u[17]!==f||u[18]!==y||u[19]!==v||u[20]!==p||u[21]!==j||u[22]!==R||u[23]!==S||u[24]!==C||u[25]!==D||u[26]!==z||u[27]!==_?(a=(0,m.jsx)(s_,{file:d,filePatch:f,layout:p,prerenderedHTML:_,shouldRenderPatch:z,comments:x,fileStat:y,isLargeFile:v,collapsed:w,active:k,sectionId:D,onToggleCollapse:S,repoPath:C,commentTarget:N,onCommentTargetChange:O,onRenderPatch:A,onAddComment:j,onDeleteComment:R}),u[12]=k,u[13]=w,u[14]=N,u[15]=x,u[16]=d,u[17]=f,u[18]=y,u[19]=v,u[20]=p,u[21]=j,u[22]=R,u[23]=S,u[24]=C,u[25]=D,u[26]=z,u[27]=_,u[28]=a):a=u[28],u[29]!==d||u[30]!==D||u[31]!==a?(c=(0,m.jsx)("section",{ref:T,id:D,"data-file-section":d,className:"scroll-mt-[52px]",children:a}),u[29]=d,u[30]=D,u[31]=a,u[32]=c):c=u[32],c}),sB=e=>{let t,r,n,o,i,l,s,a=(0,h.c)(47),{patchesByFile:c,prerenderedHTMLByFile:u,layout:d,comments:f,onAddComment:p,onDeleteComment:g,activeFileId:b,fileStats:v,collapsedFiles:x,onToggleCollapse:y,onActiveFileChange:w,repoPath:k}=e;if(a[0]!==v){for(let e of(t=new Map,v))t.set(e.file,e);a[0]=v,a[1]=t}else t=a[1];let S=t;a[2]!==S||a[3]!==v||a[4]!==c?(r=(e=>{let t={files:[],folders:new Map};for(let r of e){let e=r.split("/"),n=t;for(let t=0;t<e.length-1;t+=1){let r=e[t];n.folders.has(r)||n.folders.set(r,{files:[],folders:new Map});let o=n.folders.get(r);o&&(n=o)}n.files.push(r)}let r=[],n=e=>{for(let[,t]of[...e.folders.entries()].toSorted((e,t)=>e[0].localeCompare(t[0])))n(t);let t=[...e.files].toSorted((e,t)=>{let r=e.split("/").at(-1)??e,n=t.split("/").at(-1)??t;return r.localeCompare(n)});r.push(...t)};return n(t),r})([...v.map(sU),...Object.keys(c).filter(e=>!S.has(e))]),a[2]=S,a[3]=v,a[4]=c,a[5]=r):r=a[5];let E=r;if(a[6]!==f){for(let e of(n=new Map,f)){let t=n.get(e.file);t?t.push(e):n.set(e.file,[e])}a[6]=f,a[7]=n}else n=a[7];let C=n;a[8]!==E.length||a[9]!==u?(o=E.length>=24&&0===Object.keys(u??{}).length,a[8]=E.length,a[9]=u,a[10]=o):o=a[10];let j=o;if(a[11]!==y||a[12]!==E){for(let e of(i=new Map,E))i.set(e,()=>y(e));a[11]=y,a[12]=E,a[13]=i}else i=a[13];let R=i;if(0===E.length){let e,t;return a[14]===Symbol.for("react.memo_cache_sentinel")?(e=(0,m.jsxs)(sx,{children:[(0,m.jsx)(sw,{variant:"icon",children:(0,m.jsx)(sg,{})}),(0,m.jsx)(sk,{children:"No changes"}),(0,m.jsx)(sS,{children:"The working tree is clean relative to the base branch"})]}),a[14]=e):e=a[14],a[15]===Symbol.for("react.memo_cache_sentinel")?(t=(0,m.jsxs)(sv,{className:"h-full",children:[e,(0,m.jsx)(sE,{children:(0,m.jsxs)("p",{className:"text-xs text-muted-foreground/60",children:["Press ",(0,m.jsx)(e9,{children:"r"})," to refresh"]})})]}),a[15]=t):t=a[15],t}if(a[16]!==b||a[17]!==x||a[18]!==C||a[19]!==j||a[20]!==S||a[21]!==d||a[22]!==w||a[23]!==p||a[24]!==g||a[25]!==E||a[26]!==c||a[27]!==u||a[28]!==k||a[29]!==R){let e;a[31]!==b||a[32]!==x||a[33]!==C||a[34]!==j||a[35]!==S||a[36]!==d||a[37]!==w||a[38]!==p||a[39]!==g||a[40]!==c||a[41]!==u||a[42]!==k||a[43]!==R?(e=e=>{var t;let r=S.get(e),n=c[e]??"",o=void 0!==r&&(t=n.length,!r.binary&&(r.changes>=500||void 0!==t&&t>=5e5));return(0,m.jsx)(s$,{file:e,filePatch:n,layout:d,prerenderedHTML:u?.[e],deferPatchRendering:j,isLargeFile:o,comments:C.get(e)??sj,fileStat:r,collapsed:x.has(e),active:b===e,onToggleCollapse:R.get(e),onVisible:w,repoPath:k,onAddComment:p,onDeleteComment:g},e)},a[31]=b,a[32]=x,a[33]=C,a[34]=j,a[35]=S,a[36]=d,a[37]=w,a[38]=p,a[39]=g,a[40]=c,a[41]=u,a[42]=k,a[43]=R,a[44]=e):e=a[44],l=E.map(e),a[16]=b,a[17]=x,a[18]=C,a[19]=j,a[20]=S,a[21]=d,a[22]=w,a[23]=p,a[24]=g,a[25]=E,a[26]=c,a[27]=u,a[28]=k,a[29]=R,a[30]=l}else l=a[30];return a[45]!==l?(s=(0,m.jsx)("div",{id:"diff-container",children:l}),a[45]=l,a[46]=s):s=a[46],s};function sF(e){e?.focus({preventScroll:!0})}function sH(){return!1}function sW(){return!1}function sV(e){return{lineNumber:e.lineNumber,metadata:{comment:e,type:"comment"},side:"left"===e.side?"deletions":"additions"}}function sU(e){return e.file}let sq=[1e3,2e3,5e3],sK=(e,t,r)=>{let[n,o]=(0,b.useState)(t);return(0,b.useEffect)(()=>{try{let t=localStorage.getItem(e);null!==t&&(!r||r.includes(t))&&o(t)}catch{}},[e,r]),[n,(0,b.useCallback)(t=>{o(r=>{let n="function"==typeof t?t(r):t;try{localStorage.setItem(e,n)}catch{}return n})},[e])]},sX=["split","stacked"],sY=["all","uncommitted"],sG=e=>{let t,r=(0,h.c)(3),{text:n,pulse:o}=e,i=`text-muted-foreground text-sm${void 0!==o&&o?" animate-pulse":""}`;return r[0]!==i||r[1]!==n?(t=(0,m.jsx)("div",{className:"flex h-full items-center justify-center",children:(0,m.jsx)("div",{className:i,children:n})}),r[0]=i,r[1]=n,r[2]=t):t=r[2],t},sZ=e=>{let t=sI(e);if(window.CSS?.escape)return`#${window.CSS.escape(t)}`;let r=t.replaceAll(/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~]/g,"\\$&");return`#${r}`},sJ=e=>{let t,r,n,o,i=(0,h.c)(10),{notice:l}=e,s="border-border bg-muted/40 text-muted-foreground";"destructive"===l.tone?s="border-destructive/30 bg-destructive/10 text-destructive":"warning"===l.tone&&(s="border-amber-500/30 bg-amber-500/10 text-amber-600 dark:text-amber-400");let a=`border-b px-4 py-2 text-xs ${s}`;return i[0]!==l.label?(t=(0,m.jsx)("span",{className:"font-medium",children:l.label}),i[0]=l.label,i[1]=t):t=i[1],i[2]!==l.detail?(r=l.detail&&(0,m.jsx)("span",{className:"text-xs opacity-80",children:l.detail}),i[2]=l.detail,i[3]=r):r=i[3],i[4]!==t||i[5]!==r?(n=(0,m.jsxs)("div",{className:"flex items-center gap-2",children:[t,r]}),i[4]=t,i[5]=r,i[6]=n):n=i[6],i[7]!==a||i[8]!==n?(o=(0,m.jsx)("div",{className:a,children:n}),i[7]=a,i[8]=n,i[9]=o):o=i[9],o},sQ=e=>{let t,r,n,o=(0,h.c)(33),{filesData:i,deferredDiffData:l,diffError:s,syncNotice:a,layout:c,comments:u,onAddComment:d,onDeleteComment:f,selectedFile:p,collapsedFiles:g,onToggleCollapse:b,onActiveFileChange:v,repoPath:x,diffWatchdogTripped:y,diffHintShown:w,onRetryDiff:k}=e;if(null===i){let e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,m.jsx)(sG,{text:"Loading diff…",pulse:!0}),o[0]=e):e=o[0],e}if(0===i.files.length){let e;return o[1]===Symbol.for("react.memo_cache_sentinel")?(e=(0,m.jsx)(sG,{text:"No changes"}),o[1]=e):e=o[1],e}if(!l){let e;if(s){let e;return o[2]!==s?(e=(0,m.jsx)(sG,{text:s}),o[2]=s,o[3]=e):e=o[3],e}if(y){let e,t,r;return o[4]===Symbol.for("react.memo_cache_sentinel")?(e=(0,m.jsx)("div",{className:"text-muted-foreground text-sm",children:"Still loading the diff…"}),t=(0,m.jsx)("div",{className:"text-muted-foreground text-xs opacity-80",children:"Large diffs take longer on first load."}),o[4]=e,o[5]=t):(e=o[4],t=o[5]),o[6]!==k?(r=(0,m.jsxs)("div",{className:"flex h-full flex-col items-center justify-center gap-3",children:[e,t,(0,m.jsx)(e8,{size:"sm",variant:"default",onClick:k,children:"Retry"})]}),o[6]=k,o[7]=r):r=o[7],r}if(w){let e,t,r,n=`Loading diff${i?` (${i.files.length} files)…`:"…"}`;return o[8]!==n?(e=(0,m.jsx)("div",{className:"text-muted-foreground animate-pulse text-sm",children:n}),o[8]=n,o[9]=e):e=o[9],o[10]===Symbol.for("react.memo_cache_sentinel")?(t=(0,m.jsx)("div",{className:"text-muted-foreground text-xs opacity-80",children:"Large diffs take longer on first load."}),o[10]=t):t=o[10],o[11]!==e?(r=(0,m.jsxs)("div",{className:"flex h-full flex-col items-center justify-center gap-2",children:[e,t]}),o[11]=e,o[12]=r):r=o[12],r}let t=`Loading diff${i?` (${i.files.length} files)…`:"…"}`;return o[13]!==t?(e=(0,m.jsx)(sG,{text:t,pulse:!0}),o[13]=t,o[14]=e):e=o[14],e}return o[15]!==a?(t=a&&(0,m.jsx)(sJ,{notice:a}),o[15]=a,o[16]=t):t=o[16],o[17]!==g||o[18]!==u||o[19]!==l.patchesByFile||o[20]!==l.prerenderedHTMLByFile||o[21]!==i.files||o[22]!==c||o[23]!==v||o[24]!==d||o[25]!==f||o[26]!==b||o[27]!==x||o[28]!==p?(r=(0,m.jsx)(sB,{patchesByFile:l.patchesByFile,prerenderedHTMLByFile:l.prerenderedHTMLByFile,layout:c,comments:u,onAddComment:d,onDeleteComment:f,activeFileId:p,fileStats:i.files,collapsedFiles:g,onToggleCollapse:b,onActiveFileChange:v,repoPath:x}),o[17]=g,o[18]=u,o[19]=l.patchesByFile,o[20]=l.prerenderedHTMLByFile,o[21]=i.files,o[22]=c,o[23]=v,o[24]=d,o[25]=f,o[26]=b,o[27]=x,o[28]=p,o[29]=r):r=o[29],o[30]!==t||o[31]!==r?(n=(0,m.jsxs)(m.Fragment,{children:[t,r]}),o[30]=t,o[31]=r,o[32]=n):n=o[32],n};e.s(["DiffApp",0,({repoPath:e,defaultSidebarOpen:t=!0})=>{let[r,n]=(0,b.useState)(null),[o,i]=(0,b.useState)([]),[l,s]=(0,b.useState)(null),a=(0,b.useRef)(null),[c,u]=(0,b.useState)(null),[d,f]=sK("diffhub-layout","stacked",sX),{resolvedTheme:p}=(0,g.useTheme)(),h="light"===p?"light":"dark",v=(0,b.useRef)(d),x=(0,b.useRef)(h),[y,w]=(0,b.useState)(""),[k,S]=(0,b.useState)(256),[E,C]=(0,b.useState)(!1),[j,R]=(0,b.useState)(null),[T,N]=(0,b.useState)(null),[O,P]=(0,b.useState)(!1),[M,L]=sK("diffhub-diffMode","all",sY),A=(0,b.useRef)(M),z=(0,b.useRef)(null),I=(0,b.useRef)(null),D=(0,b.useRef)(null),_=(0,b.useRef)(null),$=(0,b.useRef)(!1),B=(0,b.useRef)(!1),F=(0,b.useRef)(()=>Promise.resolve()),H=(0,b.useRef)(!1),W=(0,b.useRef)(!1),V=(0,b.useRef)(0),U=(0,b.useRef)(0),q=(0,b.useRef)(null),[K,X]=(0,b.useState)(!1),[Y,G]=(0,b.useState)(!1),[,Z]=(0,b.useTransition)(),[J,Q]=(0,b.useState)(()=>new Set);(0,b.useEffect)(()=>{A.current=M},[M]),(0,b.useEffect)(()=>{Q(new Set(((e,t)=>{try{let r=localStorage.getItem(e);return r?JSON.parse(r):t}catch{return t}})(`diffhub-collapsed:${e}`,[])))},[e]);let ee=(0,b.useCallback)(t=>{Q(r=>{let n=t(r);if(n===r)return r;try{localStorage.setItem(`diffhub-collapsed:${e}`,JSON.stringify([...n]))}catch{}return n})},[e]),et=(0,b.useCallback)(()=>{let e=new URLSearchParams;"uncommitted"===A.current&&e.set("mode","uncommitted");let t=e.toString();return t?`?${t}`:""},[]),er=(0,b.useCallback)(()=>{let e=new URLSearchParams;_.current&&e.set("generation",_.current),"uncommitted"===A.current&&e.set("mode","uncommitted"),e.set("layout",v.current),e.set("theme",x.current);let t=e.toString();return t?`?${t}`:""},[]),en=(0,b.useCallback)(async e=>{let t=_.current,r=D.current;q.current=Date.now(),X(!1),N(null),console.info("[diffhub] fetchDiff start",{fingerprint:r,generation:t,mode:A.current,requestId:e});let n=new AbortController,o=setTimeout(()=>{n.abort(Error("Diff request timed out"))},15e3);try{var i,l;let o,s,a=await fetch(`/api/diff${er()}`,{signal:n.signal});if(!a.ok){let n=(await a.json().catch(()=>({error:"Failed to load diff"}))).error??`Failed to load diff (${a.status})`;console.error("[diffhub] fetchDiff non-ok response",{fingerprint:r,generation:t,mode:A.current,requestId:e,responseStatus:a.status,responseStatusText:a.statusText,serverError:n}),e===V.current&&N(n);return}let c=(i=await a.json(),l=r??"unknown",o=i.patchesByFile??Object.fromEntries((e=>{let t=new Map,r=/^diff --git a\/(.+?) b\/(.+)$/gm,n=[],o=r.exec(e);for(;o;)n.push({file:o[2],start:o.index}),o=r.exec(e);for(let[r,o]of n.entries()){let i=n[r+1]?.start??e.length,l=e.slice(o.start,i).trimEnd();t.set(o.file,l?`${l}
40
+ `:"")}return t})(i.patch??"")),{baseBranch:i.baseBranch,branch:i.branch,generation:i.generation,mergeBase:i.mergeBase,patchesByFile:o,prerenderedHTMLByFile:i.prerenderedHTMLByFile,reviewKeysByFile:i.reviewKeysByFile??(s=i.generation,Object.fromEntries(Object.entries(o).map(([e,t])=>[e,`${s}:${(e=>{let t=0;for(let r=0;r<e.length;r+=1)t=Math.trunc(Math.imul(31,t)+(e.codePointAt(r)??0));return Math.abs(t).toString(36)})(`${e}:${t}`)}`]))),sourceFingerprint:l});if(e!==V.current||r!==D.current||t!==_.current){console.info("[diffhub] fetchDiff response stale",{fingerprint:r,generation:t,latestRequestId:V.current,requestId:e}),null!==_.current&&(U.current+=1,U.current>=3&&(console.warn("[diffhub] fetchDiff stale-drop limit reached, invalidating",{drops:U.current}),U.current=0,V.current+=1,I.current=null,u(null)),W.current=!0);return}U.current=0,console.info("[diffhub] fetchDiff success",{fileCount:Object.keys(c.patchesByFile).length,fingerprint:r,generation:c.generation,requestId:e}),Z(()=>u(c))}catch(n){console.error("[diffhub] fetchDiff threw",{error:n,fingerprint:r,generation:t,mode:A.current,requestId:e}),e===V.current&&N(n instanceof Error?n.message:String(n))}finally{clearTimeout(o)}},[er,Z]),eo=(0,b.useCallback)(async()=>{if(W.current=!0,!H.current){for(H.current=!0,P(!0);W.current;)W.current=!1,V.current+=1,await en(V.current);H.current=!1,P(!1)}},[en]);(0,b.useEffect)(()=>{(v.current!==d||x.current!==h)&&(v.current=d,x.current=h,V.current+=1,I.current=null,u(null),eo())},[d,h,eo]);let ei=(0,b.useRef)(c),el=(0,b.useRef)(T);(0,b.useEffect)(()=>{ei.current=c},[c]),(0,b.useEffect)(()=>{el.current=T},[T]);let es=(0,b.useCallback)(e=>{if(D.current=e.fingerprint,_.current=e.generation,0===e.files.length){a.current=null,V.current+=1,(0,b.startTransition)(()=>{s(null),u(null)}),N(null),I.current=e.fingerprint;return}let t=a.current;t&&e.files.some(e=>e.file===t)||(a.current=t=e.files[0]?.file??null,(0,b.startTransition)(()=>s(t)));let r=e.fingerprint!==I.current,n=ei.current?.generation===e.generation;(r||!n||null!==el.current)&&(I.current=e.fingerprint,r&&(V.current+=1),eo())},[eo]),ea=(0,b.useCallback)(()=>{V.current+=1,I.current=null,D.current=null,_.current=null,u(null),N(null)},[]),ec=(0,b.useCallback)(async(e=!1)=>{let t=()=>{e||C(!1),$.current=!1,B.current&&(B.current=!1,queueMicrotask(()=>{F.current(!0)}))};if($.current){B.current=!0;return}$.current=!0,e||C(!0),R(null);let r=await Promise.all([fetch(`/api/files${et()}`),fetch("/api/comments").then(async e=>{if(!e.ok)throw Error(`Failed to load comments (${e.status})`);return await e.json()}).catch(e=>(console.error("[diffhub] comments refresh failed",{error:e}),null))]).catch(e=>(R(e instanceof Error?e.message:String(e)),null));if(!r)return void t();let[o,l]=r;if(!o.ok){R((await o.json().catch(()=>({error:"Network error"}))).error??"Failed to load files"),t();return}let s=await o.json();(0,b.startTransition)(()=>{n(s),null!==l&&i(l)}),es(s),t()},[et,es]);(0,b.useEffect)(()=>{F.current=ec},[ec]);let eu=(0,b.useRef)(!1),ed=(0,b.useRef)(!1);(0,b.useEffect)(()=>{let e=null,t=()=>{eu.current=!0,e&&clearTimeout(e),e=setTimeout(()=>{eu.current=!1,ed.current&&(ed.current=!1,F.current(!0))},200)};return window.addEventListener("scroll",t,{passive:!0}),()=>{window.removeEventListener("scroll",t),e&&clearTimeout(e)}},[]);let ef=(0,b.useCallback)(()=>{if(eu.current){ed.current=!0;return}F.current(!0)},[]),ep=(e=>{let[t,r]=(0,b.useState)("connecting"),n=(0,b.useEffectEvent)(e),o=(0,b.useRef)(null);return(0,b.useEffect)(()=>{let e=!1,t=0,i=null,l=new AbortController,s=async()=>{if(!e)try{let i=null===o.current?"":`?revision=${o.current}`,a=await fetch(`/api/watch${i}`,{cache:"no-store",signal:l.signal});if(e)return;if(!a.ok)throw Error(`Watch request failed with status ${a.status}`);let c=await a.json();if(e)return;t=0,r("live");let u=o.current;o.current=c.revision,c.changed&&null!==u&&c.revision!==u&&n(),e||queueMicrotask(()=>{e||s()})}catch(n){if(e||l.signal.aborted)return;if(console.error("[diffhub] file watch failed",{error:n,failureCount:t+=1}),t>10){console.error("[diffhub] file watch: max retries exceeded, stopping"),r("fallback");return}r(t>=sq.length?"fallback":"connecting"),i=setTimeout(()=>{i=null,e||s()},sq[Math.min(t-1,sq.length-1)])}};return r("connecting"),s(),()=>{e=!0,l.abort(),i&&clearTimeout(i)}},[]),t})(ef),em=(0,b.useCallback)(()=>{ec()},[ec]),eh=(0,b.useCallback)(()=>{X(!1),G(!1),N(null),V.current+=1,I.current=null,u(null),eo()},[eo]);(0,b.useEffect)(()=>{ec()},[ec]),(0,b.useEffect)(()=>{let e=setInterval(ef,"live"===ep?3e4:5e3);return()=>clearInterval(e)},[ep,ef]),(0,b.useEffect)(()=>{if(!r||0===r.files.length||c||T)return void X(!1);let e=setTimeout(()=>X(!0),2e4);return()=>clearTimeout(e)},[r,c,T]),(0,b.useEffect)(()=>{if(!r||0===r.files.length||c||T)return void G(!1);let e=setTimeout(()=>G(!0),1e4);return()=>clearTimeout(e)},[r,c,T]);let eg=(0,b.useCallback)((e,t=800)=>{z.current={file:e,until:Date.now()+t},a.current=e,(0,b.startTransition)(()=>s(e))},[]),eb=(0,b.useCallback)((e,t="smooth")=>{eg(e),ee(t=>{if(t.has(e)){let r=new Set(t);return r.delete(e),r}return t});let r=e=>{e.scrollIntoView({behavior:t,block:"start"})},n=document.querySelector(sZ(e));if(n)return void r(n);let o=document.querySelector("#diff-container");if(!o)return;let i=new MutationObserver(()=>{let t=document.querySelector(sZ(e));t&&(i.disconnect(),r(t))});i.observe(o,{childList:!0,subtree:!0}),setTimeout(()=>i.disconnect(),5e3)},[eg,ee]),ev=(0,b.useCallback)(e=>{let t=z.current;if(t){if(Date.now()>t.until)z.current=null;else if(t.file!==e)return}a.current!==e&&(a.current=e,(0,b.startTransition)(()=>s(e)))},[]),ex=(0,b.useCallback)(e=>{eg(e),ee(t=>{let r=new Set(t);return r.has(e)?r.delete(e):r.add(e),r})},[eg,ee]),ey=(0,b.useCallback)(()=>{ee(()=>new Set((r?.files??[]).map(e=>e.file)))},[r,ee]),ew=(0,b.useCallback)(()=>{ee(()=>new Set)},[ee]);(0,b.useEffect)(()=>{let e=e=>{if(!(e.target instanceof HTMLTextAreaElement||e.target instanceof HTMLInputElement)){if("s"!==e.key||e.metaKey||e.ctrlKey||f(e=>"split"===e?"stacked":"split"),"/"!==e.key&&"t"!==e.key.toLowerCase()||e.metaKey||e.ctrlKey||(e.preventDefault(),document.querySelector('input[placeholder="Filter files…"]')?.focus()),"c"===e.key.toLowerCase()&&!e.metaKey&&!e.ctrlKey&&l){if(e.shiftKey)return void ey();ex(l)}if("e"!==e.key.toLowerCase()||!e.shiftKey||e.metaKey||e.ctrlKey||ew(),"r"!==e.key||e.metaKey||e.ctrlKey||ec(),"j"===e.key||"k"===e.key){let t=r?.files??[];if(0===t.length)return;let n=t.findIndex(e=>e.file===l),o="j"===e.key?t[n+1]:t[n-1];o&&eb(o.file)}}};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[ey,ew,r,ec,eb,l,f,ex]);let ek=(0,b.useCallback)(e=>{A.current=e,L(e),ea(),ec(!1)},[ea,ec,L]),eS=(0,b.useCallback)(async(e,t,r,n,o)=>{let l=await fetch("/api/comments",{body:JSON.stringify({body:n,file:e,lineNumber:t,side:"deletions"===r?"left":"right",tag:o}),headers:{"Content-Type":"application/json"},method:"POST"});if(!l.ok)return console.error("[diffhub] add comment failed",{error:(await l.json().catch(()=>({error:"Failed to save comment"}))).error??`Failed to save comment (${l.status})`}),!1;let s=await l.json();return i(e=>[...e,s]),!0},[]),eE=(0,b.useCallback)(async e=>{let t=await fetch(`/api/comments?id=${e}`,{method:"DELETE"});return t.ok?(i(t=>t.filter(t=>t.id!==e)),!0):(console.error("[diffhub] delete comment failed",{error:(await t.json().catch(()=>({error:"Failed to delete comment"}))).error??`Failed to delete comment (${t.status})`}),!1)},[]),eC=j&&null!==r?{detail:j,label:"Background refresh failed",tone:"destructive"}:T&&c?{detail:T,label:"Diff refresh failed",tone:"destructive"}:"fallback"===ep?{detail:"Live watch is unavailable, so the app is polling every 5 seconds",label:"Polling fallback",tone:"warning"}:null;return j&&null===r?(0,m.jsx)(lF,{className:"min-h-svh",defaultOpen:t,children:(0,m.jsxs)(lV,{className:"flex flex-col h-svh items-center justify-center gap-4",children:[(0,m.jsxs)("div",{className:"rounded-lg border border-destructive/30 bg-destructive/10 px-6 py-4 text-sm text-destructive max-w-md text-center",children:[(0,m.jsx)("p",{className:"font-semibold mb-1",children:"Failed to load diff"}),(0,m.jsx)("p",{className:"text-xs opacity-80",children:j})]}),(0,m.jsx)(e8,{variant:"outline",onClick:em,children:"Retry"})]})}):(0,m.jsxs)(lF,{className:"min-h-svh",defaultOpen:t,style:{"--sidebar-width":`${k}px`},children:[(0,m.jsx)(sc,{files:r?.files??[],selectedFile:l,onSelectFile:eb,comments:o,filterQuery:y,onFilterChange:w,isLoading:null===r,insertions:r?.insertions??0,deletions:r?.deletions??0,sidebarWidth:k,onSidebarWidthChange:S}),(0,m.jsxs)(lV,{className:"flex flex-col min-h-svh",children:[(0,m.jsx)("div",{className:"sticky top-0 z-20",children:(0,m.jsx)(l0,{branch:r?.branch??"…",baseBranch:r?.baseBranch??"main",refreshing:E||O,fileWatchState:ep,comments:o,diffMode:M,onDiffModeChange:ek,layout:d,onLayoutChange:f,syncNotice:eC})}),(0,m.jsx)(sQ,{filesData:r,deferredDiffData:c,diffError:T,syncNotice:eC,layout:d,comments:o,onAddComment:eS,onDeleteComment:eE,selectedFile:l,collapsedFiles:J,onToggleCollapse:ex,onActiveFileChange:ev,repoPath:e,diffWatchdogTripped:K,diffHintShown:Y,onRetryDiff:eh})]})]})}],93190)}]);